vag
vag

Reputation:

How i add an addListener to GOOGLE MAPS to get MapType

How i add an addListener to GOOGLE MAPS to get MapType

Upvotes: 1

Views: 2828

Answers (3)

Vincent
Vincent

Reputation: 1

This works better. Test with alert()

GEvent.addListener(map, "maptypechanged", function() {
    var newMapType = map.getCurrentMapType().getName(true);   
    //alert(newMapType);
    ....
})

Upvotes: 0

Crescent Fresh
Crescent Fresh

Reputation: 116980

Try:

GEvent.addListener(map, "maptypechanged", function() {
    var newMapType = map.getCurrentMapType();
    // ...
})

Upvotes: 2

vag
vag

Reputation:

ok! i found it myself map.getCurrentMapType().getName();

Upvotes: 2

Related Questions