|
2359 | 2359 | 'leafletHelpers', |
2360 | 2360 | '$log', |
2361 | 2361 | function ($rootScope, leafletHelpers, $log) { |
2362 | | - var isDefined = leafletHelpers.isDefined, MarkerClusterPlugin = leafletHelpers.MarkerClusterPlugin, AwesomeMarkersPlugin = leafletHelpers.AwesomeMarkersPlugin, safeApply = leafletHelpers.safeApply, Helpers = leafletHelpers, isString = leafletHelpers.isString, isNumber = leafletHelpers.isNumber, isObject = leafletHelpers.isObject, groups = {}; |
| 2362 | + var isDefined = leafletHelpers.isDefined, MarkerClusterPlugin = leafletHelpers.MarkerClusterPlugin, AwesomeMarkersPlugin = leafletHelpers.AwesomeMarkersPlugin, MakiMarkersPlugin = leafletHelpers.MakiMarkersPlugin, safeApply = leafletHelpers.safeApply, Helpers = leafletHelpers, isString = leafletHelpers.isString, isNumber = leafletHelpers.isNumber, isObject = leafletHelpers.isObject, groups = {}; |
2363 | 2363 | var createLeafletIcon = function (iconData) { |
2364 | 2364 | if (isDefined(iconData) && isDefined(iconData.type) && iconData.type === 'awesomeMarker') { |
2365 | 2365 | if (!AwesomeMarkersPlugin.isLoaded()) { |
2366 | 2366 | $log.error('[AngularJS - Leaflet] The AwesomeMarkers Plugin is not loaded.'); |
2367 | 2367 | } |
2368 | 2368 | return new L.AwesomeMarkers.icon(iconData); |
2369 | 2369 | } |
| 2370 | + if (isDefined(iconData) && isDefined(iconData.type) && iconData.type === 'makiMarker') { |
| 2371 | + if (!MakiMarkersPlugin.isLoaded()) { |
| 2372 | + $log.error('[AngularJS - Leaflet] The MakiMarkers Plugin is not loaded.'); |
| 2373 | + } |
| 2374 | + return new L.MakiMarkers.icon(iconData); |
| 2375 | + } |
2370 | 2376 | if (isDefined(iconData) && isDefined(iconData.type) && iconData.type === 'div') { |
2371 | 2377 | return new L.divIcon(iconData); |
2372 | 2378 | } |
|
2774 | 2780 | } |
2775 | 2781 | } |
2776 | 2782 | }, |
| 2783 | + MakiMarkersPlugin: { |
| 2784 | + isLoaded: function () { |
| 2785 | + if (angular.isDefined(L.MakiMarkers) && angular.isDefined(L.MakiMarkers.Icon)) { |
| 2786 | + return true; |
| 2787 | + } else { |
| 2788 | + return false; |
| 2789 | + } |
| 2790 | + }, |
| 2791 | + is: function (icon) { |
| 2792 | + if (this.isLoaded()) { |
| 2793 | + return icon instanceof L.MakiMarkers.Icon; |
| 2794 | + } else { |
| 2795 | + return false; |
| 2796 | + } |
| 2797 | + }, |
| 2798 | + equal: function (iconA, iconB) { |
| 2799 | + if (!this.isLoaded()) { |
| 2800 | + return false; |
| 2801 | + } |
| 2802 | + if (this.is(iconA)) { |
| 2803 | + return angular.equals(iconA, iconB); |
| 2804 | + } else { |
| 2805 | + return false; |
| 2806 | + } |
| 2807 | + } |
| 2808 | + }, |
2777 | 2809 | LabelPlugin: { |
2778 | 2810 | isLoaded: function () { |
2779 | 2811 | return angular.isDefined(L.Label); |
|
0 commit comments