Saturday 15 August 2015

javascript - Using angular-google-maps, how can I add markers that have infowindows? -


I am using an angular-google-map for a project, and I click on users a point on the map Need to drop a pin, and then customize the info window which comes with the window. I already have the ability to click on a map and drop a pin, but I do not know how to add an information to it. I am combing through the docs, but I am not getting a clear answer.

I really need to know that for all the markers, the info window needs to go into a different array or if they can be assigned to each marker as part of the marker object. I have UI-GMAP-Windows Directive set, but really do not know exactly how to use it. Here's the beginning of my code to leave at least the pin ...

HTML

  $ scope.map = {center: {latitude: 38.2, Longitude: -98.5795}, zoom: 5};  

JS

  $ scope.markers = []; $ Scope.events = {click: function (map, eventName, handlerArgs) {$ scope. $ Apply (function () {$ scope.markers.push ({id: $ scope.markers.length, latitude: handlerArise [0] .LatLng.lat (), Longitude: HandlerRG [0] .latLng.lng (), SWONDAND: TRUE, OPTION: {ANIMATION: API.Animation. DROP, Title: HandlerRG [0] .latLng.toUrlValue ()}})}}; }}; Var API; UiGmapGoogleMapApi.then (function (googleMaps) {api = googleMaps;});  


No comments:

Post a Comment