Hello.
I've created a simple map to have a marker of my hometown. I'd like to
have an info window open upon load so that users may easily input
their address for directions. For some reason, once I added this the
map is not centered to the marker anymore.
Does anyone have any suggestions? I'm using safari if that makes a
difference.
Here's the code:
<script type="text/javascript">
//<![CDATA[
var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
var point = new GLatLng(40.7358333, -73.0825);
//map.centerAndZoom(new GPoint(-73.0825, 40.7358333), 4);
map.centerAndZoom(point, 4);
// add the marker
var marker = new GMarker(point);
map.addOverlay(marker);
// add popup window with form
marker.openInfoWindowHtml('<form action="http://maps.google.com/
maps" method="get" target="_blank">To: Sayville, NY<br />From: <input
type="text" name="saddr" /><input type="hidden" name="daddr"
value="Sayville, NY" /><br /><input type="submit" value="Get
Directions" /></form>');
//]]>
</script>
and the URL is:
http://dev.discoversayville.com/visit/
Click the "Directions" tab
Thanks so much!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---