I am using Angular -google-maps, the HTML code follows
<ui-gmap-google-map center='mapData.map.center' zoom='mapData.map.zoom' events="mapEvents"> <ui-gmap-markers models="mapData.map.markers" coords="'self'"> </ui-gmap-markers> </ui-gmap-google-map>
in JS call
angular.extend(this, $controller('MapsMixinController', {$scope:$scope, map:mapData.data[0].map}));
MapsMixinController as follows. Call this controller from js code. Markers are displayed and can click on the icon.
MapsMixinController.js
angular .module('app') .controller('MapsMixinController', ['$scope', 'GeolocationService', 'uiGmapGoogleMapApi', 'map', function($scope, GeolocationService, GoogleMapApi, map) { var _this = this; $scope.mapEvents = { click: function(mapModel, eventName, originalEventArgs) { var e = originalEventArgs[0]; if (e.latLng) { $scope.mapData.map.markers.push({ id: new Date().getTime(), latitude: e.latLng.lat(), longitude: e.latLng.lng() });
How to show heading when hovering over markers? And click how to display the description on markers?
user4870812
source share