Hello All,
I've been struggling with some specific issues on my site. I want to
achieve 3 things when i click on a link's onlclick event.
1. Firstly I would like the cursor to change to that marker icon that
gets set when i click on map. and then change after i click on the
map.
2. If i click on this (submit()) link 1-2-3 or more times it displays
3 markers on the map after i drag the first. I want to only display
one. I guess its because its executing the functionmulitple times. How
to solve this.
3. I would like to fill up the input box with the lat and long of the
marker and change it if dragged. on the php form that opens in the
iframe.
I have the following code currently:
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);
document.getElementById("sidebarwrapper").innerHTML = '<div
id="submitform"><div id="submitformdata"> <IFRAME SRC=' + submitfile +
' WIDTH=100% HEIGHT=400px FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0
scrolling="no"></IFRAME></div><div id="submitformimageform"><IFRAME
SRC=' + submitfilex + ' WIDTH=100% HEIGHT=158px FRAMEBORDER=0
MARGINWIDTH=0 MARGINHEIGHT=0 scrolling="no"></IFRAME></div></div>';
});
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
-~----------~----~----~----~------~----~------~--~---