Mike,
Yes, that was a perfect suggestion, especially because I already
had a global reference to the marker. I think I have that
application working.
That application saves only "lat" and "lng" to the external database.
I am now trying to add a single brief text field "message" in the
database and then make that "message" text into the markers'
title, but I am having a little trouble with extracting that
information
from the xml.
Can anyone tell me how to extract the message field in the following
code to create the marker title? I am having trouble with the lines
which contain the word "message" in the function below.
function MyApplication(){
map = new GMap2(document.getElementById("map-canvas"));
start = new GLatLng(33.81695,-84.2342388);
map.setCenter(start, 9);
GDownloadUrl("real.xml", function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
var point = new
GLatLng(parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute("lng")));
var message = new markers[i].getAttribute("message");
markerOptions = {title:message};
map.addOverlay(new GMarker(point),markerOptions);
}
});
}
Thank you, in advance.
Brian
On Oct 21, 4:02 am, Mike Williams <[EMAIL PROTECTED]> wrote:
> Wasn't it thebrianschott who wrote:
>
> >There is still at least one bug that I could stomp out, but it is not
> >critical. If a person clicks a marker and then tries to drag it to
> >a new location, the original latlng is stored, not the ultimate one,
> >although the marker drags fine.
>
> You can either listen for dragend events, or you could keep a global
> reference to the marker instead of the latlng, and then use
> marker.getLatLng() when the user clicksSubmit.
>
> --http://econym.org.uk/gmap
> The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---