Search code examples
sapui5

Trigger a event on Zoom change SAPUI5


I want an event to be triggered when zoom of the map changes. I am using sapui5 google maps. In my view.xml i bound the map as following

<gmaps:Map id="map1" class="googleMap" height="600px" width="100%" zoom="4" lat="100" lng=100" markers="{/co}" ready="onMapReady"  zoomControl = 'true' 
zoom_changed  = "renderNewMap">

But it doesn't trigger the event.


Solution

  • I'm afraid John Patterson's Google Maps control doesn't have a zoom event. According to Map.js on Github, only a click and ready event are present.

    However, this control is open source though, meaning that you have the possibility to add whatever you think is missing in a subclass, or even your own version of this control.

    If you make any useful modifications that could be useful for other people as well, it would also show good etiquette, if you could submit your changes in a pull request. In the open source community this is considered saying "thank you". When you make a pull request, John could then easily include your contributions in future releases of the Google Maps control.