How to wait for Angular Google Maps to append getGMap to the control object

后端 未结 2 1884
梦如初夏
梦如初夏 2021-01-04 10:53

I\'ve been trying to set up click event listeners on the google.maps.Map object that\'s created by the ui-gmap-google-map directive from the Angula

2条回答
  •  春和景丽
    2021-01-04 11:32

    I ended up using vanilla JS and got everything to work with no headache. Angular Google Maps is a cool idea, but at least in my case, the issues outnumber the benefits.

    After spending an hour or so on github and stackoverflow, I realised that the proposed solutions (like https://github.com/angular-ui/angular-google-maps/issues/308) were a hack of a hack, and since my task was just "display some markers on a map and center the map on them" I don't want to use a hack.

    The gmaps documentation contains tons of examples (in vanilla JS) that can be used in an Angular app, copy + paste and you're done.

    Again, this is my personal experience, might not be the same for you

提交回复
热议问题