On Jul 14, 3:51 pm, David <[email protected]> wrote: > I set the map center in the initialize function, but when the page > loads, the center coordinates end up at the top left corner of the > map. > > Any help is appreciated.
1. Read and follow the posting guidelines 2. sounds like the browser is reporting zero size for the map div, are you using percentage to size it? The results of a search for "top left" may prove helpful: http://groups.google.com/group/google-maps-api/search?group=google-maps-api&q=top+left&qt_g=Search+this+group -- Larry > > code: > ------------------------------- > var map; > var geoXml; > var toggleState = 1; > var marker = null; > > function initialize() { > if (GBrowserIsCompatible()) { > > map = new GMap2(document.getElementById("map_canvas")); > map.setUIToDefault(); > map.setCenter(new GLatLng(36.778928, -119.676516), 13); > map.setMapType(G_NORMAL_MAP); > marker = new GMarker(new GLatLng(36.778928, -119.676516), > {draggable: false}); > map.addOverlay(marker); > > } > } -- 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.
