Placemark Names?

Oct 13, 2009 at 2:43 PM

How do I add a name to a placemark? There is no property on the GMapMarker or PointLatLng classes for such. Is this possible some other way?

Oct 13, 2009 at 3:15 PM

Maybe use TAG property of placemark?

Oct 13, 2009 at 3:20 PM

That doesn't do anything. Don't see why it would.  Any other ideas?

Coordinator
Oct 13, 2009 at 3:40 PM

 

class MySuperAllKnowingMarker : GMapMarker
{
   // ...
}

 

 

Oct 13, 2009 at 8:25 PM
Edited Oct 13, 2009 at 8:26 PM

Err... yeah, that's quite simple enough of course, but what I am after is actually showing a name next to the placemark on the map - Visually... sorry if I confused the issue LOL.

Coordinator
Oct 13, 2009 at 8:32 PM

?

Oct 14, 2009 at 7:15 AM

Okay, let's try this again...

I currently have a Google Earth application which allows me to draw a route and add some placemarks. Now, I can add a NAME property to each placemark which will then be displayed on the actual map next to each placemark. I was hoping that the GMap / Google Maps API had a similar feature whereby I could somehow tell it to display some text next to each placemark. This is a requirement for my application and if it can't be done with GMaps, I will need to look elsewhere or figure out how to modify your code to enable such a feature. If you are still lost, I can send a screenshot to make things clearer, but I don't see an upload file option here.

By the way, great control - I just hope I have the chance to use it. If you currently don't support this feature, will you be planning to do so?

Cheers

Coordinator
Oct 14, 2009 at 7:33 AM
Edited Oct 14, 2009 at 7:34 AM

are you trying to say that you want tooltips? ;}

Oct 14, 2009 at 7:36 AM

Nope, though that would be useful to me as well for another purpose.

Is there any way I can send you an image to make things clearer?

Coordinator
Oct 14, 2009 at 7:39 AM

there are many ways, skydrive, imageshack, etc ;}

Oct 14, 2009 at 7:43 AM

Very true. In any case, I thought I would just send you soem example KML:

Save this as a .kml file and open with Google Earth. This should clear up any confusion. :-)

<kml>
  <Document>
    <name>930</name>
    <visibility>1</visibility>
    <description>Place your mouse over the icon to see it display the new icon</description>
    <Style id="styleLine">
      <IconStyle>
        <scale>0</scale>
      </IconStyle>
      <LineStyle>
        <color>7f0000ff</color>
        <width>4</width>
      </LineStyle>
    </Style>
    <Style id="styleRedPlacemark">
      <IconStyle>
        <Icon>
          <href>http://www.iconbazaar.com/dots/1dot1a.gif</href>
          <x>96</x>
          <y>160</y>
          <w>64</w>
          <h>64</h>
        </Icon>
        <scale>0.3</scale>
      </IconStyle>
    </Style>
    <StyleMap id="styleMapRed">
      <Pair>
        <key>normal</key>
        <styleUrl>#styleRedPlacemark</styleUrl>
      </Pair>
      <Pair>
        <key>highlight</key>
        <styleUrl>#styleRedPlacemark</styleUrl>
      </Pair>
    </StyleMap>
    <Placemark>
      <name>1 opp Balunie Gdns</name>
      <visibility>1</visibility>
      <styleUrl>#styleRedPlacemark</styleUrl>
      <Point>
        <extrude>1</extrude>
        <altitudeMode>relativeToGround</altitudeMode>
        <coordinates>-2.8980033155,56.4782479709,25</coordinates>
      </Point>
      <description />
    </Placemark>
    <Placemark>
      <name>2 Baluniefield South</name>
      <visibility>1</visibility>
      <styleUrl>#styleRedPlacemark</styleUrl>
      <Point>
        <extrude>1</extrude>
        <altitudeMode>relativeToGround</altitudeMode>
        <coordinates>-2.9017694621,56.478229656,25</coordinates>
      </Point>
      <description />
    </Placemark>
    <Placemark>
      <name>3 Balbeggie Place</name>
      <visibility>1</visibility>
      <styleUrl>#styleRedPlacemark</styleUrl>
      <Point>
        <extrude>1</extrude>
        <altitudeMode>relativeToGround</altitudeMode>
        <coordinates>-2.9064632534,56.4789861013,25</coordinates>
      </Point>
      <description />
    </Placemark>
    <Placemark>
      <name>4 Balmerino Place</name>
      <visibility>1</visibility>
      <styleUrl>#styleRedPlacemark</styleUrl>
      <Point>
        <extrude>1</extrude>
        <altitudeMode>relativeToGround</altitudeMode>
        <coordinates>-2.910677218,56.4793595604,25</coordinates>
      </Point>
      <description />
    </Placemark>
    <Placemark>
      <name>5 Ballindean Road</name>
      <visibility>1</visibility>
      <styleUrl>#styleRedPlacemark</styleUrl>
      <Point>
        <extrude>1</extrude>
        <altitudeMode>relativeToGround</altitudeMode>
        <coordinates>-2.9149326126,56.4794271011,25</coordinates>
      </Point>
      <description />
    </Placemark>
    <Placemark>
      <name>extruded</name>
      <visibility>1</visibility>
      <styleUrl>#styleLine</styleUrl>
      <LineString>
        <extrude>0</extrude>
        <tessellate>1</tessellate>
        <altitudeMode>relativeToGround</altitudeMode>
        <coordinates>-2.8980033155,56.4782479709,15
-2.9017694621,56.478229656,15
-2.9064632534,56.4789861013,15
-2.910677218,56.4793595604,15
-2.9149326126,56.4794271011,15
-2.9161334223,56.481421772,15
</coordinates>
      </LineString>
      <description />
    </Placemark>
  </Document>
</kml>

Coordinator
Oct 14, 2009 at 7:45 AM

you just increased confusion ;D maybe some javascript too?

Oct 14, 2009 at 7:47 AM

LOL. Having fun, are we?  :-D

Did you actually open it in GE to take a look? If you don't have GE, I will upload an image and send you the URL

Coordinator
Oct 14, 2009 at 7:51 AM

would be great! ;}

Oct 14, 2009 at 8:01 AM

http://s903.photobucket.com/albums/ac235/gordon_matt/?action=view&current=example.jpg

 

Coordinator
Oct 14, 2009 at 8:04 AM

mm, so it's just marker/tooltip with transparent background?

Oct 14, 2009 at 8:07 AM

I have not actually used your tooltips feature yet, but judging by normal tooltips, wouldn't a user have to click each one to see the text? Can they be set to always show instead of having to popup? If so, please give me some example code.  :-)

Oct 14, 2009 at 8:25 AM
Edited Oct 14, 2009 at 8:26 AM

placemark.TooltipMode = MarkerTooltipMode.Always;

 placemark.ToolTipText = stop.ShortName;

 

Wow... as simple as that LOL. I didn't expect a tooltip to have an always mode. Thanks for this. I do have a couple of other queries, but let me have a play around first and get back to you on another discussion if necessary.

Thanks for your time!

Oct 14, 2009 at 8:33 AM

One more query on this though - how do I change the size and color of the tooltip text?

Coordinator
Oct 14, 2009 at 8:34 AM

;} check GMapOverlay properties

Oct 14, 2009 at 10:05 AM

Fantastic!

Coordinator
Oct 14, 2009 at 10:36 AM

;}

Nov 23, 2010 at 6:06 AM

Another suggestion here... tooltips alway on are great, no doubt... the only problem with this solution is that most of the time any meaningful info on them take space and when I display 20 POIs they have tendency to overlap each other thus the user can see most of the info.../
So, I wonder if it is possible to mark Placemarks, 1,2,3,4,etc... they are bif enough to put a double digit in them. Then the developer (that also have access to tooltip text itself could put a legend whereever he/she wants... This legend ID (1,2,3,4 can be in the tag or somewhere else...) What do you think?

Coordinator
Nov 23, 2010 at 5:56 PM

maybe