Refresh Base Map Type Tiles

786 views
Skip to first unread message

NoRyb

unread,
Jan 19, 2012, 7:19:20 AM1/19/12
to google-map...@googlegroups.com
Hello! I would like to know if it's possible to "refresh" or "update" a MapType. I'm using an ImageMapType to display custom tiles. If I change a parameter, I want to display another set of tiles - how do I accomplish this?

Thanks

Martin™

unread,
Jan 19, 2012, 2:01:38 PM1/19/12
to Google Maps JavaScript API v3

NoRyb

unread,
Jan 20, 2012, 2:40:57 AM1/20/12
to google-map...@googlegroups.com
Hello Martin

Thank you for the answer. Unfortunately this does not help me as I don't have a list of tiles. I extended the ImageMapType so I can use it as Base Map instead of overlay map. There I only get the getTileUrl-Callback which does not have a pointer to the tile (only the URL).

Is there a way to get to the Tiles over the map object so I can iterate through them?

Martin™

unread,
Jan 20, 2012, 4:26:57 AM1/20/12
to Google Maps JavaScript API v3
The only thing i can see that would work would be to use a solution
similar to that which i posted in post #4 of the thread i linked to
previously:

https://groups.google.com/group/google-maps-js-api-v3/browse_frm/thread/25a3f290cdf0fa5e/34d32ac679be539c?hl=en&lnk=gst

Add a bogus parameter to your tile URLs and when you want to refresh
the tiles just remove and then re-add the tile layer.
A time based bogus parameter will ensure new tiles are requested
instead of cached tiles being reused.



That will not be visually smooth but should work. :-(

Can you not implement your tile layer as a BaseMapType?

http://code.google.com/apis/maps/documentation/javascript/maptypes.html#BaseMapTypes

"Map types which you construct in this manner may either stand alone
or be combined with other map types as overlays. Standalone map types
are known as base map types."

Martin.
Reply all
Reply to author
Forward
0 new messages