Hi All,

I have the dilema in the code execution of the submit function. I have
a link on my page that should create only on marker if clicked.
However if the link is clicked more than once and then clicked on the
map it displays the markers amounted to the times it was clicked. Can
anyone assist as to why this is happening with the 2 functions below?


function submit(){

var submitfile;
map.clearOverlays();

document.getElementById("mapwindow").innerHTML =  '';
map.getDragObject().setDraggableCursor("crosshair");

var submit = GEvent.addListener(map, "click", function(submitmarkerx,
point) {

if (language=='english'){

submitfile = 'http://www.mysite.com/php/submitplaceform.php'
submitfilex = 'http://www.mysite.com/upload/index.html'
}
else if(language=='espanol'){
submitfile = 'http://www.mysite.com/upload/indexesp.php'
}

var submitmarkerx = createsubmitMarker(point,'<div>Please enter
details for this location on the left side bar and click on save to
add your place</div>');

map.addOverlay(submitmarkerx);

GEvent.addListener(map, "infowindowclose", function(){map.removeOverlay
(submitmarkerx); map.getDragObject().setDraggableCursor("auto");});
GEvent.removeListener(submit);



});
GEvent.addListener(map, "infowindowclose", function(){map.clearOverlays
()



});

}

function createsubmitMarker(point,html) {

var icon = new GIcon();
icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";;
icon.shadow = "http://labs.google.com/ridefinder/images/
mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);

var homemarker = new GMarker(point,{icon:icon, draggable: true});
GEvent.addListener(homemarker, "click", function()
{homemarker.openInfoWindowHtml(html);});
return homemarker;

}

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to