angularjs - uiGmapgoogle-maps marker not showing -
i have google map set on page , want place marker on it. need 1 marker coords center of map, somehow marker not showing (the map loads, zooms , centers correctly).
there no error in console, have no idea what's wrong.
here's html:
<ui-gmap-google-map center='map.center' zoom='map.zoom'> <ui-gmap-marker ng-model="marker" idkey="0" coords="'coords'"></ui-gmap-markers> </ui-gmap-google-map>
and controller:
'use strict'; angular.module('zicapp') .controller('landingcontroller', function ($scope) { // google map settings $scope.map = { center: { latitude: 46.042356, longitude: 14.487859 }, zoom: 16 }; // google map marker settings $scope.marker = [ { id: 0, coords: { latitude: 46.042356, longitude: 14.487859 } } ]; });
had change html (model models, , idkey="0" idkey="idkey")
, html marker tag looks this:
<ui-gmap-markers models="marker" coords="'self'" icon="'icon'" idkey="'idkey'"></ui-gmap-markers>
i changed id key in controller 1:
$scope.marker = [ { idkey: 1, latitude: 46.042356, longitude: 14.487859 } ];
marker displaying correctly.
Comments
Post a Comment