Like most maps produced with the API I use the "scale" control. This is the small overlay in the lower right corner of the map next to the Google logo which gives the distance on the map in feet and meters. It's produced when you make the following call after creating the map.
map.addControl(new GScaleControl()); The problem occurs when you use a map type that has a larger zoom range, and then switch to one which has a smaller range. Example: Say you bring up the map and use the "normal" map type at zoom level 15. The scape will read "1000 ft/200 m". If you zoom in one level (to level 16), the scale will read "500 ft/ 200 m" Now if you switch to map type "Physical" (which gives the relief map). This map type only supports zoom levels up to 16. The map switches to "Physical" type, and the zoom level reverts to 15 (as high as it can go). However the scale control does not change but stays at "500 ft/200 m", corresponding to level 16. It stays that way until and unless you zoom out and then it reflects the correct scale. In this example if you zoom out it changes to "2000 ft/500 m" corresponding to level 14. In other words when you change to a map type that does not support the current zoom level, it changes to the closest zoom level it supports, which is reasonable behavior. However the scale control doe not reflect this change and gives incorrect values until you explicitly change the zoom level. Here's an example on one of my maps: http://members.bellatlantic.net/~vze2h6gy/papabear/BM_Station_GMap.html#width=1024&height=800&title=1&t=map&z=15&object={station:%22QF0763%22,lat:45.184773725,lng:-67.28071890,designation:%22CALAIS%20OBSERVATORY%22} 1) The map should come up with map type of Normal and zoom level of 15. The scale control reads "1000 ft/200 m" 2) zoom in one level. The maps moves in to level 16 and the scale now reads "500 ft/200 m". This is correct. 3) change the map type to Physical. Use the map type selector on the upper right. This type is given the name "Terrain" on my map. Now the map moves back to level 15, since this type does not support anything higher. However the scale control does not change: it still reads "500 ft/200 m" which corresponds to level 16. This is wrong. I have seen this behavior on all maps by a variety of developers but I have never seen any discussion here about the problem. 1) do others see this problem? 2) is there a fix/workaround? Thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
