2012-11-14 32 views
8

का उपयोग कर मानचित्र पर नाम प्रदर्शित करना मैं केएमएल का उपयोग करके बहुभुज, मंडल इत्यादि प्रदर्शित करने में सक्षम हूं। अब मैं केएमएल का उपयोग करके केवल कुछ नाम प्रदर्शित करना चाहता हूं। क्या यह संभव है ?केएमएल

+2

क्या आपका मतलब Google धरती, Google मानचित्र या अन्य पर प्रदर्शित होता है? – JasonM1

उत्तर

7

आप स्थान-चिह्न के लेबल प्रदर्शित (एम एल) के माध्यम से गूगल अर्थ के नक्शे पर तो आप के साथ एक 0 पैमाने अपने स्थान-चिह्नों के लिए एक LabelStyle जोड़ सकते हैं दबाने के लिए चाहते हैं (देखें नीचे दिए गए उदाहरण में sn_hide शैली)। यदि आप आइकन पर लेबल नाम दबाएंगे, तब तक जब तक आप आइकन पर होवर नहीं करते हैं तो StyleMaps आपकी सर्वश्रेष्ठ शर्त है।

नीचे दिए गए उदाहरण में पहला स्थान चिह्न स्थान पैनल में दिखाया गया है लेकिन लेबलस्टाइल का उपयोग करके मानचित्र से छिपा हुआ है। दूसरा स्थलचिह्न # 2 स्टाइल मैप का उपयोग तब तक लेबल को छिपाने के लिए करता है जब तक उपयोगकर्ता उस आइकन पर हाइलाइट या मॉल करता है जिसमें यह लेबल दिखाने वाली हाइलाइट शैली को सक्रिय करता है। तीसरा स्थलचिह्न # 3 डिफ़ॉल्ट शैली का उपयोग करता है जो हमेशा लेबल दिखाता है।

<?xml version="1.0" encoding="UTF-8"?> 
<kml xmlns="http://www.opengis.net/kml/2.2"> 
    <Document> 
     <name>Hide and show labels</name> 
     <Style id="sn_hide"> 
      <LabelStyle> 
       <scale>0</scale> 
      </LabelStyle> 
     </Style> 
     <Style id="sh_style"> 
      <LabelStyle> 
       <scale>1.1</scale> 
      </LabelStyle> 
     </Style> 
     <StyleMap id="msn_hide"> 
      <Pair> 
       <key>normal</key> 
       <styleUrl>#sn_hide</styleUrl> 
      </Pair> 
      <Pair> 
       <key>highlight</key> 
       <styleUrl>#sh_style</styleUrl> 
      </Pair> 
     </StyleMap> 

     <Placemark> 
      <name>Placemark 1</name> 
      <description>Label name always hidden</description> 
      <styleUrl>#sn_hide</styleUrl> 
      <Point> 
       <coordinates>-119.232195,36.016021</coordinates> 
      </Point> 
     </Placemark> 

     <Placemark> 
      <name>Placemark 2</name> 
      <description>Hover over place to show label</description> 
      <styleUrl>#msn_hide</styleUrl> 
      <Point> 
       <coordinates>-119.2324,36.0155</coordinates> 
      </Point> 
     </Placemark> 

     <Placemark> 
      <name>Placemark 3</name> 
      <description>Always showing</description> 
      <Point> 
       <coordinates>-119.232672,36.014837</coordinates> 
      </Point> 
     </Placemark> 
    </Document> 
</kml> 
+0

धन्यवाद जेसनएम 1 ... यह मेरे लिए काम किया है .. –