I need to handle the case when a user clicks on a mapTypeControl differently than when it’s set through map.setMapTypeId(). How do I listen for clicks on map type controls?
I need to handle the case when a user clicks on a mapTypeControl differently
Share
You can’t listen for events on the default UI control set. But if you are strictly focused on differentiating between clicks on the
mapTypeControlandmap.setMapTypeId(), you could use the fact that you control the code that may callsetMapTypeId()and add some state management code:This should set you up to handle the two different occurrences in the way you need.