Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi Dirk, for the resizing issue, you can use:
google.maps.event.addListener(map, 'idle', function () { google.maps.event.trigger(map, 'resize'); });
this will draw the map again after the page is fully loaded.
Also you can add the click event so it will be more easy to add the content
google.maps.event.addListener(map, 'click', function (event) { placeMarker(event.latLng); }); function placeMarker(location) { if (marker != null) { marker.setMap(null); } marker = new google.maps.Marker({ map: map, position: location, draggable: true }); marker.setMap(map); lookupPosition(location); addMarkerDragEndListener(); map.setCenter(location); map.panTo(location); }
Hi Yahia, where in the controller do you advise adding these?
Thanks!
Amir
Hi Amir, you will add the function like "initializeMap" function. And for the listeners, you are going to add it in the "initializeMap" function.
So the position on click worked perfectly. The resize event doesn't seem to be firing though.
I placed them both right after google.maps.event.addDomListener(resetBtn,'click',resetMap);
Any ideas?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Resizing Google Maps fix and adding click event
Hi Dirk, for the resizing issue, you can use:
this will draw the map again after the page is fully loaded.
Also you can add the click event so it will be more easy to add the content
Hi Yahia, where in the controller do you advise adding these?
Thanks!
Amir
Hi Amir, you will add the function like "initializeMap" function. And for the listeners, you are going to add it in the "initializeMap" function.
So the position on click worked perfectly. The resize event doesn't seem to be firing though.
I placed them both right after google.maps.event.addDomListener(resetBtn,'click',resetMap);
Any ideas?
is working on a reply...