Add text to marker after using Geolocation

Dec 1, 2010 at 4:34 AM

Hi,

I'm using geolocation to add a market based on an address (and it's working perfectly!).

However, i also want to be able to have text on the marker. So, if i click on the marker on the map i want it to say a string. I didn't see a way to do this in the samples (only if i'm inputing a latitude/longitude). Is there any way to do this? Can someone post the sample code?

 

Thanks a lot!

Dec 8, 2010 at 2:00 AM

can someone please tell me what is going wrong here? the marker appears, but when i click it no infowindow appears

 

            GoogleMarker a = new GoogleMarker(address);
            a.Text = "asdf";
            GoogleMap1.Markers.Add(a);

Dec 8, 2010 at 8:36 AM

try this

a.Clickable = true;

Dec 8, 2010 at 2:39 PM

I had no problem with the code you showed in 4.1, but in 5.0 the Text option no longer works in the same way. I have not yet figured out to get a text window to display in 5.0. I find that I can attach my string to marker.title instead and that works as expected allowing me to view the string when I hover the mouse over the marker. I have noticed there is a another Text option in the new GoogleMarkerStyle property and am wondering how it figures into this.