Retrieve coordinates from kml file then center on google maps api

8 views
Skip to first unread message

thomfriedel

unread,
May 10, 2009, 9:46:26 PM5/10/09
to KML Developer Support - Getting Started with KML, t...@readyink.com
I am new to this group and it did not seem I could reply to this
thread from December.

I would like my embedded Google Map app. to center around my KML file
without redrawing the screen. I know it is possible because the URL
API (http://maps.google.com?q=http://mysite.com/mykml.kml) works fine.

I can do this with

overlay.gotoDefaultViewport(map) ;

but there is a second redraw of the map. It seems I have to draw the
map once wiht setCenter.

It seems I could use

map.addOverlay( overlay ) ;
var obounds = overlay.getDefaultBounds() ;
var ocenter = overlay.getDefaultCenter() ;

before calling

map.setCenter( ocenter, map.getBoundsZoomLevel(obounds),
G_PHYSICAL_MAP);

but this does not work. It also seems I could do all the
initialziation in a hidden state, and then unhide, but is that
possible?

How is this done?

thank you very much,
tom friedel



before calling setCenter, but it doesn't seem to work.


Roman N

unread,
May 15, 2009, 3:21:31 PM5/15/09
to KML Developer Support - Getting Started with KML
Hi Tom,

Not sure about that one.. you may be able to find some tips on
avoiding the redraw at the Google Maps API group, though:

http://groups.google.com/group/Google-Maps-API

Thanks,
Roman
Reply all
Reply to author
Forward
0 new messages