"use strict"; (function () { 'use strict'; angular.module('locationModule') .directive('poiInfoBubble', function () { return { restrict: 'AE', template: '
' + '
' + '
{{poi.name}}
' + '
{{poi.type.name}}
' + '
', replace: true, scope: { poi: '=parent' }, link: function (scope, $element) { var map = scope.poi.marker.map; var infoBubble = new bmcMaps.InfoBubble({ content: $element[0], position: scope.poi.marker.position, shadowStyle: 0, borderWidth: 0, padding: 0, backgroundColor: 'transparent', borderRadius: 4, arrowSize: 0, hideCloseButton: true, arrowPosition: 50, arrowStyle: 0 }); scope.poi.infoBubble = infoBubble; scope.poi.infoBubble.open(map); scope.poi.marker.setVisible(false); function handleMapClick() { scope.poi.infoBubble.close(); scope.poi.marker.setVisible(true); } bmcMaps.event.addListener(map, 'click', handleMapClick); scope.$on('$destroy', function () { bmcMaps.event.clearInstanceListeners(map); }); } }; }); }());