views:

36

answers:

1

I am using the Google Map API V3.0

To add a listener to detect a zoom change works with the following:

google.maps.event.addListener(map,'zoom_changed',function())

What is the code to detect a change in the map type from ROADMAP to another view like SATELLITE? I can get the value:

val myMapType = map.getMapTypeId();

but do not know how to detect the change in view.

A: 

OK worked it out:

google.maps.event.addListener(map,'maptypeid_changed',function(){ document.getElementById("maptype").value = map.getMapTypeId(); });

Graham