angularjs - Set info window content from html text box using google maps api v3 and angular js -
i trying create trail of event markers, works fine have poly lines. each event marker want have useful info location, , want able add info app itself. way thinking doing adding text box add info in , when click on map make event marker takes string in text box , puts in info window.
here html code:
<ion-view view-title="maps"> <ion-content class="background"> <h1>create trail</h1> <input class = "text" id = "info" placeholder = 'info' ng-model = "info" > </input> <div id = "map1" data-tap-disabled = "true" ng-click = "addonclick($event)"></div> </ion-content> </ion-view> and angular:
google.maps.event.addlistener($scope.map, 'click', function (event) { var newmarker = new google.maps.marker({ map: $scope.map, animation: google.maps.animation.drop, position: event.latlng }); console.log($scope.info); var newmarkerinfo = new google.maps.infowindow({ content:$scope.info }); google.maps.event.addlistener(newmarker,'click', function($scope) { newmarkerinfo.open($scope.map, newmarker); }); like said create event markers , infowindows, console.log($scope.info) line prints out undefined.
Comments
Post a Comment