Angular Google Maps - automatically set 'center' and 'zoom' to fit in all markers

前端 未结 5 1867
暗喜
暗喜 2021-02-19 05:51

I have a dynamically generated list of markers within my Google Map. I want the map\'s center to be the center of all the markers and zoomed out just enough so that all markers

5条回答
  •  轮回少年
    2021-02-19 06:27

    angular-google-maps has taken care of this feature. All you need to do is add fit="true" attribute in your markers directive (ui-gmap-markers). Example : Please refer the document http://angular-ui.github.io/angular-google-maps/#!/api

提交回复
热议问题