On Mar 12, 12:50 pm, Chris Moody <[email protected]> wrote:
> I know the easy way to answer
> this would be to try it and find out, but with my limited knowledge of
> programming I would have no way of knowing if it didn't work whether
> it was because it isn't possible, or if I did something wrong!
Everything is possible, so posting to the group instead of trying is
more indicative of laziness than of lack of knowledge. ;-)
You can simply add an ID property to each marker, like
function createMarker(latlon,id) {
var marker = new GMarker(latlon);
marker.myMarkerID = id;
// and then, in the "Remove Link",
GEvent.addListener(marker,"click", function() {
var html = '<div onclick="deleteMarker(' + marker.myMarkerID +
')">DELETE</div>';
marker.openInfoWindowHtml(html);
});
}
function deleteMarker(id) {
var url = 'somePhpScript.php?task=delete&markerId=' + id;
GDownloadUrl(url,function(){
// Do something with the response
})
}
All untested!!!
... but you get the idea.
--
Marcelo - http://maps.forum.nu
--
>
> == creates a "normal" marker
> function createMarker(point,text,value,scores) {
> var marker = new GMarker(point, gicons[value]);
> GEvent.addListener(marker,"click", function() {
> marker.openInfoWindow("Value: "+value+"<BR>Score: "+scores
> +"<BR><BR><a href=www>Delete Marker</a>" );});
>
> map.addOverlay(marker);
> return marker;
>
> }
>
> basically I guess I am asking if whether a value created in the Java
> API code can be passed to a piece of PHP code called within the java/
> html? If yes I can continue, otherwise I'll have to figure out another
> method!
>
> Thanks again for your help
> Chris
--
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.