@inlog/inlog-maps 5.0.2 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DOCUMENTATION.md +1796 -1796
- package/_bundles/inlog-maps.js +54 -0
- package/_bundles/inlog-maps.js.map +1 -1
- package/_bundles/inlog-maps.min.js +1 -1
- package/_bundles/inlog-maps.min.js.map +1 -1
- package/lib/models/apis/google/google-polylines.d.ts +2 -0
- package/lib/models/apis/google/google-polylines.js +28 -0
- package/lib/models/apis/google/google-polylines.js.map +1 -1
- package/lib/models/apis/leaflet/leaflet-polylines.d.ts +2 -0
- package/lib/models/apis/leaflet/leaflet-polylines.js +24 -0
- package/lib/models/apis/leaflet/leaflet-polylines.js.map +1 -1
- package/lib/models/dto/event-type.d.ts +3 -1
- package/lib/models/dto/event-type.js +2 -0
- package/lib/models/dto/event-type.js.map +1 -1
- package/lib-esm/models/apis/google/google-polylines.d.ts +2 -0
- package/lib-esm/models/apis/google/google-polylines.js +28 -0
- package/lib-esm/models/apis/google/google-polylines.js.map +1 -1
- package/lib-esm/models/apis/leaflet/leaflet-polylines.d.ts +2 -0
- package/lib-esm/models/apis/leaflet/leaflet-polylines.js +24 -0
- package/lib-esm/models/apis/leaflet/leaflet-polylines.js.map +1 -1
- package/lib-esm/models/dto/event-type.d.ts +3 -1
- package/lib-esm/models/dto/event-type.js +2 -0
- package/lib-esm/models/dto/event-type.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6","webpack:///inlog-maps.min.js","webpack:///webpack/bootstrap 0c2e20ad3d0369e38b07?d5c2","webpack:///./src/models/features/events/event-return.ts?6cf4","webpack:///./src/models/dto/event-type.ts?15ce","webpack:///./src/models/dto/map-type.ts?ec1b","webpack:///./src/models/dto/polyline-type.ts?c49e","webpack:///./src/models/features/marker-clusterer/marker-clusterer-config.ts?bc48","webpack:///./src/models/features/polyline/polyline-options.ts?ca16","webpack:///./src/utils/maps-api-loader.service.ts?696b","webpack:///./src/index.ts?eac3","webpack:///./~/@google/markerclustererplus/src/markerclusterer.js?a612","webpack:///./src/map.ts?cf28","webpack:///./src/models/apis/googleMaps.ts?f10e","webpack:///./src/models/apis/google/google-circles.ts?363e","webpack:///./src/models/apis/google/google-geojson.ts?a37d","webpack:///./src/models/apis/google/google-map.ts?3851","webpack:///./src/models/apis/google/google-markers.ts?53ea","webpack:///./src/models/apis/google/google-overlay.ts?0e38","webpack:///./src/models/apis/google/google-polygons.ts?9913","webpack:///./src/models/apis/google/google-polylines.ts?eb20","webpack:///./src/models/apis/google/google-popup.ts?f08c","webpack:///./src/models/apis/leaflet.ts?c2ad","webpack:///./src/models/apis/leaflet/leaflet-circle.ts?e648","webpack:///./src/models/apis/leaflet/leaflet-geojson.ts?de26","webpack:///./src/models/apis/leaflet/leaflet-map.ts?9245","webpack:///./src/models/apis/leaflet/leaflet-markers.ts?38e3","webpack:///./src/models/apis/leaflet/leaflet-overlay.ts?a19a","webpack:///./src/models/apis/leaflet/leaflet-polygons.ts?718f","webpack:///./src/models/apis/leaflet/leaflet-polylines.ts?373c","webpack:///./src/models/apis/leaflet/leaflet-popup.ts?4e83","webpack:///./src/models/features/circle/circle-alter-options.ts?0e19","webpack:///./src/models/features/circle/circle-options.ts?c36a","webpack:///./src/models/features/geojson/geojson-options.ts?9fe6","webpack:///./src/models/features/marker/circle-marker-options.ts?ab05","webpack:///./src/models/features/marker/circle-marker-style.ts?3a4b","webpack:///./src/models/features/marker/marker-alter-options.ts?4b8f","webpack:///./src/models/features/marker/marker-icon.ts?e85b","webpack:///./src/models/features/marker/marker-options.ts?5d42","webpack:///./src/models/features/overlay/overlay-options.ts?55e0","webpack:///./src/models/features/polygons/polygon-alter-options.ts?346d","webpack:///./src/models/features/polygons/polygon-options.ts?01f9","webpack:///./src/models/features/polyline/navigations-options.ts?7ec9","webpack:///./src/models/features/popup/popup-options.ts?ab91","webpack:///./src/utils/url-builder.ts?2855"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","EventReturn","latlng","default","MapEventType","MarkerEventType","CircleEventType","PolygonEventType","PolylineEventType","MapType","PolylineType","MarkerClustererConfig","clusterZoomOnClick","clusterMinSize","clusterMaxZoom","PolylineOptions","path","addToMap","fitBounds","editable","draggable","color","weight","infowindows","navigateOptions","style","opacity","zIndex","map_type_1","url_builder_1","MapsApiLoaderService","loadGoogleAPI","params","script","document","createElement","type","setAttribute","src","urlBuilder","apiKey","base","callback","client","language","libraries","querySelector","hasAttribute","appendChild","loadLeafletAPI","link","rel","href","loadApi","mapType","mapsApi","Promise","resolve","windowRef","window","api","mapsAPILoadCallback","deferred","reject","Google","Leaflet","setTimeout","L","google","Error","map_1","Map","circle_alter_options_1","CircleAlterOptions","circle_options_1","CircleOptions","event_return_1","geojson_options_1","GeoJsonOptions","circle_marker_options_1","CircleMarkerOptions","circle_marker_style_1","CircleMarkerStyle","marker_alter_options_1","MarkerAlterOptions","marker_icon_1","MarkerIcon","marker_options_1","MarkerOptions","overlay_options_1","OverlayOptions","polygon_alter_options_1","PolygonAlterOptions","polygon_options_1","PolygonOptions","navigations_options_1","NavigationOptions","polyline_options_1","popup_options_1","PopupOptions","marker_clusterer_config_1","event_type_1","polyline_type_1","ClusterIcon","cluster","styles","getMarkerClusterer","extend","maps","OverlayView","cluster_","className_","getClusterClass","styles_","center_","div_","sums_","visible_","setMap","getMap","Cluster","mc","markerClusterer_","map_","gridSize_","getGridSize","minClusterSize_","getMinimumClusterSize","averageCenter_","getAverageCenter","markers_","bounds_","clusterIcon_","getStyles","MarkerClusterer","map","opt_markers","opt_options","clusters_","listeners_","activeMap_","ready_","gridSize","minimumClusterSize","maxZoom_","maxZoom","title_","title","zoomOnClick_","undefined","zoomOnClick","averageCenter","ignoreHidden_","ignoreHidden","enableRetinaIcons_","enableRetinaIcons","imagePath_","imagePath","IMAGE_PATH","imageExtension_","imageExtension","IMAGE_EXTENSION","imageSizes_","imageSizes","IMAGE_SIZES","calculator_","calculator","CALCULATOR","batchSize_","batchSize","BATCH_SIZE","batchSizeIE_","batchSizeIE","BATCH_SIZE_IE","clusterClass_","clusterClass","navigator","userAgent","toLowerCase","indexOf","setupStyles_","addMarkers","onAdd","cMouseDownInCluster","cDraggingMapByCluster","cClusterIcon","gmVersion","version","split","parseInt","className","show","getPanes","overlayMouseTarget","boundsChangedListener_","event","addListener","addDomListener","e","stopPropagation","theBounds","mz","trigger","getZoomOnClick","getMaxZoom","getBounds","getZoom","setZoom","cancelBubble","onRemove","parentNode","hide","removeListener","clearInstanceListeners","removeChild","draw","pos","getPosFromLatLng_","top","y","left","x","Marker","MAX_ZINDEX","display","img","bp","backgroundPosition_","spriteH","replace","spriteV","cssText","createCss","url_","width_","height_","innerHTML","anchorText_","textColor_","textSize_","fontFamily_","fontWeight_","fontStyle_","textDecoration_","text","getTitle","useStyle","sums","index","Math","max","min","length","url","height","width","anchorText","anchorIcon_","anchorIcon","textColor","textSize","textDecoration","fontWeight","fontStyle","fontFamily","backgroundPosition","setCenter","center","push","join","getProjection","fromLatLngToDivPixel","getSize","getMarkers","getCenter","bounds","LatLngBounds","markers","getPosition","remove","addMarker","marker","mCount","isMarkerAlreadyAdded_","lat","lng","LatLng","calculateBounds_","isAdded","updateIcon_","isMarkerInClusterBounds","contains","getExtendedBounds","numStyles","getCalculator","cMarkerClusterer","repaint","prevZoom_","zoom","minZoom","mapTypes","getMapTypeId","resetViewport_","bind","redraw_","size","fitMapToMarkers","getVisible","getIgnoreHidden","setGridSize","setMinimumClusterSize","setMaxZoom","setStyles","setTitle","setZoomOnClick","setAverageCenter","setIgnoreHidden","getEnableRetinaIcons","setEnableRetinaIcons","getImageExtension","setImageExtension","getImagePath","setImagePath","getImageSizes","setImageSizes","setCalculator","getBatchSizeIE","setBatchSizeIE","setClusterClass","getTotalMarkers","getClusters","getTotalClusters","opt_nodraw","pushMarkerTo_","key","getDraggable","removeMarker","removed","removeMarker_","removeMarkers","r","splice","clearMarkers","oldClusters","slice","projection","tr","getNorthEast","bl","getSouthWest","trPix","blPix","ne","fromDivPixelToLatLng","sw","createClusters_","opt_hide","distanceBetweenPoints_","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","isMarkerInBounds_","addToClosestCluster_","distance","clusterToAddTo","iFirst","mapBounds","timerRefStatic","clearTimeout","iLast","obj1","obj2","apply","count","toString","dv","googleMaps_1","leaflet_1","markersList","polygonsList","circlesList","polylinesList","infoWindowList","overlayList","markerClusterer","initialize","options","elementId","loadGEOJson","data","eventClick","drawMarker","addClusterer","addMarkerClusterer","addMarkerOnClusterer","drawCircleMarker","toggleMarkers","condition","filter","removeAllMarkers","alterMarkerOptions","alterMarkerPosition","position","addTransition","fitBoundsMarkers","onlyMarkersOnMap","_this","isMarkerOnMap","fitBoundsPositions","setCenterMarker","find","markerExists","countMarkers","onlyOnMap","countMarkersOnCluster","addMarkerEvent","eventFunction","removeMarkerEvent","config","alterMarkerClustererConfig","refreshClusterer","clearMarkersClusterer","drawPolygon","polygon","togglePolygons","polygons","getPolygons","removePolygons","removeAllPolygons","alterPolygonOptions","fitBoundsPolygons","isPolygonOnMap","setCenterPolygons","polygonExists","getPolygonPath","addPolygonEvent","removePolygonEvent","drawCircle","circle","toggleCircles","circles","getCircles","removeCircles","removeAllCircles","alterCircleOptions","fitBoundsCircles","isCircleOnMap","circleExists","getCircleCenter","getCircleRadius","addCircleEvent","removeCircleEvent","drawPolyline","polyline","drawPolylineWithNavigation","togglePolylines","getPolylines","removePolylines","polylines","removeAllPolylines","alterPolylineOptions","fitBoundsPolylines","isPolylineOnMap","polylineExists","addPolylinePath","getPolylinePath","removePolylineHighlight","addPolylineEvent","removePolylineEvent","setIndexPolylineHighlight","initialIndex","getObjectPolyline","getObjectPolylineHighlight","addPolylineHighlightEvent","getPolylineHighlightIndex","drawPopup","conditionMarker","popup","alterPopup","popups","alterPopupContent","getObjectOpenPopup","closePopup","closeAllPopups","resizeMap","addEventMap","eventType","removeEventMap","pixelsToLatLng","offsetx","offsety","fitBoundsElements","drawOverlay","overlay","conditionPolygon","toggleOverlay","overlays","getOverlays","removeOverlays","removeAllOverlays","__awaiter","thisArg","_arguments","P","generator","fulfilled","step","next","rejected","result","done","then","__generator","body","verb","v","op","f","TypeError","_","t","label","ops","pop","trys","g","sent","throw","return","Symbol","iterator","maps_api_loader_service_1","google_circles_1","google_geojson_1","google_map_1","google_markers_1","google_overlay_1","google_polygons_1","google_polylines_1","google_popup_1","GoogleMaps","mapsApiLoader","google_1","imageMapTypes_1","ids_1","trafficLayer","err_1","_a","fullscreenControl","keyboardShortcuts","mapTypeControl","rotateControl","scaleControl","streetViewControl","zoomControl","gestureHandling","mapTiles","MapTypeId","ROADMAP","SATELLITE","forEach","tile","mapTypeOptions","getTileUrl","coord","isPng","tileSize","Size","imageMapType","ImageMapType","id","mapTypeControlOptions","mapTypeIds","MapTypeControlStyle","HORIZONTAL_BAR","getElementById","googleMarkers","googlePolygons","googleCircles","googlePopups","googlePolylines","googleMap","googleOverlays","googleGeoJson","image","set","showTraffic","TrafficLayer","removeMarkerFromClusterer","GoogleCircles","self","newOptions","fillColor","fillOpacity","radius","strokeColor","strokeOpacity","strokeWeight","suppressUndo","Circle","param","latLng","setOptions","getCirclesBounds","getRadius","Click","CenterChanged","RadiusChanged","clearListeners","circulo","union","GoogleGeoJson","parseGeoJson","elem","parsedFeatures","Array","isArray","features","_i","feature","parseGeoJsonToObject","objectOptions","geometry","properties","assign","coordinates","paths","Polygon","Polyline","GoogleMap","ZoomChanged","scale","pow","worldCoordinateCenter","fromLatLngToPoint","pixelOffset","Point","worldCoordinateNewCenter","fromPointToLatLng","getPaths","getArray","ponto","getPath","GoogleMarkers","icon","SymbolPath","CIRCLE","newPosition","moveTransitionMarker","setPosition","RightClick","AfterDrag","MouseOver","MouseOut","BeforeDrag","reference","deltaLat","deltaLng","lastPosition","moveMarker","numDeltas","GoogleOverlays","OverlayGoogle","div","obj","afterDrag","afterDragHandler","that","panes","overlayLayer","getDiv","cursor","moveHandler","origin","clientX","clientY","overlayProjection","getPolygonsBounds","divElement","afterEventDragHandler","GooglePolygons","getPathRecursiveArray","getPathPolylineArray","getPolygonBounds","paths_1","setPath","SetAt","addPolygonEventMove","InsertAt","addPolygonEventInsertAt","RemoveAt","addPolygonEventRemoveAt","DragPolygon","addPolygonEventDragPolygon","addPolygonEventClick","polygonPathIdx","getLength","addPolygonEventMoveAllPaths","getAt","innerPolygon","newEvent","lastEvent","dragging","addPolygonEventInsertAtAllPaths","newPath","newPoint","previousPath","previousPoint","addPolygonEventRemoveAtAllPaths","GooglePolylines","selectedPolyline","selectedPath","navigateInfoWindow","directionForward","multiSelectionForward","multiSelection","icons","Dotted","console","warn","Dashed","offset","repeat","Arrow","FORWARD_OPEN_ARROW","scaledSize","getPolylineBounds","navigationHandlerClick","navigationOptions","navigateByPoint","addNavigation","getPolylinesBounds","close","addPolylineEventMove","addPolylineEventInsertAt","addPolylineEventRemoveAt","DragPolyline","addPolylineEventDragPolyline","initialIdx","finalIdx","moveSelectedPath","navegateOnKeyPress","onKeyUp","onClickPolyline","checkIdx","which","keyCode","moveForwards","shiftKey","moveBackwards","navigateForward","navigateBackward","pathSelected","updateSelectedPathListeners","anchor","drawPopupNavigation","moveListener","insertAtListener","removeAtListener","dragPolylineListener","idx","infowindow","point","content","minDistance","Number","MAX_VALUE","returnValue","distanceToLine","pt1","pt2","pt","deltaX","deltaY","incIntersect","deltaSum","kmTo","intersect","ra","b","asin","GooglePopups","InfoWindow","open","setContent","leaflet_circle_1","leaflet_geojson_1","leaflet_map_1","leaflet_markers_1","leaflet_overlay_1","leaflet_polygons_1","leaflet_polylines_1","leaflet_popup_1","mapOptions","osm","wikimedia","satelliteURL","satellite","baseLayers_1","loadDependencies","mapTimeout","keyboard","tileLayer","attribution","layers","Satellite","layer","control","addTo","leafletMarkers","leafletPolygons","leafletCircles","leafletPopups","leafletPolylines","leafletMap","leafletOverlays","leafletGeoJson","error","ms","cssDependencies","scripts","scriptsDependencies","LeafletCircles","leaflet","on","DomEvent","target","enableEdit","addLayer","removeLayer","setStyle","setRadius","setLatLng","disableEdit","getBoundsCircles","hasLayer","getLatLng","vertex","off","FeatureGroup","LeafletGeoJson","objects","parsedCoordinates","reverse","LeafletMap","invalidateSize","panTo","CRS","Simple","project","unproject","group","featureGroup","LeafletMarkers","Icon","iconUrl","iconSize","iconAnchor","popupAnchor","circleMarker","setIcon","markerClusterGroup","maxClusterRadius","showCoverageOnHover","zoomToBoundsOnClick","refreshClusters","clearLayers","getLayers","LeafletOverlay","html","outerHTML","myIcon","DivIcon","getBoundsPolygons","LeafletPolygons","setLatLngs","getLatLngs","eventStart","eventEnd","z","getIndex","eventNew","latlngs","previous","findIndex","previousPoint_1","LeafletPolylines","leafletPopup","dashArray","cancel","pathOptions","decorator","polylineDecorator","patterns","symbol","arrowHead","pixelSize","getBoundsPolylines","editEnabled","onkeyup","onkeydown","clearAllEventListeners","ctrlKey","moveFowards","multiselection","navigateFoward","addNewSelectedPath","setArrowSelectedPath","highlight","LeafletPopup","drawPopupOnMarker","Popup","openOn","getPopup","isOpen","notCalledByMap","openPopup","_popup","bindPopup","builtUrl","integrity","crossorigin","library"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,OAAA,eAAAH,GACA,gBAAAC,SACAA,QAAA,UAAAD,IAEAD,EAAA,UAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QA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,KAGlDh4B,EAAOa,WAAab,EAAOa,UAAU+M,OAAS,IAC9CkqB,GAAY,aAEZ93B,EAAOa,UAAU0gB,QAAQ,SAAU0W,EAASzqB,GACxCsqB,GAAYG,EAERzqB,IAAUxN,EAAOa,UAAU+M,OAAS,IACpCkqB,GAAY,OAIpBA,GAAY,KAGZ93B,EAAOY,WACPk3B,GAAY,YAAc93B,EAAOY,SAAW,KAG5CZ,EAAOU,WACPo3B,GAAY,YAAc93B,EAAOU,SAAW,KAGzCo3B,I3Co7NL,SAAU57B,EAAQD,EAASM,GAEjCL,EAAOD,QAAUM,EAAoB","file":"inlog-maps.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"InlogMaps\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"InlogMaps\"] = factory();\n\telse\n\t\troot[\"InlogMaps\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"InlogMaps\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"InlogMaps\"] = factory();\n\telse\n\t\troot[\"InlogMaps\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 42);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar EventReturn = /** @class */ (function () {\r\n function EventReturn(latlng) {\r\n this.latlng = latlng;\r\n }\r\n return EventReturn;\r\n}());\r\nexports.default = EventReturn;\r\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MapEventType;\r\n(function (MapEventType) {\r\n MapEventType[MapEventType[\"Click\"] = 0] = \"Click\";\r\n MapEventType[MapEventType[\"ZoomChanged\"] = 1] = \"ZoomChanged\";\r\n})(MapEventType = exports.MapEventType || (exports.MapEventType = {}));\r\nvar MarkerEventType;\r\n(function (MarkerEventType) {\r\n MarkerEventType[MarkerEventType[\"Click\"] = 0] = \"Click\";\r\n MarkerEventType[MarkerEventType[\"RightClick\"] = 1] = \"RightClick\";\r\n MarkerEventType[MarkerEventType[\"AfterDrag\"] = 2] = \"AfterDrag\";\r\n MarkerEventType[MarkerEventType[\"MouseOver\"] = 3] = \"MouseOver\";\r\n MarkerEventType[MarkerEventType[\"MouseOut\"] = 4] = \"MouseOut\";\r\n MarkerEventType[MarkerEventType[\"BeforeDrag\"] = 5] = \"BeforeDrag\";\r\n})(MarkerEventType = exports.MarkerEventType || (exports.MarkerEventType = {}));\r\nvar CircleEventType;\r\n(function (CircleEventType) {\r\n CircleEventType[CircleEventType[\"Click\"] = 0] = \"Click\";\r\n CircleEventType[CircleEventType[\"CenterChanged\"] = 1] = \"CenterChanged\";\r\n CircleEventType[CircleEventType[\"RadiusChanged\"] = 2] = \"RadiusChanged\";\r\n})(CircleEventType = exports.CircleEventType || (exports.CircleEventType = {}));\r\nvar PolygonEventType;\r\n(function (PolygonEventType) {\r\n PolygonEventType[PolygonEventType[\"SetAt\"] = 0] = \"SetAt\";\r\n PolygonEventType[PolygonEventType[\"InsertAt\"] = 1] = \"InsertAt\";\r\n PolygonEventType[PolygonEventType[\"RemoveAt\"] = 2] = \"RemoveAt\";\r\n PolygonEventType[PolygonEventType[\"DragPolygon\"] = 3] = \"DragPolygon\";\r\n PolygonEventType[PolygonEventType[\"Click\"] = 4] = \"Click\";\r\n})(PolygonEventType = exports.PolygonEventType || (exports.PolygonEventType = {}));\r\nvar PolylineEventType;\r\n(function (PolylineEventType) {\r\n PolylineEventType[PolylineEventType[\"SetAt\"] = 0] = \"SetAt\";\r\n PolylineEventType[PolylineEventType[\"InsertAt\"] = 1] = \"InsertAt\";\r\n PolylineEventType[PolylineEventType[\"RemoveAt\"] = 2] = \"RemoveAt\";\r\n PolylineEventType[PolylineEventType[\"DragPolyline\"] = 3] = \"DragPolyline\";\r\n})(PolylineEventType = exports.PolylineEventType || (exports.PolylineEventType = {}));\r\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MapType;\r\n(function (MapType) {\r\n MapType[MapType[\"Google\"] = 0] = \"Google\";\r\n MapType[MapType[\"Leaflet\"] = 1] = \"Leaflet\";\r\n})(MapType = exports.MapType || (exports.MapType = {}));\r\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PolylineType;\r\n(function (PolylineType) {\r\n PolylineType[PolylineType[\"Dashed\"] = 0] = \"Dashed\";\r\n PolylineType[PolylineType[\"Dotted\"] = 1] = \"Dotted\";\r\n PolylineType[PolylineType[\"Arrow\"] = 2] = \"Arrow\";\r\n})(PolylineType = exports.PolylineType || (exports.PolylineType = {}));\r\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MarkerClustererConfig = /** @class */ (function () {\r\n function MarkerClustererConfig(clusterZoomOnClick, clusterMinSize, clusterMaxZoom) {\r\n this.clusterZoomOnClick = clusterZoomOnClick;\r\n this.clusterMinSize = clusterMinSize;\r\n this.clusterMaxZoom = clusterMaxZoom;\r\n }\r\n return MarkerClustererConfig;\r\n}());\r\nexports.default = MarkerClustererConfig;\r\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PolylineOptions = /** @class */ (function () {\r\n function PolylineOptions(path, addToMap, fitBounds, editable, draggable, color, weight, object, infowindows, navigateOptions, style, opacity, zIndex) {\r\n this.path = path;\r\n this.addToMap = addToMap;\r\n this.fitBounds = fitBounds;\r\n this.editable = editable;\r\n this.draggable = draggable;\r\n this.color = color;\r\n this.weight = weight;\r\n this.object = object;\r\n this.infowindows = infowindows;\r\n this.navigateOptions = navigateOptions;\r\n this.style = style;\r\n this.opacity = opacity;\r\n this.zIndex = zIndex;\r\n }\r\n return PolylineOptions;\r\n}());\r\nexports.default = PolylineOptions;\r\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar map_type_1 = __webpack_require__(2);\r\nvar url_builder_1 = __webpack_require__(41);\r\nvar MapsApiLoaderService = /** @class */ (function () {\r\n function MapsApiLoaderService() {\r\n }\r\n MapsApiLoaderService.loadGoogleAPI = function (params) {\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.setAttribute('data-google-inlogmaps', 'true');\r\n script.src = url_builder_1.urlBuilder({\r\n apiKey: params.apiKey,\r\n base: 'https://maps.googleapis.com/maps/api/js',\r\n callback: 'mapsAPILoadCallback',\r\n client: params.client,\r\n language: params.language,\r\n libraries: params.libraries || []\r\n });\r\n var has_script = document.querySelector('script').hasAttribute('data-google-inlogmaps');\r\n if (!has_script)\r\n document.querySelector('head').appendChild(script);\r\n };\r\n MapsApiLoaderService.loadLeafletAPI = function (params) {\r\n var link = document.createElement('link');\r\n link.rel = 'stylesheet';\r\n link.href = 'https://desenvolvimentoweb.blob.core.windows.net/inlog-leaflet/leaflet.css';\r\n // link.integrity = params.cssIntegrity;\r\n // link.setAttribute('crossorigin', params.crossorigin);\r\n document.querySelector('head').appendChild(link);\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = url_builder_1.urlBuilder({\r\n base: 'https://desenvolvimentoweb.blob.core.windows.net/inlog-leaflet/leaflet.js',\r\n callback: 'mapsAPILoadCallback',\r\n });\r\n document.querySelector('head').appendChild(script);\r\n };\r\n // TODO: needs refactoring\r\n MapsApiLoaderService.prototype.loadApi = function (mapType, params) {\r\n if (MapsApiLoaderService.mapsApi) {\r\n return Promise.resolve(MapsApiLoaderService.mapsApi);\r\n }\r\n MapsApiLoaderService.windowRef = window ? window : { api: null, mapsAPILoadCallback: null };\r\n var deferred = function (resolve, reject) {\r\n if (mapType === map_type_1.MapType.Google) {\r\n MapsApiLoaderService.loadGoogleAPI(params);\r\n }\r\n else {\r\n MapsApiLoaderService.loadLeafletAPI(params);\r\n }\r\n // Temporaria para testar Leaflet\r\n if (mapType === map_type_1.MapType.Leaflet) {\r\n setTimeout(function () {\r\n MapsApiLoaderService.mapsApi = MapsApiLoaderService.windowRef.L;\r\n resolve(MapsApiLoaderService.mapsApi);\r\n }, 2000);\r\n }\r\n else {\r\n MapsApiLoaderService.windowRef.mapsAPILoadCallback = function () {\r\n MapsApiLoaderService.mapsApi = MapsApiLoaderService.windowRef.google;\r\n resolve(MapsApiLoaderService.mapsApi);\r\n };\r\n }\r\n setTimeout(function () {\r\n if (!MapsApiLoaderService.windowRef.api) {\r\n reject(new Error('Loading took too long'));\r\n }\r\n }, 5000);\r\n };\r\n return new Promise(deferred);\r\n };\r\n MapsApiLoaderService.windowRef = null;\r\n MapsApiLoaderService.mapsApi = null;\r\n return MapsApiLoaderService;\r\n}());\r\nexports.MapsApiLoaderService = MapsApiLoaderService;\r\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar map_1 = __webpack_require__(9);\r\nexports.Map = map_1.default;\r\nvar circle_alter_options_1 = __webpack_require__(28);\r\nexports.CircleAlterOptions = circle_alter_options_1.default;\r\nvar circle_options_1 = __webpack_require__(29);\r\nexports.CircleOptions = circle_options_1.default;\r\nvar event_return_1 = __webpack_require__(0);\r\nexports.EventReturn = event_return_1.default;\r\nvar geojson_options_1 = __webpack_require__(30);\r\nexports.GeoJsonOptions = geojson_options_1.default;\r\nvar circle_marker_options_1 = __webpack_require__(31);\r\nexports.CircleMarkerOptions = circle_marker_options_1.default;\r\nvar circle_marker_style_1 = __webpack_require__(32);\r\nexports.CircleMarkerStyle = circle_marker_style_1.default;\r\nvar marker_alter_options_1 = __webpack_require__(33);\r\nexports.MarkerAlterOptions = marker_alter_options_1.default;\r\nvar marker_icon_1 = __webpack_require__(34);\r\nexports.MarkerIcon = marker_icon_1.default;\r\nvar marker_options_1 = __webpack_require__(35);\r\nexports.MarkerOptions = marker_options_1.default;\r\nvar overlay_options_1 = __webpack_require__(36);\r\nexports.OverlayOptions = overlay_options_1.default;\r\nvar polygon_alter_options_1 = __webpack_require__(37);\r\nexports.PolygonAlterOptions = polygon_alter_options_1.default;\r\nvar polygon_options_1 = __webpack_require__(38);\r\nexports.PolygonOptions = polygon_options_1.default;\r\nvar navigations_options_1 = __webpack_require__(39);\r\nexports.NavigationOptions = navigations_options_1.default;\r\nvar polyline_options_1 = __webpack_require__(5);\r\nexports.PolylineOptions = polyline_options_1.default;\r\nvar popup_options_1 = __webpack_require__(40);\r\nexports.PopupOptions = popup_options_1.default;\r\nvar marker_clusterer_config_1 = __webpack_require__(4);\r\nexports.MarkerClustererConfig = marker_clusterer_config_1.default;\r\nvar event_type_1 = __webpack_require__(1);\r\nexports.MarkerEventType = event_type_1.MarkerEventType;\r\nexports.CircleEventType = event_type_1.CircleEventType;\r\nexports.PolygonEventType = event_type_1.PolygonEventType;\r\nexports.PolylineEventType = event_type_1.PolylineEventType;\r\nexports.MapEventType = event_type_1.MapEventType;\r\nvar map_type_1 = __webpack_require__(2);\r\nexports.MapType = map_type_1.MapType;\r\nvar polyline_type_1 = __webpack_require__(3);\r\nexports.PolylineType = polyline_type_1.PolylineType;\r\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n * @name MarkerClustererPlus for Google Maps V3\n * @version 2.1.11\n * @author Gary Little\n * @fileoverview\n * The library creates and manages per-zoom-level clusters for large amounts of markers.\n * <p>\n * This is an enhanced V3 implementation of the V2 MarkerClusterer by Xiaoxi Wu. It is\n * based on the V3 MarkerClusterer port by Luke Mahe. MarkerClustererPlus was created\n * by Gary Little.\n * <p>\n * v2.0 release: MarkerClustererPlus v2.0 is backward compatible with MarkerClusterer v1.0. It\n * adds support for the <code>ignoreHidden</code>, <code>title</code>, <code>batchSizeIE</code>,\n * and <code>calculator</code> properties as well as support for four more events. It also allows\n * greater control over the styling of the text that appears on the cluster marker. The\n * documentation has been significantly improved and the overall code has been simplified and\n * polished. Very large numbers of markers can now be managed without causing Javascript timeout\n * errors on Internet Explorer. Note that the name of the <code>clusterclick</code> event has been\n * deprecated. The new name is <code>click</code>, so please change your application code now.\n */\n\n/**\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @name ClusterIconStyle\n * @class This class represents the object for values in the <code>styles</code> array passed\n * to the {@link MarkerClusterer} constructor. The element in this array that is used to\n * style the cluster icon is determined by calling the <code>calculator</code> function.\n *\n * @property {string} url The URL of the cluster icon image file. Required.\n * @property {number} height The display height (in pixels) of the cluster icon. Required.\n * @property {number} width The display width (in pixels) of the cluster icon. Required.\n * @property {Array} [anchorText] The position (in pixels) from the center of the cluster icon to\n * where the text label is to be centered and drawn. The format is <code>[yoffset, xoffset]</code>\n * where <code>yoffset</code> increases as you go down from center and <code>xoffset</code>\n * increases to the right of center. The default is <code>[0, 0]</code>.\n * @property {Array} [anchorIcon] The anchor position (in pixels) of the cluster icon. This is the\n * spot on the cluster icon that is to be aligned with the cluster position. The format is\n * <code>[yoffset, xoffset]</code> where <code>yoffset</code> increases as you go down and\n * <code>xoffset</code> increases to the right of the top-left corner of the icon. The default\n * anchor position is the center of the cluster icon.\n * @property {string} [textColor=\"black\"] The color of the label text shown on the\n * cluster icon.\n * @property {number} [textSize=11] The size (in pixels) of the label text shown on the\n * cluster icon.\n * @property {string} [textDecoration=\"none\"] The value of the CSS <code>text-decoration</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontWeight=\"bold\"] The value of the CSS <code>font-weight</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontStyle=\"normal\"] The value of the CSS <code>font-style</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontFamily=\"Arial,sans-serif\"] The value of the CSS <code>font-family</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [backgroundPosition=\"0 0\"] The position of the cluster icon image\n * within the image defined by <code>url</code>. The format is <code>\"xpos ypos\"</code>\n * (the same format as for the CSS <code>background-position</code> property). You must set\n * this property appropriately when the image defined by <code>url</code> represents a sprite\n * containing multiple images. Note that the position <i>must</i> be specified in px units.\n */\n/**\n * @name ClusterIconInfo\n * @class This class is an object containing general information about a cluster icon. This is\n * the object that a <code>calculator</code> function returns.\n *\n * @property {string} text The text of the label to be shown on the cluster icon.\n * @property {number} index The index plus 1 of the element in the <code>styles</code>\n * array to be used to style the cluster icon.\n * @property {string} title The tooltip to display when the mouse moves over the cluster icon.\n * If this value is <code>undefined</code> or <code>\"\"</code>, <code>title</code> is set to the\n * value of the <code>title</code> property passed to the MarkerClusterer.\n */\n/**\n * A cluster icon.\n *\n * @constructor\n * @extends google.maps.OverlayView\n * @param {Cluster} cluster The cluster with which the icon is to be associated.\n * @param {Array} [styles] An array of {@link ClusterIconStyle} defining the cluster icons\n * to use for various cluster sizes.\n * @private\n */\nfunction ClusterIcon(cluster, styles) {\n cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);\n\n this.cluster_ = cluster;\n this.className_ = cluster.getMarkerClusterer().getClusterClass();\n this.styles_ = styles;\n this.center_ = null;\n this.div_ = null;\n this.sums_ = null;\n this.visible_ = false;\n\n this.setMap(cluster.getMap()); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Adds the icon to the DOM.\n */\nClusterIcon.prototype.onAdd = function () {\n var cClusterIcon = this;\n var cMouseDownInCluster;\n var cDraggingMapByCluster;\n var gmVersion = google.maps.version.split(\".\");\n\n gmVersion = parseInt(gmVersion[0] * 100, 10) + parseInt(gmVersion[1], 10);\n\n this.div_ = document.createElement(\"div\");\n this.div_.className = this.className_;\n if (this.visible_) {\n this.show();\n }\n\n this.getPanes().overlayMouseTarget.appendChild(this.div_);\n\n // Fix for Issue 157\n this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), \"bounds_changed\", function () {\n cDraggingMapByCluster = cMouseDownInCluster;\n });\n\n google.maps.event.addDomListener(this.div_, \"mousedown\", function () {\n cMouseDownInCluster = true;\n cDraggingMapByCluster = false;\n });\n\n// March 1, 2018: Fix for this 3.32 exp bug, https://issuetracker.google.com/issues/73571522\n// But it doesn't work with earlier releases so do a version check.\n if (gmVersion >= 332) { // Ugly version-dependent code\n google.maps.event.addDomListener(this.div_, \"touchstart\", function (e) {\n e.stopPropagation();\n });\n }\n\n google.maps.event.addDomListener(this.div_, \"click\", function (e) {\n cMouseDownInCluster = false;\n if (!cDraggingMapByCluster) {\n var theBounds;\n var mz;\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(mc, \"click\", cClusterIcon.cluster_);\n google.maps.event.trigger(mc, \"clusterclick\", cClusterIcon.cluster_); // deprecated name\n\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (mc.getZoomOnClick()) {\n // Zoom into the cluster.\n mz = mc.getMaxZoom();\n theBounds = cClusterIcon.cluster_.getBounds();\n mc.getMap().fitBounds(theBounds);\n // There is a fix for Issue 170 here:\n setTimeout(function () {\n mc.getMap().fitBounds(theBounds);\n // Don't zoom beyond the max zoom level\n if (mz !== null && (mc.getMap().getZoom() > mz)) {\n mc.getMap().setZoom(mz + 1);\n }\n }, 100);\n }\n\n // Prevent event propagation to the map:\n e.cancelBubble = true;\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n }\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseover\", function () {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseover\", cClusterIcon.cluster_);\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseout\", function () {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseout\", cClusterIcon.cluster_);\n });\n};\n\n\n/**\n * Removes the icon from the DOM.\n */\nClusterIcon.prototype.onRemove = function () {\n if (this.div_ && this.div_.parentNode) {\n this.hide();\n google.maps.event.removeListener(this.boundsChangedListener_);\n google.maps.event.clearInstanceListeners(this.div_);\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n};\n\n\n/**\n * Draws the icon.\n */\nClusterIcon.prototype.draw = function () {\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.top = pos.y + \"px\";\n this.div_.style.left = pos.x + \"px\";\n this.div_.style.zIndex = google.maps.Marker.MAX_ZINDEX + 1; // Put above all unclustered markers\n }\n};\n\n\n/**\n * Hides the icon.\n */\nClusterIcon.prototype.hide = function () {\n if (this.div_) {\n this.div_.style.display = \"none\";\n }\n this.visible_ = false;\n};\n\n\n/**\n * Positions and shows the icon.\n */\nClusterIcon.prototype.show = function () {\n if (this.div_) {\n var img = \"\";\n // NOTE: values must be specified in px units\n var bp = this.backgroundPosition_.split(\" \");\n var spriteH = parseInt(bp[0].replace(/^\\s+|\\s+$/g, \"\"), 10);\n var spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, \"\"), 10);\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos);\n img = \"<img src='\" + this.url_ + \"' style='position: absolute; top: \" + spriteV + \"px; left: \" + spriteH + \"px; \";\n if (this.cluster_.getMarkerClusterer().enableRetinaIcons_) {\n img += \"width: \" + this.width_ + \"px; height: \" + this.height_ + \"px;\";\n } else {\n img += \"clip: rect(\" + (-1 * spriteV) + \"px, \" + ((-1 * spriteH) + this.width_) + \"px, \" +\n ((-1 * spriteV) + this.height_) + \"px, \" + (-1 * spriteH) + \"px);\";\n }\n img += \"'>\";\n this.div_.innerHTML = img + \"<div style='\" +\n \"position: absolute;\" +\n \"top: \" + this.anchorText_[0] + \"px;\" +\n \"left: \" + this.anchorText_[1] + \"px;\" +\n \"color: \" + this.textColor_ + \";\" +\n \"font-size: \" + this.textSize_ + \"px;\" +\n \"font-family: \" + this.fontFamily_ + \";\" +\n \"font-weight: \" + this.fontWeight_ + \";\" +\n \"font-style: \" + this.fontStyle_ + \";\" +\n \"text-decoration: \" + this.textDecoration_ + \";\" +\n \"text-align: center;\" +\n \"width: \" + this.width_ + \"px;\" +\n \"line-height:\" + this.height_ + \"px;\" +\n \"'>\" + this.sums_.text + \"</div>\";\n if (typeof this.sums_.title === \"undefined\" || this.sums_.title === \"\") {\n this.div_.title = this.cluster_.getMarkerClusterer().getTitle();\n } else {\n this.div_.title = this.sums_.title;\n }\n this.div_.style.display = \"\";\n }\n this.visible_ = true;\n};\n\n\n/**\n * Sets the icon styles to the appropriate element in the styles array.\n *\n * @param {ClusterIconInfo} sums The icon label text and styles index.\n */\nClusterIcon.prototype.useStyle = function (sums) {\n this.sums_ = sums;\n var index = Math.max(0, sums.index - 1);\n index = Math.min(this.styles_.length - 1, index);\n var style = this.styles_[index];\n this.url_ = style.url;\n this.height_ = style.height;\n this.width_ = style.width;\n this.anchorText_ = style.anchorText || [0, 0];\n this.anchorIcon_ = style.anchorIcon || [parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)];\n this.textColor_ = style.textColor || \"black\";\n this.textSize_ = style.textSize || 11;\n this.textDecoration_ = style.textDecoration || \"none\";\n this.fontWeight_ = style.fontWeight || \"bold\";\n this.fontStyle_ = style.fontStyle || \"normal\";\n this.fontFamily_ = style.fontFamily || \"Arial,sans-serif\";\n this.backgroundPosition_ = style.backgroundPosition || \"0 0\";\n};\n\n\n/**\n * Sets the position at which to center the icon.\n *\n * @param {google.maps.LatLng} center The latlng to set as the center.\n */\nClusterIcon.prototype.setCenter = function (center) {\n this.center_ = center;\n};\n\n\n/**\n * Creates the cssText style parameter based on the position of the icon.\n *\n * @param {google.maps.Point} pos The position of the icon.\n * @return {string} The CSS style text.\n */\nClusterIcon.prototype.createCss = function (pos) {\n var style = [];\n style.push(\"cursor: pointer;\");\n style.push(\"position: absolute; top: \" + pos.y + \"px; left: \" + pos.x + \"px;\");\n style.push(\"width: \" + this.width_ + \"px; height: \" + this.height_ + \"px;\");\n style.push(\"-webkit-user-select: none;\");\n style.push(\"-khtml-user-select: none;\");\n style.push(\"-moz-user-select: none;\");\n style.push(\"-o-user-select: none;\");\n style.push(\"user-select: none;\");\n return style.join(\"\");\n};\n\n\n/**\n * Returns the position at which to place the DIV depending on the latlng.\n *\n * @param {google.maps.LatLng} latlng The position in latlng.\n * @return {google.maps.Point} The position in pixels.\n */\nClusterIcon.prototype.getPosFromLatLng_ = function (latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n pos.x -= this.anchorIcon_[1];\n pos.y -= this.anchorIcon_[0];\n pos.x = parseInt(pos.x, 10);\n pos.y = parseInt(pos.y, 10);\n return pos;\n};\n\n\n/**\n * Creates a single cluster that manages a group of proximate markers.\n * Used internally, do not call this constructor directly.\n * @constructor\n * @param {MarkerClusterer} mc The <code>MarkerClusterer</code> object with which this\n * cluster is associated.\n */\nfunction Cluster(mc) {\n this.markerClusterer_ = mc;\n this.map_ = mc.getMap();\n this.gridSize_ = mc.getGridSize();\n this.minClusterSize_ = mc.getMinimumClusterSize();\n this.averageCenter_ = mc.getAverageCenter();\n this.markers_ = [];\n this.center_ = null;\n this.bounds_ = null;\n this.clusterIcon_ = new ClusterIcon(this, mc.getStyles());\n}\n\n\n/**\n * Returns the number of markers managed by the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {number} The number of markers in the cluster.\n */\nCluster.prototype.getSize = function () {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the array of markers managed by the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {Array} The array of markers in the cluster.\n */\nCluster.prototype.getMarkers = function () {\n return this.markers_;\n};\n\n\n/**\n * Returns the center of the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {google.maps.LatLng} The center of the cluster.\n */\nCluster.prototype.getCenter = function () {\n return this.center_;\n};\n\n\n/**\n * Returns the map with which the cluster is associated.\n *\n * @return {google.maps.Map} The map.\n * @ignore\n */\nCluster.prototype.getMap = function () {\n return this.map_;\n};\n\n\n/**\n * Returns the <code>MarkerClusterer</code> object with which the cluster is associated.\n *\n * @return {MarkerClusterer} The associated marker clusterer.\n * @ignore\n */\nCluster.prototype.getMarkerClusterer = function () {\n return this.markerClusterer_;\n};\n\n\n/**\n * Returns the bounds of the cluster.\n *\n * @return {google.maps.LatLngBounds} the cluster bounds.\n * @ignore\n */\nCluster.prototype.getBounds = function () {\n var i;\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n var markers = this.getMarkers();\n for (i = 0; i < markers.length; i++) {\n bounds.extend(markers[i].getPosition());\n }\n return bounds;\n};\n\n\n/**\n * Removes the cluster from the map.\n *\n * @ignore\n */\nCluster.prototype.remove = function () {\n this.clusterIcon_.setMap(null);\n this.markers_ = [];\n delete this.markers_;\n};\n\n\n/**\n * Adds a marker to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to be added.\n * @return {boolean} True if the marker was added.\n * @ignore\n */\nCluster.prototype.addMarker = function (marker) {\n var i;\n var mCount;\n var mz;\n\n if (this.isMarkerAlreadyAdded_(marker)) {\n return false;\n }\n\n if (!this.center_) {\n this.center_ = marker.getPosition();\n this.calculateBounds_();\n } else {\n if (this.averageCenter_) {\n var l = this.markers_.length + 1;\n var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\n var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\n this.center_ = new google.maps.LatLng(lat, lng);\n this.calculateBounds_();\n }\n }\n\n marker.isAdded = true;\n this.markers_.push(marker);\n\n mCount = this.markers_.length;\n mz = this.markerClusterer_.getMaxZoom();\n if (mz !== null && this.map_.getZoom() > mz) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount < this.minClusterSize_) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount === this.minClusterSize_) {\n // Hide the markers that were showing.\n for (i = 0; i < mCount; i++) {\n this.markers_[i].setMap(null);\n }\n } else {\n marker.setMap(null);\n }\n\n this.updateIcon_();\n return true;\n};\n\n\n/**\n * Determines if a marker lies within the cluster's bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker lies in the bounds.\n * @ignore\n */\nCluster.prototype.isMarkerInClusterBounds = function (marker) {\n return this.bounds_.contains(marker.getPosition());\n};\n\n\n/**\n * Calculates the extended bounds of the cluster with the grid.\n */\nCluster.prototype.calculateBounds_ = function () {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\n};\n\n\n/**\n * Updates the cluster icon.\n */\nCluster.prototype.updateIcon_ = function () {\n var mCount = this.markers_.length;\n var mz = this.markerClusterer_.getMaxZoom();\n\n if (mz !== null && this.map_.getZoom() > mz) {\n this.clusterIcon_.hide();\n return;\n }\n\n if (mCount < this.minClusterSize_) {\n // Min cluster size not yet reached.\n this.clusterIcon_.hide();\n return;\n }\n\n var numStyles = this.markerClusterer_.getStyles().length;\n var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\n this.clusterIcon_.setCenter(this.center_);\n this.clusterIcon_.useStyle(sums);\n this.clusterIcon_.show();\n};\n\n\n/**\n * Determines if a marker has already been added to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker has already been added.\n */\nCluster.prototype.isMarkerAlreadyAdded_ = function (marker) {\n var i;\n if (this.markers_.indexOf) {\n return this.markers_.indexOf(marker) !== -1;\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n return true;\n }\n }\n }\n return false;\n};\n\n\n/**\n * @name MarkerClustererOptions\n * @class This class represents the optional parameter passed to\n * the {@link MarkerClusterer} constructor.\n * @property {number} [gridSize=60] The grid size of a cluster in pixels. The grid is a square.\n * @property {number} [maxZoom=null] The maximum zoom level at which clustering is enabled or\n * <code>null</code> if clustering is to be enabled at all zoom levels.\n * @property {boolean} [zoomOnClick=true] Whether to zoom the map when a cluster marker is\n * clicked. You may want to set this to <code>false</code> if you have installed a handler\n * for the <code>click</code> event and it deals with zooming on its own.\n * @property {boolean} [averageCenter=false] Whether the position of a cluster marker should be\n * the average position of all markers in the cluster. If set to <code>false</code>, the\n * cluster marker is positioned at the location of the first marker added to the cluster.\n * @property {number} [minimumClusterSize=2] The minimum number of markers needed in a cluster\n * before the markers are hidden and a cluster marker appears.\n * @property {boolean} [ignoreHidden=false] Whether to ignore hidden markers in clusters. You\n * may want to set this to <code>true</code> to ensure that hidden markers are not included\n * in the marker count that appears on a cluster marker (this count is the value of the\n * <code>text</code> property of the result returned by the default <code>calculator</code>).\n * If set to <code>true</code> and you change the visibility of a marker being clustered, be\n * sure to also call <code>MarkerClusterer.repaint()</code>.\n * @property {string} [title=\"\"] The tooltip to display when the mouse moves over a cluster\n * marker. (Alternatively, you can use a custom <code>calculator</code> function to specify a\n * different tooltip for each cluster marker.)\n * @property {function} [calculator=MarkerClusterer.CALCULATOR] The function used to determine\n * the text to be displayed on a cluster marker and the index indicating which style to use\n * for the cluster marker. The input parameters for the function are (1) the array of markers\n * represented by a cluster marker and (2) the number of cluster icon styles. It returns a\n * {@link ClusterIconInfo} object. The default <code>calculator</code> returns a\n * <code>text</code> property which is the number of markers in the cluster and an\n * <code>index</code> property which is one higher than the lowest integer such that\n * <code>10^i</code> exceeds the number of markers in the cluster, or the size of the styles\n * array, whichever is less. The <code>styles</code> array element used has an index of\n * <code>index</code> minus 1. For example, the default <code>calculator</code> returns a\n * <code>text</code> value of <code>\"125\"</code> and an <code>index</code> of <code>3</code>\n * for a cluster icon representing 125 markers so the element used in the <code>styles</code>\n * array is <code>2</code>. A <code>calculator</code> may also return a <code>title</code>\n * property that contains the text of the tooltip to be used for the cluster marker. If\n * <code>title</code> is not defined, the tooltip is set to the value of the <code>title</code>\n * property for the MarkerClusterer.\n * @property {string} [clusterClass=\"cluster\"] The name of the CSS class defining general styles\n * for the cluster markers. Use this class to define CSS styles that are not set up by the code\n * that processes the <code>styles</code> array.\n * @property {Array} [styles] An array of {@link ClusterIconStyle} elements defining the styles\n * of the cluster markers to be used. The element to be used to style a given cluster marker\n * is determined by the function defined by the <code>calculator</code> property.\n * The default is an array of {@link ClusterIconStyle} elements whose properties are derived\n * from the values for <code>imagePath</code>, <code>imageExtension</code>, and\n * <code>imageSizes</code>.\n * @property {boolean} [enableRetinaIcons=false] Whether to allow the use of cluster icons that\n * have sizes that are some multiple (typically double) of their actual display size. Icons such\n * as these look better when viewed on high-resolution monitors such as Apple's Retina displays.\n * Note: if this property is <code>true</code>, sprites cannot be used as cluster icons.\n * @property {number} [batchSize=MarkerClusterer.BATCH_SIZE] Set this property to the\n * number of markers to be processed in a single batch when using a browser other than\n * Internet Explorer (for Internet Explorer, use the batchSizeIE property instead).\n * @property {number} [batchSizeIE=MarkerClusterer.BATCH_SIZE_IE] When Internet Explorer is\n * being used, markers are processed in several batches with a small delay inserted between\n * each batch in an attempt to avoid Javascript timeout errors. Set this property to the\n * number of markers to be processed in a single batch; select as high a number as you can\n * without causing a timeout error in the browser. This number might need to be as low as 100\n * if 15,000 markers are being managed, for example.\n * @property {string} [imagePath=MarkerClusterer.IMAGE_PATH]\n * The full URL of the root name of the group of image files to use for cluster icons.\n * The complete file name is of the form <code>imagePath</code>n.<code>imageExtension</code>\n * where n is the image file number (1, 2, etc.).\n * @property {string} [imageExtension=MarkerClusterer.IMAGE_EXTENSION]\n * The extension name for the cluster icon image files (e.g., <code>\"png\"</code> or\n * <code>\"jpg\"</code>).\n * @property {Array} [imageSizes=MarkerClusterer.IMAGE_SIZES]\n * An array of numbers containing the widths of the group of\n * <code>imagePath</code>n.<code>imageExtension</code> image files.\n * (The images are assumed to be square.)\n */\n/**\n * Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}.\n * @constructor\n * @extends google.maps.OverlayView\n * @param {google.maps.Map} map The Google map to attach to.\n * @param {Array.<google.maps.Marker>} [opt_markers] The markers to be added to the cluster.\n * @param {MarkerClustererOptions} [opt_options] The optional parameters.\n */\nfunction MarkerClusterer(map, opt_markers, opt_options) {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n this.extend(MarkerClusterer, google.maps.OverlayView);\n\n opt_markers = opt_markers || [];\n opt_options = opt_options || {};\n\n this.markers_ = [];\n this.clusters_ = [];\n this.listeners_ = [];\n this.activeMap_ = null;\n this.ready_ = false;\n\n this.gridSize_ = opt_options.gridSize || 60;\n this.minClusterSize_ = opt_options.minimumClusterSize || 2;\n this.maxZoom_ = opt_options.maxZoom || null;\n this.styles_ = opt_options.styles || [];\n this.title_ = opt_options.title || \"\";\n this.zoomOnClick_ = true;\n if (opt_options.zoomOnClick !== undefined) {\n this.zoomOnClick_ = opt_options.zoomOnClick;\n }\n this.averageCenter_ = false;\n if (opt_options.averageCenter !== undefined) {\n this.averageCenter_ = opt_options.averageCenter;\n }\n this.ignoreHidden_ = false;\n if (opt_options.ignoreHidden !== undefined) {\n this.ignoreHidden_ = opt_options.ignoreHidden;\n }\n this.enableRetinaIcons_ = false;\n if (opt_options.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons_ = opt_options.enableRetinaIcons;\n }\n this.imagePath_ = opt_options.imagePath || MarkerClusterer.IMAGE_PATH;\n this.imageExtension_ = opt_options.imageExtension || MarkerClusterer.IMAGE_EXTENSION;\n this.imageSizes_ = opt_options.imageSizes || MarkerClusterer.IMAGE_SIZES;\n this.calculator_ = opt_options.calculator || MarkerClusterer.CALCULATOR;\n this.batchSize_ = opt_options.batchSize || MarkerClusterer.BATCH_SIZE;\n this.batchSizeIE_ = opt_options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE;\n this.clusterClass_ = opt_options.clusterClass || \"cluster\";\n\n if (navigator.userAgent.toLowerCase().indexOf(\"msie\") !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize_ = this.batchSizeIE_;\n }\n\n this.setupStyles_();\n\n this.addMarkers(opt_markers, true);\n this.setMap(map); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Implementation of the onAdd interface method.\n * @ignore\n */\nMarkerClusterer.prototype.onAdd = function () {\n var cMarkerClusterer = this;\n\n this.activeMap_ = this.getMap();\n this.ready_ = true;\n\n this.repaint();\n\n this.prevZoom_ = this.getMap().getZoom();\n\n // Add the map event listeners\n this.listeners_ = [\n google.maps.event.addListener(this.getMap(), \"zoom_changed\", function () {\n // Fix for bug #407\n // Determines map type and prevents illegal zoom levels\n var zoom = this.getMap().getZoom();\n var minZoom = this.getMap().minZoom || 0;\n var maxZoom = Math.min(this.getMap().maxZoom || 100,\n this.getMap().mapTypes[this.getMap().getMapTypeId()].maxZoom);\n zoom = Math.min(Math.max(zoom, minZoom), maxZoom);\n\n if (this.prevZoom_ != zoom) {\n this.prevZoom_ = zoom;\n this.resetViewport_(false);\n }\n }.bind(this)),\n google.maps.event.addListener(this.getMap(), \"idle\", function () {\n cMarkerClusterer.redraw_();\n })\n ];\n};\n\n\n/**\n * Implementation of the onRemove interface method.\n * Removes map event listeners and all cluster icons from the DOM.\n * All managed markers are also put back on the map.\n * @ignore\n */\nMarkerClusterer.prototype.onRemove = function () {\n var i;\n\n // Put all the managed markers back on the map:\n for (i = 0; i < this.markers_.length; i++) {\n if (this.markers_[i].getMap() !== this.activeMap_) {\n this.markers_[i].setMap(this.activeMap_);\n }\n }\n\n // Remove all clusters:\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Remove map event listeners:\n for (i = 0; i < this.listeners_.length; i++) {\n google.maps.event.removeListener(this.listeners_[i]);\n }\n this.listeners_ = [];\n\n this.activeMap_ = null;\n this.ready_ = false;\n};\n\n\n/**\n * Implementation of the draw interface method.\n * @ignore\n */\nMarkerClusterer.prototype.draw = function () {};\n\n\n/**\n * Sets up the styles object.\n */\nMarkerClusterer.prototype.setupStyles_ = function () {\n var i, size;\n if (this.styles_.length > 0) {\n return;\n }\n\n for (i = 0; i < this.imageSizes_.length; i++) {\n size = this.imageSizes_[i];\n this.styles_.push({\n url: this.imagePath_ + (i + 1) + \".\" + this.imageExtension_,\n height: size,\n width: size\n });\n }\n};\n\n\n/**\n * Fits the map to the bounds of the markers managed by the clusterer.\n */\nMarkerClusterer.prototype.fitMapToMarkers = function () {\n var i;\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (i = 0; i < markers.length; i++) {\n // March 3, 2018: Bug fix -- honor the ignoreHidden property\n if (markers[i].getVisible() || !this.getIgnoreHidden()) {\n bounds.extend(markers[i].getPosition());\n }\n }\n\n this.getMap().fitBounds(bounds);\n};\n\n\n/**\n * Returns the value of the <code>gridSize</code> property.\n *\n * @return {number} The grid size.\n */\nMarkerClusterer.prototype.getGridSize = function () {\n return this.gridSize_;\n};\n\n\n/**\n * Sets the value of the <code>gridSize</code> property.\n *\n * @param {number} gridSize The grid size.\n */\nMarkerClusterer.prototype.setGridSize = function (gridSize) {\n this.gridSize_ = gridSize;\n};\n\n\n/**\n * Returns the value of the <code>minimumClusterSize</code> property.\n *\n * @return {number} The minimum cluster size.\n */\nMarkerClusterer.prototype.getMinimumClusterSize = function () {\n return this.minClusterSize_;\n};\n\n/**\n * Sets the value of the <code>minimumClusterSize</code> property.\n *\n * @param {number} minimumClusterSize The minimum cluster size.\n */\nMarkerClusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) {\n this.minClusterSize_ = minimumClusterSize;\n};\n\n\n/**\n * Returns the value of the <code>maxZoom</code> property.\n *\n * @return {number} The maximum zoom level.\n */\nMarkerClusterer.prototype.getMaxZoom = function () {\n return this.maxZoom_;\n};\n\n\n/**\n * Sets the value of the <code>maxZoom</code> property.\n *\n * @param {number} maxZoom The maximum zoom level.\n */\nMarkerClusterer.prototype.setMaxZoom = function (maxZoom) {\n this.maxZoom_ = maxZoom;\n};\n\n\n/**\n * Returns the value of the <code>styles</code> property.\n *\n * @return {Array} The array of styles defining the cluster markers to be used.\n */\nMarkerClusterer.prototype.getStyles = function () {\n return this.styles_;\n};\n\n\n/**\n * Sets the value of the <code>styles</code> property.\n *\n * @param {Array.<ClusterIconStyle>} styles The array of styles to use.\n */\nMarkerClusterer.prototype.setStyles = function (styles) {\n this.styles_ = styles;\n};\n\n\n/**\n * Returns the value of the <code>title</code> property.\n *\n * @return {string} The content of the title text.\n */\nMarkerClusterer.prototype.getTitle = function () {\n return this.title_;\n};\n\n\n/**\n * Sets the value of the <code>title</code> property.\n *\n * @param {string} title The value of the title property.\n */\nMarkerClusterer.prototype.setTitle = function (title) {\n this.title_ = title;\n};\n\n\n/**\n * Returns the value of the <code>zoomOnClick</code> property.\n *\n * @return {boolean} True if zoomOnClick property is set.\n */\nMarkerClusterer.prototype.getZoomOnClick = function () {\n return this.zoomOnClick_;\n};\n\n\n/**\n * Sets the value of the <code>zoomOnClick</code> property.\n *\n * @param {boolean} zoomOnClick The value of the zoomOnClick property.\n */\nMarkerClusterer.prototype.setZoomOnClick = function (zoomOnClick) {\n this.zoomOnClick_ = zoomOnClick;\n};\n\n\n/**\n * Returns the value of the <code>averageCenter</code> property.\n *\n * @return {boolean} True if averageCenter property is set.\n */\nMarkerClusterer.prototype.getAverageCenter = function () {\n return this.averageCenter_;\n};\n\n\n/**\n * Sets the value of the <code>averageCenter</code> property.\n *\n * @param {boolean} averageCenter The value of the averageCenter property.\n */\nMarkerClusterer.prototype.setAverageCenter = function (averageCenter) {\n this.averageCenter_ = averageCenter;\n};\n\n\n/**\n * Returns the value of the <code>ignoreHidden</code> property.\n *\n * @return {boolean} True if ignoreHidden property is set.\n */\nMarkerClusterer.prototype.getIgnoreHidden = function () {\n return this.ignoreHidden_;\n};\n\n\n/**\n * Sets the value of the <code>ignoreHidden</code> property.\n *\n * @param {boolean} ignoreHidden The value of the ignoreHidden property.\n */\nMarkerClusterer.prototype.setIgnoreHidden = function (ignoreHidden) {\n this.ignoreHidden_ = ignoreHidden;\n};\n\n\n/**\n * Returns the value of the <code>enableRetinaIcons</code> property.\n *\n * @return {boolean} True if enableRetinaIcons property is set.\n */\nMarkerClusterer.prototype.getEnableRetinaIcons = function () {\n return this.enableRetinaIcons_;\n};\n\n\n/**\n * Sets the value of the <code>enableRetinaIcons</code> property.\n *\n * @param {boolean} enableRetinaIcons The value of the enableRetinaIcons property.\n */\nMarkerClusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) {\n this.enableRetinaIcons_ = enableRetinaIcons;\n};\n\n\n/**\n * Returns the value of the <code>imageExtension</code> property.\n *\n * @return {string} The value of the imageExtension property.\n */\nMarkerClusterer.prototype.getImageExtension = function () {\n return this.imageExtension_;\n};\n\n\n/**\n * Sets the value of the <code>imageExtension</code> property.\n *\n * @param {string} imageExtension The value of the imageExtension property.\n */\nMarkerClusterer.prototype.setImageExtension = function (imageExtension) {\n this.imageExtension_ = imageExtension;\n};\n\n\n/**\n * Returns the value of the <code>imagePath</code> property.\n *\n * @return {string} The value of the imagePath property.\n */\nMarkerClusterer.prototype.getImagePath = function () {\n return this.imagePath_;\n};\n\n\n/**\n * Sets the value of the <code>imagePath</code> property.\n *\n * @param {string} imagePath The value of the imagePath property.\n */\nMarkerClusterer.prototype.setImagePath = function (imagePath) {\n this.imagePath_ = imagePath;\n};\n\n\n/**\n * Returns the value of the <code>imageSizes</code> property.\n *\n * @return {Array} The value of the imageSizes property.\n */\nMarkerClusterer.prototype.getImageSizes = function () {\n return this.imageSizes_;\n};\n\n\n/**\n * Sets the value of the <code>imageSizes</code> property.\n *\n * @param {Array} imageSizes The value of the imageSizes property.\n */\nMarkerClusterer.prototype.setImageSizes = function (imageSizes) {\n this.imageSizes_ = imageSizes;\n};\n\n\n/**\n * Returns the value of the <code>calculator</code> property.\n *\n * @return {function} the value of the calculator property.\n */\nMarkerClusterer.prototype.getCalculator = function () {\n return this.calculator_;\n};\n\n\n/**\n * Sets the value of the <code>calculator</code> property.\n *\n * @param {function(Array.<google.maps.Marker>, number)} calculator The value\n * of the calculator property.\n */\nMarkerClusterer.prototype.setCalculator = function (calculator) {\n this.calculator_ = calculator;\n};\n\n\n/**\n * Returns the value of the <code>batchSizeIE</code> property.\n *\n * @return {number} the value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.getBatchSizeIE = function () {\n return this.batchSizeIE_;\n};\n\n\n/**\n * Sets the value of the <code>batchSizeIE</code> property.\n *\n * @param {number} batchSizeIE The value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.setBatchSizeIE = function (batchSizeIE) {\n this.batchSizeIE_ = batchSizeIE;\n};\n\n\n/**\n * Returns the value of the <code>clusterClass</code> property.\n *\n * @return {string} the value of the clusterClass property.\n */\nMarkerClusterer.prototype.getClusterClass = function () {\n return this.clusterClass_;\n};\n\n\n/**\n * Sets the value of the <code>clusterClass</code> property.\n *\n * @param {string} clusterClass The value of the clusterClass property.\n */\nMarkerClusterer.prototype.setClusterClass = function (clusterClass) {\n this.clusterClass_ = clusterClass;\n};\n\n\n/**\n * Returns the array of markers managed by the clusterer.\n *\n * @return {Array} The array of markers managed by the clusterer.\n */\nMarkerClusterer.prototype.getMarkers = function () {\n return this.markers_;\n};\n\n\n/**\n * Returns the number of markers managed by the clusterer.\n *\n * @return {number} The number of markers.\n */\nMarkerClusterer.prototype.getTotalMarkers = function () {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the current array of clusters formed by the clusterer.\n *\n * @return {Array} The array of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getClusters = function () {\n return this.clusters_;\n};\n\n\n/**\n * Returns the number of clusters formed by the clusterer.\n *\n * @return {number} The number of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getTotalClusters = function () {\n return this.clusters_.length;\n};\n\n\n/**\n * Adds a marker to the clusterer. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarker = function (marker, opt_nodraw) {\n this.pushMarkerTo_(marker);\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Adds an array of markers to the clusterer. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>.\n *\n * @param {Array.<google.maps.Marker>} markers The markers to add.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarkers = function (markers, opt_nodraw) {\n var key;\n for (key in markers) {\n if (markers.hasOwnProperty(key)) {\n this.pushMarkerTo_(markers[key]);\n }\n }\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Pushes a marker to the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.pushMarkerTo_ = function (marker) {\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n var cMarkerClusterer = this;\n google.maps.event.addListener(marker, \"dragend\", function () {\n if (cMarkerClusterer.ready_) {\n this.isAdded = false;\n cMarkerClusterer.repaint();\n }\n });\n }\n marker.isAdded = false;\n this.markers_.push(marker);\n};\n\n\n/**\n * Removes a marker from the cluster. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if the\n * marker was removed from the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to remove.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n * @return {boolean} True if the marker was removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarker = function (marker, opt_nodraw) {\n var removed = this.removeMarker_(marker);\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes an array of markers from the cluster. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if markers\n * were removed from the clusterer.\n *\n * @param {Array.<google.maps.Marker>} markers The markers to remove.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n * @return {boolean} True if markers were removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarkers = function (markers, opt_nodraw) {\n var i, r;\n var removed = false;\n\n for (i = 0; i < markers.length; i++) {\n r = this.removeMarker_(markers[i]);\n removed = removed || r;\n }\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes a marker and returns true if removed, false if not.\n *\n * @param {google.maps.Marker} marker The marker to remove\n * @return {boolean} Whether the marker was removed or not\n */\nMarkerClusterer.prototype.removeMarker_ = function (marker) {\n var i;\n var index = -1;\n if (this.markers_.indexOf) {\n index = this.markers_.indexOf(marker);\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n index = i;\n break;\n }\n }\n }\n\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n\n marker.setMap(null);\n this.markers_.splice(index, 1); // Remove the marker from the list of managed markers\n return true;\n};\n\n\n/**\n * Removes all clusters and markers from the map and also removes all markers\n * managed by the clusterer.\n */\nMarkerClusterer.prototype.clearMarkers = function () {\n this.resetViewport_(true);\n this.markers_ = [];\n};\n\n\n/**\n * Recalculates and redraws all the marker clusters from scratch.\n * Call this after changing any properties.\n */\nMarkerClusterer.prototype.repaint = function () {\n var oldClusters = this.clusters_.slice();\n this.clusters_ = [];\n this.resetViewport_(false);\n this.redraw_();\n\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function () {\n var i;\n for (i = 0; i < oldClusters.length; i++) {\n oldClusters[i].remove();\n }\n }, 0);\n};\n\n\n/**\n * Returns the current bounds extended by the grid size.\n *\n * @param {google.maps.LatLngBounds} bounds The bounds to extend.\n * @return {google.maps.LatLngBounds} The extended bounds.\n * @ignore\n */\nMarkerClusterer.prototype.getExtendedBounds = function (bounds) {\n var projection = this.getProjection();\n\n // Turn the bounds into latlng.\n var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),\n bounds.getNorthEast().lng());\n var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),\n bounds.getSouthWest().lng());\n\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(tr);\n trPix.x += this.gridSize_;\n trPix.y -= this.gridSize_;\n\n var blPix = projection.fromLatLngToDivPixel(bl);\n blPix.x -= this.gridSize_;\n blPix.y += this.gridSize_;\n\n // Convert the pixel points back to LatLng\n var ne = projection.fromDivPixelToLatLng(trPix);\n var sw = projection.fromDivPixelToLatLng(blPix);\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(ne);\n bounds.extend(sw);\n\n return bounds;\n};\n\n\n/**\n * Redraws all the clusters.\n */\nMarkerClusterer.prototype.redraw_ = function () {\n this.createClusters_(0);\n};\n\n\n/**\n * Removes all clusters from the map. The markers are also removed from the map\n * if <code>opt_hide</code> is set to <code>true</code>.\n *\n * @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers\n * from the map.\n */\nMarkerClusterer.prototype.resetViewport_ = function (opt_hide) {\n var i, marker;\n // Remove all the clusters\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Reset the markers to not be added and to be removed from the map.\n for (i = 0; i < this.markers_.length; i++) {\n marker = this.markers_[i];\n marker.isAdded = false;\n if (opt_hide) {\n marker.setMap(null);\n }\n }\n};\n\n\n/**\n * Calculates the distance between two latlng locations in km.\n *\n * @param {google.maps.LatLng} p1 The first lat lng point.\n * @param {google.maps.LatLng} p2 The second lat lng point.\n * @return {number} The distance between the two points in km.\n * @see http://www.movable-type.co.uk/scripts/latlong.html\n*/\nMarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) {\n var R = 6371; // Radius of the Earth in km\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *\n Math.sin(dLon / 2) * Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c;\n return d;\n};\n\n\n/**\n * Determines if a marker is contained in a bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @param {google.maps.LatLngBounds} bounds The bounds to check against.\n * @return {boolean} True if the marker is in the bounds.\n */\nMarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) {\n return bounds.contains(marker.getPosition());\n};\n\n\n/**\n * Adds a marker to a cluster, or creates a new cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.addToClosestCluster_ = function (marker) {\n var i, d, cluster, center;\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n for (i = 0; i < this.clusters_.length; i++) {\n cluster = this.clusters_[i];\n center = cluster.getCenter();\n if (center) {\n d = this.distanceBetweenPoints_(center, marker.getPosition());\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n cluster = new Cluster(this);\n cluster.addMarker(marker);\n this.clusters_.push(cluster);\n }\n};\n\n\n/**\n * Creates the clusters. This is done in batches to avoid timeout errors\n * in some browsers when there is a huge number of markers.\n *\n * @param {number} iFirst The index of the first marker in the batch of\n * markers to be added to clusters.\n */\nMarkerClusterer.prototype.createClusters_ = function (iFirst) {\n var i, marker;\n var mapBounds;\n var cMarkerClusterer = this;\n if (!this.ready_) {\n return;\n }\n\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the <code>MarkerClusterer</code> begins\n * clustering markers.\n * @name MarkerClusterer#clusteringbegin\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringbegin\", this);\n\n if (typeof this.timerRefStatic !== \"undefined\") {\n clearTimeout(this.timerRefStatic);\n delete this.timerRefStatic;\n }\n }\n\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n if (this.getMap().getZoom() > 3) {\n mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),\n this.getMap().getBounds().getNorthEast());\n } else {\n mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n }\n var bounds = this.getExtendedBounds(mapBounds);\n\n var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);\n\n for (i = iFirst; i < iLast; i++) {\n marker = this.markers_[i];\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\n if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {\n this.addToClosestCluster_(marker);\n }\n }\n }\n\n if (iLast < this.markers_.length) {\n this.timerRefStatic = setTimeout(function () {\n cMarkerClusterer.createClusters_(iLast);\n }, 0);\n } else {\n delete this.timerRefStatic;\n\n /**\n * This event is fired when the <code>MarkerClusterer</code> stops\n * clustering markers.\n * @name MarkerClusterer#clusteringend\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringend\", this);\n }\n};\n\n\n/**\n * Extends an object's prototype by another's.\n *\n * @param {Object} obj1 The object to be extended.\n * @param {Object} obj2 The object to extend with.\n * @return {Object} The new extended object.\n * @ignore\n */\nMarkerClusterer.prototype.extend = function (obj1, obj2) {\n return (function (object) {\n var property;\n for (property in object.prototype) {\n this.prototype[property] = object.prototype[property];\n }\n return this;\n }).apply(obj1, [obj2]);\n};\n\n\n/**\n * The default function for determining the label text and style\n * for a cluster icon.\n *\n * @param {Array.<google.maps.Marker>} markers The array of markers represented by the cluster.\n * @param {number} numStyles The number of marker styles available.\n * @return {ClusterIconInfo} The information resource for the cluster.\n * @constant\n * @ignore\n */\nMarkerClusterer.CALCULATOR = function (markers, numStyles) {\n var index = 0;\n var title = \"\";\n var count = markers.length.toString();\n\n var dv = count;\n while (dv !== 0) {\n dv = parseInt(dv / 10, 10);\n index++;\n }\n\n index = Math.min(index, numStyles);\n return {\n text: count,\n index: index,\n title: title\n };\n};\n\n\n/**\n * The number of markers to process in one batch.\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE = 2000;\n\n\n/**\n * The number of markers to process in one batch (IE only).\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE_IE = 500;\n\n\n/**\n * The default root name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_PATH = \"https://cdn.rawgit.com/googlemaps/js-marker-clusterer/gh-pages/images/m\";\n\n\n/**\n * The default extension name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_EXTENSION = \"png\";\n\n\n/**\n * The default array of sizes for the marker cluster images.\n *\n * @type {Array.<number>}\n * @constant\n */\nMarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90];\n\nif (true) {\n module.exports = MarkerClusterer;\n}\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar googleMaps_1 = __webpack_require__(10);\r\nvar leaflet_1 = __webpack_require__(19);\r\nvar map_type_1 = __webpack_require__(2);\r\nvar marker_clusterer_config_1 = __webpack_require__(4);\r\nvar polyline_options_1 = __webpack_require__(5);\r\nvar Map = /** @class */ (function () {\r\n function Map() {\r\n this.markersList = {};\r\n this.polygonsList = {};\r\n this.circlesList = {};\r\n this.polylinesList = {};\r\n this.infoWindowList = {};\r\n this.overlayList = {};\r\n this.markerClusterer = {};\r\n }\r\n /**\r\n * Use this to initialize map\r\n * @param {InlogMaps.MapType} mapType\r\n * @param {any} options\r\n * @param {string} elementId default: 'inlog-map' [nullable]\r\n * @returns {Promisse<any>}\r\n */\r\n Map.prototype.initialize = function (mapType, options, elementId) {\r\n if (elementId === void 0) { elementId = 'inlog-map'; }\r\n this.map = mapType === map_type_1.MapType.Google ? new googleMaps_1.default() : new leaflet_1.default();\r\n return this.map.initialize(mapType, options, elementId);\r\n };\r\n /* GEOJson */\r\n /**\r\n * Use this function to add GEOJSON to the currentMap\r\n * @param {object} data Geojson\r\n * @param {InlogMaps.GeoJsonOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n Map.prototype.loadGEOJson = function (data, options, eventClick) {\r\n this.map.loadGEOJson(data, options, eventClick);\r\n };\r\n /* Markers */\r\n /**\r\n * Use this function to draw markers in the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n Map.prototype.drawMarker = function (type, options, eventClick) {\r\n var marker = this.map.drawMarker(options, eventClick);\r\n if (!this.markersList[type]) {\r\n this.markersList[type] = [];\r\n }\r\n marker.type = 'simple';\r\n this.markersList[type].push(marker);\r\n if (options.addClusterer) {\r\n if (!this.markerClusterer[type]) {\r\n this.addMarkerClusterer(type, new marker_clusterer_config_1.default(true, 1, 10));\r\n }\r\n this.map.addMarkerOnClusterer(marker, this.markerClusterer[type]);\r\n }\r\n };\r\n /**\r\n * Use this function to draw circle markers in the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.CircleMarkerOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n Map.prototype.drawCircleMarker = function (type, options, eventClick) {\r\n var marker = this.map.drawCircleMarker(options, eventClick);\r\n if (!this.markersList[type]) {\r\n this.markersList[type] = [];\r\n }\r\n marker.type = 'circle';\r\n this.markersList[type].push(marker);\r\n };\r\n /**\r\n * Use this function to show/hide markers from a specific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toogle markers with the condition [nullable]\r\n */\r\n Map.prototype.toggleMarkers = function (show, type, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n if (markers && markers.length) {\r\n this.map.toggleMarkers(markers, show, this.markerClusterer[type]);\r\n }\r\n };\r\n /**\r\n * Remove markers from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove markers with the condition [nullable]\r\n */\r\n Map.prototype.removeMarkers = function (type, condition) {\r\n if (this.markersList[type] && condition) {\r\n var markers = this.getMarkers(type, condition);\r\n // Hide markers with the condition\r\n this.map.toggleMarkers(markers, false, this.markerClusterer[type]);\r\n // Keep markers that doesn't have the condition\r\n this.markersList[type] = this.markersList[type].filter(function (marker) { return !condition(marker.object); });\r\n }\r\n else {\r\n if (this.markersList[type]) {\r\n this.map.toggleMarkers(this.markersList[type], false, this.markerClusterer[type]);\r\n }\r\n this.markersList[type] = [];\r\n }\r\n if (this.markersList[type].length === 0) {\r\n delete this.markersList[type];\r\n }\r\n };\r\n /**\r\n * Remove all markers from the map and from the internal list\r\n */\r\n Map.prototype.removeAllMarkers = function () {\r\n for (var type in this.markersList) {\r\n if (this.markersList.hasOwnProperty(type)) {\r\n this.removeMarkers(type);\r\n }\r\n }\r\n };\r\n /**\r\n * Use this function to alter marker style\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerAlterOptions} options\r\n * @param {any} condition alter markers with the condition [nullable]\r\n */\r\n Map.prototype.alterMarkerOptions = function (type, options, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n if (markers && markers.length) {\r\n this.map.alterMarkerOptions(markers, options);\r\n }\r\n };\r\n /**\r\n * Use this functions to alterar marker position\r\n * @param {string } type\r\n * @param {number[]} position\r\n * @param {boolean} addTransition [nullable]\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.alterMarkerPosition = function (type, position, addTransition, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n if (markers && markers.length) {\r\n this.map.alterMarkerPosition(markers, position, addTransition);\r\n }\r\n };\r\n /**\r\n * Use this function to fit bounds in the markers with the especified type\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @param {boolean} onlyMarkersOnMap default true\r\n */\r\n Map.prototype.fitBoundsMarkers = function (type, condition, onlyMarkersOnMap) {\r\n var _this = this;\r\n if (onlyMarkersOnMap === void 0) { onlyMarkersOnMap = true; }\r\n var markers = this.getMarkers(type, condition);\r\n if (onlyMarkersOnMap) {\r\n markers = markers.filter(function (x) { return _this.map.isMarkerOnMap(x); });\r\n }\r\n if (markers && markers.length) {\r\n this.map.fitBoundsPositions(markers);\r\n }\r\n };\r\n /**\r\n * Use this functions to set the center of the map on marker\r\n * @param {string} type\r\n * @param {any} condition center on marker with the condition [nullable]\r\n */\r\n Map.prototype.setCenterMarker = function (type, condition) {\r\n if (this.markersList[type] && condition) {\r\n var marker = this.markersList[type].find(function (marker) { return condition(marker.object); });\r\n // Center on the marker with the condition\r\n this.map.setCenterMarker(marker);\r\n }\r\n else {\r\n if (this.markersList[type] && this.markersList[type].length) {\r\n this.map.setCenterMarker(this.markersList[type][0]);\r\n }\r\n }\r\n };\r\n /**\r\n * This functions returns if marker exists\r\n * @param type\r\n * @param condition [nullable]\r\n * @returns {boolean}\r\n */\r\n Map.prototype.markerExists = function (type, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n return markers && markers.length > 0;\r\n };\r\n /**\r\n * Use this function to count markers by type\r\n * @param {string} type\r\n * @param {boolean} onlyOnMap exclude hidden markers, default true\r\n * @param {any} condition\r\n * @returns {number}\r\n */\r\n Map.prototype.countMarkers = function (type, onlyOnMap, condition) {\r\n var _this = this;\r\n if (onlyOnMap === void 0) { onlyOnMap = true; }\r\n if (this.markerClusterer[type]) {\r\n return this.map.countMarkersOnCluster(this.markerClusterer[type]);\r\n }\r\n var markers = this.getMarkers(type, condition);\r\n if (onlyOnMap) {\r\n markers = markers.filter(function (x) { return _this.map.isMarkerOnMap(x); });\r\n }\r\n return markers.length;\r\n };\r\n /**\r\n * This function add new events on marker\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.addMarkerEvent = function (type, event, eventFunction, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n this.map.addMarkerEvent(markers, event, eventFunction);\r\n };\r\n /**\r\n * This function remove events of marker\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.removeMarkerEvent = function (type, event, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n this.map.removeMarkerEvent(markers, event);\r\n };\r\n /* Marker Clusterer */\r\n /**\r\n * Use this function to add MarkerClusterer on the map\r\n * @param {string} type same type of markers\r\n * @param {InlogMaps.MarkerClusterConfig} config\r\n */\r\n Map.prototype.addMarkerClusterer = function (type, config) {\r\n this.markerClusterer[type] = this.map.addMarkerClusterer(config);\r\n };\r\n /**\r\n * Use this function to alter clusterer options\r\n * @param type same type of markers\r\n * @param {InlogMaps.MarkerClusterConfig} config\r\n */\r\n Map.prototype.alterMarkerClustererConfig = function (type, config) {\r\n if (this.markerClusterer[type]) {\r\n this.map.alterMarkerClustererConfig(this.markerClusterer[type], config);\r\n }\r\n };\r\n /**\r\n * Use this function to redraw marker clusterer\r\n * @param type same type of markers\r\n */\r\n Map.prototype.refreshClusterer = function (type) {\r\n if (this.markerClusterer[type]) {\r\n this.map.refreshClusterer(this.markerClusterer[type]);\r\n }\r\n };\r\n /**\r\n * Use this to clear markers on clusterer\r\n * @param type same type of markers\r\n */\r\n Map.prototype.clearMarkersClusterer = function (type) {\r\n if (this.markerClusterer[type]) {\r\n this.map.clearMarkersClusterer(this.markerClusterer[type]);\r\n }\r\n };\r\n /* Polygons */\r\n /**\r\n * Use this function to draw polygons\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n Map.prototype.drawPolygon = function (type, options, eventClick) {\r\n var polygon = this.map.drawPolygon(options, eventClick);\r\n if (!this.polygonsList[type]) {\r\n this.polygonsList[type] = [];\r\n }\r\n this.polygonsList[type].push(polygon);\r\n };\r\n /**\r\n * Use this function to show/hide polygon from a especific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle polygon with the condition [nullable]\r\n */\r\n Map.prototype.togglePolygons = function (show, type, condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n if (polygons && polygons.length) {\r\n this.map.togglePolygons(polygons, show);\r\n }\r\n };\r\n /**\r\n * Remove polygons from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove polygons with the condition [nullable]\r\n */\r\n Map.prototype.removePolygons = function (type, condition) {\r\n if (this.polygonsList[type] && condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n // Hide markers with the condition\r\n this.map.togglePolygons(polygons, false);\r\n // Keep markers that doesn't have the condition\r\n this.polygonsList[type] = this.polygonsList[type].filter(function (polygon) { return !condition(polygon.object); });\r\n }\r\n else {\r\n if (this.polygonsList[type]) {\r\n this.map.togglePolygons(this.polygonsList[type], false);\r\n }\r\n this.polygonsList[type] = [];\r\n }\r\n if (this.polygonsList[type].length === 0) {\r\n delete this.polygonsList[type];\r\n }\r\n };\r\n /**\r\n * Remove all polygons from the map and from the internal list\r\n */\r\n Map.prototype.removeAllPolygons = function () {\r\n for (var type in this.polygonsList) {\r\n if (this.polygonsList.hasOwnProperty(type)) {\r\n this.removePolygons(type);\r\n }\r\n }\r\n };\r\n /**\r\n * Use this function to alter polygons options/style\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonAlterOptions} options\r\n * @param {any} condition alter polygon with the condition [nullable]\r\n */\r\n Map.prototype.alterPolygonOptions = function (type, options, condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n if (polygons && polygons.length) {\r\n this.map.alterPolygonOptions(polygons, options);\r\n }\r\n };\r\n /**\r\n * Use this function to fit bounds of a polygon\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n Map.prototype.fitBoundsPolygons = function (type, condition) {\r\n var _this = this;\r\n var polygons = this.getPolygons(type, condition)\r\n .filter(function (polygon) { return _this.map.isPolygonOnMap(polygon); });\r\n if (polygons && polygons.length) {\r\n this.map.fitBoundsPolygons(polygons);\r\n }\r\n };\r\n /**\r\n * Set center on polygon bounds\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n Map.prototype.setCenterPolygons = function (type, condition) {\r\n var _this = this;\r\n var polygons = this.getPolygons(type, condition)\r\n .filter(function (polygon) { return _this.map.isPolygonOnMap(polygon); });\r\n if (polygons && polygons.length) {\r\n this.map.setCenterPolygons(polygons);\r\n }\r\n };\r\n /**\r\n * This functions returns if polygon exists\r\n * @param type\r\n * @param condition [nullable]\r\n * @returns {boolean}\r\n */\r\n Map.prototype.polygonExists = function (type, condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n return polygons && polygons.length > 0;\r\n };\r\n /**\r\n * Use this function to get the path of some polygon\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {number[]}\r\n */\r\n Map.prototype.getPolygonPath = function (type, condition) {\r\n var polygon = this.getPolygons(type, condition);\r\n if (polygon && polygon.length) {\r\n return this.map.getPolygonPath(polygon[0]);\r\n }\r\n };\r\n /**\r\n * This function add new events on polygon\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.addPolygonEvent = function (type, event, eventFunction, condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n this.map.addPolygonEvent(polygons, event, eventFunction);\r\n };\r\n /**\r\n * This function remove events of polygon\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.removePolygonEvent = function (type, event, condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n this.map.removePolygonEvent(polygons, event);\r\n };\r\n /* Circles */\r\n /**\r\n * Use this function to draw circles on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.CircleOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n Map.prototype.drawCircle = function (type, options, eventClick) {\r\n var circle = this.map.drawCircle(options, eventClick);\r\n if (!this.circlesList[type]) {\r\n this.circlesList[type] = [];\r\n }\r\n this.circlesList[type].push(circle);\r\n };\r\n /**\r\n * Use this function to show/hide circles from a especific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle circles with the condition [nullable]\r\n */\r\n Map.prototype.toggleCircles = function (show, type, condition) {\r\n var circles = this.getCircles(type, condition);\r\n if (circles && circles.length) {\r\n this.map.toggleCircles(circles, show);\r\n }\r\n };\r\n /**\r\n * Remove circles from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove circles with the condition [nullable]\r\n */\r\n Map.prototype.removeCircles = function (type, condition) {\r\n if (this.circlesList[type] && condition) {\r\n var circles = this.getCircles(type, condition);\r\n // Hide circles with the condition\r\n this.map.toggleCircles(circles, false);\r\n // Keep circles that doesn't have the condition\r\n this.circlesList[type] = this.circlesList[type].filter(function (circle) { return !condition(circle.object); });\r\n }\r\n else {\r\n if (this.circlesList[type]) {\r\n this.map.toggleCircles(this.circlesList[type], false);\r\n }\r\n this.circlesList[type] = [];\r\n }\r\n if (this.circlesList[type].length === 0) {\r\n delete this.circlesList[type];\r\n }\r\n };\r\n /**\r\n * Remove all circles from the map and from the internal list\r\n */\r\n Map.prototype.removeAllCircles = function () {\r\n for (var type in this.circlesList) {\r\n if (this.circlesList.hasOwnProperty(type)) {\r\n this.removeCircles(type);\r\n }\r\n }\r\n };\r\n /**\r\n * Use this function to alter circle options\r\n * @param {string} type\r\n * @param {InlogMaps.CircleAlterOptions} options\r\n * @param {any} condition alter circle with the condition [nullable]\r\n */\r\n Map.prototype.alterCircleOptions = function (type, options, condition) {\r\n var circles = this.getCircles(type, condition);\r\n if (circles && circles.length) {\r\n this.map.alterCircleOptions(circles, options);\r\n }\r\n };\r\n /**\r\n * Use this function to fit bounds of a polygon\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n Map.prototype.fitBoundsCircles = function (type, condition) {\r\n var _this = this;\r\n var circles = this.getCircles(type, condition)\r\n .filter(function (circle) { return _this.map.isCircleOnMap(circle); });\r\n if (circles && circles.length) {\r\n this.map.fitBoundsCircles(circles);\r\n }\r\n };\r\n /**\r\n * This functions returns if circle exists\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {boolean}\r\n */\r\n Map.prototype.circleExists = function (type, condition) {\r\n var circles = this.getCircles(type, condition);\r\n return circles && circles.length > 0;\r\n };\r\n /**\r\n * This function return circle center\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {number[]}\r\n */\r\n Map.prototype.getCircleCenter = function (type, condition) {\r\n var circles = this.getCircles(type, condition);\r\n if (circles && circles.length) {\r\n return this.map.getCircleCenter(circles[0]);\r\n }\r\n return null;\r\n };\r\n /**\r\n * This function return circle center\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {number}\r\n */\r\n Map.prototype.getCircleRadius = function (type, condition) {\r\n var circles = this.getCircles(type, condition);\r\n if (circles && circles.length) {\r\n return this.map.getCircleRadius(circles[0]);\r\n }\r\n return null;\r\n };\r\n /**\r\n * This function add new events on circle\r\n * @param {string} type\r\n * @param {InlogMaps.CircleEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.addCircleEvent = function (type, event, eventFunction, condition) {\r\n var circles = this.getCircles(type, condition);\r\n this.map.addCircleEvent(circles, event, eventFunction);\r\n };\r\n /**\r\n * This function remove events of circle\r\n * @param {string} type\r\n * @param {InlogMaps.CircleEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.removeCircleEvent = function (type, event, condition) {\r\n var circles = this.getCircles(type, condition);\r\n this.map.removeCircleEvent(circles, event);\r\n };\r\n /* Polylines */\r\n /**\r\n * Use this function to draw polylines on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n Map.prototype.drawPolyline = function (type, options, eventClick) {\r\n var polyline = this.map.drawPolyline(options, eventClick);\r\n if (!this.polylinesList[type]) {\r\n this.polylinesList[type] = [];\r\n }\r\n this.polylinesList[type].push(polyline);\r\n };\r\n /**\r\n * Use this function to draw polylines with navigation on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n */\r\n Map.prototype.drawPolylineWithNavigation = function (type, options, eventClick) {\r\n var polyline = this.map.drawPolylineWithNavigation(options, eventClick);\r\n if (!this.polylinesList[type]) {\r\n this.polylinesList[type] = [];\r\n }\r\n this.polylinesList[type].push(polyline);\r\n };\r\n /**\r\n * Use this function to toggle polylines\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle polyline with the condition [nullable]\r\n */\r\n Map.prototype.togglePolylines = function (show, type, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n if (polyline && polyline.length) {\r\n this.map.togglePolylines(polyline, show);\r\n }\r\n };\r\n /**\r\n * Use this function to remove polylines\r\n * @param {string} type\r\n * @param {any} condition remove polyline with the condition [nullable]\r\n */\r\n Map.prototype.removePolylines = function (type, condition) {\r\n if (this.polylinesList[type] && condition) {\r\n var polylines = this.getPolylines(type, condition);\r\n // Hide markers with the condition\r\n this.map.togglePolylines(polylines, false);\r\n // Keep markers that doesn't have the condition\r\n this.polylinesList[type] = this.polylinesList[type].filter(function (polyline) { return !condition(polyline.object); });\r\n }\r\n else {\r\n if (this.polylinesList[type]) {\r\n this.map.togglePolylines(this.polylinesList[type], false);\r\n }\r\n this.polylinesList[type] = [];\r\n }\r\n if (this.polylinesList[type].length === 0) {\r\n delete this.polylinesList[type];\r\n }\r\n };\r\n /**\r\n * Remove all polylines from the map and from the internal list\r\n */\r\n Map.prototype.removeAllPolylines = function () {\r\n for (var type in this.polylinesList) {\r\n if (this.polylinesList.hasOwnProperty(type)) {\r\n this.removePolylines(type);\r\n }\r\n }\r\n };\r\n /**\r\n * Use this function to alter polyline options\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n * @param {any} condition alter polyline with the condition [nullable]\r\n */\r\n Map.prototype.alterPolylineOptions = function (type, options, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n if (polyline && polyline.length) {\r\n this.map.alterPolylineOptions(polyline, options);\r\n }\r\n };\r\n /**\r\n * Use this functions to fit polylines bounds\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.fitBoundsPolylines = function (type, condition) {\r\n var _this = this;\r\n var polylines = this.getPolylines(type, condition)\r\n .filter(function (polyline) { return _this.map.isPolylineOnMap(polyline); });\r\n if (polylines && polylines.length) {\r\n this.map.fitBoundsPolylines(polylines);\r\n }\r\n };\r\n /**\r\n * This functions returns if polyline exists\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {boolean}\r\n */\r\n Map.prototype.polylineExists = function (type, condition) {\r\n var polylines = this.getPolylines(type, condition);\r\n return polylines && polylines.length > 0;\r\n };\r\n /**\r\n * Use this function to add more paths to a polyline\r\n * @param {string} type\r\n * @param {number[]} position\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.addPolylinePath = function (type, position, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n if (polyline && polyline.length) {\r\n this.map.addPolylinePath(polyline, position);\r\n }\r\n else {\r\n var options = new polyline_options_1.default();\r\n options.addToMap = true;\r\n this.drawPolyline(type, options, null);\r\n }\r\n };\r\n /**\r\n * Use this function to get the path of some polyline\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {number[]}\r\n */\r\n Map.prototype.getPolylinePath = function (type, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n if (polyline && polyline.length) {\r\n return this.map.getPolylinePath(polyline[0]);\r\n }\r\n };\r\n /**\r\n * Use this function to clear polyline selected from the currentMap\r\n */\r\n Map.prototype.removePolylineHighlight = function () {\r\n this.map.removePolylineHighlight();\r\n };\r\n /**\r\n * Use this function to add listeners on polyline\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.addPolylineEvent = function (type, event, eventFunction, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n this.map.addPolylineEvent(polyline, event, eventFunction);\r\n };\r\n /**\r\n * Use this function to remove listeners of polyline\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.removePolylineEvent = function (type, event, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n this.map.removePolylineEvent(polyline, event);\r\n };\r\n /**\r\n * Use this function to set position of polyline highlight\r\n * @param {string} type\r\n * @param {number} initialIndex\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.setIndexPolylineHighlight = function (type, initialIndex, condition) {\r\n var polylines = this.getPolylines(type, condition);\r\n if (polylines && polylines.length) {\r\n this.map.setIndexPolylineHighlight(polylines[0], initialIndex);\r\n }\r\n };\r\n /**\r\n * Use this function to get the object of a polyline\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {object}\r\n */\r\n Map.prototype.getObjectPolyline = function (type, condition) {\r\n var polylines = this.getPolylines(type, condition);\r\n if (polylines && polylines.length) {\r\n return this.map.getObjectPolyline(polylines[0]);\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * Use this function to get the object of the polyline highligth\r\n * @returns {object}\r\n */\r\n Map.prototype.getObjectPolylineHighlight = function () {\r\n return this.map.getObjectPolylineHighlight();\r\n };\r\n /**\r\n * Use this function to add events on polyline highligtht / selected polyline\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} eventFunction\r\n */\r\n Map.prototype.addPolylineHighlightEvent = function (event, eventFunction) {\r\n this.map.addPolylineHighlightEvent(event, eventFunction);\r\n };\r\n /**\r\n * Use this function to get initial and final index of the polyline highlight\r\n * @returns {number[]} returns an array with initial index and final index\r\n */\r\n Map.prototype.getPolylineHighlightIndex = function () {\r\n return this.map.getPolylineHighlightIndex();\r\n };\r\n /* Info Windows */\r\n /**\r\n * Use this function to draw popups on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PopupOptions} options\r\n */\r\n Map.prototype.drawPopup = function (type, options) {\r\n var marker = null;\r\n if (options.marker) {\r\n var markers = this.getMarkers(options.marker, options.conditionMarker);\r\n marker = markers[0];\r\n }\r\n var popup;\r\n if (this.infoWindowList[type]) {\r\n popup = this.map.alterPopup(this.infoWindowList[type], options, marker);\r\n }\r\n else {\r\n popup = this.map.drawPopup(options, marker);\r\n }\r\n this.infoWindowList[type] = popup;\r\n };\r\n /**\r\n * Use this function to alter popups\r\n * @param {string} type\r\n * @param {InlogMaps.PopupOptions} options\r\n */\r\n Map.prototype.alterPopup = function (type, options) {\r\n var popups = this.infoWindowList[type];\r\n var markers;\r\n if (options.marker) {\r\n markers = this.getMarkers(options.marker, options.conditionMarker);\r\n }\r\n if (popups) {\r\n this.map.alterPopupContent(popups, options, markers ? markers[0] : null);\r\n }\r\n };\r\n /**\r\n *\r\n * @param {string} type\r\n * @returns {object}\r\n */\r\n Map.prototype.getObjectOpenPopup = function (type) {\r\n return this.infoWindowList[type] ? this.infoWindowList[type].object : null;\r\n };\r\n /**\r\n * Use this function to close popup by type\r\n * @param {string} type\r\n */\r\n Map.prototype.closePopup = function (type) {\r\n if (this.infoWindowList[type]) {\r\n this.map.closePopup(this.infoWindowList[type]);\r\n }\r\n };\r\n /**\r\n * Use this function to close all popups\r\n * @param {string} type\r\n */\r\n Map.prototype.closeAllPopups = function () {\r\n for (var type in this.infoWindowList) {\r\n if (this.infoWindowList.hasOwnProperty(type)) {\r\n this.closePopup(type);\r\n }\r\n }\r\n };\r\n /* Map */\r\n /**\r\n * Resize de map based on html size\r\n */\r\n Map.prototype.resizeMap = function () {\r\n this.map.resizeMap();\r\n };\r\n /**\r\n * Use this function to add event clicks on the currentMap\r\n * @param {InlogMaps.MapEventType} eventType\r\n * @param eventFunction function callback\r\n */\r\n Map.prototype.addEventMap = function (eventType, eventFunction) {\r\n this.map.addEventMap(eventType, eventFunction);\r\n };\r\n /**\r\n * Use this function to remove event clicks from the currentMap\r\n * @param {InlogMaps.MapEventType} eventType\r\n */\r\n Map.prototype.removeEventMap = function (eventType) {\r\n this.map.removeEventMap(eventType);\r\n };\r\n /**\r\n * Returns the current zoom level of the map view\r\n * @returns {number}\r\n */\r\n Map.prototype.getZoom = function () {\r\n return this.map.getZoom();\r\n };\r\n /**\r\n * Set the current zoom level of the map view\r\n * @param {number} zoom\r\n */\r\n Map.prototype.setZoom = function (zoom) {\r\n this.map.setZoom(zoom);\r\n };\r\n /**\r\n * Returns the center position of the map\r\n * @returns {number[]}\r\n */\r\n Map.prototype.getCenter = function () {\r\n return this.map.getCenter();\r\n };\r\n /**\r\n * Set the position center of the map\r\n * @param {number[]} position\r\n */\r\n Map.prototype.setCenter = function (position) {\r\n this.map.setCenter(position);\r\n };\r\n /**\r\n * Returns the coordinates from pixels\r\n * @param {number} offsetx\r\n * @param {number} offsety\r\n * @returns {number[]}\r\n */\r\n Map.prototype.pixelsToLatLng = function (offsetx, offsety) {\r\n return this.map.pixelsToLatLng(offsetx, offsety);\r\n };\r\n /**\r\n * Use this functions to fit bounds on elements with same type and condition\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.fitBoundsElements = function (type, condition) {\r\n var _this = this;\r\n var markers = this.getMarkers(type, condition)\r\n .filter(function (marker) { return _this.map.isMarkerOnMap(marker); });\r\n var circles = this.getCircles(type, condition)\r\n .filter(function (circle) { return _this.map.isCircleOnMap(circle); });\r\n var polygons = this.getPolygons(type, condition)\r\n .filter(function (polygon) { return _this.map.isPolygonOnMap(polygon); });\r\n var polylines = this.getPolylines(type, condition)\r\n .filter(function (polyline) { return _this.map.isPolylineOnMap(polyline); });\r\n this.map.fitBoundsElements(markers, circles, polygons, polylines);\r\n };\r\n /* Overlay */\r\n /**\r\n * Use this function to dray overlays on the current map\r\n * @param {string} type\r\n * @param {InlogMaps.OverlayOptions} options\r\n */\r\n Map.prototype.drawOverlay = function (type, options) {\r\n var overlay = null;\r\n if (options.polygon) {\r\n var polygons = this.getPolygons(options.polygon, options.conditionPolygon);\r\n if (polygons && polygons.length) {\r\n overlay = this.map.drawOverlay(options, polygons);\r\n }\r\n }\r\n else {\r\n overlay = this.map.drawOverlay(options);\r\n }\r\n if (overlay != null) {\r\n if (!this.overlayList[type]) {\r\n this.overlayList[type] = [];\r\n }\r\n this.overlayList[type].push(overlay);\r\n }\r\n };\r\n /**\r\n * Use this function to show or hide overlay\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.toggleOverlay = function (show, type, condition) {\r\n var overlays = this.getOverlays(type, condition);\r\n if (overlays && overlays.length) {\r\n this.map.toggleOverlay(overlays, show);\r\n }\r\n };\r\n /**\r\n * Remove overlays from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove overlays with the condition [nullable]\r\n */\r\n Map.prototype.removeOverlays = function (type, condition) {\r\n if (this.overlayList[type] && condition) {\r\n var overlays = this.getOverlays(type, condition);\r\n // Hide markers with the condition\r\n this.map.toggleOverlay(overlays, false);\r\n // Keep markers that doesn't have the condition\r\n this.overlayList[type] = this.overlayList[type].filter(function (overlay) { return !condition(overlay.object); });\r\n }\r\n else {\r\n if (this.overlayList[type]) {\r\n this.map.toggleOverlay(this.overlayList[type], false);\r\n }\r\n this.overlayList[type] = [];\r\n }\r\n if (this.overlayList[type].length === 0) {\r\n delete this.overlayList[type];\r\n }\r\n };\r\n /**\r\n * Remove all overlays from the map and from the internal list\r\n */\r\n Map.prototype.removeAllOverlays = function () {\r\n for (var type in this.overlayList) {\r\n if (this.overlayList.hasOwnProperty(type)) {\r\n this.removeOverlays(type);\r\n }\r\n }\r\n };\r\n /* Private Methods */\r\n Map.prototype.getMarkers = function (type, condition) {\r\n var markers = this.markersList[type];\r\n if (markers && markers.length) {\r\n return condition ? markers.filter(function (marker) { return condition(marker.object); }) : markers;\r\n }\r\n else\r\n return [];\r\n };\r\n Map.prototype.getPolygons = function (type, condition) {\r\n var polygons = this.polygonsList[type];\r\n if (polygons && polygons.length) {\r\n return condition ? polygons.filter(function (polygon) { return condition(polygon.object); }) : polygons;\r\n }\r\n else\r\n return [];\r\n };\r\n Map.prototype.getCircles = function (type, condition) {\r\n var circles = this.circlesList[type];\r\n if (circles && circles.length) {\r\n return condition ? circles.filter(function (circle) { return condition(circle.object); }) : circles;\r\n }\r\n else\r\n return [];\r\n };\r\n Map.prototype.getPolylines = function (type, condition) {\r\n var polylines = this.polylinesList[type];\r\n if (polylines && polylines.length) {\r\n return condition ? polylines.filter(function (polyline) { return condition(polyline.object); }) : polylines;\r\n }\r\n else\r\n return [];\r\n };\r\n Map.prototype.getOverlays = function (type, condition) {\r\n var overlays = this.overlayList[type];\r\n if (overlays && overlays.length) {\r\n return condition ? overlays.filter(function (overlay) { return condition(overlay.object); }) : overlays;\r\n }\r\n else\r\n return [];\r\n };\r\n return Map;\r\n}());\r\nexports.default = Map;\r\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar maps_api_loader_service_1 = __webpack_require__(6);\r\nvar google_circles_1 = __webpack_require__(11);\r\nvar google_geojson_1 = __webpack_require__(12);\r\nvar google_map_1 = __webpack_require__(13);\r\nvar google_markers_1 = __webpack_require__(14);\r\nvar google_overlay_1 = __webpack_require__(15);\r\nvar google_polygons_1 = __webpack_require__(16);\r\nvar google_polylines_1 = __webpack_require__(17);\r\nvar google_popup_1 = __webpack_require__(18);\r\nvar GoogleMaps = /** @class */ (function () {\r\n function GoogleMaps() {\r\n this.mapsApiLoader = new maps_api_loader_service_1.MapsApiLoaderService();\r\n }\r\n GoogleMaps.prototype.initialize = function (mapType, params, elementId) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var api, google_1, options, key, imageMapTypes_1, ids_1, map_1, trafficLayer, err_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 3]);\r\n return [4 /*yield*/, this.mapsApiLoader.loadApi(mapType, params)];\r\n case 1:\r\n api = _a.sent();\r\n google_1 = api;\r\n options = {\r\n center: new google_1.maps.LatLng(-14, -54),\r\n fullscreenControl: false,\r\n keyboardShortcuts: false,\r\n mapTypeControl: true,\r\n minZoom: 4,\r\n rotateControl: false,\r\n scaleControl: false,\r\n streetViewControl: false,\r\n zoom: 4,\r\n zoomControl: true\r\n };\r\n if (params.gestureHandling) {\r\n options.gestureHandling = 'cooperative';\r\n }\r\n else {\r\n options.gestureHandling = 'greedy';\r\n }\r\n if (params.options) {\r\n for (key in params.options) {\r\n if (params.options.hasOwnProperty(key)) {\r\n options[key] = params.options[key];\r\n }\r\n }\r\n }\r\n imageMapTypes_1 = [];\r\n if (params.mapTiles) {\r\n ids_1 = [google_1.maps.MapTypeId.ROADMAP, google_1.maps.MapTypeId.SATELLITE];\r\n params.mapTiles.forEach(function (tile) {\r\n ids_1.push(tile.name);\r\n var mapTypeOptions = {\r\n getTileUrl: function (coord, zoom) {\r\n return \"https://tile.openstreetmap.org/\" + zoom + \"/\" + coord.x + \"/\" + coord.y + \".png\";\r\n },\r\n isPng: true,\r\n maxZoom: 19,\r\n minZoom: 0,\r\n name: 'OpenStreetMap',\r\n tileSize: new google_1.maps.Size(256, 256),\r\n };\r\n for (var key in tile) {\r\n if (tile.hasOwnProperty(key)) {\r\n mapTypeOptions[key] = tile[key];\r\n }\r\n }\r\n var imageMapType = new google_1.maps.ImageMapType(mapTypeOptions);\r\n imageMapTypes_1.push({ id: tile.name, tile: imageMapType });\r\n });\r\n options.mapTypeControlOptions = {\r\n mapTypeIds: ids_1,\r\n style: google_1.maps.MapTypeControlStyle.HORIZONTAL_BAR\r\n };\r\n }\r\n map_1 = new google_1.maps.Map(document.getElementById(elementId), options);\r\n this.googleMarkers = new google_markers_1.default(map_1, google_1);\r\n this.googlePolygons = new google_polygons_1.default(map_1, google_1);\r\n this.googleCircles = new google_circles_1.default(map_1, google_1);\r\n this.googlePopups = new google_popup_1.default(map_1, google_1);\r\n this.googlePolylines = new google_polylines_1.default(map_1, google_1, this.googlePopups);\r\n this.googleMap = new google_map_1.default(map_1, google_1);\r\n this.googleOverlays = new google_overlay_1.default(map_1, google_1, this.googlePolygons);\r\n this.googleGeoJson = new google_geojson_1.default(map_1, google_1);\r\n if (imageMapTypes_1 && imageMapTypes_1.length) {\r\n imageMapTypes_1.forEach(function (image) {\r\n map_1.mapTypes.set(image.id, image.tile);\r\n });\r\n }\r\n if (params.showTraffic) {\r\n trafficLayer = new google_1.maps.TrafficLayer();\r\n trafficLayer.setMap(map_1);\r\n }\r\n return [2 /*return*/, this];\r\n case 2:\r\n err_1 = _a.sent();\r\n return [2 /*return*/, err_1];\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /* GEOJson */\r\n GoogleMaps.prototype.loadGEOJson = function (data, options, eventClick) {\r\n this.googleGeoJson.loadGEOJson(data, options, eventClick);\r\n };\r\n /* Markers */\r\n GoogleMaps.prototype.drawMarker = function (options, eventClick) {\r\n return this.googleMarkers.drawMarker(options, eventClick);\r\n };\r\n GoogleMaps.prototype.drawCircleMarker = function (options, eventClick) {\r\n return this.googleMarkers.drawCircleMarker(options, eventClick);\r\n };\r\n GoogleMaps.prototype.toggleMarkers = function (markers, show, markerClusterer) {\r\n this.googleMarkers.toggleMarkers(markers, show, markerClusterer);\r\n };\r\n GoogleMaps.prototype.alterMarkerOptions = function (markers, options) {\r\n this.googleMarkers.alterMarkerOptions(markers, options);\r\n };\r\n GoogleMaps.prototype.alterMarkerPosition = function (markers, position, addTransition) {\r\n this.googleMarkers.alterMarkerPosition(markers, position, addTransition);\r\n };\r\n GoogleMaps.prototype.fitBoundsPositions = function (markers) {\r\n this.googleMarkers.fitBoundsPositions(markers);\r\n };\r\n GoogleMaps.prototype.isMarkerOnMap = function (marker) {\r\n return this.googleMarkers.isMarkerOnMap(marker);\r\n };\r\n GoogleMaps.prototype.setCenterMarker = function (marker) {\r\n this.googleMarkers.setCenterMarker(marker);\r\n };\r\n GoogleMaps.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {\r\n this.googleMarkers.addMarkerEvent(markers, eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.removeMarkerEvent = function (markers, event) {\r\n this.googleMarkers.removeMarkerEvent(markers, event);\r\n };\r\n /* Marker Clusterer */\r\n GoogleMaps.prototype.addMarkerClusterer = function (config) {\r\n return this.googleMarkers.addMarkerClusterer(config);\r\n };\r\n GoogleMaps.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {\r\n this.googleMarkers.alterMarkerClustererConfig(markerClusterer, config);\r\n };\r\n GoogleMaps.prototype.refreshClusterer = function (markerClusterer) {\r\n this.googleMarkers.refreshClusterer(markerClusterer);\r\n };\r\n GoogleMaps.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {\r\n this.googleMarkers.addMarkerOnClusterer(marker, markerClusterer);\r\n };\r\n GoogleMaps.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {\r\n this.googleMarkers.removeMarkerFromClusterer(marker, markerClusterer);\r\n };\r\n GoogleMaps.prototype.clearMarkersClusterer = function (markerClusterer) {\r\n this.googleMarkers.clearMarkersClusterer(markerClusterer);\r\n };\r\n GoogleMaps.prototype.countMarkersOnCluster = function (markerClusterer) {\r\n return this.googleMarkers.countMarkersOnCluster(markerClusterer);\r\n };\r\n /* Polygons */\r\n GoogleMaps.prototype.drawPolygon = function (options, eventClick) {\r\n return this.googlePolygons.drawPolygon(options, eventClick);\r\n };\r\n GoogleMaps.prototype.togglePolygons = function (polygons, show) {\r\n this.googlePolygons.togglePolygons(polygons, show);\r\n };\r\n GoogleMaps.prototype.alterPolygonOptions = function (polygons, options) {\r\n this.googlePolygons.alterPolygonOptions(polygons, options);\r\n };\r\n GoogleMaps.prototype.fitBoundsPolygons = function (polygons) {\r\n this.googlePolygons.fitBoundsPolygons(polygons);\r\n };\r\n GoogleMaps.prototype.setCenterPolygons = function (polygons) {\r\n this.googlePolygons.setCenterPolygons(polygons);\r\n };\r\n GoogleMaps.prototype.isPolygonOnMap = function (polygon) {\r\n return this.googlePolygons.isPolygonOnMap(polygon);\r\n };\r\n GoogleMaps.prototype.getPolygonPath = function (polygon) {\r\n return this.googlePolygons.getPolygonPath(polygon);\r\n };\r\n GoogleMaps.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {\r\n return this.googlePolygons.addPolygonEvent(polygons, eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.removePolygonEvent = function (polygons, event) {\r\n this.googlePolygons.removePolygonEvent(polygons, event);\r\n };\r\n /* Circles */\r\n GoogleMaps.prototype.drawCircle = function (options, eventClick) {\r\n return this.googleCircles.drawCircle(options, eventClick);\r\n };\r\n GoogleMaps.prototype.toggleCircles = function (circles, show) {\r\n this.googleCircles.toggleCircles(circles, show);\r\n };\r\n GoogleMaps.prototype.alterCircleOptions = function (circles, options) {\r\n this.googleCircles.alterCircleOptions(circles, options);\r\n };\r\n GoogleMaps.prototype.fitBoundsCircles = function (circles) {\r\n this.googleCircles.fitBoundsCircles(circles);\r\n };\r\n GoogleMaps.prototype.isCircleOnMap = function (circle) {\r\n return this.googleCircles.isCircleOnMap(circle);\r\n };\r\n GoogleMaps.prototype.getCircleCenter = function (circle) {\r\n return this.googleCircles.getCircleCenter(circle);\r\n };\r\n GoogleMaps.prototype.getCircleRadius = function (circle) {\r\n return this.googleCircles.getCircleRadius(circle);\r\n };\r\n GoogleMaps.prototype.addCircleEvent = function (circles, eventType, eventFunction) {\r\n this.googleCircles.addCircleEvent(circles, eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.removeCircleEvent = function (circles, event) {\r\n this.googleCircles.removeCircleEvent(circles, event);\r\n };\r\n /* Polylines */\r\n GoogleMaps.prototype.drawPolyline = function (options, eventClick) {\r\n return this.googlePolylines.drawPolyline(options, eventClick);\r\n };\r\n GoogleMaps.prototype.drawPolylineWithNavigation = function (options, eventClick) {\r\n return this.googlePolylines.drawPolylineWithNavigation(options, eventClick);\r\n };\r\n GoogleMaps.prototype.togglePolylines = function (polylines, show) {\r\n this.googlePolylines.togglePolylines(polylines, show);\r\n };\r\n GoogleMaps.prototype.alterPolylineOptions = function (polylines, options) {\r\n this.googlePolylines.alterPolylineOptions(polylines, options);\r\n };\r\n GoogleMaps.prototype.fitBoundsPolylines = function (polylines) {\r\n this.googlePolylines.fitBoundsPolylines(polylines);\r\n };\r\n GoogleMaps.prototype.isPolylineOnMap = function (polyline) {\r\n return this.googlePolylines.isPolylineOnMap(polyline);\r\n };\r\n GoogleMaps.prototype.addPolylinePath = function (polylines, position) {\r\n this.googlePolylines.addPolylinePath(polylines, position);\r\n };\r\n GoogleMaps.prototype.getPolylinePath = function (polyline) {\r\n return this.googlePolylines.getPolylinePath(polyline);\r\n };\r\n GoogleMaps.prototype.removePolylineHighlight = function () {\r\n this.googlePolylines.removePolylineHighlight();\r\n };\r\n GoogleMaps.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {\r\n this.googlePolylines.addPolylineEvent(polylines, eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.removePolylineEvent = function (polylines, event) {\r\n this.googlePolylines.removePolylineEvent(polylines, event);\r\n };\r\n GoogleMaps.prototype.setIndexPolylineHighlight = function (polyline, index) {\r\n this.googlePolylines.setIndexPolylineHighlight(polyline, index);\r\n };\r\n GoogleMaps.prototype.getObjectPolyline = function (polyline) {\r\n return this.googlePolylines.getObjectPolyline(polyline);\r\n };\r\n GoogleMaps.prototype.getObjectPolylineHighlight = function () {\r\n return this.googlePolylines.getObjectPolylineHighlight();\r\n };\r\n GoogleMaps.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {\r\n this.googlePolylines.addPolylineHighlightEvent(eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.getPolylineHighlightIndex = function () {\r\n return this.googlePolylines.getPolylineHighlightIndex();\r\n };\r\n /* Info Windows */\r\n GoogleMaps.prototype.drawPopup = function (options, marker) {\r\n return this.googlePopups.drawPopup(options, marker);\r\n };\r\n GoogleMaps.prototype.alterPopup = function (popup, options, marker) {\r\n return this.googlePopups.alterPopup(popup, options, marker);\r\n };\r\n GoogleMaps.prototype.alterPopupContent = function (popup, options, marker) {\r\n this.googlePopups.alterPopupContent(popup, options, marker);\r\n };\r\n GoogleMaps.prototype.closePopup = function (popup) {\r\n this.googlePopups.closePopup(popup);\r\n };\r\n /* Map */\r\n GoogleMaps.prototype.resizeMap = function () {\r\n this.googleMap.resizeMap();\r\n };\r\n GoogleMaps.prototype.addEventMap = function (eventType, eventFunction) {\r\n this.googleMap.addEventMap(eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.removeEventMap = function (eventType) {\r\n this.googleMap.removeEventMap(eventType);\r\n };\r\n GoogleMaps.prototype.getZoom = function () {\r\n return this.googleMap.getZoom();\r\n };\r\n GoogleMaps.prototype.setZoom = function (zoom) {\r\n this.googleMap.setZoom(zoom);\r\n };\r\n GoogleMaps.prototype.getCenter = function () {\r\n return this.googleMap.getCenter();\r\n };\r\n GoogleMaps.prototype.setCenter = function (position) {\r\n this.googleMap.setCenter(position);\r\n };\r\n GoogleMaps.prototype.pixelsToLatLng = function (offsetx, offsety) {\r\n return this.googleMap.pixelsToLatLng(offsetx, offsety);\r\n };\r\n GoogleMaps.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {\r\n this.googleMap.fitBoundsElements(markers, circles, polygons, polylines);\r\n };\r\n /* Overlay */\r\n GoogleMaps.prototype.drawOverlay = function (options, polygons) {\r\n return this.googleOverlays.drawOverlay(options, polygons);\r\n };\r\n GoogleMaps.prototype.toggleOverlay = function (overlays, show) {\r\n this.googleOverlays.toggleOverlay(overlays, show);\r\n };\r\n return GoogleMaps;\r\n}());\r\nexports.default = GoogleMaps;\r\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GoogleCircles = /** @class */ (function () {\r\n function GoogleCircles(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GoogleCircles.prototype.drawCircle = function (options, eventClick) {\r\n var self = this;\r\n var latlng = {\r\n lat: options.center[0],\r\n lng: options.center[1]\r\n };\r\n var newOptions = {\r\n center: latlng,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n object: options.object,\r\n radius: options.radius,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity,\r\n strokeWeight: options.weight,\r\n suppressUndo: true\r\n };\r\n var circle = new this.google.maps.Circle(newOptions);\r\n if (eventClick) {\r\n this.google.maps.event.addListener(circle, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n circle.setMap(self.map);\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(circle.getBounds());\r\n }\r\n return circle;\r\n };\r\n GoogleCircles.prototype.toggleCircles = function (circles, show) {\r\n var self = this;\r\n circles.forEach(function (circle) { return circle.setMap(show ? self.map : null); });\r\n };\r\n GoogleCircles.prototype.alterCircleOptions = function (circles, options) {\r\n circles.forEach(function (circle) {\r\n var latlng = options.center && options.center.length > 0 ?\r\n { lat: options.center[0], lng: options.center[1] } : circle.getCenter();\r\n var newOptions = {\r\n center: latlng,\r\n fillColor: options.fillColor ? options.fillColor : circle.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : circle.fillOpacity,\r\n radius: options.radius ? options.radius : circle.radius,\r\n strokeColor: options.color ? options.color : circle.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : circle.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : circle.strokeWeight,\r\n editable: options.editable !== null && options.editable !== undefined ?\r\n options.editable : circle.editable,\r\n draggable: options.draggable !== null && options.draggable !== undefined ?\r\n options.draggable : circle.draggable\r\n };\r\n circle.setOptions(newOptions);\r\n });\r\n };\r\n GoogleCircles.prototype.fitBoundsCircles = function (circles) {\r\n this.map.fitBounds(this.getCirclesBounds(circles));\r\n };\r\n GoogleCircles.prototype.isCircleOnMap = function (circle) {\r\n return !!circle.map;\r\n };\r\n GoogleCircles.prototype.getCircleCenter = function (circle) {\r\n var center = circle.getCenter();\r\n return [center.lat(), center.lng()];\r\n };\r\n GoogleCircles.prototype.getCircleRadius = function (circle) {\r\n return circle.getRadius();\r\n };\r\n GoogleCircles.prototype.addCircleEvent = function (circles, eventType, eventFunction) {\r\n var _this = this;\r\n circles.forEach(function (circle) {\r\n switch (eventType) {\r\n case event_type_1.CircleEventType.Click:\r\n _this.google.maps.event.addListener(circle, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, circle.object);\r\n });\r\n break;\r\n case event_type_1.CircleEventType.CenterChanged:\r\n _this.google.maps.event.addListener(circle, 'center_changed', function () {\r\n var param = new event_return_1.default([circle.getCenter().lat(), circle.getCenter().lng()]);\r\n eventFunction(param, circle.object);\r\n });\r\n case event_type_1.CircleEventType.RadiusChanged:\r\n _this.google.maps.event.addListener(circle, 'radius_changed', function (event) {\r\n var param = new event_return_1.default([circle.getCenter().lat(), circle.getCenter().lng()]);\r\n eventFunction(param, circle.object, circle.getRadius());\r\n });\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GoogleCircles.prototype.removeCircleEvent = function (circles, event) {\r\n var _this = this;\r\n circles.forEach(function (circle) {\r\n switch (event) {\r\n case event_type_1.CircleEventType.Click:\r\n _this.google.maps.event.clearListeners(circle, 'click');\r\n case event_type_1.CircleEventType.CenterChanged:\r\n _this.google.maps.event.clearListeners(circle, 'center_changed');\r\n case event_type_1.CircleEventType.RadiusChanged:\r\n _this.google.maps.event.clearListeners(circle, 'radius_changed');\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GoogleCircles.prototype.getCirclesBounds = function (circles) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n circles.forEach(function (circulo) { return bounds.union(circulo.getBounds()); });\r\n return bounds;\r\n };\r\n return GoogleCircles;\r\n}());\r\nexports.default = GoogleCircles;\r\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GoogleGeoJson = /** @class */ (function () {\r\n function GoogleGeoJson(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GoogleGeoJson.prototype.loadGEOJson = function (data, options, eventClick) {\r\n var self = this;\r\n var objects = self.parseGeoJson(data, options);\r\n objects.forEach(function (elem) {\r\n if (eventClick) {\r\n elem.addListener('click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param);\r\n });\r\n }\r\n elem.setMap(self.map);\r\n });\r\n };\r\n GoogleGeoJson.prototype.parseGeoJson = function (data, options) {\r\n var self = this;\r\n var parsedFeatures = [];\r\n if (Array.isArray(data.features)) {\r\n for (var _i = 0, _a = data.features; _i < _a.length; _i++) {\r\n var feature = _a[_i];\r\n parsedFeatures.push(self.parseGeoJsonToObject(feature, options));\r\n }\r\n }\r\n else {\r\n parsedFeatures.push(self.parseGeoJsonToObject(data, options));\r\n }\r\n return parsedFeatures;\r\n };\r\n GoogleGeoJson.prototype.parseGeoJsonToObject = function (data, objectOptions) {\r\n var geometry = data.geometry;\r\n if (data.properties) {\r\n Object.assign(objectOptions, data.properties);\r\n }\r\n switch (geometry.type) {\r\n case 'Point':\r\n objectOptions.position = {\r\n lat: geometry.coordinates[1],\r\n lng: geometry.coordinates[0]\r\n };\r\n return new this.google.maps.Marker(objectOptions);\r\n case 'Polygon':\r\n objectOptions.paths = [];\r\n geometry.coordinates.forEach(function (polygon) {\r\n return objectOptions.paths.push(polygon.map(function (elem) { return ({\r\n lat: elem[1],\r\n lng: elem[0]\r\n }); }));\r\n });\r\n return new this.google.maps.Polygon(objectOptions);\r\n case 'LineString':\r\n objectOptions.path = geometry.coordinates.map(function (elem) { return ({\r\n lat: elem[1],\r\n lng: elem[0]\r\n }); });\r\n return new this.google.maps.Polyline(objectOptions);\r\n default:\r\n throw new Error('Forma de objeto desconhecida.');\r\n }\r\n };\r\n return GoogleGeoJson;\r\n}());\r\nexports.default = GoogleGeoJson;\r\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GoogleMap = /** @class */ (function () {\r\n function GoogleMap(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GoogleMap.prototype.resizeMap = function () {\r\n google.maps.event.trigger(this.map, 'resize');\r\n };\r\n GoogleMap.prototype.addEventMap = function (eventType, eventFunction) {\r\n var self = this;\r\n switch (eventType) {\r\n case event_type_1.MapEventType.Click:\r\n this.google.maps.event.addListener(self.map, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param);\r\n });\r\n break;\r\n case event_type_1.MapEventType.ZoomChanged:\r\n self.map.addListener('zoom_changed', function () {\r\n var param = new event_return_1.default([self.map.getCenter().lat(), self.map.getCenter().lng()]);\r\n eventFunction(param);\r\n });\r\n default:\r\n break;\r\n }\r\n };\r\n GoogleMap.prototype.removeEventMap = function (eventType) {\r\n var self = this;\r\n switch (eventType) {\r\n case event_type_1.MapEventType.Click:\r\n this.google.maps.event.clearListeners(self.map, 'click');\r\n break;\r\n case event_type_1.MapEventType.ZoomChanged:\r\n this.google.maps.event.clearListeners(self.map, 'zoom_changed');\r\n default:\r\n break;\r\n }\r\n };\r\n GoogleMap.prototype.getZoom = function () {\r\n return this.map.getZoom();\r\n };\r\n GoogleMap.prototype.setZoom = function (zoom) {\r\n return this.map.setZoom(zoom);\r\n };\r\n GoogleMap.prototype.getCenter = function () {\r\n var center = this.map.getCenter();\r\n return [center.lat(), center.lng()];\r\n };\r\n GoogleMap.prototype.setCenter = function (position) {\r\n this.map.setCenter(new google.maps.LatLng(position[0], position[1]));\r\n };\r\n GoogleMap.prototype.pixelsToLatLng = function (offsetx, offsety) {\r\n var scale = Math.pow(2, this.map.getZoom());\r\n var worldCoordinateCenter = this.map.getProjection().fromLatLngToPoint(this.map.getCenter());\r\n var pixelOffset = new google.maps.Point(offsetx / scale || 0, offsety / scale || 0);\r\n var worldCoordinateNewCenter = new google.maps.Point(worldCoordinateCenter.x - pixelOffset.x, worldCoordinateCenter.y + pixelOffset.y);\r\n var latlng = this.map.getProjection().fromPointToLatLng(worldCoordinateNewCenter);\r\n return [latlng.lat(), latlng.lng()];\r\n };\r\n GoogleMap.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {\r\n var bounds = new google.maps.LatLngBounds();\r\n if (markers && markers.length) {\r\n markers.forEach(function (marker) { return bounds.extend(marker.getPosition()); });\r\n this.map.fitBounds(bounds);\r\n }\r\n if (circles && circles.length) {\r\n circles.forEach(function (circle) { return bounds.union(circle.getBounds()); });\r\n this.map.fitBounds(bounds);\r\n }\r\n if (polygons && polygons.length) {\r\n polygons.forEach(function (polygon) { return polygon.getPaths()\r\n .forEach(function (path) { return path.getArray()\r\n .forEach(function (ponto) { return bounds.extend(ponto); }); }); });\r\n this.map.fitBounds(bounds);\r\n }\r\n if (polylines && polylines.length) {\r\n polylines.forEach(function (polyline) { return polyline.getPath()\r\n .forEach(function (path) { return bounds.extend(new google.maps.LatLng(path.lat(), path.lng())); }); });\r\n this.map.fitBounds(bounds);\r\n }\r\n };\r\n return GoogleMap;\r\n}());\r\nexports.default = GoogleMap;\r\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar MarkerClusterer = __webpack_require__(8);\r\nvar GoogleMarkers = /** @class */ (function () {\r\n function GoogleMarkers(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GoogleMarkers.prototype.drawMarker = function (options, eventClick) {\r\n var newOptions = {\r\n draggable: options.draggable,\r\n icon: null,\r\n object: options.object,\r\n position: {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n }\r\n };\r\n if (options.icon) {\r\n newOptions.icon = {\r\n url: options.icon.url\r\n };\r\n if (options.icon.size) {\r\n newOptions.icon.size = new this.google.maps.Size(options.icon.size[0], options.icon.size[1]);\r\n }\r\n }\r\n var marker = new this.google.maps.Marker(newOptions);\r\n if (eventClick) {\r\n this.google.maps.event.addListener(marker, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n marker.setMap(this.map);\r\n }\r\n if (options.fitBounds) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n bounds.extend(marker.getPosition());\r\n this.map.fitBounds(bounds);\r\n }\r\n return marker;\r\n };\r\n GoogleMarkers.prototype.drawCircleMarker = function (options, eventClick) {\r\n var self = this;\r\n var newOptions = {\r\n icon: {\r\n fillColor: options.style.fillColor,\r\n fillOpacity: options.style.fillOpacity,\r\n path: this.google.maps.SymbolPath.CIRCLE,\r\n scale: options.style.radius,\r\n strokeColor: options.style.color,\r\n strokeWeight: options.style.weight\r\n },\r\n object: options.object,\r\n position: {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n }\r\n };\r\n var marker = new this.google.maps.Marker(newOptions);\r\n if (eventClick) {\r\n this.google.maps.event.addListener(marker, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n marker.setMap(self.map);\r\n }\r\n if (options.fitBounds) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n bounds.extend(marker.getPosition());\r\n self.map.fitBounds(bounds);\r\n }\r\n return marker;\r\n };\r\n GoogleMarkers.prototype.toggleMarkers = function (markers, show, markerClusterer) {\r\n var self = this;\r\n markers.forEach(function (marker) {\r\n marker.setMap(show ? self.map : null);\r\n if (markerClusterer) {\r\n if (show) {\r\n self.addMarkerOnClusterer(marker, markerClusterer);\r\n }\r\n else {\r\n self.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n }\r\n });\r\n };\r\n GoogleMarkers.prototype.alterMarkerOptions = function (markers, options) {\r\n var _this = this;\r\n var icon = null;\r\n var position = null;\r\n if (options.latlng) {\r\n position = {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n };\r\n }\r\n if (options.icon) {\r\n icon = options.icon;\r\n if (options.icon.size) {\r\n icon.size = new this.google.maps.Size(options.icon.size[0], options.icon.size[1]);\r\n }\r\n }\r\n markers.forEach(function (marker) {\r\n if (options.style) {\r\n icon = {\r\n fillColor: options.style.fillColor ? options.style.fillColor : marker.icon.fillColor,\r\n fillOpacity: options.style.fillOpacity ? options.style.fillOpacity : marker.icon.fillOpacity,\r\n path: _this.google.maps.SymbolPath.CIRCLE,\r\n scale: options.style.radius ? options.style.radius : marker.icon.scale,\r\n strokeColor: options.style.color ? options.style.color : marker.icon.strokeColor,\r\n strokeWeight: options.style.weight ? options.style.weight : marker.icon.strokeWeight\r\n };\r\n }\r\n var newOptions = null;\r\n if (position && icon) {\r\n newOptions = { icon: icon, position: position };\r\n }\r\n else if (position) {\r\n newOptions = { position: position };\r\n }\r\n else {\r\n newOptions = { icon: icon };\r\n }\r\n marker.setOptions(newOptions);\r\n });\r\n };\r\n GoogleMarkers.prototype.alterMarkerPosition = function (markers, position, addTransition) {\r\n var _this = this;\r\n var newPosition = {\r\n lat: position[0],\r\n lng: position[1]\r\n };\r\n markers.forEach(function (marker) {\r\n if (addTransition) {\r\n _this.moveTransitionMarker(newPosition, marker);\r\n }\r\n else {\r\n marker.setPosition(newPosition);\r\n }\r\n });\r\n };\r\n GoogleMarkers.prototype.fitBoundsPositions = function (markers) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n markers.map(function (marker) { return marker.position; }).forEach(function (position) { return bounds.extend(position); });\r\n this.map.fitBounds(bounds);\r\n };\r\n GoogleMarkers.prototype.isMarkerOnMap = function (marker) {\r\n return !!marker.map;\r\n };\r\n GoogleMarkers.prototype.setCenterMarker = function (marker) {\r\n this.map.setCenter(marker.getPosition());\r\n };\r\n GoogleMarkers.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {\r\n var _this = this;\r\n markers.forEach(function (marker) {\r\n switch (eventType) {\r\n case event_type_1.MarkerEventType.Click:\r\n _this.google.maps.event.addListener(marker, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.RightClick:\r\n _this.google.maps.event.addListener(marker, 'rightclick', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.AfterDrag:\r\n _this.google.maps.event.addListener(marker, 'dragend', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.MouseOver:\r\n _this.google.maps.event.addListener(marker, 'mouseover', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.MouseOut:\r\n _this.google.maps.event.addListener(marker, 'mouseout', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.BeforeDrag:\r\n _this.google.maps.event.addListener(marker, 'dragstart', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GoogleMarkers.prototype.removeMarkerEvent = function (markers, event) {\r\n var _this = this;\r\n markers.forEach(function (marker) {\r\n switch (event) {\r\n case event_type_1.MarkerEventType.Click:\r\n _this.google.maps.event.clearListeners(marker, 'click');\r\n break;\r\n case event_type_1.MarkerEventType.RightClick:\r\n _this.google.maps.event.clearListeners(marker, 'rightclick');\r\n break;\r\n case event_type_1.MarkerEventType.AfterDrag:\r\n _this.google.maps.event.clearListeners(marker, 'dragend');\r\n break;\r\n case event_type_1.MarkerEventType.MouseOver:\r\n _this.google.maps.event.clearListeners(marker, 'mouseover');\r\n break;\r\n case event_type_1.MarkerEventType.MouseOut:\r\n _this.google.maps.event.clearListeners(marker, 'mouseout');\r\n break;\r\n case event_type_1.MarkerEventType.BeforeDrag:\r\n _this.google.maps.event.clearListeners(marker, \"dragstart\");\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n /* Marker Clusterer */\r\n GoogleMarkers.prototype.addMarkerClusterer = function (config) {\r\n return new MarkerClusterer(this.map, [], {\r\n maxZoom: config.clusterMaxZoom,\r\n minimumClusterSize: config.clusterMinSize,\r\n zoomOnClick: config.clusterZoomOnClick\r\n });\r\n };\r\n GoogleMarkers.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {\r\n markerClusterer.setZoomOnClick(config.clusterZoomOnClick);\r\n markerClusterer.setMinimumClusterSize(config.clusterMinSize);\r\n markerClusterer.setMaxZoom(config.clusterMaxZoom);\r\n };\r\n GoogleMarkers.prototype.refreshClusterer = function (markerClusterer) {\r\n markerClusterer.repaint();\r\n };\r\n GoogleMarkers.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {\r\n if (markerClusterer.getMarkers().indexOf(marker) === -1) {\r\n markerClusterer.addMarker(marker, true);\r\n }\r\n };\r\n GoogleMarkers.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {\r\n markerClusterer.removeMarker(marker);\r\n };\r\n GoogleMarkers.prototype.clearMarkersClusterer = function (markerClusterer) {\r\n markerClusterer.clearMarkers();\r\n };\r\n GoogleMarkers.prototype.countMarkersOnCluster = function (markerClusterer) {\r\n return markerClusterer.getMarkers().length;\r\n };\r\n GoogleMarkers.prototype.moveTransitionMarker = function (position, marker) {\r\n var numDeltas = 5;\r\n var reference = {\r\n deltaLat: (position.lat - marker.getPosition().lat()) / numDeltas,\r\n deltaLng: (position.lng - marker.getPosition().lng()) / numDeltas,\r\n i: 0,\r\n position: [marker.getPosition().lat(), marker.getPosition().lng()],\r\n lastPosition: position\r\n };\r\n this.moveMarker(marker, reference, numDeltas);\r\n };\r\n GoogleMarkers.prototype.moveMarker = function (marker, reference, numDeltas) {\r\n var _this = this;\r\n reference.position[0] += reference.deltaLat;\r\n reference.position[1] += reference.deltaLng;\r\n marker.setPosition(new google.maps.LatLng(reference.position[0], reference.position[1]));\r\n if (reference.i < numDeltas) {\r\n reference.i++;\r\n setTimeout(function () { return _this.moveMarker(marker, reference, numDeltas); }, 20);\r\n }\r\n else if (reference.i === numDeltas) {\r\n setTimeout(function () { return marker.setPosition(reference.lastPosition); }, 20);\r\n }\r\n };\r\n return GoogleMarkers;\r\n}());\r\nexports.default = GoogleMarkers;\r\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GoogleOverlays = /** @class */ (function () {\r\n function GoogleOverlays(map, google, googlePolygons) {\r\n this.map = null;\r\n this.google = null;\r\n this.OverlayGoogle = null;\r\n this.map = map;\r\n this.google = google;\r\n this.googlePolygons = googlePolygons;\r\n OverlayGoogle.prototype = new this.google.maps.OverlayView();\r\n function OverlayGoogle(bounds, div, draggable, obj, afterDrag) {\r\n this.bounds_ = bounds;\r\n this.div_ = div;\r\n this.draggable = draggable;\r\n this.afterDragHandler = afterDrag;\r\n this.object = obj;\r\n this.setMap(map);\r\n }\r\n OverlayGoogle.prototype.onAdd = function () {\r\n var that = this;\r\n var panes = this.getPanes();\r\n panes.overlayLayer.appendChild(this.div_);\r\n panes.overlayMouseTarget.appendChild(this.div_);\r\n google.maps.event.addDomListener(this.div_, 'click', function () {\r\n google.maps.event.trigger(this.div_, 'click');\r\n });\r\n if (this.draggable) {\r\n google.maps.event.addDomListener(this.get('map').getDiv(), 'mouseleave', function () {\r\n google.maps.event.trigger(this.div_, 'mouseup');\r\n });\r\n google.maps.event.addDomListener(this.div_, 'mousedown', function (e) {\r\n this.style.cursor = 'move';\r\n that.map.set('draggable', false);\r\n that.set('origin', e);\r\n that.moveHandler = google.maps.event.addDomListener(that.get('map').getDiv(), 'mousemove', function (e) {\r\n var origin = that.get('origin');\r\n var left = origin.clientX - e.clientX;\r\n var top = origin.clientY - e.clientY;\r\n var pos = that.getProjection().fromLatLngToDivPixel(that.bounds_.getCenter());\r\n var latLng = that.getProjection()\r\n .fromDivPixelToLatLng(new google.maps.Point(pos.x - left, pos.y - top));\r\n that.set('origin', e);\r\n that.bounds_ = new google.maps.LatLngBounds();\r\n that.bounds_.extend(latLng);\r\n that.draw();\r\n });\r\n });\r\n google.maps.event.addDomListener(this.div_, 'mouseup', function () {\r\n that.map.set('draggable', true);\r\n this.style.cursor = 'default';\r\n google.maps.event.removeListener(that.moveHandler);\r\n if (that.afterDragHandler) {\r\n var latLng = that.bounds_.getCenter();\r\n var param = new event_return_1.default([latLng.lat(), latLng.lng()]);\r\n that.afterDragHandler(param, that.object);\r\n }\r\n });\r\n }\r\n };\r\n OverlayGoogle.prototype.draw = function () {\r\n var overlayProjection = this.getProjection();\r\n var center = overlayProjection.fromLatLngToDivPixel(this.bounds_.getCenter());\r\n var div = this.div_;\r\n div.style.left = center.x + 'px';\r\n div.style.top = center.y + 'px';\r\n };\r\n OverlayGoogle.prototype.onRemove = function () {\r\n this.div_.parentNode.removeChild(this.div_);\r\n };\r\n this.OverlayGoogle = OverlayGoogle;\r\n }\r\n GoogleOverlays.prototype.drawOverlay = function (options, polygons) {\r\n var bounds = null;\r\n if (polygons && polygons.length > 0) {\r\n bounds = this.googlePolygons.getPolygonsBounds(polygons);\r\n }\r\n else {\r\n bounds = new this.google.maps.LatLngBounds();\r\n bounds.extend(new this.google.maps.LatLng(options.position[0], options.position[1]));\r\n }\r\n var overlay = new this.OverlayGoogle(bounds, options.divElement, options.draggable, options.object, options.afterEventDragHandler);\r\n if (options.addToMap) {\r\n overlay.setMap(this.map);\r\n }\r\n overlay.object = options.object;\r\n return overlay;\r\n };\r\n GoogleOverlays.prototype.toggleOverlay = function (overlays, show) {\r\n var self = this;\r\n overlays.forEach(function (overlay) { return overlay.setMap(show ? self.map : null); });\r\n };\r\n return GoogleOverlays;\r\n}());\r\nexports.default = GoogleOverlays;\r\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GooglePolygons = /** @class */ (function () {\r\n function GooglePolygons(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GooglePolygons.prototype.drawPolygon = function (options, eventClick) {\r\n var self = this;\r\n var paths = this.getPathRecursiveArray(options.path);\r\n paths = this.getPathPolylineArray(paths);\r\n var newOptions = {\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n object: options.object,\r\n paths: paths,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity,\r\n strokeWeight: options.weight,\r\n suppressUndo: true,\r\n zIndex: options.zIndex\r\n };\r\n var polygon = new this.google.maps.Polygon(newOptions);\r\n if (eventClick) {\r\n this.google.maps.event.addListener(polygon, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n polygon.setMap(self.map);\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(self.getPolygonBounds(polygon));\r\n }\r\n return polygon;\r\n };\r\n GooglePolygons.prototype.togglePolygons = function (polygons, show) {\r\n var self = this;\r\n polygons.forEach(function (polygon) { return polygon.setMap(show ? self.map : null); });\r\n };\r\n GooglePolygons.prototype.alterPolygonOptions = function (polygons, options) {\r\n var newOptions = {};\r\n polygons.forEach(function (polygon) {\r\n newOptions = {\r\n editable: options.editable !== null && options.editable !== undefined ?\r\n options.editable : polygon.editable,\r\n fillColor: options.fillColor ? options.fillColor : polygon.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : polygon.fillOpacity,\r\n strokeColor: options.color ? options.color : polygon.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : polygon.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : polygon.strokeWeight,\r\n draggable: options.draggable !== null && options.draggable !== undefined ?\r\n options.draggable : polygon.draggable\r\n };\r\n if (options.path) {\r\n var paths_1 = [];\r\n options.path.forEach(function (path) { return paths_1.push({ lat: path[0], lng: path[1] }); });\r\n polygon.setPath(paths_1);\r\n }\r\n polygon.setOptions(newOptions);\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n });\r\n };\r\n GooglePolygons.prototype.fitBoundsPolygons = function (polygons) {\r\n this.map.fitBounds(this.getPolygonsBounds(polygons));\r\n };\r\n GooglePolygons.prototype.setCenterPolygons = function (polygons) {\r\n this.map.setCenter(this.getPolygonsBounds(polygons).getCenter());\r\n };\r\n GooglePolygons.prototype.isPolygonOnMap = function (polygon) {\r\n return !!polygon.map;\r\n };\r\n GooglePolygons.prototype.getPolygonPath = function (polygon) {\r\n return polygon.getPaths().getArray().map(function (x) { return x.getArray().map(function (y) { return new event_return_1.default([y.lat(), y.lng()]); }); });\r\n };\r\n GooglePolygons.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {\r\n var _this = this;\r\n polygons.forEach(function (polygon) {\r\n switch (eventType) {\r\n case event_type_1.PolygonEventType.SetAt:\r\n _this.addPolygonEventMove(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.InsertAt:\r\n _this.addPolygonEventInsertAt(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.RemoveAt:\r\n _this.addPolygonEventRemoveAt(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.DragPolygon:\r\n _this.addPolygonEventDragPolygon(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.Click:\r\n _this.addPolygonEventClick(polygon, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GooglePolygons.prototype.removePolygonEvent = function (polygons, event) {\r\n var _this = this;\r\n polygons.forEach(function (polygon) {\r\n switch (event) {\r\n case event_type_1.PolygonEventType.SetAt:\r\n _this.google.maps.event.clearListeners(polygon.getPaths(), 'set_at');\r\n break;\r\n case event_type_1.PolygonEventType.InsertAt:\r\n _this.google.maps.event.clearListeners(polygon.getPaths(), 'insert_at');\r\n break;\r\n case event_type_1.PolygonEventType.RemoveAt:\r\n _this.google.maps.event.clearListeners(polygon.getPaths(), 'remove_at');\r\n break;\r\n case event_type_1.PolygonEventType.DragPolygon:\r\n _this.google.maps.event.clearListeners(polygon, 'dragstart');\r\n _this.google.maps.event.clearListeners(polygon, 'dragend');\r\n break;\r\n case event_type_1.PolygonEventType.Click:\r\n _this.google.maps.event.clearListeners(polygon, 'click');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GooglePolygons.prototype.getPolygonsBounds = function (polygons) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n polygons.forEach(function (polygon) {\r\n var paths = polygon.getPaths().getArray();\r\n paths.forEach(function (path) { return path.getArray().forEach(function (x) { return bounds.extend(x); }); });\r\n });\r\n return bounds;\r\n };\r\n GooglePolygons.prototype.getPolygonBounds = function (polygon) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n var paths = polygon.getPaths().getArray();\r\n paths.forEach(function (path) { return path.getArray().forEach(function (x) { return bounds.extend(x); }); });\r\n return bounds;\r\n };\r\n GooglePolygons.prototype.addPolygonEventMove = function (polygon, eventFunction) {\r\n var polygonPathIdx = polygon.getPaths().getLength();\r\n for (var index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventMoveAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction);\r\n }\r\n };\r\n GooglePolygons.prototype.addPolygonEventMoveAllPaths = function (polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'set_at', function (newEvent, lastEvent) {\r\n if (polygon.dragging)\r\n return;\r\n var path = innerPolygon.getAt(newEvent);\r\n var newPosition = new event_return_1.default([path.lat(), path.lng()]);\r\n var lastPosition = new event_return_1.default([lastEvent.lat(), lastEvent.lng()]);\r\n eventFunction(newPosition, lastPosition, polygon.object, newEvent, polygon.getPaths().getArray().map(function (x) { return x.getArray().map(function (y) { return new event_return_1.default([y.lat(), y.lng()]); }); }));\r\n });\r\n };\r\n GooglePolygons.prototype.addPolygonEventInsertAt = function (polygon, eventFunction) {\r\n var polygonPathIdx = polygon.getPaths().getLength();\r\n for (var index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventInsertAtAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction);\r\n }\r\n };\r\n GooglePolygons.prototype.addPolygonEventInsertAtAllPaths = function (polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'insert_at', function (event) {\r\n var newPath = innerPolygon.getAt(event);\r\n var newPoint = new event_return_1.default([newPath.lat(), newPath.lng()]);\r\n var previousPath = innerPolygon.getAt(event - 1);\r\n var previousPoint = previousPath ? new event_return_1.default([previousPath.lat(), previousPath.lng()]) : null;\r\n eventFunction(newPoint, previousPoint, polygon.object, event, polygon.getPaths().getArray().map(function (x) { return x.getArray().map(function (y) { return new event_return_1.default([y.lat(), y.lng()]); }); }));\r\n });\r\n };\r\n GooglePolygons.prototype.addPolygonEventRemoveAt = function (polygon, eventFunction) {\r\n var polygonPathIdx = polygon.getPaths().getLength();\r\n for (var index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventRemoveAtAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction);\r\n }\r\n };\r\n GooglePolygons.prototype.addPolygonEventRemoveAtAllPaths = function (polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'remove_at', function (event) {\r\n var param = new event_return_1.default([innerPolygon.getAt(event).lat(), innerPolygon.getAt(event).lng()]);\r\n eventFunction(param, polygon.getPaths().getArray().map(function (x) { return x.getArray().map(function (y) { return new event_return_1.default([y.lat(), y.lng()]); }); }), polygon.object);\r\n });\r\n };\r\n GooglePolygons.prototype.addPolygonEventDragPolygon = function (polygon, eventFunction) {\r\n this.google.maps.event.addListener(polygon, 'dragstart', function (event) {\r\n polygon.dragging = true;\r\n });\r\n this.google.maps.event.addListener(polygon, 'dragend', function (event) {\r\n polygon.dragging = false;\r\n eventFunction(polygon.getPaths().getArray().map(function (x) { return x.getArray().map(function (y) { return new event_return_1.default([y.lat(), y.lng()]); }); }), polygon.object);\r\n });\r\n };\r\n GooglePolygons.prototype.addPolygonEventClick = function (polygon, eventFunction) {\r\n this.google.maps.event.addListener(polygon, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, polygon.object);\r\n });\r\n };\r\n GooglePolygons.prototype.getPathRecursiveArray = function (path) {\r\n var _this = this;\r\n if (Array.isArray(path) && typeof path[0] !== 'number') {\r\n return path.map(function (x) { return _this.getPathRecursiveArray(x); });\r\n }\r\n else\r\n return { lat: path[0], lng: path[1] };\r\n };\r\n GooglePolygons.prototype.getPathPolylineArray = function (path) {\r\n if (typeof path[0].lat === 'number') {\r\n return path;\r\n }\r\n else if (typeof path[0][0].lat !== 'number') {\r\n path = path[0];\r\n return this.getPathPolylineArray(path);\r\n }\r\n else\r\n return path;\r\n };\r\n return GooglePolygons;\r\n}());\r\nexports.default = GooglePolygons;\r\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar polyline_type_1 = __webpack_require__(3);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GooglePolylines = /** @class */ (function () {\r\n function GooglePolylines(map, google, googlePopups) {\r\n this.map = null;\r\n this.google = null;\r\n this.selectedPolyline = null;\r\n this.selectedPath = null;\r\n this.navigateInfoWindow = null;\r\n this.directionForward = false;\r\n this.multiSelectionForward = false;\r\n this.multiSelection = false;\r\n this.map = map;\r\n this.google = google;\r\n this.googlePopups = googlePopups;\r\n }\r\n GooglePolylines.prototype.drawPolyline = function (options, eventClick) {\r\n var self = this;\r\n var newOptions = {\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n icons: null,\r\n infowindows: options.infowindows,\r\n object: options.object,\r\n path: null,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity || 1,\r\n strokeWeight: options.weight,\r\n suppressUndo: true,\r\n zIndex: options.zIndex\r\n };\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1,\r\n strokeWeight: options.weight\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case polyline_type_1.PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scaledSize: new google.maps.Size(20, 20),\r\n size: new google.maps.Size(20, 20)\r\n },\r\n offset: '100%',\r\n repeat: '100px'\r\n },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '0%' },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '100%' }];\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n newOptions.path = options.path ? options.path.map(function (x) {\r\n return {\r\n lat: x[0],\r\n lng: x[1]\r\n };\r\n }) : [];\r\n var polyline = new this.google.maps.Polyline(newOptions);\r\n if (eventClick) {\r\n this.google.maps.event.addListener(polyline, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, polyline.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n polyline.setMap(self.map);\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(self.getPolylineBounds(polyline));\r\n }\r\n return polyline;\r\n };\r\n GooglePolylines.prototype.drawPolylineWithNavigation = function (options, eventClick) {\r\n var polyline = this.drawPolyline(options, null);\r\n polyline.navigationHandlerClick = eventClick;\r\n this.navigationOptions = options.navigateOptions;\r\n this.navigateByPoint = this.navigationOptions ? this.navigationOptions.navigateByPoint : true;\r\n this.addNavigation(polyline);\r\n return polyline;\r\n };\r\n GooglePolylines.prototype.togglePolylines = function (polylines, show) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) {\r\n var self = _this;\r\n polyline.setMap(show ? self.map : null);\r\n });\r\n };\r\n GooglePolylines.prototype.alterPolylineOptions = function (polylines, options) {\r\n polylines.forEach(function (polyline) {\r\n var newOptions = {\r\n draggable: options.draggable ? options.draggable : polyline.draggable,\r\n editable: options.editable ? options.editable : polyline.editable,\r\n infowindows: options.infowindows ? options.infowindows : polyline.infowindows,\r\n object: options.object ? options.object : polyline.object,\r\n strokeColor: options.color ? options.color : polyline.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : polyline.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : polyline.strokeWeight,\r\n zIndex: options.zIndex ? options.zIndex : polyline.zIndex\r\n };\r\n if (options.path) {\r\n polyline.setPath(options.path.map(function (x) { return new google.maps.LatLng(x[0], x[1]); }));\r\n }\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case polyline_type_1.PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scaledSize: new google.maps.Size(20, 20),\r\n size: new google.maps.Size(20, 20)\r\n },\r\n offset: '90%',\r\n repeat: '20%'\r\n },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '0%' },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '100%' }];\r\n break;\r\n default:\r\n newOptions.icons = null;\r\n break;\r\n }\r\n polyline.setOptions(newOptions);\r\n });\r\n };\r\n GooglePolylines.prototype.fitBoundsPolylines = function (polylines) {\r\n var self = this;\r\n self.map.fitBounds(self.getPolylinesBounds(polylines));\r\n };\r\n GooglePolylines.prototype.isPolylineOnMap = function (polyline) {\r\n return !!polyline.map;\r\n };\r\n GooglePolylines.prototype.addPolylinePath = function (polylines, position) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) {\r\n var path = polyline.getPath();\r\n path.push(new _this.google.maps.LatLng(position[0], position[1]));\r\n polyline.setPath(path);\r\n });\r\n };\r\n GooglePolylines.prototype.getPolylinePath = function (polyline) {\r\n return polyline.getPath().getArray().map(function (x) { return [x.lat(), x.lng()]; });\r\n };\r\n GooglePolylines.prototype.removePolylineHighlight = function () {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n if (this.selectedPath) {\r\n this.selectedPath.setMap(null);\r\n this.selectedPath = null;\r\n }\r\n if (this.navigateInfoWindow) {\r\n this.navigateInfoWindow.close();\r\n }\r\n };\r\n GooglePolylines.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) {\r\n switch (eventType) {\r\n case event_type_1.PolylineEventType.SetAt:\r\n _this.addPolylineEventMove(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.InsertAt:\r\n _this.addPolylineEventInsertAt(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.RemoveAt:\r\n _this.addPolylineEventRemoveAt(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.DragPolyline:\r\n _this.addPolylineEventDragPolyline(polyline, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GooglePolylines.prototype.removePolylineEvent = function (polylines, event) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) { return _this.google.maps.event.clearListeners(polyline, 'click'); });\r\n polylines.forEach(function (polyline) {\r\n switch (event) {\r\n case event_type_1.PolylineEventType.SetAt:\r\n _this.google.maps.event.clearListeners(polyline.getPath(), 'set_at');\r\n break;\r\n case event_type_1.PolylineEventType.InsertAt:\r\n _this.google.maps.event.clearListeners(polyline.getPath(), 'insert_at');\r\n break;\r\n case event_type_1.PolylineEventType.RemoveAt:\r\n _this.google.maps.event.clearListeners(polyline.getPath(), 'remove_at');\r\n break;\r\n case event_type_1.PolylineEventType.DragPolyline:\r\n _this.google.maps.event.clearListeners(polyline, 'dragstart');\r\n _this.google.maps.event.clearListeners(polyline, 'dragend');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GooglePolylines.prototype.setIndexPolylineHighlight = function (polyline, index) {\r\n this.directionForward = false;\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n this.google.maps.event.addDomListener(document, 'keydown', this.onKeyUp.bind(this));\r\n }\r\n else {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.addDomListener(document, 'keyup', this.onKeyUp.bind(this));\r\n }\r\n };\r\n GooglePolylines.prototype.getObjectPolyline = function (polyline) {\r\n return polyline.object;\r\n };\r\n GooglePolylines.prototype.getObjectPolylineHighlight = function () {\r\n if (this.selectedPath) {\r\n return this.selectedPath.object;\r\n }\r\n return null;\r\n };\r\n GooglePolylines.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {\r\n if (this.selectedPath) {\r\n this.addPolylineEvent([this.selectedPath], eventType, eventFunction);\r\n }\r\n };\r\n GooglePolylines.prototype.getPolylineHighlightIndex = function () {\r\n if (this.selectedPath) {\r\n return [this.selectedPath.initialIdx, this.selectedPath.finalIdx];\r\n }\r\n return null;\r\n };\r\n /* Private methods */\r\n GooglePolylines.prototype.addNavigation = function (polyline) {\r\n var self = this;\r\n this.google.maps.event.clearListeners(polyline, 'click');\r\n this.google.maps.event.addListener(polyline, 'click', self.onClickPolyline.bind(self, polyline));\r\n };\r\n GooglePolylines.prototype.onClickPolyline = function (polyline, event) {\r\n var index = this.checkIdx(polyline, event.latLng);\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n this.google.maps.event.addDomListener(document, 'keydown', this.onKeyUp.bind(this));\r\n }\r\n else {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.addDomListener(document, 'keyup', this.onKeyUp.bind(this));\r\n }\r\n if (polyline.navigationHandlerClick) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n polyline.navigationHandlerClick(param, polyline.object);\r\n }\r\n };\r\n GooglePolylines.prototype.onKeyUp = function (event) {\r\n var self = this;\r\n if (self.selectedPath) {\r\n switch (event.which ? event.which : event.keyCode) {\r\n case 38:\r\n case 39:\r\n // up arrow or right arrow\r\n self.moveForwards(event.shiftKey);\r\n break;\r\n case 37:\r\n case 40:\r\n // left arrow or down arrow\r\n self.moveBackwards(event.shiftKey);\r\n break;\r\n }\r\n }\r\n };\r\n GooglePolylines.prototype.moveForwards = function (multiSelection) {\r\n var self = this;\r\n var polyline = self.selectedPolyline;\r\n if ((!self.navigateByPoint || self.directionForward) &&\r\n polyline.finalIdx < polyline.getPath().getArray().length - 1) {\r\n self.navigateForward(multiSelection, polyline);\r\n }\r\n self.directionForward = true;\r\n self.moveSelectedPath(polyline, null);\r\n };\r\n GooglePolylines.prototype.navigateForward = function (multiSelection, polyline) {\r\n var self = this;\r\n if (!multiSelection) {\r\n polyline.finalIdx++;\r\n polyline.initialIdx = self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n }\r\n else {\r\n self.multiSelection = true;\r\n if (self.multiSelectionForward) {\r\n polyline.finalIdx++;\r\n }\r\n self.multiSelectionForward = true;\r\n }\r\n };\r\n GooglePolylines.prototype.moveBackwards = function (multiSelection) {\r\n var self = this;\r\n var polyline = self.selectedPolyline;\r\n if ((!self.navigateByPoint || !self.directionForward) && polyline.initialIdx > 0) {\r\n self.navigateBackward(multiSelection, polyline);\r\n }\r\n self.directionForward = false;\r\n self.moveSelectedPath(polyline, null);\r\n };\r\n GooglePolylines.prototype.navigateBackward = function (multiSelection, polyline) {\r\n var self = this;\r\n if (!multiSelection) {\r\n polyline.initialIdx--;\r\n polyline.finalIdx = !self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n }\r\n else {\r\n self.multiSelection = true;\r\n if (!self.multiSelectionForward) {\r\n polyline.initialIdx--;\r\n }\r\n self.multiSelectionForward = false;\r\n }\r\n };\r\n GooglePolylines.prototype.moveSelectedPath = function (polyline, options) {\r\n var pathSelected = polyline.getPath().getArray().slice(polyline.initialIdx, polyline.finalIdx + 1);\r\n if (this.selectedPath) {\r\n this.selectedPath.setPath(pathSelected);\r\n this.selectedPath.object = polyline.object;\r\n this.updateSelectedPathListeners();\r\n }\r\n else {\r\n var newOptions = {\r\n editable: options.editable,\r\n keyboardShortcuts: false,\r\n map: this.map,\r\n object: polyline.object,\r\n path: pathSelected,\r\n strokeColor: options && options.color || '#FF0000',\r\n strokeOpacity: options && options.opacity || 1,\r\n strokeWeight: options && options.weight || 10,\r\n zIndex: 9999\r\n };\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case polyline_type_1.PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n anchor: new google.maps.Point(0, 2),\r\n fillColor: '#000',\r\n fillOpacity: 0.7,\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scale: 4,\r\n strokeColor: '#000',\r\n strokeWeight: 5,\r\n },\r\n offset: '100%'\r\n }];\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n this.selectedPath = new this.google.maps.Polyline(newOptions);\r\n }\r\n this.selectedPath.initialIdx = polyline.initialIdx;\r\n this.selectedPath.finalIdx = polyline.finalIdx;\r\n this.drawPopupNavigation(polyline);\r\n };\r\n GooglePolylines.prototype.addPolylineEventMove = function (polyline, eventFunction) {\r\n polyline.moveListener = function (newEvent, lastEvent) {\r\n if (polyline.dragging)\r\n return;\r\n var path = polyline.getPath().getAt(newEvent);\r\n var newPosition = new event_return_1.default([path.lat(), path.lng()]);\r\n var lastPosition = new event_return_1.default([lastEvent.lat(), lastEvent.lng()]);\r\n eventFunction(newPosition, lastPosition, polyline.object, newEvent, polyline.getPath().getArray().map(function (x) { return new event_return_1.default([x.lat(), x.lng()]); }));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'set_at', polyline.moveListener);\r\n };\r\n GooglePolylines.prototype.addPolylineEventInsertAt = function (polyline, eventFunction) {\r\n polyline.insertAtListener = function (event) {\r\n var path = polyline.getPath();\r\n var newPath = path.getAt(event);\r\n var newPoint = new event_return_1.default([newPath.lat(), newPath.lng()]);\r\n var previousPath = path.getAt(event - 1);\r\n var previousPoint = previousPath ? new event_return_1.default([previousPath.lat(), previousPath.lng()]) : null;\r\n eventFunction(newPoint, previousPoint, polyline.object, event, polyline.getPath().getArray().map(function (x) { return new event_return_1.default([x.lat(), x.lng()]); }));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'insert_at', polyline.insertAtListener);\r\n };\r\n GooglePolylines.prototype.addPolylineEventRemoveAt = function (polyline, eventFunction) {\r\n polyline.removeAtListener = function (event) {\r\n var param = new event_return_1.default([polyline.getPath().getAt(event).lat(), polyline.getPath().getAt(event).lng()]);\r\n eventFunction(param, polyline.object, polyline.getPath().getArray().map(function (x) { return new event_return_1.default([x.lat(), x.lng()]); }));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'remove_at', polyline.removeAtListener);\r\n };\r\n GooglePolylines.prototype.addPolylineEventDragPolyline = function (polyline, eventFunction) {\r\n polyline.dragPolylineListener = function () {\r\n polyline.dragging = false;\r\n var param = polyline.getPath().getArray().map(function (x) { return new event_return_1.default([x.lat(), x.lng()]); });\r\n eventFunction(param, polyline.object);\r\n };\r\n this.google.maps.event.addListener(polyline, 'dragend', polyline.dragPolylineListener);\r\n this.google.maps.event.addListener(polyline, 'dragstart', function () { return polyline.dragging = true; });\r\n };\r\n GooglePolylines.prototype.updateSelectedPathListeners = function () {\r\n if (this.selectedPath.moveListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'set_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'set_at', this.selectedPath.moveListener);\r\n }\r\n if (this.selectedPath.insertAtListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'insert_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'insert_at', this.selectedPath.insertAtListener);\r\n }\r\n if (this.selectedPath.removeAtListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'remove_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'remove_at', this.selectedPath.removeAtListener);\r\n }\r\n };\r\n GooglePolylines.prototype.drawPopupNavigation = function (polyline) {\r\n var self = this;\r\n var idx = self.directionForward ? polyline.finalIdx : polyline.initialIdx;\r\n if (!self.navigateByPoint) {\r\n idx = polyline.finalIdx > polyline.initialIdx ? polyline.finalIdx : polyline.initialIdx;\r\n }\r\n var infowindow = polyline.infowindows ? polyline.infowindows[idx] : null;\r\n if (infowindow) {\r\n var point = polyline.getPath().getArray()[idx];\r\n if (self.navigateInfoWindow) {\r\n this.googlePopups.alterPopup(self.navigateInfoWindow, {\r\n content: infowindow,\r\n latlng: [point.lat(), point.lng()]\r\n });\r\n }\r\n else {\r\n self.navigateInfoWindow = this.googlePopups.drawPopup({\r\n content: infowindow,\r\n latlng: [point.lat(), point.lng()]\r\n });\r\n }\r\n }\r\n };\r\n GooglePolylines.prototype.checkIdx = function (polyline, point) {\r\n var self = this;\r\n var path = polyline.getPath();\r\n var distance = 0;\r\n var minDistance = Number.MAX_VALUE;\r\n var returnValue = -1;\r\n for (var i = 0; i < path.length - 1; i++) {\r\n distance = self.distanceToLine(path.getAt(i), path.getAt(i + 1), point);\r\n if (distance < minDistance) {\r\n minDistance = distance;\r\n returnValue = i;\r\n }\r\n }\r\n return returnValue;\r\n };\r\n GooglePolylines.prototype.distanceToLine = function (pt1, pt2, pt) {\r\n var self = this;\r\n var deltaX = pt2.lng() - pt1.lng();\r\n var deltaY = pt2.lat() - pt1.lat();\r\n var incIntersect = (pt.lng() - pt1.lng()) * deltaX;\r\n var deltaSum = (deltaX * deltaX) + (deltaY * deltaY);\r\n incIntersect += (pt.lat() - pt1.lat()) * deltaY;\r\n if (deltaSum > 0) {\r\n incIntersect /= deltaSum;\r\n }\r\n else {\r\n incIntersect = -1;\r\n }\r\n // The intersection occurs outside the line segment, 'before' pt1.\r\n if (incIntersect < 0) {\r\n return self.kmTo(pt, pt1);\r\n }\r\n else if (incIntersect > 1) {\r\n return self.kmTo(pt, pt2);\r\n }\r\n // Intersection point calculation.\r\n var intersect = new this.google.maps\r\n .LatLng(pt1.lat() + incIntersect * deltaY, pt1.lng() + incIntersect * deltaX);\r\n return self.kmTo(pt, intersect);\r\n };\r\n GooglePolylines.prototype.kmTo = function (pt1, pt2) {\r\n var e = Math;\r\n var ra = e.PI / 180;\r\n var b = pt1.lat() * ra;\r\n var c = pt2.lat() * ra;\r\n var d = b - c;\r\n var g = pt1.lng() * ra - pt2.lng() * ra;\r\n var f = 2 * e.asin(e.sqrt(e.pow(e.sin(d / 2), 2) + e.cos(b) * e.cos(c) * e.pow(e.sin(g / 2), 2)));\r\n return f * 6378.137 * 1000;\r\n };\r\n GooglePolylines.prototype.getPolylinesBounds = function (polylines) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n polylines.forEach(function (polyline) {\r\n var paths = polyline.getPath().getArray();\r\n paths.forEach(function (path) { return bounds.extend(path); });\r\n });\r\n return bounds;\r\n };\r\n GooglePolylines.prototype.getPolylineBounds = function (polyline) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n var paths = polyline.getPath().getArray();\r\n paths.forEach(function (path) { return bounds.extend(path); });\r\n return bounds;\r\n };\r\n return GooglePolylines;\r\n}());\r\nexports.default = GooglePolylines;\r\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar GooglePopups = /** @class */ (function () {\r\n function GooglePopups(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GooglePopups.prototype.drawPopup = function (options, marker) {\r\n var self = this;\r\n var infowindow = new this.google.maps.InfoWindow({\r\n content: options.content\r\n });\r\n if (options.latlng) {\r\n infowindow.setPosition({\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n });\r\n }\r\n infowindow.open(self.map, marker || null);\r\n if (options.object) {\r\n infowindow.object = options.object;\r\n }\r\n return infowindow;\r\n };\r\n GooglePopups.prototype.alterPopup = function (popup, options, marker) {\r\n var self = this;\r\n self.alterPopupContent(popup, options, marker);\r\n if (!popup.getMap()) {\r\n popup.open(self.map, marker || null);\r\n }\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n return popup;\r\n };\r\n GooglePopups.prototype.alterPopupContent = function (popup, options, marker) {\r\n if (options.content) {\r\n popup.setContent(options.content);\r\n }\r\n if (options.latlng) {\r\n popup.setPosition({\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n });\r\n }\r\n else if (marker) {\r\n popup.setPosition(marker.getPosition());\r\n }\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n };\r\n GooglePopups.prototype.closePopup = function (popup) {\r\n popup.close();\r\n };\r\n return GooglePopups;\r\n}());\r\nexports.default = GooglePopups;\r\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar maps_api_loader_service_1 = __webpack_require__(6);\r\nvar leaflet_circle_1 = __webpack_require__(20);\r\nvar leaflet_geojson_1 = __webpack_require__(21);\r\nvar leaflet_map_1 = __webpack_require__(22);\r\nvar leaflet_markers_1 = __webpack_require__(23);\r\nvar leaflet_overlay_1 = __webpack_require__(24);\r\nvar leaflet_polygons_1 = __webpack_require__(25);\r\nvar leaflet_polylines_1 = __webpack_require__(26);\r\nvar leaflet_popup_1 = __webpack_require__(27);\r\nvar Leaflet = /** @class */ (function () {\r\n function Leaflet() {\r\n this.mapsApiLoader = new maps_api_loader_service_1.MapsApiLoaderService();\r\n }\r\n Leaflet.prototype.initialize = function (mapType, params, elementId) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var api, leaflet_1, mapOptions, osm, wikimedia, satelliteURL, satellite, map, baseLayers_1, err_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 4, , 5]);\r\n return [4 /*yield*/, this.mapsApiLoader.loadApi(mapType, params)];\r\n case 1:\r\n api = _a.sent();\r\n leaflet_1 = api;\r\n this.loadDependencies(params);\r\n return [4 /*yield*/, this.mapTimeout(1000)];\r\n case 2:\r\n _a.sent();\r\n mapOptions = {\r\n center: new leaflet_1.LatLng(-14, -54),\r\n editable: true,\r\n keyboard: false,\r\n maxZoom: params.wikimedia ? 18 : 19,\r\n minZoom: 4,\r\n zoom: 4,\r\n zoomControl: false\r\n };\r\n if (params.gestureHandling) {\r\n mapOptions.gestureHandling = true;\r\n }\r\n return [4 /*yield*/, this.mapTimeout(200)];\r\n case 3:\r\n _a.sent();\r\n osm = new leaflet_1.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', mapOptions);\r\n wikimedia = new leaflet_1.tileLayer('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', {\r\n attribution: '<a href=\"https://wikimediafoundation.org/wiki/Maps_Terms_of_Use\">Wikimedia</a>'\r\n });\r\n satelliteURL = 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\r\n 'World_Imagery/MapServer/tile/{z}/{y}/{x}';\r\n satellite = L.tileLayer(satelliteURL, {\r\n attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye,' +\r\n ' Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',\r\n maxZoom: 18\r\n });\r\n mapOptions.layers = [params.wikimedia ? wikimedia : osm];\r\n map = new leaflet_1.Map(elementId, mapOptions);\r\n baseLayers_1 = {\r\n Map: params.wikimedia ? wikimedia : osm,\r\n Satellite: satellite\r\n };\r\n if (params.mapTiles && params.mapTiles.length) {\r\n params.mapTiles.forEach(function (tile) {\r\n var layer = new leaflet_1.tileLayer(tile.url, tile.options);\r\n baseLayers_1[tile.name] = layer;\r\n });\r\n }\r\n leaflet_1.control.layers(baseLayers_1, null, { position: 'topleft' }).addTo(map);\r\n leaflet_1.control.zoom({ position: 'bottomright' }).addTo(map);\r\n this.leafletMarkers = new leaflet_markers_1.default(map, leaflet_1);\r\n this.leafletPolygons = new leaflet_polygons_1.default(map, leaflet_1);\r\n this.leafletCircles = new leaflet_circle_1.default(map, leaflet_1);\r\n this.leafletPopups = new leaflet_popup_1.default(map, leaflet_1);\r\n this.leafletPolylines = new leaflet_polylines_1.default(map, leaflet_1, this.leafletPopups);\r\n this.leafletMap = new leaflet_map_1.default(map, leaflet_1);\r\n this.leafletOverlays = new leaflet_overlay_1.default(map, leaflet_1, this.leafletPolygons);\r\n this.leafletGeoJson = new leaflet_geojson_1.default(map, leaflet_1);\r\n return [2 /*return*/, this];\r\n case 4:\r\n err_1 = _a.sent();\r\n console.error(err_1);\r\n return [2 /*return*/, err_1];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /* GEOJson */\r\n Leaflet.prototype.loadGEOJson = function (data, options, eventClick) {\r\n this.leafletGeoJson.loadGEOJson(data, options, eventClick);\r\n };\r\n /* Markers */\r\n Leaflet.prototype.drawMarker = function (options, eventClick) {\r\n return this.leafletMarkers.drawMarker(options, eventClick);\r\n };\r\n Leaflet.prototype.drawCircleMarker = function (options, eventClick) {\r\n return this.leafletMarkers.drawCircleMarker(options, eventClick);\r\n };\r\n Leaflet.prototype.toggleMarkers = function (markers, show, markerClusterer) {\r\n this.leafletMarkers.toggleMarkers(markers, show, markerClusterer);\r\n };\r\n Leaflet.prototype.alterMarkerOptions = function (markers, options) {\r\n this.leafletMarkers.alterMarkerOptions(markers, options);\r\n };\r\n Leaflet.prototype.alterMarkerPosition = function (markers, position, addTransition) {\r\n this.leafletMarkers.alterMarkerPosition(markers, position, addTransition);\r\n };\r\n Leaflet.prototype.fitBoundsPositions = function (markers) {\r\n this.leafletMarkers.fitBoundsPositions(markers);\r\n };\r\n Leaflet.prototype.isMarkerOnMap = function (marker) {\r\n return this.leafletMarkers.isMarkerOnMap(marker);\r\n };\r\n Leaflet.prototype.setCenterMarker = function (marker) {\r\n this.leafletMarkers.setCenterMarker(marker);\r\n };\r\n Leaflet.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {\r\n this.leafletMarkers.addMarkerEvent(markers, eventType, eventFunction);\r\n };\r\n Leaflet.prototype.removeMarkerEvent = function (markers, event) {\r\n this.leafletMarkers.removeMarkerEvent(markers, event);\r\n };\r\n /* Marker Clusterer */\r\n Leaflet.prototype.addMarkerClusterer = function (config) {\r\n return this.leafletMarkers.addMarkerClusterer(config);\r\n };\r\n Leaflet.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {\r\n this.leafletMarkers.alterMarkerClustererConfig(markerClusterer, config);\r\n };\r\n Leaflet.prototype.refreshClusterer = function (markerClusterer) {\r\n this.leafletMarkers.refreshClusterer(markerClusterer);\r\n };\r\n Leaflet.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {\r\n this.leafletMarkers.addMarkerOnClusterer(marker, markerClusterer);\r\n };\r\n Leaflet.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {\r\n this.leafletMarkers.removeMarkerFromClusterer(marker, markerClusterer);\r\n };\r\n Leaflet.prototype.clearMarkersClusterer = function (markerClusterer) {\r\n this.leafletMarkers.clearMarkersClusterer(markerClusterer);\r\n };\r\n Leaflet.prototype.countMarkersOnCluster = function (markerClusterer) {\r\n return this.leafletMarkers.countMarkersOnCluster(markerClusterer);\r\n };\r\n /* Polygons */\r\n Leaflet.prototype.drawPolygon = function (options, eventClick) {\r\n return this.leafletPolygons.drawPolygon(options, eventClick);\r\n };\r\n Leaflet.prototype.togglePolygons = function (polygons, show) {\r\n this.leafletPolygons.togglePolygons(polygons, show);\r\n };\r\n Leaflet.prototype.alterPolygonOptions = function (polygons, options) {\r\n this.leafletPolygons.alterPolygonOptions(polygons, options);\r\n };\r\n Leaflet.prototype.fitBoundsPolygons = function (polygons) {\r\n this.leafletPolygons.fitBoundsPolygons(polygons);\r\n };\r\n Leaflet.prototype.setCenterPolygons = function (polygons) {\r\n this.leafletPolygons.setCenterPolygons(polygons);\r\n };\r\n Leaflet.prototype.isPolygonOnMap = function (polygon) {\r\n return this.leafletPolygons.isPolygonOnMap(polygon);\r\n };\r\n Leaflet.prototype.getPolygonPath = function (polygon) {\r\n return this.leafletPolygons.getPolygonPath(polygon);\r\n };\r\n Leaflet.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {\r\n this.leafletPolygons.addPolygonEvent(polygons, eventType, eventFunction);\r\n };\r\n Leaflet.prototype.removePolygonEvent = function (polygons, event) {\r\n this.leafletPolygons.removePolygonEvent(polygons, event);\r\n };\r\n /* Circles */\r\n Leaflet.prototype.drawCircle = function (options, eventClick) {\r\n return this.leafletCircles.drawCircle(options, eventClick);\r\n };\r\n Leaflet.prototype.toggleCircles = function (circles, show) {\r\n this.leafletCircles.toggleCircles(circles, show);\r\n };\r\n Leaflet.prototype.alterCircleOptions = function (circles, options) {\r\n this.leafletCircles.alterCircleOptions(circles, options);\r\n };\r\n Leaflet.prototype.fitBoundsCircles = function (circles) {\r\n this.leafletCircles.fitBoundsCircles(circles);\r\n };\r\n Leaflet.prototype.isCircleOnMap = function (circle) {\r\n return this.leafletCircles.isCircleOnMap(circle);\r\n };\r\n Leaflet.prototype.getCircleCenter = function (circle) {\r\n return this.leafletCircles.getCircleCenter(circle);\r\n };\r\n Leaflet.prototype.getCircleRadius = function (circle) {\r\n return this.leafletCircles.getCircleRadius(circle);\r\n };\r\n Leaflet.prototype.addCircleEvent = function (circles, eventType, eventFunction) {\r\n this.leafletCircles.addCircleEvent(circles, eventType, eventFunction);\r\n };\r\n Leaflet.prototype.removeCircleEvent = function (circles, event) {\r\n this.leafletCircles.removeCircleEvent(circles, event);\r\n };\r\n /* Polylines */\r\n Leaflet.prototype.drawPolyline = function (options, eventClick) {\r\n return this.leafletPolylines.drawPolyline(options, eventClick);\r\n };\r\n Leaflet.prototype.drawPolylineWithNavigation = function (options, eventClick) {\r\n return this.leafletPolylines.drawPolylineWithNavigation(options, eventClick);\r\n };\r\n Leaflet.prototype.togglePolylines = function (polylines, show) {\r\n this.leafletPolylines.togglePolylines(polylines, show);\r\n };\r\n Leaflet.prototype.alterPolylineOptions = function (polylines, options) {\r\n this.leafletPolylines.alterPolylineOptions(polylines, options);\r\n };\r\n Leaflet.prototype.fitBoundsPolylines = function (polylines) {\r\n this.leafletPolylines.fitBoundsPolylines(polylines);\r\n };\r\n Leaflet.prototype.isPolylineOnMap = function (polyline) {\r\n return this.leafletPolylines.isPolylineOnMap(polyline);\r\n };\r\n Leaflet.prototype.addPolylinePath = function (polylines, position) {\r\n this.leafletPolylines.addPolylinePath(polylines, position);\r\n };\r\n Leaflet.prototype.getPolylinePath = function (polyline) {\r\n return this.leafletPolylines.getPolylinePath(polyline);\r\n };\r\n Leaflet.prototype.removePolylineHighlight = function () {\r\n this.leafletPolylines.removePolylineHighlight();\r\n };\r\n Leaflet.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {\r\n this.leafletPolylines.addPolylineEvent(polylines, eventType, eventFunction);\r\n };\r\n Leaflet.prototype.removePolylineEvent = function (polylines, event) {\r\n this.leafletPolylines.removePolylineEvent(polylines, event);\r\n };\r\n Leaflet.prototype.setIndexPolylineHighlight = function (polyline, index) {\r\n this.leafletPolylines.setIndexPolylineHighlight(polyline, index);\r\n };\r\n Leaflet.prototype.getObjectPolyline = function (polyline) {\r\n return this.leafletPolylines.getObjectPolyline(polyline);\r\n };\r\n Leaflet.prototype.getObjectPolylineHighlight = function () {\r\n return this.leafletPolylines.getObjectPolylineHighlight();\r\n };\r\n Leaflet.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {\r\n this.leafletPolylines.addPolylineHighlightEvent(eventType, eventFunction);\r\n };\r\n Leaflet.prototype.getPolylineHighlightIndex = function () {\r\n return this.leafletPolylines.getPolylineHighlightIndex();\r\n };\r\n /* Popups */\r\n Leaflet.prototype.drawPopup = function (options, marker) {\r\n return this.leafletPopups.drawPopup(options, marker);\r\n };\r\n Leaflet.prototype.alterPopup = function (popup, options, marker) {\r\n return this.leafletPopups.alterPopup(popup, options, marker);\r\n };\r\n Leaflet.prototype.alterPopupContent = function (popup, options, marker) {\r\n this.leafletPopups.alterPopupContent(popup, options, marker);\r\n };\r\n Leaflet.prototype.closePopup = function (popup) {\r\n this.leafletPopups.closePopup(popup);\r\n };\r\n /* Map */\r\n Leaflet.prototype.resizeMap = function () {\r\n this.leafletMap.resizeMap();\r\n };\r\n Leaflet.prototype.addEventMap = function (eventType, eventFunction) {\r\n this.leafletMap.addEventMap(eventType, eventFunction);\r\n };\r\n Leaflet.prototype.removeEventMap = function (eventType) {\r\n this.leafletMap.removeEventMap(eventType);\r\n };\r\n Leaflet.prototype.getZoom = function () {\r\n return this.leafletMap.getZoom();\r\n };\r\n Leaflet.prototype.setZoom = function (zoom) {\r\n this.leafletMap.setZoom(zoom);\r\n };\r\n Leaflet.prototype.getCenter = function () {\r\n return this.leafletMap.getCenter();\r\n };\r\n Leaflet.prototype.setCenter = function (position) {\r\n this.leafletMap.setCenter(position);\r\n };\r\n Leaflet.prototype.pixelsToLatLng = function (offsetx, offsety) {\r\n return this.leafletMap.pixelsToLatLng(offsetx, offsety);\r\n };\r\n Leaflet.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {\r\n this.leafletMap.fitBoundsElements(markers, circles, polygons, polylines);\r\n };\r\n /* Overlay */\r\n Leaflet.prototype.drawOverlay = function (options, polygons) {\r\n return this.leafletOverlays.drawOverlay(options, polygons);\r\n };\r\n Leaflet.prototype.toggleOverlay = function (overlays, show) {\r\n this.leafletOverlays.toggleOverlay(overlays, show);\r\n };\r\n /* Private Methods */\r\n Leaflet.prototype.mapTimeout = function (ms) {\r\n return new Promise(function (resolve) { return setTimeout(resolve, ms); });\r\n };\r\n Leaflet.prototype.loadDependencies = function (params) {\r\n var styles = params.cssDependencies;\r\n if (styles && styles.length > 0) {\r\n styles.forEach(function (path) {\r\n var link = document.createElement('link');\r\n link.rel = 'stylesheet';\r\n link.href = path;\r\n document.querySelector('head').appendChild(link);\r\n });\r\n }\r\n var scripts = params.scriptsDependencies;\r\n if (scripts && scripts.length > 0) {\r\n scripts.forEach(function (path) {\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = path;\r\n document.querySelector('head').appendChild(script);\r\n });\r\n }\r\n };\r\n return Leaflet;\r\n}());\r\nexports.default = Leaflet;\r\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletCircles = /** @class */ (function () {\r\n function LeafletCircles(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n LeafletCircles.prototype.drawCircle = function (options, eventClick) {\r\n var self = this;\r\n var newOptions = {\r\n color: options.color,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n opacity: options.opacity,\r\n radius: options.radius,\r\n weight: options.weight\r\n };\r\n var circle = new this.leaflet.Circle(options.center, newOptions);\r\n if (eventClick) {\r\n circle.on('click', function (event) {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n circle.addTo(self.map);\r\n if (options.editable) {\r\n circle.enableEdit();\r\n }\r\n }\r\n if (options.object) {\r\n circle.object = options.object;\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(circle.getBounds());\r\n }\r\n return circle;\r\n };\r\n LeafletCircles.prototype.toggleCircles = function (circles, show) {\r\n var self = this;\r\n circles.forEach(function (circle) { return show ? self.map.addLayer(circle) : self.map.removeLayer(circle); });\r\n };\r\n LeafletCircles.prototype.alterCircleOptions = function (circles, options) {\r\n circles.forEach(function (circle) {\r\n var style = {\r\n color: options.color ? options.color : circle.options.color,\r\n draggable: options.draggable ? options.draggable : circle.options.draggable,\r\n editable: options.editable ? options.editable : circle.options.editable,\r\n fillColor: options.fillColor ? options.fillColor : circle.options.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : circle.options.fillOpacity,\r\n opacity: options.opacity ? options.opacity : circle.options.opacity,\r\n weight: options.weight ? options.weight : circle.options.weight\r\n };\r\n circle.setStyle(style);\r\n if (options.radius) {\r\n circle.setRadius(options.radius);\r\n }\r\n if (options.center) {\r\n circle.setLatLng(options.center);\r\n }\r\n if (options.editable !== null && options.editable !== undefined) {\r\n if (options.editable) {\r\n circle.enableEdit();\r\n }\r\n else {\r\n circle.disableEdit();\r\n }\r\n }\r\n });\r\n };\r\n LeafletCircles.prototype.fitBoundsCircles = function (circles) {\r\n this.map.fitBounds(this.getBoundsCircles(circles));\r\n };\r\n LeafletCircles.prototype.isCircleOnMap = function (circle) {\r\n return this.map.hasLayer(circle);\r\n };\r\n LeafletCircles.prototype.getCircleCenter = function (circle) {\r\n var center = circle.getLatLng();\r\n return [center.lat, center.lng];\r\n };\r\n LeafletCircles.prototype.getCircleRadius = function (circle) {\r\n return circle.getRadius();\r\n };\r\n LeafletCircles.prototype.addCircleEvent = function (circles, eventType, eventFunction) {\r\n circles.forEach(function (circle) {\r\n switch (eventType) {\r\n case event_type_1.CircleEventType.Click:\r\n circle.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, circle.object);\r\n });\r\n case event_type_1.CircleEventType.CenterChanged:\r\n circle.on('dragend', function (event) {\r\n var param = new event_return_1.default([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, circle.object);\r\n });\r\n case event_type_1.CircleEventType.RadiusChanged:\r\n circle.on('editable:vertex:dragend', function (event) {\r\n var param = new event_return_1.default([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(param, circle.object, circle.getRadius());\r\n });\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletCircles.prototype.removeCircleEvent = function (circles, event) {\r\n circles.forEach(function (circle) {\r\n switch (event) {\r\n case event_type_1.CircleEventType.Click:\r\n circle.off('click');\r\n case event_type_1.CircleEventType.CenterChanged:\r\n circle.off('dragend');\r\n case event_type_1.CircleEventType.RadiusChanged:\r\n circle.off('editable:vertex:dragend');\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletCircles.prototype.getBoundsCircles = function (circles) {\r\n var group = new this.leaflet.FeatureGroup(circles);\r\n return group.getBounds();\r\n };\r\n return LeafletCircles;\r\n}());\r\nexports.default = LeafletCircles;\r\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletGeoJson = /** @class */ (function () {\r\n function LeafletGeoJson(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n LeafletGeoJson.prototype.loadGEOJson = function (data, options, eventClick) {\r\n var self = this;\r\n var objects = self.parseGeoJson(data, options);\r\n objects.forEach(function (elem) { return self.map.addLayer(elem); });\r\n if (self.map.options) {\r\n if (self.map.options.editable) {\r\n objects.forEach(function (obj) {\r\n if (obj.enableEdit) {\r\n obj.enableEdit();\r\n }\r\n if (eventClick) {\r\n obj.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param);\r\n });\r\n }\r\n });\r\n }\r\n }\r\n };\r\n LeafletGeoJson.prototype.parseGeoJson = function (data, options) {\r\n var self = this;\r\n var parsedFeatures = [];\r\n if (Array.isArray(data.features)) {\r\n for (var _i = 0, _a = data.features; _i < _a.length; _i++) {\r\n var feature = _a[_i];\r\n parsedFeatures.push(self.parseGeoJsonToObject(feature, options));\r\n }\r\n }\r\n else {\r\n parsedFeatures.push(self.parseGeoJsonToObject(data, options));\r\n }\r\n return parsedFeatures;\r\n };\r\n LeafletGeoJson.prototype.parseGeoJsonToObject = function (data, objectOptions) {\r\n var geometry = data.geometry;\r\n var parsedCoordinates = [];\r\n if (data.properties) {\r\n Object.assign(objectOptions, data.properties);\r\n }\r\n switch (geometry.type) {\r\n case 'Point':\r\n parsedCoordinates = geometry.coordinates.reverse();\r\n return new this.leaflet.Marker(parsedCoordinates, objectOptions);\r\n case 'Polygon':\r\n geometry.coordinates\r\n .forEach(function (polygon) { return parsedCoordinates.push(polygon.map(function (elem) { return elem.reverse(); })); });\r\n return new this.leaflet.Polygon(parsedCoordinates, objectOptions);\r\n case 'LineString':\r\n parsedCoordinates = geometry.coordinates.map(function (elem) { return elem.reverse(); });\r\n return new this.leaflet.Polyline(parsedCoordinates, objectOptions);\r\n default:\r\n throw new Error('Unknown object shape.');\r\n }\r\n };\r\n return LeafletGeoJson;\r\n}());\r\nexports.default = LeafletGeoJson;\r\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletMap = /** @class */ (function () {\r\n function LeafletMap(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n LeafletMap.prototype.resizeMap = function () {\r\n this.map.invalidateSize();\r\n };\r\n LeafletMap.prototype.addEventMap = function (eventType, eventFunction) {\r\n var self = this;\r\n switch (eventType) {\r\n case event_type_1.MapEventType.Click:\r\n self.map.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param);\r\n });\r\n break;\r\n case event_type_1.MapEventType.ZoomChanged:\r\n self.map.on('zoomend', function (event) {\r\n var param = new event_return_1.default([event.target.getCenter().lat, event.target.getCenter().lng]);\r\n eventFunction(param);\r\n });\r\n default:\r\n break;\r\n }\r\n };\r\n LeafletMap.prototype.removeEventMap = function (eventType) {\r\n var self = this;\r\n switch (eventType) {\r\n case event_type_1.MapEventType.Click:\r\n self.map.off('click');\r\n break;\r\n case event_type_1.MapEventType.ZoomChanged: self.map.off('zoomend');\r\n default: break;\r\n }\r\n };\r\n LeafletMap.prototype.getZoom = function () {\r\n return this.map.getZoom();\r\n };\r\n LeafletMap.prototype.setZoom = function (zoom) {\r\n this.map.setZoom(zoom);\r\n };\r\n LeafletMap.prototype.getCenter = function () {\r\n var center = this.map.getCenter();\r\n return [center.lat, center.lng];\r\n };\r\n LeafletMap.prototype.setCenter = function (position) {\r\n this.map.panTo(position);\r\n };\r\n LeafletMap.prototype.pixelsToLatLng = function (offsetx, offsety) {\r\n var scale = Math.pow(2, this.map.getZoom());\r\n var worldCoordinateCenter = this.leaflet.CRS.Simple.project(this.map.getCenter());\r\n var pixelOffset = new this.leaflet.Point(offsetx / scale || 0, offsety / scale || 0);\r\n var worldCoordinateNewCenter = new this.leaflet.Point(worldCoordinateCenter.x - pixelOffset.x, worldCoordinateCenter.y + pixelOffset.y);\r\n var latlng = this.leaflet.CRS.Simple.unproject(worldCoordinateNewCenter);\r\n return [latlng.lat, latlng.lng];\r\n };\r\n LeafletMap.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {\r\n var group = [];\r\n if (markers && markers.length) {\r\n markers.forEach(function (marker) { return group.push(marker); });\r\n }\r\n if (circles && circles.length) {\r\n circles.forEach(function (circle) { return group.push(circle); });\r\n }\r\n if (polygons && polygons.length) {\r\n polygons.forEach(function (polygon) { return group.push(polygon); });\r\n }\r\n if (polylines && polylines.length) {\r\n polylines.forEach(function (polyline) { return group.push(polyline); });\r\n }\r\n if (group && group.length) {\r\n var bounds = this.leaflet.featureGroup(group).getBounds();\r\n this.map.fitBounds(bounds);\r\n }\r\n };\r\n return LeafletMap;\r\n}());\r\nexports.default = LeafletMap;\r\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletMarkers = /** @class */ (function () {\r\n function LeafletMarkers(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n /* Markers */\r\n LeafletMarkers.prototype.drawMarker = function (options, eventClick) {\r\n var newOptions = {\r\n draggable: options.draggable\r\n };\r\n if (options.icon) {\r\n newOptions.icon = new this.leaflet.Icon({\r\n iconUrl: options.icon.url\r\n });\r\n var size = options.icon.size;\r\n if (size) {\r\n newOptions.icon.options.iconSize = size;\r\n newOptions.icon.options.iconAnchor = [size[0] / 2, size[1]];\r\n newOptions.icon.options.popupAnchor = [0, -size[1]];\r\n }\r\n }\r\n var marker = new this.leaflet.Marker(options.latlng, newOptions);\r\n if (options.object) {\r\n marker.object = options.object;\r\n }\r\n if (eventClick) {\r\n marker.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n if (options.addToMap && !options.addClusterer) {\r\n marker.addTo(this.map);\r\n }\r\n if (options.fitBounds) {\r\n var group = new this.leaflet.FeatureGroup([marker]);\r\n this.map.fitBounds(group.getBounds());\r\n }\r\n return marker;\r\n };\r\n LeafletMarkers.prototype.drawCircleMarker = function (options, eventClick) {\r\n var self = this;\r\n var marker = new this.leaflet.circleMarker(options.latlng, options.style);\r\n if (eventClick) {\r\n marker.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n marker.addTo(self.map);\r\n }\r\n if (options.fitBounds) {\r\n var group = new this.leaflet.FeatureGroup([marker]);\r\n self.map.fitBounds(group.getBounds());\r\n }\r\n marker.object = options.object;\r\n return marker;\r\n };\r\n LeafletMarkers.prototype.toggleMarkers = function (markers, show, markerClusterer) {\r\n var self = this;\r\n markers.forEach(function (marker) {\r\n if (markerClusterer) {\r\n if (show) {\r\n self.addMarkerOnClusterer(marker, markerClusterer);\r\n }\r\n else {\r\n self.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n }\r\n else {\r\n if (show) {\r\n self.map.addLayer(marker);\r\n }\r\n else {\r\n self.map.removeLayer(marker);\r\n }\r\n }\r\n });\r\n };\r\n LeafletMarkers.prototype.alterMarkerOptions = function (markers, options) {\r\n var _this = this;\r\n markers.forEach(function (marker) {\r\n if (marker.type === 'circle' && options.style) {\r\n var style = {\r\n fillColor: options.style.fillColor ? options.style.fillColor : marker.options.fillColor,\r\n fillOpacity: options.style.fillOpacity ? options.style.fillOpacity : marker.options.fillOpacity,\r\n radius: options.style.radius ? options.style.radius : marker.options.radius,\r\n strokeColor: options.style.color ? options.style.color : marker.options.strokeColor,\r\n strokeWeight: options.style.weight ? options.style.weight : marker.options.strokeWeight\r\n };\r\n marker.setStyle(style);\r\n }\r\n if (options.icon) {\r\n var icon = new _this.leaflet.icon({ iconUrl: options.icon.url });\r\n var size = options.icon.size;\r\n if (size) {\r\n icon.options.iconSize = size;\r\n icon.options.iconAnchor = [size[0] / 2, size[1]];\r\n }\r\n marker.setIcon(icon);\r\n }\r\n if (options.latlng) {\r\n marker.setLatLng(options.latlng);\r\n }\r\n });\r\n };\r\n LeafletMarkers.prototype.alterMarkerPosition = function (markers, position, addTransition) {\r\n var _this = this;\r\n markers.forEach(function (marker) {\r\n if (addTransition) {\r\n _this.moveTransitionMarker(position, marker);\r\n }\r\n else {\r\n marker.setLatLng(position);\r\n }\r\n });\r\n };\r\n LeafletMarkers.prototype.fitBoundsPositions = function (markers) {\r\n var group = new this.leaflet.featureGroup(markers);\r\n this.map.fitBounds(group.getBounds());\r\n };\r\n LeafletMarkers.prototype.isMarkerOnMap = function (marker) {\r\n return this.map.hasLayer(marker);\r\n };\r\n LeafletMarkers.prototype.setCenterMarker = function (marker) {\r\n this.map.panTo(marker.getLatLng());\r\n };\r\n LeafletMarkers.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {\r\n markers.forEach(function (marker) {\r\n switch (eventType) {\r\n case event_type_1.MarkerEventType.Click:\r\n marker.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.RightClick:\r\n marker.on('contextmenu', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.AfterDrag:\r\n marker.on('dragend', function (event) {\r\n var param = new event_return_1.default([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.MouseOver:\r\n marker.on('mouseover', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.MouseOut:\r\n marker.on('mouseout', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.BeforeDrag:\r\n marker.on('dragstart', function (event) {\r\n var param = new event_return_1.default([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletMarkers.prototype.removeMarkerEvent = function (markers, event) {\r\n markers.forEach(function (marker) {\r\n switch (event) {\r\n case event_type_1.MarkerEventType.Click:\r\n marker.off('click');\r\n break;\r\n case event_type_1.MarkerEventType.RightClick:\r\n marker.off('contextmenu');\r\n break;\r\n case event_type_1.MarkerEventType.AfterDrag:\r\n marker.off('dragend');\r\n break;\r\n case event_type_1.MarkerEventType.MouseOver:\r\n marker.off('mouseover');\r\n break;\r\n case event_type_1.MarkerEventType.MouseOut:\r\n marker.off('mouseout');\r\n break;\r\n case event_type_1.MarkerEventType.BeforeDrag:\r\n marker.off('dragstart');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n /* Marker Clusterer */\r\n LeafletMarkers.prototype.addMarkerClusterer = function (config) {\r\n var layer = this.leaflet.markerClusterGroup({\r\n maxClusterRadius: 50,\r\n showCoverageOnHover: false,\r\n zoomToBoundsOnClick: config.clusterZoomOnClick\r\n });\r\n this.map.addLayer(layer);\r\n return layer;\r\n };\r\n LeafletMarkers.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {\r\n markerClusterer.options.zoomToBoundsOnClick = config.clusterZoomOnClick;\r\n };\r\n LeafletMarkers.prototype.refreshClusterer = function (markerClusterer) {\r\n markerClusterer.refreshClusters();\r\n };\r\n LeafletMarkers.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {\r\n markerClusterer.addLayer(marker);\r\n };\r\n LeafletMarkers.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {\r\n markerClusterer.removeLayer(marker);\r\n };\r\n LeafletMarkers.prototype.clearMarkersClusterer = function (markerClusterer) {\r\n markerClusterer.clearLayers();\r\n };\r\n LeafletMarkers.prototype.countMarkersOnCluster = function (markerClusterer) {\r\n return markerClusterer.getLayers().length;\r\n };\r\n LeafletMarkers.prototype.moveTransitionMarker = function (position, marker) {\r\n var numDeltas = 5;\r\n var reference = {\r\n deltaLat: (position[0] - marker.getLatLng().lat) / numDeltas,\r\n deltaLng: (position[1] - marker.getLatLng().lng) / numDeltas,\r\n i: 0,\r\n position: [marker.getLatLng().lat, marker.getLatLng().lng],\r\n lastPosition: position\r\n };\r\n this.moveMarker(marker, reference, numDeltas);\r\n };\r\n LeafletMarkers.prototype.moveMarker = function (marker, reference, numDeltas) {\r\n var _this = this;\r\n reference.position[0] += reference.deltaLat;\r\n reference.position[1] += reference.deltaLng;\r\n marker.setLatLng(reference.position);\r\n if (reference.i < numDeltas) {\r\n reference.i++;\r\n setTimeout(function () { return _this.moveMarker(marker, reference, numDeltas); }, 20);\r\n }\r\n else if (reference.i === numDeltas) {\r\n setTimeout(function () { return marker.setLatLng(reference.lastPosition); }, 20);\r\n }\r\n };\r\n return LeafletMarkers;\r\n}());\r\nexports.default = LeafletMarkers;\r\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletOverlay = /** @class */ (function () {\r\n function LeafletOverlay(map, leaflet, leafletPolygons) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n this.leafletPolygons = leafletPolygons;\r\n }\r\n LeafletOverlay.prototype.drawOverlay = function (options, polygons) {\r\n var html = options.divElement.outerHTML;\r\n var myIcon = new this.leaflet.DivIcon({ html: html });\r\n var position = polygons && polygons.length > 0 ?\r\n this.leafletPolygons.getBoundsPolygons(polygons).getCenter() : options.position;\r\n var overlay = new this.leaflet.Marker(position, { icon: myIcon, draggable: options.draggable });\r\n if (options.addToMap) {\r\n overlay.addTo(this.map);\r\n }\r\n overlay.object = options.object;\r\n if (options.draggable && options.afterEventDragHandler) {\r\n overlay.on('dragend', function (event) {\r\n var param = new event_return_1.default([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n options.afterEventDragHandler(param, options.object);\r\n });\r\n }\r\n return overlay;\r\n };\r\n LeafletOverlay.prototype.toggleOverlay = function (overlays, show) {\r\n var self = this;\r\n overlays.forEach(function (overlay) { return show ? self.map.addLayer(overlay) : self.map.removeLayer(overlay); });\r\n };\r\n return LeafletOverlay;\r\n}());\r\nexports.default = LeafletOverlay;\r\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletPolygons = /** @class */ (function () {\r\n function LeafletPolygons(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n LeafletPolygons.prototype.drawPolygon = function (options, eventClick) {\r\n var self = this;\r\n var newOptions = {\r\n color: options.color || '#000',\r\n draggable: options.draggable,\r\n fillColor: options.fillColor || '#fff',\r\n fillOpacity: options.fillOpacity || 1,\r\n opacity: options.opacity || 1,\r\n weight: options.weight || 2\r\n };\r\n var polygon = new this.leaflet.Polygon(options.path, newOptions);\r\n if (eventClick) {\r\n polygon.on('click', function (event) {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n polygon.addTo(self.map);\r\n if (options.editable) {\r\n polygon.enableEdit();\r\n }\r\n }\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(polygon.getBounds());\r\n }\r\n return polygon;\r\n };\r\n LeafletPolygons.prototype.togglePolygons = function (polygons, show) {\r\n var self = this;\r\n polygons.forEach(function (polygon) { return show ? self.map.addLayer(polygon) : self.map.removeLayer(polygon); });\r\n };\r\n LeafletPolygons.prototype.alterPolygonOptions = function (polygons, options) {\r\n polygons.forEach(function (polygon) {\r\n var style = {\r\n color: options.color ? options.color : polygon.options.color,\r\n draggable: options.draggable ? options.draggable : polygon.options.draggable,\r\n fillColor: options.fillColor ? options.fillColor : polygon.options.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : polygon.options.fillOpacity,\r\n opacity: options.opacity ? options.opacity : polygon.options.opacity,\r\n weight: options.weight ? options.weight : polygon.options.weight\r\n };\r\n if (options.path) {\r\n polygon.setLatLngs(options.path);\r\n }\r\n polygon.setStyle(style);\r\n if (options.editable !== null && options.editable !== undefined) {\r\n polygon.disableEdit();\r\n if (options.editable) {\r\n polygon.enableEdit();\r\n }\r\n }\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n });\r\n };\r\n LeafletPolygons.prototype.fitBoundsPolygons = function (polygons) {\r\n this.map.fitBounds(this.getBoundsPolygons(polygons));\r\n };\r\n LeafletPolygons.prototype.setCenterPolygons = function (polygons) {\r\n this.map.panTo(this.getBoundsPolygons(polygons).getCenter());\r\n };\r\n LeafletPolygons.prototype.isPolygonOnMap = function (polygon) {\r\n return this.map.hasLayer(polygon);\r\n };\r\n LeafletPolygons.prototype.getPolygonPath = function (polygon) {\r\n return polygon.getLatLngs()[0].map(function (x) { return [x.lat, x.lng]; });\r\n };\r\n LeafletPolygons.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {\r\n var _this = this;\r\n var self = this;\r\n polygons.forEach(function (polygon) {\r\n switch (eventType) {\r\n case event_type_1.PolygonEventType.SetAt:\r\n _this.addPolygonEventMove(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.InsertAt:\r\n _this.addPolygonEventInsertAt(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.RemoveAt:\r\n _this.addPolygonEventRemoveAt(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.DragPolygon:\r\n _this.addPolygonEventDragPolygon(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.Click:\r\n _this.addPolygonEventClick(polygon, eventFunction, self);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletPolygons.prototype.removePolygonEvent = function (polygons, event) {\r\n polygons.forEach(function (polygon) {\r\n switch (event) {\r\n case event_type_1.PolygonEventType.SetAt:\r\n polygon.off('editable:vertex:dragstart');\r\n break;\r\n case event_type_1.PolygonEventType.InsertAt:\r\n polygon.off('editable:vertex:new');\r\n break;\r\n case event_type_1.PolygonEventType.RemoveAt:\r\n polygon.off('editable:vertex:clicked');\r\n polygon.off('editable:vertex:deleted');\r\n break;\r\n case event_type_1.PolygonEventType.DragPolygon:\r\n polygon.off('dragend');\r\n break;\r\n case event_type_1.PolygonEventType.Click:\r\n polygon.off('click');\r\n break;\r\n }\r\n });\r\n };\r\n LeafletPolygons.prototype.getBoundsPolygons = function (polygons) {\r\n var group = new this.leaflet.FeatureGroup(polygons);\r\n return group.getBounds();\r\n };\r\n LeafletPolygons.prototype.addPolygonEventMove = function (polygon, eventFunction) {\r\n polygon.on('editable:vertex:dragstart', function (eventStart) {\r\n var lastPosition = new event_return_1.default([eventStart.vertex.latlng.lat, eventStart.vertex.latlng.lng]);\r\n polygon.on('editable:vertex:dragend', function (eventEnd) {\r\n var newPosition = new event_return_1.default([eventEnd.vertex.latlng.lat, eventEnd.vertex.latlng.lng]);\r\n var path = polygon.getLatLngs().map(function (x) {\r\n if (Array.isArray(x[0])) {\r\n return x.map(function (y) { return y.map(function (z) { return new event_return_1.default([z.lat, z.lng]); }); });\r\n }\r\n else {\r\n return [x.map(function (y) { return new event_return_1.default([y.lat, y.lng]); })];\r\n }\r\n });\r\n eventFunction(newPosition, lastPosition, eventEnd.target.object, eventEnd.vertex.getIndex(), path[0]);\r\n polygon.off('editable:vertex:dragend');\r\n });\r\n });\r\n };\r\n LeafletPolygons.prototype.addPolygonEventInsertAt = function (polygon, eventFunction) {\r\n polygon.on('editable:vertex:new', function (eventNew) {\r\n var latlngs = eventNew.vertex.latlngs;\r\n var previous = latlngs[latlngs.findIndex(function (x) { return x === eventNew.vertex.latlng; }) - 1];\r\n if (previous) {\r\n var previousPoint_1 = new event_return_1.default([previous.lat, previous.lng]);\r\n polygon.on('editable:vertex:dragend', function (event) {\r\n var newPoint = new event_return_1.default([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n var path = polygon.getLatLngs().map(function (x) {\r\n if (Array.isArray(x[0])) {\r\n return x.map(function (y) { return y.map(function (z) { return new event_return_1.default([z.lat, z.lng]); }); });\r\n }\r\n else {\r\n return [x.map(function (y) { return new event_return_1.default([y.lat, y.lng]); })];\r\n }\r\n });\r\n eventFunction(newPoint, previousPoint_1, event.target.object, event.vertex.getIndex(), path[0]);\r\n polygon.off('editable:vertex:dragend');\r\n });\r\n }\r\n });\r\n };\r\n LeafletPolygons.prototype.addPolygonEventRemoveAt = function (polygon, eventFunction) {\r\n polygon.on('editable:vertex:deleted', function (event) {\r\n var param = new event_return_1.default([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n var path = polygon.getLatLngs().map(function (x) {\r\n if (Array.isArray(x[0])) {\r\n return x.map(function (y) { return y.map(function (z) { return new event_return_1.default([z.lat, z.lng]); }); });\r\n }\r\n else {\r\n return [x.map(function (y) { return new event_return_1.default([y.lat, y.lng]); })];\r\n }\r\n });\r\n eventFunction(param, path[0], event.target.object);\r\n });\r\n };\r\n LeafletPolygons.prototype.addPolygonEventDragPolygon = function (polygon, eventFunction) {\r\n polygon.on('dragend', function (event) {\r\n var path = polygon.getLatLngs().map(function (x) {\r\n if (Array.isArray(x[0])) {\r\n return x.map(function (y) { return y.map(function (z) { return new event_return_1.default([z.lat, z.lng]); }); });\r\n }\r\n else {\r\n return [x.map(function (y) { return new event_return_1.default([y.lat, y.lng]); })];\r\n }\r\n });\r\n eventFunction(path[0], event.target.object);\r\n });\r\n };\r\n LeafletPolygons.prototype.addPolygonEventClick = function (polygon, eventFunction, self) {\r\n polygon.on('click', function (event) {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, event.target.object);\r\n });\r\n };\r\n return LeafletPolygons;\r\n}());\r\nexports.default = LeafletPolygons;\r\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar polyline_type_1 = __webpack_require__(3);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletPolylines = /** @class */ (function () {\r\n function LeafletPolylines(map, leaflet, leafletPopup) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.selectedPolyline = null;\r\n this.selectedPath = null;\r\n this.navigateInfoWindow = null;\r\n this.directionForward = false;\r\n this.multiSelectionForward = false;\r\n this.multiSelection = false;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n this.leafletPopup = leafletPopup;\r\n }\r\n LeafletPolylines.prototype.drawPolyline = function (options, eventClick) {\r\n var self = this;\r\n var newOptions = {\r\n color: options.color || '#000000',\r\n dashArray: null,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n infowindows: options.infowindows,\r\n opacity: options.opacity || 1,\r\n weight: options.weight || 3,\r\n zIndex: options.zIndex\r\n };\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n newOptions.opacity = .7;\r\n newOptions.dashArray = '20,15';\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n var polyline = new this.leaflet.Polyline(options.path || [], newOptions);\r\n polyline.on('editable:vertex:rawclick', function (e) { return e.cancel(); });\r\n if (eventClick) {\r\n polyline.on('click', function (event) {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n polyline.on('editable:vertex:rawclick', function (event) {\r\n event.cancel();\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n if (options.style && options.style === polyline_type_1.PolylineType.Arrow) {\r\n var pathOptions = { fillOpacity: 1, weight: 0, color: polyline.options.color };\r\n polyline.decorator = self.leaflet.polylineDecorator(polyline, {\r\n patterns: [{\r\n offset: '20%',\r\n repeat: '90px',\r\n symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions })\r\n },\r\n { offset: '0%', symbol: self.leaflet.Symbol.arrowHead({ pathOptions: pathOptions, pixelSize: 20 }) },\r\n { offset: '100%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions }) }]\r\n });\r\n }\r\n if (options.addToMap) {\r\n polyline.addTo(self.map);\r\n if (polyline.decorator) {\r\n polyline.decorator.addTo(self.map);\r\n }\r\n if (options.editable) {\r\n polyline.enableEdit();\r\n }\r\n }\r\n if (options.object) {\r\n polyline.object = options.object;\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(polyline.getBounds());\r\n }\r\n return polyline;\r\n };\r\n LeafletPolylines.prototype.drawPolylineWithNavigation = function (options, eventClick) {\r\n var polyline = this.drawPolyline(options, null);\r\n polyline.navigationHandlerClick = eventClick;\r\n this.navigationOptions = options.navigateOptions;\r\n this.navigateByPoint = this.navigationOptions ? this.navigationOptions.navigateByPoint : true;\r\n this.addNavigation(polyline);\r\n return polyline;\r\n };\r\n LeafletPolylines.prototype.togglePolylines = function (polylines, show) {\r\n var self = this;\r\n polylines.forEach(function (polyline) {\r\n if (show) {\r\n self.map.addLayer(polyline);\r\n if (polyline.options.editable) {\r\n polyline.enableEdit();\r\n }\r\n if (polyline.decorator) {\r\n self.map.addLayer(polyline.decorator);\r\n }\r\n }\r\n else {\r\n self.map.removeLayer(polyline);\r\n if (polyline.options.editable) {\r\n polyline.disableEdit();\r\n }\r\n if (polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n }\r\n }\r\n });\r\n };\r\n LeafletPolylines.prototype.alterPolylineOptions = function (polylines, options) {\r\n var self = this;\r\n polylines.forEach(function (polyline) {\r\n var style = {\r\n color: options.color ? options.color : polyline.options.color,\r\n draggable: options.draggable ? options.draggable : polyline.options.draggable,\r\n opacity: options.opacity ? options.opacity : polyline.options.opacity,\r\n weight: options.weight ? options.weight : polyline.options.weight,\r\n zIndex: options.zIndex ? options.zIndex : polyline.options.zIndex\r\n };\r\n if (options.path) {\r\n polyline.setLatLngs(options.path);\r\n }\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n style.dashArray = '20,15';\r\n break;\r\n case polyline_type_1.PolylineType.Arrow:\r\n var pathOptions = { fillOpacity: 1, weight: 0, color: style.color };\r\n if (polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n }\r\n polyline.decorator = self.leaflet.polylineDecorator(polyline, {\r\n patterns: [{\r\n offset: '20%',\r\n repeat: '90px',\r\n symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions })\r\n },\r\n { offset: '0%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions }) },\r\n { offset: '100%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions }) }]\r\n });\r\n if (self.map.hasLayer(polyline)) {\r\n polyline.decorator.addTo(self.map);\r\n }\r\n break;\r\n default:\r\n if (polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n polyline.decorator = null;\r\n }\r\n break;\r\n }\r\n polyline.setStyle(style);\r\n if (options.object) {\r\n polyline.object = options.object;\r\n }\r\n if (options.editable) {\r\n polyline.disableEdit();\r\n polyline.enableEdit();\r\n }\r\n });\r\n };\r\n LeafletPolylines.prototype.fitBoundsPolylines = function (polylines) {\r\n var self = this;\r\n self.map.fitBounds(self.getBoundsPolylines(polylines));\r\n };\r\n LeafletPolylines.prototype.isPolylineOnMap = function (polyline) {\r\n return this.map.hasLayer(polyline);\r\n };\r\n LeafletPolylines.prototype.addPolylinePath = function (polylines, position) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) {\r\n var path = polyline.getLatLngs();\r\n path.push(new _this.leaflet.LatLng(position[0], position[1]));\r\n polyline.setLatLngs(path);\r\n if (polyline.editEnabled && polyline.editEnabled()) {\r\n polyline.disableEdit();\r\n polyline.enableEdit();\r\n }\r\n });\r\n };\r\n LeafletPolylines.prototype.getPolylinePath = function (polyline) {\r\n return polyline.getLatLngs().map(function (x) { return [x.lat, x.lng]; });\r\n };\r\n LeafletPolylines.prototype.removePolylineHighlight = function () {\r\n var self = this;\r\n if (self.selectedPath) {\r\n if (this.selectedPath.decorator) {\r\n this.map.removeLayer(this.selectedPath.decorator);\r\n }\r\n this.map.removeLayer(self.selectedPath);\r\n self.selectedPath = null;\r\n }\r\n if (self.navigateInfoWindow) {\r\n self.navigateInfoWindow.remove();\r\n }\r\n document.onkeyup = null;\r\n document.onkeydown = null;\r\n };\r\n LeafletPolylines.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) {\r\n switch (eventType) {\r\n case event_type_1.PolylineEventType.SetAt:\r\n _this.addPolylineEventMove(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.InsertAt:\r\n _this.addPolylineEventInsertAt(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.RemoveAt:\r\n _this.addPolylineEventRemoveAt(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.DragPolyline:\r\n _this.addPolylineEventDragPolyline(polyline, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletPolylines.prototype.removePolylineEvent = function (polylines, event) {\r\n polylines.forEach(function (polyline) {\r\n switch (event) {\r\n case event_type_1.PolylineEventType.SetAt:\r\n polyline.off('editable:vertex:dragstart');\r\n break;\r\n case event_type_1.PolylineEventType.InsertAt:\r\n polyline.off('editable:vertex:new');\r\n break;\r\n case event_type_1.PolylineEventType.RemoveAt:\r\n polyline.off('editable:vertex:deleted');\r\n break;\r\n case event_type_1.PolylineEventType.DragPolyline:\r\n polyline.off('dragend');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletPolylines.prototype.setIndexPolylineHighlight = function (polyline, index) {\r\n this.directionForward = false;\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n document.onkeydown = this.onKeyUp.bind(this);\r\n }\r\n else {\r\n document.onkeyup = this.onKeyUp.bind(this);\r\n }\r\n };\r\n LeafletPolylines.prototype.getObjectPolyline = function (polyline) {\r\n return polyline.object;\r\n };\r\n LeafletPolylines.prototype.getObjectPolylineHighlight = function () {\r\n if (this.selectedPath) {\r\n return this.selectedPath.object;\r\n }\r\n return null;\r\n };\r\n LeafletPolylines.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {\r\n if (this.selectedPolyline) {\r\n this.addPolylineEvent([this.selectedPath], eventType, eventFunction);\r\n }\r\n };\r\n LeafletPolylines.prototype.getPolylineHighlightIndex = function () {\r\n if (this.selectedPath) {\r\n return [this.selectedPath.initialIdx, this.selectedPath.finalIdx];\r\n }\r\n return null;\r\n };\r\n /* Private methods */\r\n LeafletPolylines.prototype.addNavigation = function (polyline) {\r\n polyline.clearAllEventListeners();\r\n polyline.on('click', this.onClickPolyline.bind(this, polyline));\r\n };\r\n LeafletPolylines.prototype.onClickPolyline = function (polyline, event) {\r\n var index = this.checkIdx(polyline, event.latlng);\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n document.onkeydown = this.onKeyUp.bind(this);\r\n }\r\n else {\r\n document.onkeyup = this.onKeyUp.bind(this);\r\n }\r\n if (polyline.navigationHandlerClick) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n polyline.navigationHandlerClick(param, event.target.object);\r\n }\r\n };\r\n LeafletPolylines.prototype.onKeyUp = function (event) {\r\n var self = this;\r\n if (self.selectedPath) {\r\n if (event.ctrlKey) {\r\n console.warn('Deprecated: CTRL is not needed in navigation anymore');\r\n }\r\n switch (event.which ? event.which : event.keyCode) {\r\n case 38:\r\n case 39:\r\n // up arrow or right arrow\r\n self.moveFowards(event.shiftKey);\r\n break;\r\n case 37:\r\n case 40:\r\n // left arrow or down arrow\r\n self.moveBackwards(event.shiftKey);\r\n break;\r\n }\r\n }\r\n };\r\n LeafletPolylines.prototype.moveFowards = function (multiselection) {\r\n var polyline = this.selectedPolyline;\r\n if ((!this.navigateByPoint || this.directionForward) && polyline.finalIdx < polyline.getLatLngs().length - 1) {\r\n this.navigateFoward(multiselection, polyline);\r\n }\r\n this.directionForward = true;\r\n this.moveSelectedPath(polyline, null);\r\n };\r\n LeafletPolylines.prototype.navigateFoward = function (multiSelection, polyline) {\r\n if (!multiSelection) {\r\n polyline.finalIdx++;\r\n polyline.initialIdx = this.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n this.multiSelection = false;\r\n }\r\n else {\r\n this.multiSelection = true;\r\n if (this.multiSelectionForward) {\r\n polyline.finalIdx++;\r\n }\r\n this.multiSelectionForward = true;\r\n }\r\n };\r\n LeafletPolylines.prototype.moveBackwards = function (multiSelection) {\r\n var polyline = this.selectedPolyline;\r\n if ((!this.navigateByPoint || !this.directionForward) && polyline.initialIdx > 0) {\r\n this.navigateBackward(multiSelection, polyline);\r\n }\r\n this.directionForward = false;\r\n this.moveSelectedPath(polyline, null);\r\n };\r\n LeafletPolylines.prototype.navigateBackward = function (multiSelection, polyline) {\r\n var self = this;\r\n if (!multiSelection) {\r\n polyline.initialIdx--;\r\n polyline.finalIdx = !self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n }\r\n else {\r\n self.multiSelection = true;\r\n if (!self.multiSelectionForward) {\r\n polyline.initialIdx--;\r\n }\r\n self.multiSelectionForward = false;\r\n }\r\n };\r\n LeafletPolylines.prototype.moveSelectedPath = function (polyline, options) {\r\n var self = this;\r\n var pathSelected = polyline.getLatLngs().map(function (x) { return [x.lat, x.lng]; })\r\n .slice(polyline.initialIdx, polyline.finalIdx + 1);\r\n if (self.selectedPath) {\r\n self.selectedPath.setLatLngs(pathSelected);\r\n this.selectedPath.object = polyline.object;\r\n }\r\n else {\r\n this.addNewSelectedPath(pathSelected, options, polyline.object);\r\n this.selectedPath.addTo(this.map);\r\n }\r\n if (this.selectedPath.decorator) {\r\n this.map.removeLayer(this.selectedPath.decorator);\r\n this.setArrowSelectedPath();\r\n }\r\n if ((options && options.editable) ||\r\n (this.selectedPath.editEnabled && this.selectedPath.editEnabled())) {\r\n this.selectedPath.disableEdit();\r\n this.selectedPath.enableEdit();\r\n }\r\n this.selectedPath.initialIdx = polyline.initialIdx;\r\n this.selectedPath.finalIdx = polyline.finalIdx;\r\n var idx = self.directionForward ? polyline.finalIdx : polyline.initialIdx;\r\n if (!this.navigateByPoint) {\r\n idx = polyline.finalIdx > polyline.initialIdx ? polyline.finalIdx : polyline.initialIdx;\r\n }\r\n var infowindow = polyline.options.infowindows ? polyline.options.infowindows[idx] : null;\r\n if (infowindow) {\r\n var point = polyline.getLatLngs()[idx];\r\n if (self.navigateInfoWindow) {\r\n self.leafletPopup.alterPopup(self.navigateInfoWindow, {\r\n content: infowindow,\r\n latlng: [point.lat, point.lng]\r\n });\r\n }\r\n else {\r\n self.navigateInfoWindow = self.leafletPopup.drawPopup({\r\n content: infowindow,\r\n latlng: [point.lat, point.lng]\r\n });\r\n }\r\n }\r\n };\r\n LeafletPolylines.prototype.setArrowSelectedPath = function () {\r\n var pathOptions = { fillOpacity: 1, weight: 0, color: this.selectedPath.options.color };\r\n this.selectedPath.decorator = this.leaflet.polylineDecorator(this.selectedPath, {\r\n patterns: [{ offset: '100%', symbol: this.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions }) }]\r\n });\r\n this.selectedPath.decorator.addTo(this.map);\r\n };\r\n LeafletPolylines.prototype.addNewSelectedPath = function (pathSelected, options, object) {\r\n var newOptions = {\r\n color: options && options.color || '#FF0000',\r\n draggable: false,\r\n editable: options.editable,\r\n opacity: options && options.opacity || 1,\r\n weight: options && options.weight || 10,\r\n zIndex: 9999\r\n };\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n newOptions.opacity = .7;\r\n newOptions.dashArray = '20,15';\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n this.selectedPath = new this.leaflet.Polyline(pathSelected, newOptions);\r\n this.selectedPath.on('editable:vertex:rawclick', function (e) { return e.cancel(); });\r\n if (options.style && options.style === polyline_type_1.PolylineType.Arrow) {\r\n this.setArrowSelectedPath();\r\n }\r\n this.selectedPath.object = object;\r\n this.selectedPath.highlight = true;\r\n };\r\n LeafletPolylines.prototype.checkIdx = function (polyline, point) {\r\n var self = this;\r\n var path = polyline.getLatLngs();\r\n var distance = 0;\r\n var minDistance = Number.MAX_VALUE;\r\n var returnValue = -1;\r\n for (var i = 0; i < path.length - 1; i++) {\r\n distance = self.distanceToLine(path[i], path[i + 1], point);\r\n if (distance < minDistance) {\r\n minDistance = distance;\r\n returnValue = i;\r\n }\r\n }\r\n return returnValue;\r\n };\r\n LeafletPolylines.prototype.distanceToLine = function (pt1, pt2, pt) {\r\n var self = this;\r\n var deltaX = pt2.lng - pt1.lng;\r\n var deltaY = pt2.lat - pt1.lat;\r\n var incIntersect = (pt.lng - pt1.lng) * deltaX;\r\n var deltaSum = (deltaX * deltaX) + (deltaY * deltaY);\r\n incIntersect += (pt.lat - pt1.lat) * deltaY;\r\n if (deltaSum > 0) {\r\n incIntersect /= deltaSum;\r\n }\r\n else {\r\n incIntersect = -1;\r\n }\r\n // The intersection occurs outside the line segment, 'before' pt1.\r\n if (incIntersect < 0) {\r\n return self.kmTo(pt, pt1);\r\n }\r\n else if (incIntersect > 1) {\r\n return self.kmTo(pt, pt2);\r\n }\r\n // Intersection point calculation.\r\n var intersect = new this.leaflet.LatLng(pt1.lat + incIntersect * deltaY, pt1.lng + incIntersect * deltaX);\r\n return self.kmTo(pt, intersect);\r\n };\r\n LeafletPolylines.prototype.kmTo = function (pt1, pt2) {\r\n var e = Math;\r\n var ra = e.PI / 180;\r\n var b = pt1.lat * ra;\r\n var c = pt2.lat * ra;\r\n var d = b - c;\r\n var g = pt1.lng * ra - pt2.lng * ra;\r\n var f = 2 * e.asin(e.sqrt(e.pow(e.sin(d / 2), 2) + e.cos(b) * e.cos(c) * e.pow(e.sin(g / 2), 2)));\r\n return f * 6378.137 * 1000;\r\n };\r\n LeafletPolylines.prototype.getBoundsPolylines = function (polylines) {\r\n var group = new this.leaflet.FeatureGroup(polylines);\r\n return group.getBounds();\r\n };\r\n LeafletPolylines.prototype.addPolylineEventMove = function (polyline, eventFunction) {\r\n var self = this;\r\n polyline.on('editable:vertex:dragstart', function (eventStart) {\r\n var lastPosition = new event_return_1.default([eventStart.vertex.latlng.lat, eventStart.vertex.latlng.lng]);\r\n polyline.on('editable:vertex:dragend', function (eventEnd) {\r\n if (polyline.highlight && polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n self.setArrowSelectedPath();\r\n }\r\n var newPosition = new event_return_1.default([eventEnd.vertex.latlng.lat, eventEnd.vertex.latlng.lng]);\r\n eventFunction(newPosition, lastPosition, eventEnd.target.object, eventEnd.vertex.getIndex(), polyline.getLatLngs().map(function (x) { return new event_return_1.default([x.lat, x.lng]); }));\r\n polyline.off('editable:vertex:dragend');\r\n });\r\n });\r\n };\r\n LeafletPolylines.prototype.addPolylineEventInsertAt = function (polyline, eventFunction) {\r\n var self = this;\r\n polyline.on('editable:vertex:new', function (eventNew) {\r\n var latlngs = eventNew.vertex.latlngs;\r\n var previous = latlngs[latlngs.findIndex(function (x) { return x === eventNew.vertex.latlng; }) - 1];\r\n var previousPoint = new event_return_1.default([previous.lat, previous.lng]);\r\n polyline.on('editable:vertex:dragend', function (event) {\r\n if (polyline.highlight && polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n self.setArrowSelectedPath();\r\n }\r\n var newPoint = new event_return_1.default([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(newPoint, previousPoint, event.target.object, event.vertex.getIndex(), polyline.getLatLngs().map(function (x) { return new event_return_1.default([x.lat, x.lng]); }));\r\n polyline.off('editable:vertex:dragend');\r\n });\r\n });\r\n };\r\n LeafletPolylines.prototype.addPolylineEventRemoveAt = function (polyline, eventFunction) {\r\n polyline.on('editable:vertex:deleted', function (event) {\r\n var param = new event_return_1.default([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(param, event.target.object, polyline.getLatLngs().map(function (x) { return new event_return_1.default([x.lat, x.lng]); }));\r\n });\r\n };\r\n LeafletPolylines.prototype.addPolylineEventDragPolyline = function (polyline, eventFunction) {\r\n polyline.on('dragend', function (event) {\r\n var param = event.target.getLatLngs().map(function (x) { return new event_return_1.default([x.lat, x.lng]); });\r\n eventFunction(param, event.target.object);\r\n });\r\n };\r\n return LeafletPolylines;\r\n}());\r\nexports.default = LeafletPolylines;\r\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar LeafletPopup = /** @class */ (function () {\r\n function LeafletPopup(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n LeafletPopup.prototype.drawPopup = function (options, marker) {\r\n var self = this;\r\n var popup = null;\r\n if (!marker) {\r\n popup = new this.leaflet.Popup();\r\n popup.setLatLng(options.latlng);\r\n popup.setContent(options.content);\r\n popup.openOn(self.map);\r\n }\r\n else {\r\n popup = self.drawPopupOnMarker(marker, options);\r\n }\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n return popup;\r\n };\r\n LeafletPopup.prototype.alterPopup = function (popup, options, marker) {\r\n var self = this;\r\n if (marker && !marker.getPopup()) {\r\n popup = self.drawPopup(options, marker);\r\n }\r\n else {\r\n self.alterPopupContent(popup, options, marker);\r\n if (!popup.isOpen()) {\r\n if (!marker) {\r\n popup.openOn(self.map);\r\n }\r\n else if (options.notCalledByMap) {\r\n marker.openPopup();\r\n }\r\n }\r\n }\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n return popup;\r\n };\r\n LeafletPopup.prototype.alterPopupContent = function (popup, options, marker) {\r\n if (marker) {\r\n popup = marker._popup;\r\n }\r\n if (popup) {\r\n if (options.content) {\r\n popup.setContent(options.content);\r\n }\r\n if (options.latlng) {\r\n popup.setLatLng(options.latlng);\r\n }\r\n }\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n };\r\n LeafletPopup.prototype.closePopup = function (popup) {\r\n popup.remove();\r\n };\r\n LeafletPopup.prototype.drawPopupOnMarker = function (marker, options) {\r\n marker.bindPopup(options.content);\r\n var popup = marker.getPopup();\r\n marker.openPopup();\r\n return popup;\r\n };\r\n return LeafletPopup;\r\n}());\r\nexports.default = LeafletPopup;\r\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar CircleAlterOptions = /** @class */ (function () {\r\n function CircleAlterOptions(center, radius, weight, fillOpacity, fillColor, color, opacity) {\r\n this.center = center;\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.fillOpacity = fillOpacity;\r\n this.fillColor = fillColor;\r\n this.color = color;\r\n this.opacity = opacity;\r\n }\r\n return CircleAlterOptions;\r\n}());\r\nexports.default = CircleAlterOptions;\r\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar CircleOptions = /** @class */ (function () {\r\n function CircleOptions(center, radius, weight, addToMap, fillOpacity, fillColor, color, opacity, draggable, editable, fitBounds, object) {\r\n this.center = center;\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.addToMap = addToMap;\r\n this.fillOpacity = fillOpacity;\r\n this.fillColor = fillColor;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n return CircleOptions;\r\n}());\r\nexports.default = CircleOptions;\r\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar GeoJsonOptions = /** @class */ (function () {\r\n function GeoJsonOptions(draggable, editable) {\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n }\r\n return GeoJsonOptions;\r\n}());\r\nexports.default = GeoJsonOptions;\r\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar CircleMarkerOptions = /** @class */ (function () {\r\n function CircleMarkerOptions(latlng, style, addToMap, fitBounds, object) {\r\n this.latlng = latlng;\r\n this.addToMap = addToMap;\r\n this.style = style;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n return CircleMarkerOptions;\r\n}());\r\nexports.default = CircleMarkerOptions;\r\n\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar CircleMarkerStyle = /** @class */ (function () {\r\n function CircleMarkerStyle(radius, weight, color, fillColor, fillOpacity) {\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.color = color;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n }\r\n return CircleMarkerStyle;\r\n}());\r\nexports.default = CircleMarkerStyle;\r\n\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MarkerAlterOptions = /** @class */ (function () {\r\n function MarkerAlterOptions(latlng, icon, style) {\r\n this.latlng = latlng;\r\n this.icon = icon;\r\n this.style = style;\r\n }\r\n return MarkerAlterOptions;\r\n}());\r\nexports.default = MarkerAlterOptions;\r\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MarkerIcon = /** @class */ (function () {\r\n function MarkerIcon(url, size) {\r\n this.url = url;\r\n this.size = size;\r\n }\r\n return MarkerIcon;\r\n}());\r\nexports.default = MarkerIcon;\r\n\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MarkerOptions = /** @class */ (function () {\r\n function MarkerOptions(latlng, addToMap, draggable, icon, fitBounds, object, addClusterer) {\r\n if (addToMap === void 0) { addToMap = false; }\r\n if (draggable === void 0) { draggable = false; }\r\n if (fitBounds === void 0) { fitBounds = false; }\r\n if (addClusterer === void 0) { addClusterer = false; }\r\n this.latlng = latlng;\r\n this.addToMap = addToMap;\r\n this.draggable = draggable;\r\n this.icon = icon;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n this.addClusterer = addClusterer;\r\n }\r\n return MarkerOptions;\r\n}());\r\nexports.default = MarkerOptions;\r\n\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar OverlayOptions = /** @class */ (function () {\r\n function OverlayOptions(divElement, addToMap, position, object, polygon, conditionPolygon, draggable) {\r\n if (draggable === void 0) { draggable = false; }\r\n this.position = position;\r\n this.divElement = divElement;\r\n this.addToMap = addToMap;\r\n this.object = object;\r\n this.polygon = polygon;\r\n this.conditionPolygon = conditionPolygon;\r\n this.draggable = draggable;\r\n }\r\n return OverlayOptions;\r\n}());\r\nexports.default = OverlayOptions;\r\n\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PolygonAlterOptions = /** @class */ (function () {\r\n function PolygonAlterOptions(addToMap, color, opacity, fillColor, fillOpacity, weight) {\r\n this.addToMap = addToMap;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n this.weight = weight;\r\n }\r\n return PolygonAlterOptions;\r\n}());\r\nexports.default = PolygonAlterOptions;\r\n\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PolygonOptions = /** @class */ (function () {\r\n function PolygonOptions(path, weight, addToMap, color, opacity, fillColor, fillOpacity, draggable, editable, fitBounds, object) {\r\n this.path = path;\r\n this.weight = weight;\r\n this.addToMap = addToMap;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n return PolygonOptions;\r\n}());\r\nexports.default = PolygonOptions;\r\n\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar NavigationOptions = /** @class */ (function () {\r\n function NavigationOptions(color, weight, navigateByPoint, opacity) {\r\n if (navigateByPoint === void 0) { navigateByPoint = true; }\r\n if (opacity === void 0) { opacity = 1; }\r\n this.color = color;\r\n this.weight = weight;\r\n this.opacity = opacity;\r\n this.navigateByPoint = navigateByPoint;\r\n this.navegateOnKeyPress = false;\r\n }\r\n return NavigationOptions;\r\n}());\r\nexports.default = NavigationOptions;\r\n\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PopupOptions = /** @class */ (function () {\r\n function PopupOptions(latlng, content, marker, conditionMarker, notCalledByMap, object) {\r\n this.latlng = latlng;\r\n this.content = content;\r\n this.marker = marker;\r\n this.conditionMarker = conditionMarker;\r\n this.notCalledByMap = notCalledByMap;\r\n this.object = object;\r\n }\r\n return PopupOptions;\r\n}());\r\nexports.default = PopupOptions;\r\n\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/**\r\n * urlBuilder\r\n *\r\n * @param {object} params\r\n * @param {string} params.base the base url\r\n * @param {array} params.libraries an array of the libraries to be requested\r\n * @param {string} params.callback the callback function\r\n *\r\n * @return {string}\r\n */\r\nexports.urlBuilder = function (params) {\r\n var builtUrl = params.base;\r\n builtUrl += '?';\r\n if (params.apiKey) {\r\n builtUrl += 'key=' + params.apiKey + '&';\r\n }\r\n if (params.integrity) {\r\n builtUrl += 'integrity=' + params.integrity + '&';\r\n }\r\n if (params.client) {\r\n builtUrl += 'client=' + params.client + '&';\r\n }\r\n if (params.crossorigin) {\r\n builtUrl += 'crossorigin=' + params.crossorigin + '&';\r\n }\r\n if (params.libraries && params.libraries.length > 0) {\r\n builtUrl += 'libraries=';\r\n params.libraries.forEach(function (library, index) {\r\n builtUrl += library;\r\n if (index !== params.libraries.length - 1) {\r\n builtUrl += ',';\r\n }\r\n });\r\n builtUrl += '&';\r\n }\r\n if (params.language) {\r\n builtUrl += 'language=' + params.language + '&';\r\n }\r\n if (params.callback) {\r\n builtUrl += 'callback=' + params.callback + '&';\r\n }\r\n return builtUrl;\r\n};\r\n\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(7);\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// inlog-maps.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 42);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0c2e20ad3d0369e38b07","export default class EventReturn {\r\n public latlng: number[];\r\n\r\n constructor(latlng: number[]) {\r\n this.latlng = latlng;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/events/event-return.ts","export enum MapEventType {\r\n Click,\r\n ZoomChanged\r\n}\r\n\r\nexport enum MarkerEventType {\r\n Click,\r\n RightClick,\r\n AfterDrag,\r\n MouseOver,\r\n MouseOut,\r\n BeforeDrag\r\n}\r\n\r\nexport enum CircleEventType {\r\n Click,\r\n CenterChanged,\r\n RadiusChanged\r\n}\r\n\r\nexport enum PolygonEventType {\r\n SetAt,\r\n InsertAt,\r\n RemoveAt,\r\n DragPolygon,\r\n Click\r\n}\r\n\r\nexport enum PolylineEventType {\r\n SetAt,\r\n InsertAt,\r\n RemoveAt,\r\n DragPolyline\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/dto/event-type.ts","export enum MapType {\r\n Google,\r\n Leaflet\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/dto/map-type.ts","export enum PolylineType {\r\n Dashed,\r\n Dotted,\r\n Arrow\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/dto/polyline-type.ts","export default class MarkerClustererConfig {\r\n public clusterZoomOnClick: boolean;\r\n public clusterMinSize: number;\r\n public clusterMaxZoom: number;\r\n\r\n constructor(clusterZoomOnClick: boolean, clusterMinSize: number, clusterMaxZoom: number) {\r\n this.clusterZoomOnClick = clusterZoomOnClick;\r\n this.clusterMinSize = clusterMinSize;\r\n this.clusterMaxZoom = clusterMaxZoom;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker-clusterer/marker-clusterer-config.ts","import NavigationOptions from './navigations-options';\r\nimport { PolylineType } from '../../dto/polyline-type';\r\n\r\nexport default class PolylineOptions {\r\n public path: number[][];\r\n public addToMap?: boolean;\r\n public fitBounds?: boolean;\r\n public editable?: boolean;\r\n public draggable?: boolean;\r\n public color?: string;\r\n public weight: number;\r\n public object?: object;\r\n public infowindows?: string[];\r\n public style?: PolylineType;\r\n public navigateOptions?: NavigationOptions;\r\n public opacity: number;\r\n public zIndex: number;\r\n\r\n constructor(path?: number[][], addToMap?: boolean, fitBounds?: boolean,\r\n editable?: boolean, draggable?: boolean, color?: string, weight?: number,\r\n object?: object, infowindows?: string[], navigateOptions?: NavigationOptions, style?: PolylineType,\r\n opacity?: number, zIndex?: number) {\r\n\r\n this.path = path;\r\n this.addToMap = addToMap;\r\n this.fitBounds = fitBounds;\r\n this.editable = editable;\r\n this.draggable = draggable;\r\n this.color = color;\r\n this.weight = weight;\r\n this.object = object;\r\n this.infowindows = infowindows;\r\n this.navigateOptions = navigateOptions;\r\n this.style = style;\r\n this.opacity = opacity;\r\n this.zIndex = zIndex;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/polyline/polyline-options.ts","import { MapType } from '../models/dto/map-type';\r\nimport { urlBuilder } from './url-builder';\r\n\r\nexport class MapsApiLoaderService {\r\n public static loadGoogleAPI(params) {\r\n const script = document.createElement('script');\r\n\r\n script.type = 'text/javascript';\r\n script.setAttribute('data-google-inlogmaps', 'true');\r\n\r\n script.src = urlBuilder({\r\n apiKey: params.apiKey,\r\n base: 'https://maps.googleapis.com/maps/api/js',\r\n callback: 'mapsAPILoadCallback',\r\n client: params.client,\r\n language: params.language,\r\n libraries: params.libraries || []\r\n });\r\n\r\n var has_script = document.querySelector('script').hasAttribute('data-google-inlogmaps');\r\n\r\n if (!has_script) document.querySelector('head').appendChild(script);\r\n }\r\n\r\n public static loadLeafletAPI(params) {\r\n const link = document.createElement('link');\r\n link.rel = 'stylesheet';\r\n link.href = 'https://desenvolvimentoweb.blob.core.windows.net/inlog-leaflet/leaflet.css';\r\n // link.integrity = params.cssIntegrity;\r\n // link.setAttribute('crossorigin', params.crossorigin);\r\n\r\n document.querySelector('head').appendChild(link);\r\n\r\n const script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n\r\n script.src = urlBuilder({\r\n base: 'https://desenvolvimentoweb.blob.core.windows.net/inlog-leaflet/leaflet.js',\r\n callback: 'mapsAPILoadCallback',\r\n // crossorigin: params.crossorigin,\r\n // integrity: params.integrity\r\n });\r\n\r\n document.querySelector('head').appendChild(script);\r\n }\r\n\r\n private static windowRef = null;\r\n private static mapsApi = null;\r\n\r\n constructor() { /* */ }\r\n\r\n // TODO: needs refactoring\r\n public loadApi(mapType: MapType, params) {\r\n if (MapsApiLoaderService.mapsApi) {\r\n return Promise.resolve(MapsApiLoaderService.mapsApi);\r\n }\r\n\r\n MapsApiLoaderService.windowRef = window ? window : { api: null, mapsAPILoadCallback: null };\r\n\r\n const deferred = (resolve, reject) => {\r\n if (mapType === MapType.Google) {\r\n MapsApiLoaderService.loadGoogleAPI(params);\r\n } else {\r\n MapsApiLoaderService.loadLeafletAPI(params);\r\n }\r\n\r\n // Temporaria para testar Leaflet\r\n if (mapType === MapType.Leaflet) {\r\n setTimeout(() => {\r\n MapsApiLoaderService.mapsApi = MapsApiLoaderService.windowRef.L;\r\n resolve(MapsApiLoaderService.mapsApi);\r\n }, 2000);\r\n } else {\r\n MapsApiLoaderService.windowRef.mapsAPILoadCallback = () => {\r\n MapsApiLoaderService.mapsApi = MapsApiLoaderService.windowRef.google;\r\n resolve(MapsApiLoaderService.mapsApi);\r\n };\r\n }\r\n\r\n setTimeout(() => {\r\n if (!MapsApiLoaderService.windowRef.api) {\r\n reject(new Error('Loading took too long'));\r\n }\r\n }, 5000);\r\n };\r\n\r\n return new Promise(deferred);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/maps-api-loader.service.ts","'use strict';\r\n\r\nimport Map from './map';\r\nimport IMapFunctions from './models/apis/mapFunctions';\r\nimport CircleAlterOptions from './models/features/circle/circle-alter-options';\r\nimport CircleOptions from './models/features/circle/circle-options';\r\nimport EventReturn from './models/features/events/event-return';\r\nimport GeoJsonOptions from './models/features/geojson/geojson-options';\r\nimport CircleMarkerOptions from './models/features/marker/circle-marker-options';\r\nimport CircleMarkerStyle from './models/features/marker/circle-marker-style';\r\nimport MarkerAlterOptions from './models/features/marker/marker-alter-options';\r\nimport MarkerIcon from './models/features/marker/marker-icon';\r\nimport MarkerOptions from './models/features/marker/marker-options';\r\nimport OverlayOptions from './models/features/overlay/overlay-options';\r\nimport PolygonAlterOptions from './models/features/polygons/polygon-alter-options';\r\nimport PolygonOptions from './models/features/polygons/polygon-options';\r\nimport NavigationOptions from './models/features/polyline/navigations-options';\r\nimport PolylineOptions from './models/features/polyline/polyline-options';\r\nimport PopupOptions from './models/features/popup/popup-options';\r\nimport MarkerClustererConfig from './models/features/marker-clusterer/marker-clusterer-config';\r\nimport { MarkerEventType, CircleEventType, PolygonEventType, PolylineEventType, MapEventType } from './models/dto/event-type';\r\nimport { MapType } from './models/dto/map-type';\r\nimport { PolylineType } from './models/dto/polyline-type';\r\n\r\nexport { Map };\r\nexport { MarkerOptions };\r\nexport { MarkerIcon };\r\nexport { EventReturn };\r\nexport { CircleMarkerOptions };\r\nexport { CircleMarkerStyle };\r\nexport { GeoJsonOptions };\r\nexport { MarkerAlterOptions };\r\nexport { PopupOptions };\r\nexport { PolygonOptions };\r\nexport { PolygonAlterOptions };\r\nexport { CircleOptions };\r\nexport { CircleAlterOptions };\r\nexport { PolylineOptions };\r\nexport { NavigationOptions };\r\nexport { IMapFunctions };\r\nexport { OverlayOptions };\r\nexport { MapType };\r\nexport { PolylineType };\r\nexport { MapEventType };\r\nexport { MarkerEventType };\r\nexport { CircleEventType };\r\nexport { PolygonEventType };\r\nexport { PolylineEventType };\r\nexport { MarkerClustererConfig };\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.ts","/**\n * @name MarkerClustererPlus for Google Maps V3\n * @version 2.1.11\n * @author Gary Little\n * @fileoverview\n * The library creates and manages per-zoom-level clusters for large amounts of markers.\n * <p>\n * This is an enhanced V3 implementation of the V2 MarkerClusterer by Xiaoxi Wu. It is\n * based on the V3 MarkerClusterer port by Luke Mahe. MarkerClustererPlus was created\n * by Gary Little.\n * <p>\n * v2.0 release: MarkerClustererPlus v2.0 is backward compatible with MarkerClusterer v1.0. It\n * adds support for the <code>ignoreHidden</code>, <code>title</code>, <code>batchSizeIE</code>,\n * and <code>calculator</code> properties as well as support for four more events. It also allows\n * greater control over the styling of the text that appears on the cluster marker. The\n * documentation has been significantly improved and the overall code has been simplified and\n * polished. Very large numbers of markers can now be managed without causing Javascript timeout\n * errors on Internet Explorer. Note that the name of the <code>clusterclick</code> event has been\n * deprecated. The new name is <code>click</code>, so please change your application code now.\n */\n\n/**\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @name ClusterIconStyle\n * @class This class represents the object for values in the <code>styles</code> array passed\n * to the {@link MarkerClusterer} constructor. The element in this array that is used to\n * style the cluster icon is determined by calling the <code>calculator</code> function.\n *\n * @property {string} url The URL of the cluster icon image file. Required.\n * @property {number} height The display height (in pixels) of the cluster icon. Required.\n * @property {number} width The display width (in pixels) of the cluster icon. Required.\n * @property {Array} [anchorText] The position (in pixels) from the center of the cluster icon to\n * where the text label is to be centered and drawn. The format is <code>[yoffset, xoffset]</code>\n * where <code>yoffset</code> increases as you go down from center and <code>xoffset</code>\n * increases to the right of center. The default is <code>[0, 0]</code>.\n * @property {Array} [anchorIcon] The anchor position (in pixels) of the cluster icon. This is the\n * spot on the cluster icon that is to be aligned with the cluster position. The format is\n * <code>[yoffset, xoffset]</code> where <code>yoffset</code> increases as you go down and\n * <code>xoffset</code> increases to the right of the top-left corner of the icon. The default\n * anchor position is the center of the cluster icon.\n * @property {string} [textColor=\"black\"] The color of the label text shown on the\n * cluster icon.\n * @property {number} [textSize=11] The size (in pixels) of the label text shown on the\n * cluster icon.\n * @property {string} [textDecoration=\"none\"] The value of the CSS <code>text-decoration</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontWeight=\"bold\"] The value of the CSS <code>font-weight</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontStyle=\"normal\"] The value of the CSS <code>font-style</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontFamily=\"Arial,sans-serif\"] The value of the CSS <code>font-family</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [backgroundPosition=\"0 0\"] The position of the cluster icon image\n * within the image defined by <code>url</code>. The format is <code>\"xpos ypos\"</code>\n * (the same format as for the CSS <code>background-position</code> property). You must set\n * this property appropriately when the image defined by <code>url</code> represents a sprite\n * containing multiple images. Note that the position <i>must</i> be specified in px units.\n */\n/**\n * @name ClusterIconInfo\n * @class This class is an object containing general information about a cluster icon. This is\n * the object that a <code>calculator</code> function returns.\n *\n * @property {string} text The text of the label to be shown on the cluster icon.\n * @property {number} index The index plus 1 of the element in the <code>styles</code>\n * array to be used to style the cluster icon.\n * @property {string} title The tooltip to display when the mouse moves over the cluster icon.\n * If this value is <code>undefined</code> or <code>\"\"</code>, <code>title</code> is set to the\n * value of the <code>title</code> property passed to the MarkerClusterer.\n */\n/**\n * A cluster icon.\n *\n * @constructor\n * @extends google.maps.OverlayView\n * @param {Cluster} cluster The cluster with which the icon is to be associated.\n * @param {Array} [styles] An array of {@link ClusterIconStyle} defining the cluster icons\n * to use for various cluster sizes.\n * @private\n */\nfunction ClusterIcon(cluster, styles) {\n cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);\n\n this.cluster_ = cluster;\n this.className_ = cluster.getMarkerClusterer().getClusterClass();\n this.styles_ = styles;\n this.center_ = null;\n this.div_ = null;\n this.sums_ = null;\n this.visible_ = false;\n\n this.setMap(cluster.getMap()); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Adds the icon to the DOM.\n */\nClusterIcon.prototype.onAdd = function () {\n var cClusterIcon = this;\n var cMouseDownInCluster;\n var cDraggingMapByCluster;\n var gmVersion = google.maps.version.split(\".\");\n\n gmVersion = parseInt(gmVersion[0] * 100, 10) + parseInt(gmVersion[1], 10);\n\n this.div_ = document.createElement(\"div\");\n this.div_.className = this.className_;\n if (this.visible_) {\n this.show();\n }\n\n this.getPanes().overlayMouseTarget.appendChild(this.div_);\n\n // Fix for Issue 157\n this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), \"bounds_changed\", function () {\n cDraggingMapByCluster = cMouseDownInCluster;\n });\n\n google.maps.event.addDomListener(this.div_, \"mousedown\", function () {\n cMouseDownInCluster = true;\n cDraggingMapByCluster = false;\n });\n\n// March 1, 2018: Fix for this 3.32 exp bug, https://issuetracker.google.com/issues/73571522\n// But it doesn't work with earlier releases so do a version check.\n if (gmVersion >= 332) { // Ugly version-dependent code\n google.maps.event.addDomListener(this.div_, \"touchstart\", function (e) {\n e.stopPropagation();\n });\n }\n\n google.maps.event.addDomListener(this.div_, \"click\", function (e) {\n cMouseDownInCluster = false;\n if (!cDraggingMapByCluster) {\n var theBounds;\n var mz;\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(mc, \"click\", cClusterIcon.cluster_);\n google.maps.event.trigger(mc, \"clusterclick\", cClusterIcon.cluster_); // deprecated name\n\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (mc.getZoomOnClick()) {\n // Zoom into the cluster.\n mz = mc.getMaxZoom();\n theBounds = cClusterIcon.cluster_.getBounds();\n mc.getMap().fitBounds(theBounds);\n // There is a fix for Issue 170 here:\n setTimeout(function () {\n mc.getMap().fitBounds(theBounds);\n // Don't zoom beyond the max zoom level\n if (mz !== null && (mc.getMap().getZoom() > mz)) {\n mc.getMap().setZoom(mz + 1);\n }\n }, 100);\n }\n\n // Prevent event propagation to the map:\n e.cancelBubble = true;\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n }\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseover\", function () {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseover\", cClusterIcon.cluster_);\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseout\", function () {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseout\", cClusterIcon.cluster_);\n });\n};\n\n\n/**\n * Removes the icon from the DOM.\n */\nClusterIcon.prototype.onRemove = function () {\n if (this.div_ && this.div_.parentNode) {\n this.hide();\n google.maps.event.removeListener(this.boundsChangedListener_);\n google.maps.event.clearInstanceListeners(this.div_);\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n};\n\n\n/**\n * Draws the icon.\n */\nClusterIcon.prototype.draw = function () {\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.top = pos.y + \"px\";\n this.div_.style.left = pos.x + \"px\";\n this.div_.style.zIndex = google.maps.Marker.MAX_ZINDEX + 1; // Put above all unclustered markers\n }\n};\n\n\n/**\n * Hides the icon.\n */\nClusterIcon.prototype.hide = function () {\n if (this.div_) {\n this.div_.style.display = \"none\";\n }\n this.visible_ = false;\n};\n\n\n/**\n * Positions and shows the icon.\n */\nClusterIcon.prototype.show = function () {\n if (this.div_) {\n var img = \"\";\n // NOTE: values must be specified in px units\n var bp = this.backgroundPosition_.split(\" \");\n var spriteH = parseInt(bp[0].replace(/^\\s+|\\s+$/g, \"\"), 10);\n var spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, \"\"), 10);\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos);\n img = \"<img src='\" + this.url_ + \"' style='position: absolute; top: \" + spriteV + \"px; left: \" + spriteH + \"px; \";\n if (this.cluster_.getMarkerClusterer().enableRetinaIcons_) {\n img += \"width: \" + this.width_ + \"px; height: \" + this.height_ + \"px;\";\n } else {\n img += \"clip: rect(\" + (-1 * spriteV) + \"px, \" + ((-1 * spriteH) + this.width_) + \"px, \" +\n ((-1 * spriteV) + this.height_) + \"px, \" + (-1 * spriteH) + \"px);\";\n }\n img += \"'>\";\n this.div_.innerHTML = img + \"<div style='\" +\n \"position: absolute;\" +\n \"top: \" + this.anchorText_[0] + \"px;\" +\n \"left: \" + this.anchorText_[1] + \"px;\" +\n \"color: \" + this.textColor_ + \";\" +\n \"font-size: \" + this.textSize_ + \"px;\" +\n \"font-family: \" + this.fontFamily_ + \";\" +\n \"font-weight: \" + this.fontWeight_ + \";\" +\n \"font-style: \" + this.fontStyle_ + \";\" +\n \"text-decoration: \" + this.textDecoration_ + \";\" +\n \"text-align: center;\" +\n \"width: \" + this.width_ + \"px;\" +\n \"line-height:\" + this.height_ + \"px;\" +\n \"'>\" + this.sums_.text + \"</div>\";\n if (typeof this.sums_.title === \"undefined\" || this.sums_.title === \"\") {\n this.div_.title = this.cluster_.getMarkerClusterer().getTitle();\n } else {\n this.div_.title = this.sums_.title;\n }\n this.div_.style.display = \"\";\n }\n this.visible_ = true;\n};\n\n\n/**\n * Sets the icon styles to the appropriate element in the styles array.\n *\n * @param {ClusterIconInfo} sums The icon label text and styles index.\n */\nClusterIcon.prototype.useStyle = function (sums) {\n this.sums_ = sums;\n var index = Math.max(0, sums.index - 1);\n index = Math.min(this.styles_.length - 1, index);\n var style = this.styles_[index];\n this.url_ = style.url;\n this.height_ = style.height;\n this.width_ = style.width;\n this.anchorText_ = style.anchorText || [0, 0];\n this.anchorIcon_ = style.anchorIcon || [parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)];\n this.textColor_ = style.textColor || \"black\";\n this.textSize_ = style.textSize || 11;\n this.textDecoration_ = style.textDecoration || \"none\";\n this.fontWeight_ = style.fontWeight || \"bold\";\n this.fontStyle_ = style.fontStyle || \"normal\";\n this.fontFamily_ = style.fontFamily || \"Arial,sans-serif\";\n this.backgroundPosition_ = style.backgroundPosition || \"0 0\";\n};\n\n\n/**\n * Sets the position at which to center the icon.\n *\n * @param {google.maps.LatLng} center The latlng to set as the center.\n */\nClusterIcon.prototype.setCenter = function (center) {\n this.center_ = center;\n};\n\n\n/**\n * Creates the cssText style parameter based on the position of the icon.\n *\n * @param {google.maps.Point} pos The position of the icon.\n * @return {string} The CSS style text.\n */\nClusterIcon.prototype.createCss = function (pos) {\n var style = [];\n style.push(\"cursor: pointer;\");\n style.push(\"position: absolute; top: \" + pos.y + \"px; left: \" + pos.x + \"px;\");\n style.push(\"width: \" + this.width_ + \"px; height: \" + this.height_ + \"px;\");\n style.push(\"-webkit-user-select: none;\");\n style.push(\"-khtml-user-select: none;\");\n style.push(\"-moz-user-select: none;\");\n style.push(\"-o-user-select: none;\");\n style.push(\"user-select: none;\");\n return style.join(\"\");\n};\n\n\n/**\n * Returns the position at which to place the DIV depending on the latlng.\n *\n * @param {google.maps.LatLng} latlng The position in latlng.\n * @return {google.maps.Point} The position in pixels.\n */\nClusterIcon.prototype.getPosFromLatLng_ = function (latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n pos.x -= this.anchorIcon_[1];\n pos.y -= this.anchorIcon_[0];\n pos.x = parseInt(pos.x, 10);\n pos.y = parseInt(pos.y, 10);\n return pos;\n};\n\n\n/**\n * Creates a single cluster that manages a group of proximate markers.\n * Used internally, do not call this constructor directly.\n * @constructor\n * @param {MarkerClusterer} mc The <code>MarkerClusterer</code> object with which this\n * cluster is associated.\n */\nfunction Cluster(mc) {\n this.markerClusterer_ = mc;\n this.map_ = mc.getMap();\n this.gridSize_ = mc.getGridSize();\n this.minClusterSize_ = mc.getMinimumClusterSize();\n this.averageCenter_ = mc.getAverageCenter();\n this.markers_ = [];\n this.center_ = null;\n this.bounds_ = null;\n this.clusterIcon_ = new ClusterIcon(this, mc.getStyles());\n}\n\n\n/**\n * Returns the number of markers managed by the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {number} The number of markers in the cluster.\n */\nCluster.prototype.getSize = function () {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the array of markers managed by the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {Array} The array of markers in the cluster.\n */\nCluster.prototype.getMarkers = function () {\n return this.markers_;\n};\n\n\n/**\n * Returns the center of the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {google.maps.LatLng} The center of the cluster.\n */\nCluster.prototype.getCenter = function () {\n return this.center_;\n};\n\n\n/**\n * Returns the map with which the cluster is associated.\n *\n * @return {google.maps.Map} The map.\n * @ignore\n */\nCluster.prototype.getMap = function () {\n return this.map_;\n};\n\n\n/**\n * Returns the <code>MarkerClusterer</code> object with which the cluster is associated.\n *\n * @return {MarkerClusterer} The associated marker clusterer.\n * @ignore\n */\nCluster.prototype.getMarkerClusterer = function () {\n return this.markerClusterer_;\n};\n\n\n/**\n * Returns the bounds of the cluster.\n *\n * @return {google.maps.LatLngBounds} the cluster bounds.\n * @ignore\n */\nCluster.prototype.getBounds = function () {\n var i;\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n var markers = this.getMarkers();\n for (i = 0; i < markers.length; i++) {\n bounds.extend(markers[i].getPosition());\n }\n return bounds;\n};\n\n\n/**\n * Removes the cluster from the map.\n *\n * @ignore\n */\nCluster.prototype.remove = function () {\n this.clusterIcon_.setMap(null);\n this.markers_ = [];\n delete this.markers_;\n};\n\n\n/**\n * Adds a marker to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to be added.\n * @return {boolean} True if the marker was added.\n * @ignore\n */\nCluster.prototype.addMarker = function (marker) {\n var i;\n var mCount;\n var mz;\n\n if (this.isMarkerAlreadyAdded_(marker)) {\n return false;\n }\n\n if (!this.center_) {\n this.center_ = marker.getPosition();\n this.calculateBounds_();\n } else {\n if (this.averageCenter_) {\n var l = this.markers_.length + 1;\n var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\n var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\n this.center_ = new google.maps.LatLng(lat, lng);\n this.calculateBounds_();\n }\n }\n\n marker.isAdded = true;\n this.markers_.push(marker);\n\n mCount = this.markers_.length;\n mz = this.markerClusterer_.getMaxZoom();\n if (mz !== null && this.map_.getZoom() > mz) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount < this.minClusterSize_) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount === this.minClusterSize_) {\n // Hide the markers that were showing.\n for (i = 0; i < mCount; i++) {\n this.markers_[i].setMap(null);\n }\n } else {\n marker.setMap(null);\n }\n\n this.updateIcon_();\n return true;\n};\n\n\n/**\n * Determines if a marker lies within the cluster's bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker lies in the bounds.\n * @ignore\n */\nCluster.prototype.isMarkerInClusterBounds = function (marker) {\n return this.bounds_.contains(marker.getPosition());\n};\n\n\n/**\n * Calculates the extended bounds of the cluster with the grid.\n */\nCluster.prototype.calculateBounds_ = function () {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\n};\n\n\n/**\n * Updates the cluster icon.\n */\nCluster.prototype.updateIcon_ = function () {\n var mCount = this.markers_.length;\n var mz = this.markerClusterer_.getMaxZoom();\n\n if (mz !== null && this.map_.getZoom() > mz) {\n this.clusterIcon_.hide();\n return;\n }\n\n if (mCount < this.minClusterSize_) {\n // Min cluster size not yet reached.\n this.clusterIcon_.hide();\n return;\n }\n\n var numStyles = this.markerClusterer_.getStyles().length;\n var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\n this.clusterIcon_.setCenter(this.center_);\n this.clusterIcon_.useStyle(sums);\n this.clusterIcon_.show();\n};\n\n\n/**\n * Determines if a marker has already been added to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker has already been added.\n */\nCluster.prototype.isMarkerAlreadyAdded_ = function (marker) {\n var i;\n if (this.markers_.indexOf) {\n return this.markers_.indexOf(marker) !== -1;\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n return true;\n }\n }\n }\n return false;\n};\n\n\n/**\n * @name MarkerClustererOptions\n * @class This class represents the optional parameter passed to\n * the {@link MarkerClusterer} constructor.\n * @property {number} [gridSize=60] The grid size of a cluster in pixels. The grid is a square.\n * @property {number} [maxZoom=null] The maximum zoom level at which clustering is enabled or\n * <code>null</code> if clustering is to be enabled at all zoom levels.\n * @property {boolean} [zoomOnClick=true] Whether to zoom the map when a cluster marker is\n * clicked. You may want to set this to <code>false</code> if you have installed a handler\n * for the <code>click</code> event and it deals with zooming on its own.\n * @property {boolean} [averageCenter=false] Whether the position of a cluster marker should be\n * the average position of all markers in the cluster. If set to <code>false</code>, the\n * cluster marker is positioned at the location of the first marker added to the cluster.\n * @property {number} [minimumClusterSize=2] The minimum number of markers needed in a cluster\n * before the markers are hidden and a cluster marker appears.\n * @property {boolean} [ignoreHidden=false] Whether to ignore hidden markers in clusters. You\n * may want to set this to <code>true</code> to ensure that hidden markers are not included\n * in the marker count that appears on a cluster marker (this count is the value of the\n * <code>text</code> property of the result returned by the default <code>calculator</code>).\n * If set to <code>true</code> and you change the visibility of a marker being clustered, be\n * sure to also call <code>MarkerClusterer.repaint()</code>.\n * @property {string} [title=\"\"] The tooltip to display when the mouse moves over a cluster\n * marker. (Alternatively, you can use a custom <code>calculator</code> function to specify a\n * different tooltip for each cluster marker.)\n * @property {function} [calculator=MarkerClusterer.CALCULATOR] The function used to determine\n * the text to be displayed on a cluster marker and the index indicating which style to use\n * for the cluster marker. The input parameters for the function are (1) the array of markers\n * represented by a cluster marker and (2) the number of cluster icon styles. It returns a\n * {@link ClusterIconInfo} object. The default <code>calculator</code> returns a\n * <code>text</code> property which is the number of markers in the cluster and an\n * <code>index</code> property which is one higher than the lowest integer such that\n * <code>10^i</code> exceeds the number of markers in the cluster, or the size of the styles\n * array, whichever is less. The <code>styles</code> array element used has an index of\n * <code>index</code> minus 1. For example, the default <code>calculator</code> returns a\n * <code>text</code> value of <code>\"125\"</code> and an <code>index</code> of <code>3</code>\n * for a cluster icon representing 125 markers so the element used in the <code>styles</code>\n * array is <code>2</code>. A <code>calculator</code> may also return a <code>title</code>\n * property that contains the text of the tooltip to be used for the cluster marker. If\n * <code>title</code> is not defined, the tooltip is set to the value of the <code>title</code>\n * property for the MarkerClusterer.\n * @property {string} [clusterClass=\"cluster\"] The name of the CSS class defining general styles\n * for the cluster markers. Use this class to define CSS styles that are not set up by the code\n * that processes the <code>styles</code> array.\n * @property {Array} [styles] An array of {@link ClusterIconStyle} elements defining the styles\n * of the cluster markers to be used. The element to be used to style a given cluster marker\n * is determined by the function defined by the <code>calculator</code> property.\n * The default is an array of {@link ClusterIconStyle} elements whose properties are derived\n * from the values for <code>imagePath</code>, <code>imageExtension</code>, and\n * <code>imageSizes</code>.\n * @property {boolean} [enableRetinaIcons=false] Whether to allow the use of cluster icons that\n * have sizes that are some multiple (typically double) of their actual display size. Icons such\n * as these look better when viewed on high-resolution monitors such as Apple's Retina displays.\n * Note: if this property is <code>true</code>, sprites cannot be used as cluster icons.\n * @property {number} [batchSize=MarkerClusterer.BATCH_SIZE] Set this property to the\n * number of markers to be processed in a single batch when using a browser other than\n * Internet Explorer (for Internet Explorer, use the batchSizeIE property instead).\n * @property {number} [batchSizeIE=MarkerClusterer.BATCH_SIZE_IE] When Internet Explorer is\n * being used, markers are processed in several batches with a small delay inserted between\n * each batch in an attempt to avoid Javascript timeout errors. Set this property to the\n * number of markers to be processed in a single batch; select as high a number as you can\n * without causing a timeout error in the browser. This number might need to be as low as 100\n * if 15,000 markers are being managed, for example.\n * @property {string} [imagePath=MarkerClusterer.IMAGE_PATH]\n * The full URL of the root name of the group of image files to use for cluster icons.\n * The complete file name is of the form <code>imagePath</code>n.<code>imageExtension</code>\n * where n is the image file number (1, 2, etc.).\n * @property {string} [imageExtension=MarkerClusterer.IMAGE_EXTENSION]\n * The extension name for the cluster icon image files (e.g., <code>\"png\"</code> or\n * <code>\"jpg\"</code>).\n * @property {Array} [imageSizes=MarkerClusterer.IMAGE_SIZES]\n * An array of numbers containing the widths of the group of\n * <code>imagePath</code>n.<code>imageExtension</code> image files.\n * (The images are assumed to be square.)\n */\n/**\n * Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}.\n * @constructor\n * @extends google.maps.OverlayView\n * @param {google.maps.Map} map The Google map to attach to.\n * @param {Array.<google.maps.Marker>} [opt_markers] The markers to be added to the cluster.\n * @param {MarkerClustererOptions} [opt_options] The optional parameters.\n */\nfunction MarkerClusterer(map, opt_markers, opt_options) {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n this.extend(MarkerClusterer, google.maps.OverlayView);\n\n opt_markers = opt_markers || [];\n opt_options = opt_options || {};\n\n this.markers_ = [];\n this.clusters_ = [];\n this.listeners_ = [];\n this.activeMap_ = null;\n this.ready_ = false;\n\n this.gridSize_ = opt_options.gridSize || 60;\n this.minClusterSize_ = opt_options.minimumClusterSize || 2;\n this.maxZoom_ = opt_options.maxZoom || null;\n this.styles_ = opt_options.styles || [];\n this.title_ = opt_options.title || \"\";\n this.zoomOnClick_ = true;\n if (opt_options.zoomOnClick !== undefined) {\n this.zoomOnClick_ = opt_options.zoomOnClick;\n }\n this.averageCenter_ = false;\n if (opt_options.averageCenter !== undefined) {\n this.averageCenter_ = opt_options.averageCenter;\n }\n this.ignoreHidden_ = false;\n if (opt_options.ignoreHidden !== undefined) {\n this.ignoreHidden_ = opt_options.ignoreHidden;\n }\n this.enableRetinaIcons_ = false;\n if (opt_options.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons_ = opt_options.enableRetinaIcons;\n }\n this.imagePath_ = opt_options.imagePath || MarkerClusterer.IMAGE_PATH;\n this.imageExtension_ = opt_options.imageExtension || MarkerClusterer.IMAGE_EXTENSION;\n this.imageSizes_ = opt_options.imageSizes || MarkerClusterer.IMAGE_SIZES;\n this.calculator_ = opt_options.calculator || MarkerClusterer.CALCULATOR;\n this.batchSize_ = opt_options.batchSize || MarkerClusterer.BATCH_SIZE;\n this.batchSizeIE_ = opt_options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE;\n this.clusterClass_ = opt_options.clusterClass || \"cluster\";\n\n if (navigator.userAgent.toLowerCase().indexOf(\"msie\") !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize_ = this.batchSizeIE_;\n }\n\n this.setupStyles_();\n\n this.addMarkers(opt_markers, true);\n this.setMap(map); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Implementation of the onAdd interface method.\n * @ignore\n */\nMarkerClusterer.prototype.onAdd = function () {\n var cMarkerClusterer = this;\n\n this.activeMap_ = this.getMap();\n this.ready_ = true;\n\n this.repaint();\n\n this.prevZoom_ = this.getMap().getZoom();\n\n // Add the map event listeners\n this.listeners_ = [\n google.maps.event.addListener(this.getMap(), \"zoom_changed\", function () {\n // Fix for bug #407\n // Determines map type and prevents illegal zoom levels\n var zoom = this.getMap().getZoom();\n var minZoom = this.getMap().minZoom || 0;\n var maxZoom = Math.min(this.getMap().maxZoom || 100,\n this.getMap().mapTypes[this.getMap().getMapTypeId()].maxZoom);\n zoom = Math.min(Math.max(zoom, minZoom), maxZoom);\n\n if (this.prevZoom_ != zoom) {\n this.prevZoom_ = zoom;\n this.resetViewport_(false);\n }\n }.bind(this)),\n google.maps.event.addListener(this.getMap(), \"idle\", function () {\n cMarkerClusterer.redraw_();\n })\n ];\n};\n\n\n/**\n * Implementation of the onRemove interface method.\n * Removes map event listeners and all cluster icons from the DOM.\n * All managed markers are also put back on the map.\n * @ignore\n */\nMarkerClusterer.prototype.onRemove = function () {\n var i;\n\n // Put all the managed markers back on the map:\n for (i = 0; i < this.markers_.length; i++) {\n if (this.markers_[i].getMap() !== this.activeMap_) {\n this.markers_[i].setMap(this.activeMap_);\n }\n }\n\n // Remove all clusters:\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Remove map event listeners:\n for (i = 0; i < this.listeners_.length; i++) {\n google.maps.event.removeListener(this.listeners_[i]);\n }\n this.listeners_ = [];\n\n this.activeMap_ = null;\n this.ready_ = false;\n};\n\n\n/**\n * Implementation of the draw interface method.\n * @ignore\n */\nMarkerClusterer.prototype.draw = function () {};\n\n\n/**\n * Sets up the styles object.\n */\nMarkerClusterer.prototype.setupStyles_ = function () {\n var i, size;\n if (this.styles_.length > 0) {\n return;\n }\n\n for (i = 0; i < this.imageSizes_.length; i++) {\n size = this.imageSizes_[i];\n this.styles_.push({\n url: this.imagePath_ + (i + 1) + \".\" + this.imageExtension_,\n height: size,\n width: size\n });\n }\n};\n\n\n/**\n * Fits the map to the bounds of the markers managed by the clusterer.\n */\nMarkerClusterer.prototype.fitMapToMarkers = function () {\n var i;\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (i = 0; i < markers.length; i++) {\n // March 3, 2018: Bug fix -- honor the ignoreHidden property\n if (markers[i].getVisible() || !this.getIgnoreHidden()) {\n bounds.extend(markers[i].getPosition());\n }\n }\n\n this.getMap().fitBounds(bounds);\n};\n\n\n/**\n * Returns the value of the <code>gridSize</code> property.\n *\n * @return {number} The grid size.\n */\nMarkerClusterer.prototype.getGridSize = function () {\n return this.gridSize_;\n};\n\n\n/**\n * Sets the value of the <code>gridSize</code> property.\n *\n * @param {number} gridSize The grid size.\n */\nMarkerClusterer.prototype.setGridSize = function (gridSize) {\n this.gridSize_ = gridSize;\n};\n\n\n/**\n * Returns the value of the <code>minimumClusterSize</code> property.\n *\n * @return {number} The minimum cluster size.\n */\nMarkerClusterer.prototype.getMinimumClusterSize = function () {\n return this.minClusterSize_;\n};\n\n/**\n * Sets the value of the <code>minimumClusterSize</code> property.\n *\n * @param {number} minimumClusterSize The minimum cluster size.\n */\nMarkerClusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) {\n this.minClusterSize_ = minimumClusterSize;\n};\n\n\n/**\n * Returns the value of the <code>maxZoom</code> property.\n *\n * @return {number} The maximum zoom level.\n */\nMarkerClusterer.prototype.getMaxZoom = function () {\n return this.maxZoom_;\n};\n\n\n/**\n * Sets the value of the <code>maxZoom</code> property.\n *\n * @param {number} maxZoom The maximum zoom level.\n */\nMarkerClusterer.prototype.setMaxZoom = function (maxZoom) {\n this.maxZoom_ = maxZoom;\n};\n\n\n/**\n * Returns the value of the <code>styles</code> property.\n *\n * @return {Array} The array of styles defining the cluster markers to be used.\n */\nMarkerClusterer.prototype.getStyles = function () {\n return this.styles_;\n};\n\n\n/**\n * Sets the value of the <code>styles</code> property.\n *\n * @param {Array.<ClusterIconStyle>} styles The array of styles to use.\n */\nMarkerClusterer.prototype.setStyles = function (styles) {\n this.styles_ = styles;\n};\n\n\n/**\n * Returns the value of the <code>title</code> property.\n *\n * @return {string} The content of the title text.\n */\nMarkerClusterer.prototype.getTitle = function () {\n return this.title_;\n};\n\n\n/**\n * Sets the value of the <code>title</code> property.\n *\n * @param {string} title The value of the title property.\n */\nMarkerClusterer.prototype.setTitle = function (title) {\n this.title_ = title;\n};\n\n\n/**\n * Returns the value of the <code>zoomOnClick</code> property.\n *\n * @return {boolean} True if zoomOnClick property is set.\n */\nMarkerClusterer.prototype.getZoomOnClick = function () {\n return this.zoomOnClick_;\n};\n\n\n/**\n * Sets the value of the <code>zoomOnClick</code> property.\n *\n * @param {boolean} zoomOnClick The value of the zoomOnClick property.\n */\nMarkerClusterer.prototype.setZoomOnClick = function (zoomOnClick) {\n this.zoomOnClick_ = zoomOnClick;\n};\n\n\n/**\n * Returns the value of the <code>averageCenter</code> property.\n *\n * @return {boolean} True if averageCenter property is set.\n */\nMarkerClusterer.prototype.getAverageCenter = function () {\n return this.averageCenter_;\n};\n\n\n/**\n * Sets the value of the <code>averageCenter</code> property.\n *\n * @param {boolean} averageCenter The value of the averageCenter property.\n */\nMarkerClusterer.prototype.setAverageCenter = function (averageCenter) {\n this.averageCenter_ = averageCenter;\n};\n\n\n/**\n * Returns the value of the <code>ignoreHidden</code> property.\n *\n * @return {boolean} True if ignoreHidden property is set.\n */\nMarkerClusterer.prototype.getIgnoreHidden = function () {\n return this.ignoreHidden_;\n};\n\n\n/**\n * Sets the value of the <code>ignoreHidden</code> property.\n *\n * @param {boolean} ignoreHidden The value of the ignoreHidden property.\n */\nMarkerClusterer.prototype.setIgnoreHidden = function (ignoreHidden) {\n this.ignoreHidden_ = ignoreHidden;\n};\n\n\n/**\n * Returns the value of the <code>enableRetinaIcons</code> property.\n *\n * @return {boolean} True if enableRetinaIcons property is set.\n */\nMarkerClusterer.prototype.getEnableRetinaIcons = function () {\n return this.enableRetinaIcons_;\n};\n\n\n/**\n * Sets the value of the <code>enableRetinaIcons</code> property.\n *\n * @param {boolean} enableRetinaIcons The value of the enableRetinaIcons property.\n */\nMarkerClusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) {\n this.enableRetinaIcons_ = enableRetinaIcons;\n};\n\n\n/**\n * Returns the value of the <code>imageExtension</code> property.\n *\n * @return {string} The value of the imageExtension property.\n */\nMarkerClusterer.prototype.getImageExtension = function () {\n return this.imageExtension_;\n};\n\n\n/**\n * Sets the value of the <code>imageExtension</code> property.\n *\n * @param {string} imageExtension The value of the imageExtension property.\n */\nMarkerClusterer.prototype.setImageExtension = function (imageExtension) {\n this.imageExtension_ = imageExtension;\n};\n\n\n/**\n * Returns the value of the <code>imagePath</code> property.\n *\n * @return {string} The value of the imagePath property.\n */\nMarkerClusterer.prototype.getImagePath = function () {\n return this.imagePath_;\n};\n\n\n/**\n * Sets the value of the <code>imagePath</code> property.\n *\n * @param {string} imagePath The value of the imagePath property.\n */\nMarkerClusterer.prototype.setImagePath = function (imagePath) {\n this.imagePath_ = imagePath;\n};\n\n\n/**\n * Returns the value of the <code>imageSizes</code> property.\n *\n * @return {Array} The value of the imageSizes property.\n */\nMarkerClusterer.prototype.getImageSizes = function () {\n return this.imageSizes_;\n};\n\n\n/**\n * Sets the value of the <code>imageSizes</code> property.\n *\n * @param {Array} imageSizes The value of the imageSizes property.\n */\nMarkerClusterer.prototype.setImageSizes = function (imageSizes) {\n this.imageSizes_ = imageSizes;\n};\n\n\n/**\n * Returns the value of the <code>calculator</code> property.\n *\n * @return {function} the value of the calculator property.\n */\nMarkerClusterer.prototype.getCalculator = function () {\n return this.calculator_;\n};\n\n\n/**\n * Sets the value of the <code>calculator</code> property.\n *\n * @param {function(Array.<google.maps.Marker>, number)} calculator The value\n * of the calculator property.\n */\nMarkerClusterer.prototype.setCalculator = function (calculator) {\n this.calculator_ = calculator;\n};\n\n\n/**\n * Returns the value of the <code>batchSizeIE</code> property.\n *\n * @return {number} the value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.getBatchSizeIE = function () {\n return this.batchSizeIE_;\n};\n\n\n/**\n * Sets the value of the <code>batchSizeIE</code> property.\n *\n * @param {number} batchSizeIE The value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.setBatchSizeIE = function (batchSizeIE) {\n this.batchSizeIE_ = batchSizeIE;\n};\n\n\n/**\n * Returns the value of the <code>clusterClass</code> property.\n *\n * @return {string} the value of the clusterClass property.\n */\nMarkerClusterer.prototype.getClusterClass = function () {\n return this.clusterClass_;\n};\n\n\n/**\n * Sets the value of the <code>clusterClass</code> property.\n *\n * @param {string} clusterClass The value of the clusterClass property.\n */\nMarkerClusterer.prototype.setClusterClass = function (clusterClass) {\n this.clusterClass_ = clusterClass;\n};\n\n\n/**\n * Returns the array of markers managed by the clusterer.\n *\n * @return {Array} The array of markers managed by the clusterer.\n */\nMarkerClusterer.prototype.getMarkers = function () {\n return this.markers_;\n};\n\n\n/**\n * Returns the number of markers managed by the clusterer.\n *\n * @return {number} The number of markers.\n */\nMarkerClusterer.prototype.getTotalMarkers = function () {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the current array of clusters formed by the clusterer.\n *\n * @return {Array} The array of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getClusters = function () {\n return this.clusters_;\n};\n\n\n/**\n * Returns the number of clusters formed by the clusterer.\n *\n * @return {number} The number of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getTotalClusters = function () {\n return this.clusters_.length;\n};\n\n\n/**\n * Adds a marker to the clusterer. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarker = function (marker, opt_nodraw) {\n this.pushMarkerTo_(marker);\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Adds an array of markers to the clusterer. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>.\n *\n * @param {Array.<google.maps.Marker>} markers The markers to add.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarkers = function (markers, opt_nodraw) {\n var key;\n for (key in markers) {\n if (markers.hasOwnProperty(key)) {\n this.pushMarkerTo_(markers[key]);\n }\n }\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Pushes a marker to the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.pushMarkerTo_ = function (marker) {\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n var cMarkerClusterer = this;\n google.maps.event.addListener(marker, \"dragend\", function () {\n if (cMarkerClusterer.ready_) {\n this.isAdded = false;\n cMarkerClusterer.repaint();\n }\n });\n }\n marker.isAdded = false;\n this.markers_.push(marker);\n};\n\n\n/**\n * Removes a marker from the cluster. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if the\n * marker was removed from the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to remove.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n * @return {boolean} True if the marker was removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarker = function (marker, opt_nodraw) {\n var removed = this.removeMarker_(marker);\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes an array of markers from the cluster. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if markers\n * were removed from the clusterer.\n *\n * @param {Array.<google.maps.Marker>} markers The markers to remove.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n * @return {boolean} True if markers were removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarkers = function (markers, opt_nodraw) {\n var i, r;\n var removed = false;\n\n for (i = 0; i < markers.length; i++) {\n r = this.removeMarker_(markers[i]);\n removed = removed || r;\n }\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes a marker and returns true if removed, false if not.\n *\n * @param {google.maps.Marker} marker The marker to remove\n * @return {boolean} Whether the marker was removed or not\n */\nMarkerClusterer.prototype.removeMarker_ = function (marker) {\n var i;\n var index = -1;\n if (this.markers_.indexOf) {\n index = this.markers_.indexOf(marker);\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n index = i;\n break;\n }\n }\n }\n\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n\n marker.setMap(null);\n this.markers_.splice(index, 1); // Remove the marker from the list of managed markers\n return true;\n};\n\n\n/**\n * Removes all clusters and markers from the map and also removes all markers\n * managed by the clusterer.\n */\nMarkerClusterer.prototype.clearMarkers = function () {\n this.resetViewport_(true);\n this.markers_ = [];\n};\n\n\n/**\n * Recalculates and redraws all the marker clusters from scratch.\n * Call this after changing any properties.\n */\nMarkerClusterer.prototype.repaint = function () {\n var oldClusters = this.clusters_.slice();\n this.clusters_ = [];\n this.resetViewport_(false);\n this.redraw_();\n\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function () {\n var i;\n for (i = 0; i < oldClusters.length; i++) {\n oldClusters[i].remove();\n }\n }, 0);\n};\n\n\n/**\n * Returns the current bounds extended by the grid size.\n *\n * @param {google.maps.LatLngBounds} bounds The bounds to extend.\n * @return {google.maps.LatLngBounds} The extended bounds.\n * @ignore\n */\nMarkerClusterer.prototype.getExtendedBounds = function (bounds) {\n var projection = this.getProjection();\n\n // Turn the bounds into latlng.\n var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),\n bounds.getNorthEast().lng());\n var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),\n bounds.getSouthWest().lng());\n\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(tr);\n trPix.x += this.gridSize_;\n trPix.y -= this.gridSize_;\n\n var blPix = projection.fromLatLngToDivPixel(bl);\n blPix.x -= this.gridSize_;\n blPix.y += this.gridSize_;\n\n // Convert the pixel points back to LatLng\n var ne = projection.fromDivPixelToLatLng(trPix);\n var sw = projection.fromDivPixelToLatLng(blPix);\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(ne);\n bounds.extend(sw);\n\n return bounds;\n};\n\n\n/**\n * Redraws all the clusters.\n */\nMarkerClusterer.prototype.redraw_ = function () {\n this.createClusters_(0);\n};\n\n\n/**\n * Removes all clusters from the map. The markers are also removed from the map\n * if <code>opt_hide</code> is set to <code>true</code>.\n *\n * @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers\n * from the map.\n */\nMarkerClusterer.prototype.resetViewport_ = function (opt_hide) {\n var i, marker;\n // Remove all the clusters\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Reset the markers to not be added and to be removed from the map.\n for (i = 0; i < this.markers_.length; i++) {\n marker = this.markers_[i];\n marker.isAdded = false;\n if (opt_hide) {\n marker.setMap(null);\n }\n }\n};\n\n\n/**\n * Calculates the distance between two latlng locations in km.\n *\n * @param {google.maps.LatLng} p1 The first lat lng point.\n * @param {google.maps.LatLng} p2 The second lat lng point.\n * @return {number} The distance between the two points in km.\n * @see http://www.movable-type.co.uk/scripts/latlong.html\n*/\nMarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) {\n var R = 6371; // Radius of the Earth in km\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *\n Math.sin(dLon / 2) * Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c;\n return d;\n};\n\n\n/**\n * Determines if a marker is contained in a bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @param {google.maps.LatLngBounds} bounds The bounds to check against.\n * @return {boolean} True if the marker is in the bounds.\n */\nMarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) {\n return bounds.contains(marker.getPosition());\n};\n\n\n/**\n * Adds a marker to a cluster, or creates a new cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.addToClosestCluster_ = function (marker) {\n var i, d, cluster, center;\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n for (i = 0; i < this.clusters_.length; i++) {\n cluster = this.clusters_[i];\n center = cluster.getCenter();\n if (center) {\n d = this.distanceBetweenPoints_(center, marker.getPosition());\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n cluster = new Cluster(this);\n cluster.addMarker(marker);\n this.clusters_.push(cluster);\n }\n};\n\n\n/**\n * Creates the clusters. This is done in batches to avoid timeout errors\n * in some browsers when there is a huge number of markers.\n *\n * @param {number} iFirst The index of the first marker in the batch of\n * markers to be added to clusters.\n */\nMarkerClusterer.prototype.createClusters_ = function (iFirst) {\n var i, marker;\n var mapBounds;\n var cMarkerClusterer = this;\n if (!this.ready_) {\n return;\n }\n\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the <code>MarkerClusterer</code> begins\n * clustering markers.\n * @name MarkerClusterer#clusteringbegin\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringbegin\", this);\n\n if (typeof this.timerRefStatic !== \"undefined\") {\n clearTimeout(this.timerRefStatic);\n delete this.timerRefStatic;\n }\n }\n\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n if (this.getMap().getZoom() > 3) {\n mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),\n this.getMap().getBounds().getNorthEast());\n } else {\n mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n }\n var bounds = this.getExtendedBounds(mapBounds);\n\n var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);\n\n for (i = iFirst; i < iLast; i++) {\n marker = this.markers_[i];\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\n if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {\n this.addToClosestCluster_(marker);\n }\n }\n }\n\n if (iLast < this.markers_.length) {\n this.timerRefStatic = setTimeout(function () {\n cMarkerClusterer.createClusters_(iLast);\n }, 0);\n } else {\n delete this.timerRefStatic;\n\n /**\n * This event is fired when the <code>MarkerClusterer</code> stops\n * clustering markers.\n * @name MarkerClusterer#clusteringend\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringend\", this);\n }\n};\n\n\n/**\n * Extends an object's prototype by another's.\n *\n * @param {Object} obj1 The object to be extended.\n * @param {Object} obj2 The object to extend with.\n * @return {Object} The new extended object.\n * @ignore\n */\nMarkerClusterer.prototype.extend = function (obj1, obj2) {\n return (function (object) {\n var property;\n for (property in object.prototype) {\n this.prototype[property] = object.prototype[property];\n }\n return this;\n }).apply(obj1, [obj2]);\n};\n\n\n/**\n * The default function for determining the label text and style\n * for a cluster icon.\n *\n * @param {Array.<google.maps.Marker>} markers The array of markers represented by the cluster.\n * @param {number} numStyles The number of marker styles available.\n * @return {ClusterIconInfo} The information resource for the cluster.\n * @constant\n * @ignore\n */\nMarkerClusterer.CALCULATOR = function (markers, numStyles) {\n var index = 0;\n var title = \"\";\n var count = markers.length.toString();\n\n var dv = count;\n while (dv !== 0) {\n dv = parseInt(dv / 10, 10);\n index++;\n }\n\n index = Math.min(index, numStyles);\n return {\n text: count,\n index: index,\n title: title\n };\n};\n\n\n/**\n * The number of markers to process in one batch.\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE = 2000;\n\n\n/**\n * The number of markers to process in one batch (IE only).\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE_IE = 500;\n\n\n/**\n * The default root name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_PATH = \"https://cdn.rawgit.com/googlemaps/js-marker-clusterer/gh-pages/images/m\";\n\n\n/**\n * The default extension name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_EXTENSION = \"png\";\n\n\n/**\n * The default array of sizes for the marker cluster images.\n *\n * @type {Array.<number>}\n * @constant\n */\nMarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90];\n\nif (typeof module == 'object') {\n module.exports = MarkerClusterer;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@google/markerclustererplus/src/markerclusterer.js\n// module id = 8\n// module chunks = 0 1","import GoogleMaps from './models/apis/googleMaps';\r\nimport Leaflet from './models/apis/leaflet';\r\nimport IMapFunctions from './models/apis/mapFunctions';\r\nimport { MarkerEventType, CircleEventType, PolygonEventType, PolylineEventType, MapEventType } from './models/dto/event-type';\r\nimport { MapType } from './models/dto/map-type';\r\nimport CircleAlterOptions from './models/features/circle/circle-alter-options';\r\nimport CircleOptions from './models/features/circle/circle-options';\r\nimport GeoJsonOptions from './models/features/geojson/geojson-options';\r\nimport MarkerClustererConfig from './models/features/marker-clusterer/marker-clusterer-config';\r\nimport CircleMarkerOptions from './models/features/marker/circle-marker-options';\r\nimport MarkerAlterOptions from './models/features/marker/marker-alter-options';\r\nimport MarkerOptions from './models/features/marker/marker-options';\r\nimport OverlayOptions from './models/features/overlay/overlay-options';\r\nimport PolygonAlterOptions from './models/features/polygons/polygon-alter-options';\r\nimport PolygonOptions from './models/features/polygons/polygon-options';\r\nimport PolylineOptions from './models/features/polyline/polyline-options';\r\nimport PopupOptions from './models/features/popup/popup-options';\r\n\r\nexport default class Map {\r\n private markersList = {};\r\n private polygonsList = {};\r\n private circlesList = {};\r\n private polylinesList = {};\r\n private infoWindowList = {};\r\n private overlayList = {};\r\n private map: IMapFunctions;\r\n private markerClusterer = {};\r\n\r\n constructor() { /**/ }\r\n\r\n /**\r\n * Use this to initialize map\r\n * @param {InlogMaps.MapType} mapType\r\n * @param {any} options\r\n * @param {string} elementId default: 'inlog-map' [nullable]\r\n * @returns {Promisse<any>}\r\n */\r\n public initialize(mapType: MapType, options: any, elementId: string = 'inlog-map'): Promise<any> {\r\n this.map = mapType === MapType.Google ? new GoogleMaps() : new Leaflet();\r\n return this.map.initialize(mapType, options, elementId);\r\n }\r\n\r\n /* GEOJson */\r\n /**\r\n * Use this function to add GEOJSON to the currentMap\r\n * @param {object} data Geojson\r\n * @param {InlogMaps.GeoJsonOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n public loadGEOJson(data: object, options: GeoJsonOptions, eventClick?: any): void {\r\n this.map.loadGEOJson(data, options, eventClick);\r\n }\r\n\r\n /* Markers */\r\n /**\r\n * Use this function to draw markers in the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n public drawMarker(type: string, options: MarkerOptions, eventClick?: any): void {\r\n const marker = this.map.drawMarker(options, eventClick);\r\n\r\n if (!this.markersList[type]) {\r\n this.markersList[type] = [];\r\n }\r\n marker.type = 'simple';\r\n this.markersList[type].push(marker);\r\n\r\n if (options.addClusterer) {\r\n if (!this.markerClusterer[type]) {\r\n this.addMarkerClusterer(type, new MarkerClustererConfig(true, 1, 10));\r\n }\r\n\r\n this.map.addMarkerOnClusterer(marker, this.markerClusterer[type]);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to draw circle markers in the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.CircleMarkerOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n public drawCircleMarker(type: string, options: CircleMarkerOptions, eventClick?: any): void {\r\n const marker = this.map.drawCircleMarker(options, eventClick);\r\n\r\n if (!this.markersList[type]) {\r\n this.markersList[type] = [];\r\n }\r\n marker.type = 'circle';\r\n this.markersList[type].push(marker);\r\n }\r\n\r\n /**\r\n * Use this function to show/hide markers from a specific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toogle markers with the condition [nullable]\r\n */\r\n public toggleMarkers(show: boolean, type: string, condition?: any): void {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n if (markers && markers.length) {\r\n this.map.toggleMarkers(markers, show, this.markerClusterer[type]);\r\n }\r\n }\r\n\r\n /**\r\n * Remove markers from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove markers with the condition [nullable]\r\n */\r\n public removeMarkers(type: string, condition?: any): void {\r\n if (this.markersList[type] && condition) {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n // Hide markers with the condition\r\n this.map.toggleMarkers(markers, false, this.markerClusterer[type]);\r\n\r\n // Keep markers that doesn't have the condition\r\n this.markersList[type] = this.markersList[type].filter((marker: any) => !condition(marker.object));\r\n } else {\r\n if (this.markersList[type]) {\r\n this.map.toggleMarkers(this.markersList[type], false, this.markerClusterer[type]);\r\n }\r\n this.markersList[type] = [];\r\n }\r\n\r\n if (this.markersList[type].length === 0) {\r\n delete this.markersList[type];\r\n }\r\n }\r\n\r\n /**\r\n * Remove all markers from the map and from the internal list\r\n */\r\n public removeAllMarkers(): void {\r\n for (const type in this.markersList) {\r\n if (this.markersList.hasOwnProperty(type)) {\r\n this.removeMarkers(type);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to alter marker style\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerAlterOptions} options\r\n * @param {any} condition alter markers with the condition [nullable]\r\n */\r\n public alterMarkerOptions(type: string, options: MarkerAlterOptions, condition?: any): void {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n if (markers && markers.length) {\r\n this.map.alterMarkerOptions(markers, options);\r\n }\r\n }\r\n\r\n /**\r\n * Use this functions to alterar marker position\r\n * @param {string } type\r\n * @param {number[]} position\r\n * @param {boolean} addTransition [nullable]\r\n * @param {any} condition [nullable]\r\n */\r\n public alterMarkerPosition(type: string, position: number[], addTransition?: boolean, condition?: any): void {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n if (markers && markers.length) {\r\n this.map.alterMarkerPosition(markers, position, addTransition);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to fit bounds in the markers with the especified type\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @param {boolean} onlyMarkersOnMap default true\r\n */\r\n public fitBoundsMarkers(type: string, condition?: any, onlyMarkersOnMap: boolean = true): void {\r\n let markers = this.getMarkers(type, condition);\r\n\r\n if (onlyMarkersOnMap) {\r\n markers = markers.filter((x: any) => this.map.isMarkerOnMap(x));\r\n }\r\n\r\n if (markers && markers.length) {\r\n this.map.fitBoundsPositions(markers);\r\n }\r\n }\r\n\r\n /**\r\n * Use this functions to set the center of the map on marker\r\n * @param {string} type\r\n * @param {any} condition center on marker with the condition [nullable]\r\n */\r\n public setCenterMarker(type: string, condition?: any): void {\r\n if (this.markersList[type] && condition) {\r\n const marker = this.markersList[type].find((marker: any) => condition(marker.object));\r\n\r\n // Center on the marker with the condition\r\n this.map.setCenterMarker(marker);\r\n } else {\r\n if (this.markersList[type] && this.markersList[type].length) {\r\n this.map.setCenterMarker(this.markersList[type][0]);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This functions returns if marker exists\r\n * @param type\r\n * @param condition [nullable]\r\n * @returns {boolean}\r\n */\r\n public markerExists(type: string, condition?: any): boolean {\r\n const markers = this.getMarkers(type, condition);\r\n return markers && markers.length > 0;\r\n }\r\n\r\n /**\r\n * Use this function to count markers by type\r\n * @param {string} type\r\n * @param {boolean} onlyOnMap exclude hidden markers, default true\r\n * @param {any} condition\r\n * @returns {number}\r\n */\r\n public countMarkers(type: string, onlyOnMap: boolean = true, condition?: any): number {\r\n if (this.markerClusterer[type]) {\r\n return this.map.countMarkersOnCluster(this.markerClusterer[type]);\r\n }\r\n\r\n let markers = this.getMarkers(type, condition);\r\n if (onlyOnMap) {\r\n markers = markers.filter((x: any) => this.map.isMarkerOnMap(x));\r\n }\r\n\r\n return markers.length;\r\n }\r\n\r\n /**\r\n * This function add new events on marker\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n public addMarkerEvent(type: string, event: MarkerEventType, eventFunction: any, condition?: any): void {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n this.map.addMarkerEvent(markers, event, eventFunction);\r\n }\r\n\r\n /**\r\n * This function remove events of marker\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n public removeMarkerEvent(type: string, event: MarkerEventType, condition?: any): void {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n this.map.removeMarkerEvent(markers, event);\r\n }\r\n\r\n /* Marker Clusterer */\r\n /**\r\n * Use this function to add MarkerClusterer on the map\r\n * @param {string} type same type of markers\r\n * @param {InlogMaps.MarkerClusterConfig} config\r\n */\r\n public addMarkerClusterer(type: string, config: MarkerClustererConfig): void {\r\n this.markerClusterer[type] = this.map.addMarkerClusterer(config);\r\n }\r\n\r\n /**\r\n * Use this function to alter clusterer options\r\n * @param type same type of markers\r\n * @param {InlogMaps.MarkerClusterConfig} config\r\n */\r\n public alterMarkerClustererConfig(type: string, config: MarkerClustererConfig): void {\r\n if (this.markerClusterer[type]) {\r\n this.map.alterMarkerClustererConfig(this.markerClusterer[type], config);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to redraw marker clusterer\r\n * @param type same type of markers\r\n */\r\n public refreshClusterer(type: string): void {\r\n if (this.markerClusterer[type]) {\r\n this.map.refreshClusterer(this.markerClusterer[type]);\r\n }\r\n }\r\n\r\n /**\r\n * Use this to clear markers on clusterer\r\n * @param type same type of markers\r\n */\r\n public clearMarkersClusterer(type: string): void {\r\n if (this.markerClusterer[type]) {\r\n this.map.clearMarkersClusterer(this.markerClusterer[type]);\r\n }\r\n }\r\n\r\n /* Polygons */\r\n /**\r\n * Use this function to draw polygons\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n public drawPolygon(type: string, options: PolygonOptions, eventClick?: any): void {\r\n const polygon = this.map.drawPolygon(options, eventClick);\r\n\r\n if (!this.polygonsList[type]) {\r\n this.polygonsList[type] = [];\r\n }\r\n this.polygonsList[type].push(polygon);\r\n }\r\n\r\n /**\r\n * Use this function to show/hide polygon from a especific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle polygon with the condition [nullable]\r\n */\r\n public togglePolygons(show: boolean, type: string, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition);\r\n\r\n if (polygons && polygons.length) {\r\n this.map.togglePolygons(polygons, show);\r\n }\r\n }\r\n\r\n /**\r\n * Remove polygons from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove polygons with the condition [nullable]\r\n */\r\n public removePolygons(type: string, condition?: any): void {\r\n if (this.polygonsList[type] && condition) {\r\n const polygons = this.getPolygons(type, condition);\r\n\r\n // Hide markers with the condition\r\n this.map.togglePolygons(polygons, false);\r\n\r\n // Keep markers that doesn't have the condition\r\n this.polygonsList[type] = this.polygonsList[type].filter((polygon: any) => !condition(polygon.object));\r\n } else {\r\n if (this.polygonsList[type]) {\r\n this.map.togglePolygons(this.polygonsList[type], false);\r\n }\r\n this.polygonsList[type] = [];\r\n }\r\n\r\n if (this.polygonsList[type].length === 0) {\r\n delete this.polygonsList[type];\r\n }\r\n }\r\n\r\n /**\r\n * Remove all polygons from the map and from the internal list\r\n */\r\n public removeAllPolygons(): void {\r\n for (const type in this.polygonsList) {\r\n if (this.polygonsList.hasOwnProperty(type)) {\r\n this.removePolygons(type);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to alter polygons options/style\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonAlterOptions} options\r\n * @param {any} condition alter polygon with the condition [nullable]\r\n */\r\n public alterPolygonOptions(type: string, options: PolygonAlterOptions, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition);\r\n\r\n if (polygons && polygons.length) {\r\n this.map.alterPolygonOptions(polygons, options);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to fit bounds of a polygon\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n public fitBoundsPolygons(type: string, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition)\r\n .filter((polygon: any) => this.map.isPolygonOnMap(polygon));\r\n\r\n if (polygons && polygons.length) {\r\n this.map.fitBoundsPolygons(polygons);\r\n }\r\n }\r\n\r\n /**\r\n * Set center on polygon bounds\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n public setCenterPolygons(type: string, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition)\r\n .filter((polygon: any) => this.map.isPolygonOnMap(polygon));\r\n\r\n if (polygons && polygons.length) {\r\n this.map.setCenterPolygons(polygons);\r\n }\r\n }\r\n\r\n /**\r\n * This functions returns if polygon exists\r\n * @param type\r\n * @param condition [nullable]\r\n * @returns {boolean}\r\n */\r\n public polygonExists(type: string, condition?: any): boolean {\r\n const polygons = this.getPolygons(type, condition);\r\n return polygons && polygons.length > 0;\r\n }\r\n\r\n /**\r\n * Use this function to get the path of some polygon\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {number[]}\r\n */\r\n public getPolygonPath(type: string, condition?: any): number[][] {\r\n const polygon = this.getPolygons(type, condition);\r\n\r\n if (polygon && polygon.length) {\r\n return this.map.getPolygonPath(polygon[0]);\r\n }\r\n }\r\n\r\n /**\r\n * This function add new events on polygon\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n public addPolygonEvent(type: string, event: PolygonEventType, eventFunction: any, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition);\r\n\r\n this.map.addPolygonEvent(polygons, event, eventFunction);\r\n }\r\n\r\n /**\r\n * This function remove events of polygon\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n public removePolygonEvent(type: string, event: PolygonEventType, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition);\r\n\r\n this.map.removePolygonEvent(polygons, event);\r\n }\r\n\r\n /* Circles */\r\n /**\r\n * Use this function to draw circles on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.CircleOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n public drawCircle(type: string, options: CircleOptions, eventClick?: any): void {\r\n const circle = this.map.drawCircle(options, eventClick);\r\n\r\n if (!this.circlesList[type]) {\r\n this.circlesList[type] = [];\r\n }\r\n this.circlesList[type].push(circle);\r\n }\r\n\r\n /**\r\n * Use this function to show/hide circles from a especific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle circles with the condition [nullable]\r\n */\r\n public toggleCircles(show: boolean, type: string, condition?: any): void {\r\n const circles = this.getCircles(type, condition);\r\n\r\n if (circles && circles.length) {\r\n this.map.toggleCircles(circles, show);\r\n }\r\n }\r\n\r\n /**\r\n * Remove circles from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove circles with the condition [nullable]\r\n */\r\n public removeCircles(type: string, condition?: any): void {\r\n if (this.circlesList[type] && condition) {\r\n const circles = this.getCircles(type, condition);\r\n\r\n // Hide circles with the condition\r\n this.map.toggleCircles(circles, false);\r\n\r\n // Keep circles that doesn't have the condition\r\n this.circlesList[type] = this.circlesList[type].filter((circle: any) => !condition(circle.object));\r\n } else {\r\n if (this.circlesList[type]) {\r\n this.map.toggleCircles(this.circlesList[type], false);\r\n }\r\n this.circlesList[type] = [];\r\n }\r\n\r\n if (this.circlesList[type].length === 0) {\r\n delete this.circlesList[type];\r\n }\r\n }\r\n\r\n /**\r\n * Remove all circles from the map and from the internal list\r\n */\r\n public removeAllCircles(): void {\r\n for (const type in this.circlesList) {\r\n if (this.circlesList.hasOwnProperty(type)) {\r\n this.removeCircles(type);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to alter circle options\r\n * @param {string} type\r\n * @param {InlogMaps.CircleAlterOptions} options\r\n * @param {any} condition alter circle with the condition [nullable]\r\n */\r\n public alterCircleOptions(type: string, options: CircleAlterOptions, condition?: any): void {\r\n const circles = this.getCircles(type, condition);\r\n\r\n if (circles && circles.length) {\r\n this.map.alterCircleOptions(circles, options);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to fit bounds of a polygon\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n public fitBoundsCircles(type: string, condition?: any): void {\r\n const circles = this.getCircles(type, condition)\r\n .filter((circle: any) => this.map.isCircleOnMap(circle));\r\n\r\n if (circles && circles.length) {\r\n this.map.fitBoundsCircles(circles);\r\n }\r\n }\r\n\r\n /**\r\n * This functions returns if circle exists\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {boolean}\r\n */\r\n public circleExists(type: string, condition?: any): boolean {\r\n const circles = this.getCircles(type, condition);\r\n return circles && circles.length > 0;\r\n }\r\n\r\n /**\r\n * This function return circle center\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {number[]}\r\n */\r\n public getCircleCenter(type: string, condition?: any): number[] {\r\n const circles = this.getCircles(type, condition);\r\n\r\n if (circles && circles.length) {\r\n return this.map.getCircleCenter(circles[0]);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * This function return circle center\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {number}\r\n */\r\n public getCircleRadius(type: string, condition?: any): number {\r\n const circles = this.getCircles(type, condition);\r\n\r\n if (circles && circles.length) {\r\n return this.map.getCircleRadius(circles[0]);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * This function add new events on circle\r\n * @param {string} type\r\n * @param {InlogMaps.CircleEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n public addCircleEvent(type: string, event: CircleEventType, eventFunction: any, condition?: any): void {\r\n const circles = this.getCircles(type, condition);\r\n\r\n this.map.addCircleEvent(circles, event, eventFunction);\r\n }\r\n\r\n /**\r\n * This function remove events of circle\r\n * @param {string} type\r\n * @param {InlogMaps.CircleEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n public removeCircleEvent(type: string, event: CircleEventType, condition?: any): void {\r\n const circles = this.getCircles(type, condition);\r\n\r\n this.map.removeCircleEvent(circles, event);\r\n }\r\n\r\n /* Polylines */\r\n /**\r\n * Use this function to draw polylines on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n public drawPolyline(type: string, options: PolylineOptions, eventClick?: any): void {\r\n const polyline = this.map.drawPolyline(options, eventClick);\r\n\r\n if (!this.polylinesList[type]) {\r\n this.polylinesList[type] = [];\r\n }\r\n this.polylinesList[type].push(polyline);\r\n }\r\n\r\n /**\r\n * Use this function to draw polylines with navigation on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n */\r\n public drawPolylineWithNavigation(type: string, options: PolylineOptions, eventClick?: any): void {\r\n const polyline = this.map.drawPolylineWithNavigation(options, eventClick);\r\n\r\n if (!this.polylinesList[type]) {\r\n this.polylinesList[type] = [];\r\n }\r\n this.polylinesList[type].push(polyline);\r\n }\r\n\r\n /**\r\n * Use this function to toggle polylines\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle polyline with the condition [nullable]\r\n */\r\n public togglePolylines(show: boolean, type: string, condition?: any): void {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n if (polyline && polyline.length) {\r\n this.map.togglePolylines(polyline, show);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to remove polylines\r\n * @param {string} type\r\n * @param {any} condition remove polyline with the condition [nullable]\r\n */\r\n public removePolylines(type: string, condition?: any): void {\r\n if (this.polylinesList[type] && condition) {\r\n const polylines = this.getPolylines(type, condition);\r\n\r\n // Hide markers with the condition\r\n this.map.togglePolylines(polylines, false);\r\n\r\n // Keep markers that doesn't have the condition\r\n this.polylinesList[type] = this.polylinesList[type].filter((polyline: any) => !condition(polyline.object));\r\n } else {\r\n if (this.polylinesList[type]) {\r\n this.map.togglePolylines(this.polylinesList[type], false);\r\n }\r\n this.polylinesList[type] = [];\r\n }\r\n\r\n if (this.polylinesList[type].length === 0) {\r\n delete this.polylinesList[type];\r\n }\r\n }\r\n\r\n /**\r\n * Remove all polylines from the map and from the internal list\r\n */\r\n public removeAllPolylines(): void {\r\n for (const type in this.polylinesList) {\r\n if (this.polylinesList.hasOwnProperty(type)) {\r\n this.removePolylines(type);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to alter polyline options\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n * @param {any} condition alter polyline with the condition [nullable]\r\n */\r\n public alterPolylineOptions(type: string, options: PolylineOptions, condition?: any): void {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n if (polyline && polyline.length) {\r\n this.map.alterPolylineOptions(polyline, options);\r\n }\r\n }\r\n\r\n /**\r\n * Use this functions to fit polylines bounds\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n public fitBoundsPolylines(type: string, condition?: any): void {\r\n const polylines = this.getPolylines(type, condition)\r\n .filter((polyline: any) => this.map.isPolylineOnMap(polyline));\r\n\r\n if (polylines && polylines.length) {\r\n this.map.fitBoundsPolylines(polylines);\r\n }\r\n }\r\n\r\n /**\r\n * This functions returns if polyline exists\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {boolean}\r\n */\r\n public polylineExists(type: string, condition?: any): boolean {\r\n const polylines = this.getPolylines(type, condition);\r\n return polylines && polylines.length > 0;\r\n }\r\n\r\n /**\r\n * Use this function to add more paths to a polyline\r\n * @param {string} type\r\n * @param {number[]} position\r\n * @param {any} condition [nullable]\r\n */\r\n public addPolylinePath(type: string, position: number[], condition?: any): void {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n if (polyline && polyline.length) {\r\n this.map.addPolylinePath(polyline, position);\r\n } else {\r\n const options = new PolylineOptions();\r\n options.addToMap = true;\r\n\r\n this.drawPolyline(type, options, null);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to get the path of some polyline\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {number[]}\r\n */\r\n public getPolylinePath(type: string, condition?: any): number[][] {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n if (polyline && polyline.length) {\r\n return this.map.getPolylinePath(polyline[0]);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to clear polyline selected from the currentMap\r\n */\r\n public removePolylineHighlight(): void {\r\n this.map.removePolylineHighlight();\r\n }\r\n\r\n /**\r\n * Use this function to add listeners on polyline\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n public addPolylineEvent(type: string, event: PolylineEventType, eventFunction: any, condition?: any): void {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n this.map.addPolylineEvent(polyline, event, eventFunction);\r\n }\r\n\r\n /**\r\n * Use this function to remove listeners of polyline\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n public removePolylineEvent(type: string, event: PolylineEventType, condition?: any): void {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n this.map.removePolylineEvent(polyline, event);\r\n }\r\n\r\n /**\r\n * Use this function to set position of polyline highlight\r\n * @param {string} type\r\n * @param {number} initialIndex\r\n * @param {any} condition [nullable]\r\n */\r\n public setIndexPolylineHighlight(type: string, initialIndex: number, condition?: any) {\r\n const polylines = this.getPolylines(type, condition);\r\n\r\n if (polylines && polylines.length) {\r\n this.map.setIndexPolylineHighlight(polylines[0], initialIndex);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to get the object of a polyline\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {object}\r\n */\r\n public getObjectPolyline(type: string, condition?: any): object {\r\n const polylines = this.getPolylines(type, condition);\r\n\r\n if (polylines && polylines.length) {\r\n return this.map.getObjectPolyline(polylines[0]);\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to get the object of the polyline highligth\r\n * @returns {object}\r\n */\r\n public getObjectPolylineHighlight(): any {\r\n return this.map.getObjectPolylineHighlight();\r\n }\r\n\r\n /**\r\n * Use this function to add events on polyline highligtht / selected polyline\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} eventFunction\r\n */\r\n public addPolylineHighlightEvent(event: PolylineEventType, eventFunction: any) {\r\n this.map.addPolylineHighlightEvent(event, eventFunction);\r\n }\r\n\r\n /**\r\n * Use this function to get initial and final index of the polyline highlight\r\n * @returns {number[]} returns an array with initial index and final index\r\n */\r\n public getPolylineHighlightIndex(): number[] {\r\n return this.map.getPolylineHighlightIndex();\r\n }\r\n\r\n /* Info Windows */\r\n /**\r\n * Use this function to draw popups on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PopupOptions} options\r\n */\r\n public drawPopup(type: string, options: PopupOptions): void {\r\n let marker: any = null;\r\n if (options.marker) {\r\n const markers = this.getMarkers(options.marker, options.conditionMarker);\r\n marker = markers[0];\r\n }\r\n\r\n let popup: any;\r\n if (this.infoWindowList[type]) {\r\n popup = this.map.alterPopup(this.infoWindowList[type], options, marker);\r\n } else {\r\n popup = this.map.drawPopup(options, marker);\r\n }\r\n\r\n this.infoWindowList[type] = popup;\r\n }\r\n\r\n /**\r\n * Use this function to alter popups\r\n * @param {string} type\r\n * @param {InlogMaps.PopupOptions} options\r\n */\r\n public alterPopup(type: string, options: PopupOptions): void {\r\n const popups = this.infoWindowList[type];\r\n\r\n let markers: any;\r\n if (options.marker) {\r\n markers = this.getMarkers(options.marker, options.conditionMarker);\r\n }\r\n\r\n if (popups) {\r\n this.map.alterPopupContent(popups, options, markers ? markers[0] : null);\r\n }\r\n }\r\n\r\n /**\r\n *\r\n * @param {string} type\r\n * @returns {object}\r\n */\r\n public getObjectOpenPopup(type: string): object {\r\n return this.infoWindowList[type] ? this.infoWindowList[type].object : null;\r\n }\r\n\r\n /**\r\n * Use this function to close popup by type\r\n * @param {string} type\r\n */\r\n public closePopup(type: string): void {\r\n if (this.infoWindowList[type]) {\r\n this.map.closePopup(this.infoWindowList[type])\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to close all popups\r\n * @param {string} type\r\n */\r\n public closeAllPopups(): void {\r\n for (const type in this.infoWindowList) {\r\n if (this.infoWindowList.hasOwnProperty(type)) {\r\n this.closePopup(type);\r\n }\r\n }\r\n }\r\n\r\n /* Map */\r\n /**\r\n * Resize de map based on html size\r\n */\r\n public resizeMap(): void {\r\n this.map.resizeMap();\r\n }\r\n\r\n /**\r\n * Use this function to add event clicks on the currentMap\r\n * @param {InlogMaps.MapEventType} eventType\r\n * @param eventFunction function callback\r\n */\r\n public addEventMap(eventType: MapEventType, eventFunction: any): void {\r\n this.map.addEventMap(eventType, eventFunction);\r\n }\r\n\r\n /**\r\n * Use this function to remove event clicks from the currentMap\r\n * @param {InlogMaps.MapEventType} eventType\r\n */\r\n public removeEventMap(eventType: MapEventType): void {\r\n this.map.removeEventMap(eventType);\r\n }\r\n\r\n /**\r\n * Returns the current zoom level of the map view\r\n * @returns {number}\r\n */\r\n public getZoom(): number {\r\n return this.map.getZoom();\r\n }\r\n\r\n /**\r\n * Set the current zoom level of the map view\r\n * @param {number} zoom\r\n */\r\n public setZoom(zoom: number): void {\r\n this.map.setZoom(zoom);\r\n }\r\n\r\n /**\r\n * Returns the center position of the map\r\n * @returns {number[]}\r\n */\r\n public getCenter(): number[] {\r\n return this.map.getCenter();\r\n }\r\n\r\n /**\r\n * Set the position center of the map\r\n * @param {number[]} position\r\n */\r\n public setCenter(position: number[]): void {\r\n this.map.setCenter(position);\r\n }\r\n\r\n /**\r\n * Returns the coordinates from pixels\r\n * @param {number} offsetx\r\n * @param {number} offsety\r\n * @returns {number[]}\r\n */\r\n public pixelsToLatLng(offsetx: number, offsety: number): number[] {\r\n return this.map.pixelsToLatLng(offsetx, offsety);\r\n }\r\n\r\n /**\r\n * Use this functions to fit bounds on elements with same type and condition\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n public fitBoundsElements(type: string, condition?: any): void {\r\n const markers = this.getMarkers(type, condition)\r\n .filter((marker: any) => this.map.isMarkerOnMap(marker));\r\n\r\n const circles = this.getCircles(type, condition)\r\n .filter((circle: any) => this.map.isCircleOnMap(circle));\r\n\r\n const polygons = this.getPolygons(type, condition)\r\n .filter((polygon: any) => this.map.isPolygonOnMap(polygon));\r\n\r\n const polylines = this.getPolylines(type, condition)\r\n .filter((polyline: any) => this.map.isPolylineOnMap(polyline));\r\n\r\n this.map.fitBoundsElements(markers, circles, polygons, polylines);\r\n }\r\n\r\n /* Overlay */\r\n /**\r\n * Use this function to dray overlays on the current map\r\n * @param {string} type\r\n * @param {InlogMaps.OverlayOptions} options\r\n */\r\n public drawOverlay(type: string, options: OverlayOptions): void {\r\n let overlay = null;\r\n\r\n if (options.polygon) {\r\n const polygons = this.getPolygons(options.polygon, options.conditionPolygon);\r\n\r\n if (polygons && polygons.length) {\r\n overlay = this.map.drawOverlay(options, polygons);\r\n }\r\n } else {\r\n overlay = this.map.drawOverlay(options);\r\n }\r\n\r\n if (overlay != null) {\r\n if (!this.overlayList[type]) {\r\n this.overlayList[type] = [];\r\n }\r\n this.overlayList[type].push(overlay);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to show or hide overlay\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n public toggleOverlay(show: boolean, type: string, condition?: any): void {\r\n const overlays = this.getOverlays(type, condition);\r\n\r\n if (overlays && overlays.length) {\r\n this.map.toggleOverlay(overlays, show);\r\n }\r\n }\r\n\r\n /**\r\n * Remove overlays from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove overlays with the condition [nullable]\r\n */\r\n public removeOverlays(type: string, condition?: any): void {\r\n if (this.overlayList[type] && condition) {\r\n const overlays = this.getOverlays(type, condition);\r\n\r\n // Hide markers with the condition\r\n this.map.toggleOverlay(overlays, false);\r\n\r\n // Keep markers that doesn't have the condition\r\n this.overlayList[type] = this.overlayList[type].filter((overlay: any) => !condition(overlay.object));\r\n } else {\r\n if (this.overlayList[type]) {\r\n this.map.toggleOverlay(this.overlayList[type], false);\r\n }\r\n this.overlayList[type] = [];\r\n }\r\n\r\n if (this.overlayList[type].length === 0) {\r\n delete this.overlayList[type];\r\n }\r\n }\r\n\r\n /**\r\n * Remove all overlays from the map and from the internal list\r\n */\r\n public removeAllOverlays(): void {\r\n for (const type in this.overlayList) {\r\n if (this.overlayList.hasOwnProperty(type)) {\r\n this.removeOverlays(type);\r\n }\r\n }\r\n }\r\n\r\n /* Private Methods */\r\n private getMarkers(type: string, condition: any): any[] {\r\n const markers = this.markersList[type];\r\n\r\n if (markers && markers.length) {\r\n return condition ? markers.filter((marker: any) => condition(marker.object)) : markers;\r\n } else return [];\r\n }\r\n\r\n private getPolygons(type: string, condition: any): any[] {\r\n const polygons = this.polygonsList[type];\r\n\r\n if (polygons && polygons.length) {\r\n return condition ? polygons.filter((polygon: any) => condition(polygon.object)) : polygons;\r\n } else return [];\r\n }\r\n\r\n private getCircles(type: string, condition: any): any[] {\r\n const circles = this.circlesList[type];\r\n\r\n if (circles && circles.length) {\r\n return condition ? circles.filter((circle: any) => condition(circle.object)) : circles;\r\n } else return [];\r\n }\r\n\r\n private getPolylines(type: string, condition: any): any[] {\r\n const polylines = this.polylinesList[type];\r\n\r\n if (polylines && polylines.length) {\r\n return condition ? polylines.filter((polyline: any) => condition(polyline.object)) : polylines;\r\n } else return [];\r\n }\r\n\r\n private getOverlays(type: string, condition: any): any[] {\r\n const overlays = this.overlayList[type];\r\n\r\n if (overlays && overlays.length) {\r\n return condition ? overlays.filter((overlay: any) => condition(overlay.object)) : overlays;\r\n } else return [];\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/map.ts","import { MapsApiLoaderService } from '../../utils/maps-api-loader.service';\r\nimport { CircleEventType, MapEventType, MarkerEventType, PolygonEventType, PolylineEventType } from '../dto/event-type';\r\nimport { MapType } from '../dto/map-type';\r\nimport CircleAlterOptions from '../features/circle/circle-alter-options';\r\nimport CircleOptions from '../features/circle/circle-options';\r\nimport GeoJsonOptions from '../features/geojson/geojson-options';\r\nimport MarkerClustererConfig from '../features/marker-clusterer/marker-clusterer-config';\r\nimport CircleMarkerOptions from '../features/marker/circle-marker-options';\r\nimport MarkerAlterOptions from '../features/marker/marker-alter-options';\r\nimport MarkerOptions from '../features/marker/marker-options';\r\nimport OverlayOptions from '../features/overlay/overlay-options';\r\nimport PolygonAlterOptions from '../features/polygons/polygon-alter-options';\r\nimport PolygonOptions from '../features/polygons/polygon-options';\r\nimport PolylineOptions from '../features/polyline/polyline-options';\r\nimport PopupOptions from '../features/popup/popup-options';\r\nimport GoogleCircles from './google/google-circles';\r\nimport GoogleGeoJson from './google/google-geojson';\r\nimport GoogleMap from './google/google-map';\r\nimport GoogleMarkers from './google/google-markers';\r\nimport GoogleOverlays from './google/google-overlay';\r\nimport GooglePolygons from './google/google-polygons';\r\nimport GooglePolylines from './google/google-polylines';\r\nimport GooglePopups from './google/google-popup';\r\nimport IMapFunctions from './mapFunctions';\r\n\r\nexport default class GoogleMaps implements IMapFunctions {\r\n private googleMarkers: GoogleMarkers;\r\n private googlePolygons: GooglePolygons;\r\n private googleCircles: GoogleCircles;\r\n private googlePolylines: GooglePolylines;\r\n private googlePopups: GooglePopups;\r\n private googleMap: GoogleMap;\r\n private googleOverlays: GoogleOverlays;\r\n private googleGeoJson: GoogleGeoJson;\r\n\r\n private mapsApiLoader: MapsApiLoaderService = new MapsApiLoaderService();\r\n\r\n constructor() { /* */ }\r\n\r\n public async initialize(mapType: MapType, params: any, elementId: string): Promise<any> {\r\n try {\r\n const api = await this.mapsApiLoader.loadApi(mapType, params);\r\n const google = api;\r\n const options: any = {\r\n center: new google.maps.LatLng(-14, -54),\r\n fullscreenControl: false,\r\n keyboardShortcuts: false,\r\n mapTypeControl: true,\r\n minZoom: 4,\r\n rotateControl: false,\r\n scaleControl: false,\r\n streetViewControl: false,\r\n zoom: 4,\r\n zoomControl: true\r\n };\r\n\r\n if (params.gestureHandling) {\r\n options.gestureHandling = 'cooperative';\r\n } else {\r\n options.gestureHandling = 'greedy';\r\n }\r\n\r\n if (params.options) {\r\n for (const key in params.options) {\r\n if (params.options.hasOwnProperty(key)) {\r\n options[key] = params.options[key];\r\n }\r\n }\r\n }\r\n\r\n const imageMapTypes = [];\r\n if (params.mapTiles) {\r\n const ids = [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE];\r\n\r\n params.mapTiles.forEach((tile: any) => {\r\n ids.push(tile.name);\r\n\r\n const mapTypeOptions = {\r\n getTileUrl: (coord: any, zoom: any) =>\r\n `https://tile.openstreetmap.org/${zoom}/${coord.x}/${coord.y}.png`,\r\n isPng: true,\r\n maxZoom: 19,\r\n minZoom: 0,\r\n name: 'OpenStreetMap',\r\n tileSize: new google.maps.Size(256, 256),\r\n };\r\n\r\n for (const key in tile) {\r\n if (tile.hasOwnProperty(key)) {\r\n mapTypeOptions[key] = tile[key];\r\n }\r\n }\r\n\r\n const imageMapType = new google.maps.ImageMapType(mapTypeOptions);\r\n imageMapTypes.push({ id: tile.name, tile: imageMapType });\r\n });\r\n\r\n options.mapTypeControlOptions = {\r\n mapTypeIds: ids,\r\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR\r\n };\r\n }\r\n\r\n const map = new google.maps.Map(document.getElementById(elementId), options);\r\n this.googleMarkers = new GoogleMarkers(map, google);\r\n this.googlePolygons = new GooglePolygons(map, google);\r\n this.googleCircles = new GoogleCircles(map, google);\r\n this.googlePopups = new GooglePopups(map, google);\r\n this.googlePolylines = new GooglePolylines(map, google, this.googlePopups);\r\n this.googleMap = new GoogleMap(map, google);\r\n this.googleOverlays = new GoogleOverlays(map, google, this.googlePolygons);\r\n this.googleGeoJson = new GoogleGeoJson(map, google);\r\n\r\n if (imageMapTypes && imageMapTypes.length) {\r\n imageMapTypes.forEach((image: any) => {\r\n map.mapTypes.set(image.id, image.tile);\r\n });\r\n }\r\n\r\n if (params.showTraffic) {\r\n const trafficLayer = new google.maps.TrafficLayer();\r\n trafficLayer.setMap(map);\r\n }\r\n\r\n return this;\r\n } catch (err) {\r\n return err;\r\n }\r\n }\r\n\r\n /* GEOJson */\r\n public loadGEOJson(data: object, options: GeoJsonOptions, eventClick: any) {\r\n this.googleGeoJson.loadGEOJson(data, options, eventClick);\r\n }\r\n\r\n /* Markers */\r\n public drawMarker(options: MarkerOptions, eventClick: any): any {\r\n return this.googleMarkers.drawMarker(options, eventClick);\r\n }\r\n\r\n public drawCircleMarker(options: CircleMarkerOptions, eventClick: any): any {\r\n return this.googleMarkers.drawCircleMarker(options, eventClick);\r\n }\r\n\r\n public toggleMarkers(markers: any[], show: boolean, markerClusterer?: any): void {\r\n this.googleMarkers.toggleMarkers(markers, show, markerClusterer);\r\n }\r\n\r\n public alterMarkerOptions(markers: any[], options: MarkerAlterOptions): void {\r\n this.googleMarkers.alterMarkerOptions(markers, options);\r\n }\r\n\r\n public alterMarkerPosition(markers: any[], position: number[], addTransition: boolean): void {\r\n this.googleMarkers.alterMarkerPosition(markers, position, addTransition);\r\n }\r\n\r\n public fitBoundsPositions(markers: any[]): void {\r\n this.googleMarkers.fitBoundsPositions(markers);\r\n }\r\n\r\n public isMarkerOnMap(marker: any): boolean {\r\n return this.googleMarkers.isMarkerOnMap(marker);\r\n }\r\n\r\n public setCenterMarker(marker: any): void {\r\n this.googleMarkers.setCenterMarker(marker);\r\n }\r\n\r\n public addMarkerEvent(markers: any, eventType: MarkerEventType, eventFunction: any): void {\r\n this.googleMarkers.addMarkerEvent(markers, eventType, eventFunction);\r\n }\r\n\r\n public removeMarkerEvent(markers: any, event: MarkerEventType): void {\r\n this.googleMarkers.removeMarkerEvent(markers, event);\r\n }\r\n\r\n /* Marker Clusterer */\r\n public addMarkerClusterer(config: MarkerClustererConfig): any {\r\n return this.googleMarkers.addMarkerClusterer(config);\r\n }\r\n\r\n public alterMarkerClustererConfig(markerClusterer: any, config: MarkerClustererConfig): void {\r\n this.googleMarkers.alterMarkerClustererConfig(markerClusterer, config);\r\n }\r\n\r\n public refreshClusterer(markerClusterer: any): void {\r\n this.googleMarkers.refreshClusterer(markerClusterer);\r\n }\r\n\r\n public addMarkerOnClusterer(marker: any, markerClusterer: any): void {\r\n this.googleMarkers.addMarkerOnClusterer(marker, markerClusterer);\r\n }\r\n\r\n public removeMarkerFromClusterer(marker: any, markerClusterer: any): void {\r\n this.googleMarkers.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n\r\n public clearMarkersClusterer(markerClusterer: any): void {\r\n this.googleMarkers.clearMarkersClusterer(markerClusterer);\r\n }\r\n\r\n public countMarkersOnCluster(markerClusterer: any): number {\r\n return this.googleMarkers.countMarkersOnCluster(markerClusterer);\r\n }\r\n\r\n /* Polygons */\r\n public drawPolygon(options: PolygonOptions, eventClick: any): any {\r\n return this.googlePolygons.drawPolygon(options, eventClick);\r\n }\r\n\r\n public togglePolygons(polygons: any[], show: boolean): void {\r\n this.googlePolygons.togglePolygons(polygons, show);\r\n }\r\n\r\n public alterPolygonOptions(polygons: any[], options: PolygonAlterOptions): void {\r\n this.googlePolygons.alterPolygonOptions(polygons, options);\r\n }\r\n\r\n public fitBoundsPolygons(polygons: any): void {\r\n this.googlePolygons.fitBoundsPolygons(polygons);\r\n }\r\n\r\n public setCenterPolygons(polygons: any): void {\r\n this.googlePolygons.setCenterPolygons(polygons);\r\n }\r\n\r\n public isPolygonOnMap(polygon: any): boolean {\r\n return this.googlePolygons.isPolygonOnMap(polygon);\r\n }\r\n\r\n public getPolygonPath(polygon: any): number[][] {\r\n return this.googlePolygons.getPolygonPath(polygon);\r\n }\r\n\r\n public addPolygonEvent(polygons: any, eventType: PolygonEventType, eventFunction: any): void {\r\n return this.googlePolygons.addPolygonEvent(polygons, eventType, eventFunction);\r\n }\r\n\r\n public removePolygonEvent(polygons: any, event: PolygonEventType): void {\r\n this.googlePolygons.removePolygonEvent(polygons, event);\r\n }\r\n\r\n /* Circles */\r\n public drawCircle(options: CircleOptions, eventClick: any): any {\r\n return this.googleCircles.drawCircle(options, eventClick);\r\n }\r\n\r\n public toggleCircles(circles: any[], show: boolean): void {\r\n this.googleCircles.toggleCircles(circles, show);\r\n }\r\n\r\n public alterCircleOptions(circles: any[], options: CircleAlterOptions): void {\r\n this.googleCircles.alterCircleOptions(circles, options);\r\n }\r\n\r\n public fitBoundsCircles(circles: any): void {\r\n this.googleCircles.fitBoundsCircles(circles);\r\n }\r\n\r\n public isCircleOnMap(circle: any): boolean {\r\n return this.googleCircles.isCircleOnMap(circle);\r\n }\r\n\r\n public getCircleCenter(circle: any): number[] {\r\n return this.googleCircles.getCircleCenter(circle);\r\n }\r\n\r\n public getCircleRadius(circle: any): number {\r\n return this.googleCircles.getCircleRadius(circle);\r\n }\r\n\r\n public addCircleEvent(circles: any, eventType: CircleEventType, eventFunction: any): void {\r\n this.googleCircles.addCircleEvent(circles, eventType, eventFunction);\r\n }\r\n\r\n public removeCircleEvent(circles: any, event: CircleEventType): void {\r\n this.googleCircles.removeCircleEvent(circles, event);\r\n }\r\n\r\n /* Polylines */\r\n public drawPolyline(options: PolylineOptions, eventClick: any): any {\r\n return this.googlePolylines.drawPolyline(options, eventClick);\r\n }\r\n\r\n public drawPolylineWithNavigation(options: PolylineOptions, eventClick?: any): any {\r\n return this.googlePolylines.drawPolylineWithNavigation(options, eventClick);\r\n }\r\n\r\n public togglePolylines(polylines: any, show: boolean): void {\r\n this.googlePolylines.togglePolylines(polylines, show);\r\n }\r\n\r\n public alterPolylineOptions(polylines: any, options: PolylineOptions): void {\r\n this.googlePolylines.alterPolylineOptions(polylines, options);\r\n }\r\n\r\n public fitBoundsPolylines(polylines: any): void {\r\n this.googlePolylines.fitBoundsPolylines(polylines);\r\n }\r\n\r\n public isPolylineOnMap(polyline: any): boolean {\r\n return this.googlePolylines.isPolylineOnMap(polyline);\r\n }\r\n\r\n public addPolylinePath(polylines: any, position: number[]): void {\r\n this.googlePolylines.addPolylinePath(polylines, position);\r\n }\r\n\r\n public getPolylinePath(polyline: any): number[][] {\r\n return this.googlePolylines.getPolylinePath(polyline);\r\n }\r\n\r\n public removePolylineHighlight(): void {\r\n this.googlePolylines.removePolylineHighlight();\r\n }\r\n\r\n public addPolylineEvent(polylines: any, eventType: PolylineEventType, eventFunction: any): void {\r\n this.googlePolylines.addPolylineEvent(polylines, eventType, eventFunction);\r\n }\r\n\r\n public removePolylineEvent(polylines: any, event: PolylineEventType): void {\r\n this.googlePolylines.removePolylineEvent(polylines, event);\r\n }\r\n\r\n public setIndexPolylineHighlight(polyline: any, index: number): void {\r\n this.googlePolylines.setIndexPolylineHighlight(polyline, index);\r\n }\r\n\r\n public getObjectPolyline(polyline: any): object {\r\n return this.googlePolylines.getObjectPolyline(polyline);\r\n }\r\n\r\n public getObjectPolylineHighlight(): object {\r\n return this.googlePolylines.getObjectPolylineHighlight();\r\n }\r\n\r\n public addPolylineHighlightEvent(eventType: PolylineEventType, eventFunction: any): void {\r\n this.googlePolylines.addPolylineHighlightEvent(eventType, eventFunction);\r\n }\r\n\r\n public getPolylineHighlightIndex(): number[] {\r\n return this.googlePolylines.getPolylineHighlightIndex();\r\n }\r\n\r\n /* Info Windows */\r\n public drawPopup(options: PopupOptions, marker?: any): any {\r\n return this.googlePopups.drawPopup(options, marker);\r\n }\r\n\r\n public alterPopup(popup: any, options: PopupOptions, marker?: any): any {\r\n return this.googlePopups.alterPopup(popup, options, marker);\r\n }\r\n\r\n public alterPopupContent(popup: any, options: PopupOptions, marker?: any): void {\r\n this.googlePopups.alterPopupContent(popup, options, marker);\r\n }\r\n\r\n public closePopup(popup: any): void {\r\n this.googlePopups.closePopup(popup);\r\n }\r\n\r\n /* Map */\r\n public resizeMap(): void {\r\n this.googleMap.resizeMap();\r\n }\r\n\r\n public addEventMap(eventType: MapEventType, eventFunction: any): void {\r\n this.googleMap.addEventMap(eventType, eventFunction);\r\n }\r\n\r\n public removeEventMap(eventType: MapEventType): void {\r\n this.googleMap.removeEventMap(eventType);\r\n }\r\n\r\n public getZoom(): number {\r\n return this.googleMap.getZoom();\r\n }\r\n\r\n public setZoom(zoom: number): void {\r\n this.googleMap.setZoom(zoom);\r\n }\r\n\r\n public getCenter(): number[] {\r\n return this.googleMap.getCenter();\r\n }\r\n\r\n public setCenter(position: number[]): void {\r\n this.googleMap.setCenter(position);\r\n }\r\n\r\n public pixelsToLatLng(offsetx: number, offsety: number): number[] {\r\n return this.googleMap.pixelsToLatLng(offsetx, offsety);\r\n }\r\n\r\n public fitBoundsElements(markers: any, circles: any, polygons: any, polylines: any): void {\r\n this.googleMap.fitBoundsElements(markers, circles, polygons, polylines);\r\n }\r\n\r\n /* Overlay */\r\n public drawOverlay(options: OverlayOptions, polygons: any) {\r\n return this.googleOverlays.drawOverlay(options, polygons);\r\n }\r\n\r\n public toggleOverlay(overlays: any[], show: boolean): void {\r\n this.googleOverlays.toggleOverlay(overlays, show);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/googleMaps.ts","import { CircleEventType } from '../../dto/event-type';\r\nimport CircleAlterOptions from '../../features/circle/circle-alter-options';\r\nimport CircleOptions from '../../features/circle/circle-options';\r\nimport EventReturn from '../../features/events/event-return';\r\n\r\nexport default class GoogleCircles {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public drawCircle(options: CircleOptions, eventClick: any) {\r\n const self = this;\r\n const latlng = {\r\n lat: options.center[0],\r\n lng: options.center[1]\r\n };\r\n const newOptions = {\r\n center: latlng,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n object: options.object,\r\n radius: options.radius,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity,\r\n strokeWeight: options.weight,\r\n suppressUndo: true\r\n };\r\n\r\n const circle = new this.google.maps.Circle(newOptions);\r\n\r\n if (eventClick) {\r\n this.google.maps.event.addListener(circle, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n circle.setMap(self.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(circle.getBounds());\r\n }\r\n\r\n return circle;\r\n }\r\n\r\n public toggleCircles(circles: any[], show: boolean) {\r\n const self = this;\r\n circles.forEach((circle) => circle.setMap(show ? self.map : null));\r\n }\r\n\r\n public alterCircleOptions(circles: any[], options: CircleAlterOptions) {\r\n circles.forEach((circle) => {\r\n const latlng = options.center && options.center.length > 0 ?\r\n { lat: options.center[0], lng: options.center[1] } : circle.getCenter();\r\n\r\n const newOptions = {\r\n center: latlng,\r\n fillColor: options.fillColor ? options.fillColor : circle.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : circle.fillOpacity,\r\n radius: options.radius ? options.radius : circle.radius,\r\n strokeColor: options.color ? options.color : circle.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : circle.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : circle.strokeWeight,\r\n editable: options.editable !== null && options.editable !== undefined ?\r\n options.editable : circle.editable,\r\n draggable: options.draggable !== null && options.draggable !== undefined ?\r\n options.draggable : circle.draggable\r\n };\r\n\r\n circle.setOptions(newOptions);\r\n });\r\n }\r\n\r\n public fitBoundsCircles(circles: any): void {\r\n this.map.fitBounds(this.getCirclesBounds(circles));\r\n }\r\n\r\n public isCircleOnMap(circle: any): boolean {\r\n return !!circle.map;\r\n }\r\n\r\n public getCircleCenter(circle: any): number[] {\r\n const center = circle.getCenter();\r\n\r\n return [center.lat(), center.lng()];\r\n }\r\n\r\n public getCircleRadius(circle: any): number {\r\n return circle.getRadius();\r\n }\r\n\r\n public addCircleEvent(circles: any, eventType: CircleEventType, eventFunction: any): void {\r\n circles.forEach((circle: any) => {\r\n switch (eventType) {\r\n case CircleEventType.Click:\r\n this.google.maps.event.addListener(circle, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, circle.object);\r\n });\r\n break;\r\n case CircleEventType.CenterChanged:\r\n this.google.maps.event.addListener(circle, 'center_changed', () => {\r\n const param = new EventReturn([circle.getCenter().lat(), circle.getCenter().lng()]);\r\n eventFunction(param, circle.object);\r\n });\r\n case CircleEventType.RadiusChanged:\r\n this.google.maps.event.addListener(circle, 'radius_changed', (event: any) => {\r\n const param = new EventReturn([circle.getCenter().lat(), circle.getCenter().lng()]);\r\n eventFunction(param, circle.object, circle.getRadius());\r\n });\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removeCircleEvent(circles: any, event: CircleEventType): void {\r\n circles.forEach((circle: any) => {\r\n switch (event) {\r\n case CircleEventType.Click:\r\n this.google.maps.event.clearListeners(circle, 'click');\r\n case CircleEventType.CenterChanged:\r\n this.google.maps.event.clearListeners(circle, 'center_changed');\r\n case CircleEventType.RadiusChanged:\r\n this.google.maps.event.clearListeners(circle, 'radius_changed');\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private getCirclesBounds(circles: any) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n\r\n circles.forEach((circulo: any) => bounds.union(circulo.getBounds()));\r\n return bounds;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-circles.ts","import EventReturn from '../../features/events/event-return';\r\nimport GeoJsonOptions from '../../features/geojson/geojson-options';\r\n\r\nexport default class GoogleGeoJson {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public loadGEOJson(data: object, options: GeoJsonOptions, eventClick: any) {\r\n const self = this;\r\n const objects = self.parseGeoJson(data, options);\r\n\r\n objects.forEach((elem) => {\r\n if (eventClick) {\r\n elem.addListener('click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param);\r\n });\r\n }\r\n elem.setMap(self.map);\r\n });\r\n }\r\n\r\n private parseGeoJson(data: any, options: GeoJsonOptions) {\r\n const self = this;\r\n const parsedFeatures = [];\r\n\r\n if (Array.isArray(data.features)) {\r\n for (const feature of data.features) {\r\n parsedFeatures.push(self.parseGeoJsonToObject(feature, options));\r\n }\r\n } else {\r\n parsedFeatures.push(self.parseGeoJsonToObject(data, options));\r\n }\r\n\r\n return parsedFeatures;\r\n }\r\n\r\n private parseGeoJsonToObject(data: any, objectOptions: any) {\r\n const geometry = data.geometry;\r\n\r\n if (data.properties) {\r\n Object.assign(objectOptions, data.properties);\r\n }\r\n\r\n switch (geometry.type) {\r\n case 'Point':\r\n objectOptions.position = {\r\n lat: geometry.coordinates[1],\r\n lng: geometry.coordinates[0]\r\n };\r\n return new this.google.maps.Marker(objectOptions);\r\n case 'Polygon':\r\n objectOptions.paths = [];\r\n geometry.coordinates.forEach((polygon) =>\r\n objectOptions.paths.push(polygon.map((elem) => ({\r\n lat: elem[1],\r\n lng: elem[0]\r\n })))\r\n );\r\n return new this.google.maps.Polygon(objectOptions);\r\n case 'LineString':\r\n objectOptions.path = geometry.coordinates.map((elem) => ({\r\n lat: elem[1],\r\n lng: elem[0]\r\n }));\r\n return new this.google.maps.Polyline(objectOptions);\r\n default:\r\n throw new Error('Forma de objeto desconhecida.');\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-geojson.ts","import { MapEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\n\r\nexport default class GoogleMap {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public resizeMap(): void {\r\n google.maps.event.trigger(this.map, 'resize');\r\n }\r\n\r\n public addEventMap(eventType: MapEventType, eventFunction: any) {\r\n const self = this;\r\n\r\n switch (eventType) {\r\n case MapEventType.Click:\r\n this.google.maps.event.addListener(self.map, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param);\r\n });\r\n break;\r\n case MapEventType.ZoomChanged:\r\n self.map.addListener('zoom_changed', () => {\r\n const param = new EventReturn([self.map.getCenter().lat(), self.map.getCenter().lng()]);\r\n eventFunction(param);\r\n });\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n public removeEventMap(eventType: MapEventType) {\r\n const self = this;\r\n switch (eventType) {\r\n case MapEventType.Click:\r\n this.google.maps.event.clearListeners(self.map, 'click');\r\n break;\r\n case MapEventType.ZoomChanged:\r\n this.google.maps.event.clearListeners(self.map, 'zoom_changed');\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n public getZoom(): number {\r\n return this.map.getZoom();\r\n }\r\n\r\n public setZoom(zoom: number) {\r\n return this.map.setZoom(zoom);\r\n }\r\n\r\n public getCenter(): number[] {\r\n const center = this.map.getCenter();\r\n return [center.lat(), center.lng()];\r\n }\r\n\r\n public setCenter(position: number[]) {\r\n this.map.setCenter(new google.maps.LatLng(position[0], position[1]));\r\n }\r\n\r\n public pixelsToLatLng(offsetx: number, offsety: number) {\r\n const scale = Math.pow(2, this.map.getZoom());\r\n const worldCoordinateCenter = this.map.getProjection().fromLatLngToPoint(this.map.getCenter());\r\n const pixelOffset = new google.maps.Point(offsetx / scale || 0, offsety / scale || 0);\r\n\r\n const worldCoordinateNewCenter = new google.maps.Point(\r\n worldCoordinateCenter.x - pixelOffset.x,\r\n worldCoordinateCenter.y + pixelOffset.y\r\n );\r\n\r\n const latlng = this.map.getProjection().fromPointToLatLng(worldCoordinateNewCenter);\r\n return [latlng.lat(), latlng.lng()];\r\n }\r\n\r\n public fitBoundsElements(markers: any, circles: any, polygons: any, polylines: any) {\r\n const bounds = new google.maps.LatLngBounds();\r\n\r\n if (markers && markers.length) {\r\n markers.forEach((marker: any) => bounds.extend(marker.getPosition()));\r\n\r\n this.map.fitBounds(bounds);\r\n }\r\n\r\n if (circles && circles.length) {\r\n circles.forEach((circle: any) => bounds.union(circle.getBounds()));\r\n\r\n this.map.fitBounds(bounds);\r\n }\r\n\r\n if (polygons && polygons.length) {\r\n polygons.forEach((polygon: any) => polygon.getPaths()\r\n .forEach((path: any) => path.getArray()\r\n .forEach((ponto: any) => bounds.extend(ponto))));\r\n\r\n this.map.fitBounds(bounds);\r\n }\r\n\r\n if (polylines && polylines.length) {\r\n polylines.forEach((polyline: any) => polyline.getPath()\r\n .forEach((path: any) => bounds.extend(new google.maps.LatLng(path.lat(), path.lng()))));\r\n\r\n this.map.fitBounds(bounds);\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-map.ts","import { MarkerEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport MarkerClustererConfig from '../../features/marker-clusterer/marker-clusterer-config';\r\nimport CircleMarkerOptions from '../../features/marker/circle-marker-options';\r\nimport MarkerAlterOptions from '../../features/marker/marker-alter-options';\r\nimport MarkerOptions from '../../features/marker/marker-options';\r\n\r\nconst MarkerClusterer = require('@google/markerclustererplus');\r\n\r\nexport default class GoogleMarkers {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public drawMarker(options: MarkerOptions, eventClick: any) {\r\n const newOptions = {\r\n draggable: options.draggable,\r\n icon: null,\r\n object: options.object,\r\n position: {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n }\r\n };\r\n\r\n if (options.icon) {\r\n newOptions.icon = {\r\n url: options.icon.url\r\n };\r\n\r\n if (options.icon.size) {\r\n newOptions.icon.size = new this.google.maps.Size(options.icon.size[0], options.icon.size[1]);\r\n }\r\n }\r\n const marker = new this.google.maps.Marker(newOptions);\r\n\r\n if (eventClick) {\r\n this.google.maps.event.addListener(marker, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n\r\n eventClick(param, options.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n marker.setMap(this.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n\r\n bounds.extend(marker.getPosition());\r\n this.map.fitBounds(bounds);\r\n }\r\n\r\n return marker;\r\n }\r\n\r\n public drawCircleMarker(options: CircleMarkerOptions, eventClick: any) {\r\n const self = this;\r\n const newOptions = {\r\n icon: {\r\n fillColor: options.style.fillColor,\r\n fillOpacity: options.style.fillOpacity,\r\n path: this.google.maps.SymbolPath.CIRCLE,\r\n scale: options.style.radius,\r\n strokeColor: options.style.color,\r\n strokeWeight: options.style.weight\r\n },\r\n object: options.object,\r\n position: {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n }\r\n };\r\n\r\n const marker = new this.google.maps.Marker(newOptions);\r\n\r\n if (eventClick) {\r\n this.google.maps.event.addListener(marker, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n marker.setMap(self.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n bounds.extend(marker.getPosition());\r\n self.map.fitBounds(bounds);\r\n }\r\n\r\n return marker;\r\n }\r\n\r\n public toggleMarkers(markers: any[], show: boolean, markerClusterer?: any) {\r\n const self = this;\r\n markers.forEach((marker) => {\r\n marker.setMap(show ? self.map : null);\r\n\r\n if (markerClusterer) {\r\n if (show) {\r\n self.addMarkerOnClusterer(marker, markerClusterer);\r\n } else {\r\n self.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n }\r\n });\r\n }\r\n\r\n public alterMarkerOptions(markers: any[], options: MarkerAlterOptions) {\r\n let icon = null;\r\n let position = null;\r\n\r\n if (options.latlng) {\r\n position = {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n };\r\n }\r\n\r\n if (options.icon) {\r\n icon = options.icon;\r\n\r\n if (options.icon.size) {\r\n icon.size = new this.google.maps.Size(options.icon.size[0], options.icon.size[1]);\r\n }\r\n }\r\n\r\n markers.forEach((marker) => {\r\n if (options.style) {\r\n icon = {\r\n fillColor: options.style.fillColor ? options.style.fillColor : marker.icon.fillColor,\r\n fillOpacity: options.style.fillOpacity ? options.style.fillOpacity : marker.icon.fillOpacity,\r\n path: this.google.maps.SymbolPath.CIRCLE,\r\n scale: options.style.radius ? options.style.radius : marker.icon.scale,\r\n strokeColor: options.style.color ? options.style.color : marker.icon.strokeColor,\r\n strokeWeight: options.style.weight ? options.style.weight : marker.icon.strokeWeight\r\n };\r\n }\r\n\r\n let newOptions = null;\r\n if (position && icon) {\r\n newOptions = { icon, position };\r\n } else if (position) {\r\n newOptions = { position };\r\n } else {\r\n newOptions = { icon };\r\n }\r\n\r\n marker.setOptions(newOptions);\r\n });\r\n }\r\n\r\n public alterMarkerPosition(markers: any[], position: number[], addTransition: boolean) {\r\n const newPosition = {\r\n lat: position[0],\r\n lng: position[1]\r\n };\r\n\r\n markers.forEach((marker) => {\r\n if (addTransition) {\r\n this.moveTransitionMarker(newPosition, marker);\r\n } else {\r\n marker.setPosition(newPosition);\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsPositions(markers: any[]) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n markers.map((marker) => marker.position).forEach((position) => bounds.extend(position));\r\n this.map.fitBounds(bounds);\r\n }\r\n\r\n public isMarkerOnMap(marker: any): boolean {\r\n return !!marker.map;\r\n }\r\n\r\n public setCenterMarker(marker: any) {\r\n this.map.setCenter(marker.getPosition());\r\n }\r\n\r\n public addMarkerEvent(markers: any, eventType: MarkerEventType, eventFunction: any) {\r\n markers.forEach((marker: any) => {\r\n switch (eventType) {\r\n case MarkerEventType.Click:\r\n this.google.maps.event.addListener(marker, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.RightClick:\r\n this.google.maps.event.addListener(marker, 'rightclick', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.AfterDrag:\r\n this.google.maps.event.addListener(marker, 'dragend', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.MouseOver:\r\n this.google.maps.event.addListener(marker, 'mouseover', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.MouseOut:\r\n this.google.maps.event.addListener(marker, 'mouseout', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.BeforeDrag:\r\n this.google.maps.event.addListener(marker, 'dragstart', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removeMarkerEvent(markers: any, event: MarkerEventType): void {\r\n markers.forEach((marker: any) => {\r\n switch (event) {\r\n case MarkerEventType.Click:\r\n this.google.maps.event.clearListeners(marker, 'click');\r\n break;\r\n case MarkerEventType.RightClick:\r\n this.google.maps.event.clearListeners(marker, 'rightclick');\r\n break;\r\n case MarkerEventType.AfterDrag:\r\n this.google.maps.event.clearListeners(marker, 'dragend');\r\n break;\r\n case MarkerEventType.MouseOver:\r\n this.google.maps.event.clearListeners(marker, 'mouseover');\r\n break;\r\n case MarkerEventType.MouseOut:\r\n this.google.maps.event.clearListeners(marker, 'mouseout');\r\n break;\r\n case MarkerEventType.BeforeDrag:\r\n this.google.maps.event.clearListeners(marker, \"dragstart\");\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n /* Marker Clusterer */\r\n public addMarkerClusterer(config: MarkerClustererConfig): any {\r\n return new MarkerClusterer(this.map, [], {\r\n maxZoom: config.clusterMaxZoom,\r\n minimumClusterSize: config.clusterMinSize,\r\n zoomOnClick: config.clusterZoomOnClick\r\n });\r\n }\r\n\r\n public alterMarkerClustererConfig(markerClusterer: any, config: MarkerClustererConfig): void {\r\n markerClusterer.setZoomOnClick(config.clusterZoomOnClick);\r\n markerClusterer.setMinimumClusterSize(config.clusterMinSize);\r\n markerClusterer.setMaxZoom(config.clusterMaxZoom);\r\n }\r\n\r\n public refreshClusterer(markerClusterer: any): void {\r\n markerClusterer.repaint();\r\n }\r\n\r\n public addMarkerOnClusterer(marker: any, markerClusterer: any): void {\r\n if (markerClusterer.getMarkers().indexOf(marker) === -1) {\r\n markerClusterer.addMarker(marker, true);\r\n }\r\n }\r\n\r\n public removeMarkerFromClusterer(marker: any, markerClusterer: any): void {\r\n markerClusterer.removeMarker(marker);\r\n }\r\n\r\n public clearMarkersClusterer(markerClusterer: any): void {\r\n markerClusterer.clearMarkers();\r\n }\r\n\r\n public countMarkersOnCluster(markerClusterer: any): number {\r\n return markerClusterer.getMarkers().length;\r\n }\r\n\r\n private moveTransitionMarker(position: any, marker: any) {\r\n const numDeltas = 5;\r\n const reference = {\r\n deltaLat: (position.lat - marker.getPosition().lat()) / numDeltas,\r\n deltaLng: (position.lng - marker.getPosition().lng()) / numDeltas,\r\n i: 0,\r\n position: [marker.getPosition().lat(), marker.getPosition().lng()],\r\n lastPosition: position\r\n };\r\n\r\n this.moveMarker(marker, reference, numDeltas);\r\n }\r\n\r\n private moveMarker(marker: any, reference: any, numDeltas: number) {\r\n reference.position[0] += reference.deltaLat;\r\n reference.position[1] += reference.deltaLng;\r\n marker.setPosition(new google.maps.LatLng(reference.position[0], reference.position[1]));\r\n if (reference.i < numDeltas) {\r\n reference.i++;\r\n setTimeout(() => this.moveMarker(marker, reference, numDeltas), 20);\r\n } else if (reference.i === numDeltas) {\r\n setTimeout(() => marker.setPosition(reference.lastPosition), 20);\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-markers.ts","import EventReturn from '../../features/events/event-return';\r\nimport OverlayOptions from '../../features/overlay/overlay-options';\r\nimport GooglePolygons from './google-polygons';\r\n\r\nexport default class GoogleOverlays {\r\n private map = null;\r\n private google = null;\r\n private googlePolygons: GooglePolygons;\r\n private OverlayGoogle = null;\r\n\r\n constructor(map: any, google: any, googlePolygons: GooglePolygons) {\r\n this.map = map;\r\n this.google = google;\r\n this.googlePolygons = googlePolygons;\r\n\r\n OverlayGoogle.prototype = new this.google.maps.OverlayView();\r\n\r\n function OverlayGoogle(bounds: any, div: any, draggable: boolean, obj: any, afterDrag: any) {\r\n this.bounds_ = bounds;\r\n this.div_ = div;\r\n this.draggable = draggable;\r\n this.afterDragHandler = afterDrag;\r\n this.object = obj;\r\n this.setMap(map);\r\n }\r\n\r\n OverlayGoogle.prototype.onAdd = function () {\r\n const that = this;\r\n const panes = this.getPanes();\r\n panes.overlayLayer.appendChild(this.div_);\r\n panes.overlayMouseTarget.appendChild(this.div_);\r\n\r\n google.maps.event.addDomListener(this.div_, 'click', function () {\r\n google.maps.event.trigger(this.div_, 'click');\r\n });\r\n\r\n if (this.draggable) {\r\n google.maps.event.addDomListener(this.get('map').getDiv(), 'mouseleave', function () {\r\n google.maps.event.trigger(this.div_, 'mouseup');\r\n });\r\n\r\n google.maps.event.addDomListener(this.div_, 'mousedown', function (e) {\r\n this.style.cursor = 'move';\r\n that.map.set('draggable', false);\r\n that.set('origin', e);\r\n\r\n that.moveHandler = google.maps.event.addDomListener(that.get('map').getDiv(),\r\n 'mousemove', function (e) {\r\n const origin = that.get('origin');\r\n const left = origin.clientX - e.clientX;\r\n const top = origin.clientY - e.clientY;\r\n const pos = that.getProjection().fromLatLngToDivPixel(that.bounds_.getCenter());\r\n const latLng = that.getProjection()\r\n .fromDivPixelToLatLng(new google.maps.Point(pos.x - left, pos.y - top));\r\n\r\n that.set('origin', e);\r\n that.bounds_ = new google.maps.LatLngBounds();\r\n that.bounds_.extend(latLng);\r\n that.draw();\r\n });\r\n });\r\n\r\n google.maps.event.addDomListener(this.div_, 'mouseup', function () {\r\n that.map.set('draggable', true);\r\n this.style.cursor = 'default';\r\n google.maps.event.removeListener(that.moveHandler);\r\n\r\n if (that.afterDragHandler) {\r\n const latLng = that.bounds_.getCenter();\r\n const param = new EventReturn([latLng.lat(), latLng.lng()]);\r\n that.afterDragHandler(param, that.object);\r\n }\r\n });\r\n }\r\n };\r\n\r\n OverlayGoogle.prototype.draw = function () {\r\n const overlayProjection = this.getProjection();\r\n const center = overlayProjection.fromLatLngToDivPixel(this.bounds_.getCenter());\r\n\r\n const div = this.div_;\r\n div.style.left = center.x + 'px';\r\n div.style.top = center.y + 'px';\r\n };\r\n\r\n OverlayGoogle.prototype.onRemove = function () {\r\n this.div_.parentNode.removeChild(this.div_);\r\n };\r\n\r\n this.OverlayGoogle = OverlayGoogle;\r\n }\r\n\r\n public drawOverlay(options: OverlayOptions, polygons: any) {\r\n let bounds = null;\r\n\r\n if (polygons && polygons.length > 0) {\r\n bounds = this.googlePolygons.getPolygonsBounds(polygons);\r\n } else {\r\n bounds = new this.google.maps.LatLngBounds();\r\n bounds.extend(new this.google.maps.LatLng(options.position[0], options.position[1]));\r\n }\r\n\r\n const overlay = new this.OverlayGoogle(bounds, options.divElement,\r\n options.draggable, options.object, options.afterEventDragHandler);\r\n\r\n if (options.addToMap) {\r\n overlay.setMap(this.map);\r\n }\r\n\r\n overlay.object = options.object;\r\n return overlay;\r\n }\r\n\r\n public toggleOverlay(overlays: any[], show: boolean) {\r\n const self = this;\r\n overlays.forEach((overlay) => overlay.setMap(show ? self.map : null));\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-overlay.ts","import { PolygonEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport PolygonAlterOptions from '../../features/polygons/polygon-alter-options';\r\nimport PolygonOptions from '../../features/polygons/polygon-options';\r\n\r\nexport default class GooglePolygons {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public drawPolygon(options: PolygonOptions, eventClick: any) {\r\n const self = this;\r\n let paths = this.getPathRecursiveArray(options.path);\r\n paths = this.getPathPolylineArray(paths);\r\n\r\n const newOptions = {\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n object: options.object,\r\n paths,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity,\r\n strokeWeight: options.weight,\r\n suppressUndo: true,\r\n zIndex: options.zIndex\r\n };\r\n\r\n const polygon = new this.google.maps.Polygon(newOptions);\r\n\r\n if (eventClick) {\r\n this.google.maps.event.addListener(polygon, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n polygon.setMap(self.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(self.getPolygonBounds(polygon));\r\n }\r\n\r\n return polygon;\r\n }\r\n\r\n public togglePolygons(polygons: any[], show: boolean) {\r\n const self = this;\r\n polygons.forEach((polygon) => polygon.setMap(show ? self.map : null));\r\n }\r\n\r\n public alterPolygonOptions(polygons: any[], options: PolygonAlterOptions) {\r\n let newOptions = {};\r\n\r\n polygons.forEach((polygon) => {\r\n newOptions = {\r\n editable: options.editable !== null && options.editable !== undefined ?\r\n options.editable : polygon.editable,\r\n fillColor: options.fillColor ? options.fillColor : polygon.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : polygon.fillOpacity,\r\n strokeColor: options.color ? options.color : polygon.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : polygon.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : polygon.strokeWeight,\r\n draggable: options.draggable !== null && options.draggable !== undefined ?\r\n options.draggable : polygon.draggable\r\n };\r\n\r\n if (options.path) {\r\n const paths = [];\r\n options.path.forEach((path) => paths.push({ lat: path[0], lng: path[1] }));\r\n polygon.setPath(paths);\r\n }\r\n\r\n polygon.setOptions(newOptions);\r\n\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsPolygons(polygons: any): void {\r\n this.map.fitBounds(this.getPolygonsBounds(polygons));\r\n }\r\n\r\n public setCenterPolygons(polygons: any): void {\r\n this.map.setCenter(this.getPolygonsBounds(polygons).getCenter());\r\n }\r\n\r\n public isPolygonOnMap(polygon: any): boolean {\r\n return !!polygon.map;\r\n }\r\n\r\n public getPolygonPath(polygon: any): number[][] {\r\n return polygon.getPaths().getArray().map((x: any) => x.getArray().map(y => new EventReturn([y.lat(), y.lng()])));\r\n }\r\n\r\n public addPolygonEvent(polygons: any, eventType: PolygonEventType, eventFunction: any): void {\r\n polygons.forEach((polygon: any) => {\r\n switch (eventType) {\r\n case PolygonEventType.SetAt:\r\n this.addPolygonEventMove(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.InsertAt:\r\n this.addPolygonEventInsertAt(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.RemoveAt:\r\n this.addPolygonEventRemoveAt(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.DragPolygon:\r\n this.addPolygonEventDragPolygon(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.Click:\r\n this.addPolygonEventClick(polygon, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removePolygonEvent(polygons: any, event: PolygonEventType): void {\r\n polygons.forEach((polygon: any) => {\r\n switch (event) {\r\n case PolygonEventType.SetAt:\r\n this.google.maps.event.clearListeners(polygon.getPaths(), 'set_at');\r\n break;\r\n case PolygonEventType.InsertAt:\r\n this.google.maps.event.clearListeners(polygon.getPaths(), 'insert_at');\r\n break;\r\n case PolygonEventType.RemoveAt:\r\n this.google.maps.event.clearListeners(polygon.getPaths(), 'remove_at');\r\n break;\r\n case PolygonEventType.DragPolygon:\r\n this.google.maps.event.clearListeners(polygon, 'dragstart');\r\n this.google.maps.event.clearListeners(polygon, 'dragend');\r\n break;\r\n case PolygonEventType.Click:\r\n this.google.maps.event.clearListeners(polygon, 'click');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public getPolygonsBounds(polygons: any) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n\r\n polygons.forEach((polygon: any) => {\r\n const paths = polygon.getPaths().getArray();\r\n paths.forEach((path: any) => path.getArray().forEach((x: any) => bounds.extend(x)));\r\n });\r\n\r\n return bounds;\r\n }\r\n\r\n private getPolygonBounds(polygon: any) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n const paths = polygon.getPaths().getArray();\r\n\r\n paths.forEach((path: any) => path.getArray().forEach((x: any) => bounds.extend(x)));\r\n return bounds;\r\n }\r\n\r\n private addPolygonEventMove(polygon, eventFunction) {\r\n const polygonPathIdx = polygon.getPaths().getLength();\r\n\r\n for (let index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventMoveAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction);\r\n }\r\n }\r\n\r\n private addPolygonEventMoveAllPaths(polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'set_at', (newEvent: any, lastEvent: any) => {\r\n if (polygon.dragging)\r\n return;\r\n\r\n const path = innerPolygon.getAt(newEvent);\r\n const newPosition = new EventReturn([path.lat(), path.lng()]);\r\n const lastPosition = new EventReturn([lastEvent.lat(), lastEvent.lng()]);\r\n\r\n eventFunction(newPosition, lastPosition, polygon.object, newEvent, polygon.getPaths().getArray().map((x: any) => x.getArray().map(y => new EventReturn([y.lat(), y.lng()]))));\r\n });\r\n }\r\n\r\n private addPolygonEventInsertAt(polygon, eventFunction) {\r\n const polygonPathIdx = polygon.getPaths().getLength();\r\n\r\n for (let index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventInsertAtAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction);\r\n }\r\n }\r\n\r\n private addPolygonEventInsertAtAllPaths(polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'insert_at', (event: any) => {\r\n const newPath = innerPolygon.getAt(event);\r\n const newPoint = new EventReturn([newPath.lat(), newPath.lng()]);\r\n\r\n const previousPath = innerPolygon.getAt(event - 1);\r\n const previousPoint = previousPath ? new EventReturn([previousPath.lat(), previousPath.lng()]) : null;\r\n eventFunction(newPoint, previousPoint, polygon.object, event, polygon.getPaths().getArray().map((x: any) => x.getArray().map(y => new EventReturn([y.lat(), y.lng()]))));\r\n });\r\n }\r\n\r\n private addPolygonEventRemoveAt(polygon, eventFunction) {\r\n const polygonPathIdx = polygon.getPaths().getLength();\r\n\r\n for (let index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventRemoveAtAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction)\r\n }\r\n }\r\n\r\n private addPolygonEventRemoveAtAllPaths(polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'remove_at', (event: any) => {\r\n const param = new EventReturn([innerPolygon.getAt(event).lat(), innerPolygon.getAt(event).lng()]);\r\n eventFunction(param, polygon.getPaths().getArray().map((x: any) => x.getArray().map(y => new EventReturn([y.lat(), y.lng()]))), polygon.object);\r\n });\r\n }\r\n\r\n private addPolygonEventDragPolygon(polygon, eventFunction) {\r\n this.google.maps.event.addListener(polygon, 'dragstart', (event: any) => {\r\n polygon.dragging = true;\r\n });\r\n\r\n this.google.maps.event.addListener(polygon, 'dragend', (event: any) => {\r\n polygon.dragging = false;\r\n eventFunction(polygon.getPaths().getArray().map((x: any) => x.getArray().map(y => new EventReturn([y.lat(), y.lng()]))), polygon.object);\r\n });\r\n }\r\n\r\n private addPolygonEventClick(polygon, eventFunction) {\r\n this.google.maps.event.addListener(polygon, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, polygon.object);\r\n });\r\n }\r\n\r\n private getPathRecursiveArray(path: any) {\r\n if (Array.isArray(path) && typeof path[0] !== 'number') {\r\n return path.map(x => this.getPathRecursiveArray(x));\r\n }\r\n else return { lat: path[0], lng: path[1] }\r\n }\r\n\r\n private getPathPolylineArray(path: any) {\r\n if (typeof path[0].lat === 'number') {\r\n return path;\r\n }\r\n else if (typeof path[0][0].lat !== 'number') {\r\n path = path[0];\r\n return this.getPathPolylineArray(path);\r\n } else return path;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-polygons.ts","import { PolylineEventType } from '../../dto/event-type';\r\nimport { PolylineType } from '../../dto/polyline-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport NavigationOptions from '../../features/polyline/navigations-options';\r\nimport PolylineOptions from '../../features/polyline/polyline-options';\r\nimport GooglePopups from './google-popup';\r\n\r\nexport default class GooglePolylines {\r\n private map = null;\r\n private google = null;\r\n private googlePopups: GooglePopups;\r\n\r\n private selectedPolyline = null;\r\n private selectedPath = null;\r\n private navigateInfoWindow = null;\r\n private directionForward = false;\r\n private multiSelectionForward = false;\r\n private multiSelection = false;\r\n private navigateByPoint: boolean;\r\n private navigationOptions: NavigationOptions;\r\n\r\n constructor(map: any, google: any, googlePopups: GooglePopups) {\r\n this.map = map;\r\n this.google = google;\r\n this.googlePopups = googlePopups;\r\n }\r\n\r\n public drawPolyline(options: PolylineOptions, eventClick: any) {\r\n const self = this;\r\n const newOptions = {\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n icons: null,\r\n infowindows: options.infowindows,\r\n object: options.object,\r\n path: null,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity || 1,\r\n strokeWeight: options.weight,\r\n suppressUndo: true,\r\n zIndex: options.zIndex\r\n };\r\n\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1,\r\n strokeWeight: options.weight\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scaledSize: new google.maps.Size(20, 20),\r\n size: new google.maps.Size(20, 20)\r\n },\r\n offset: '100%',\r\n repeat: '100px'\r\n },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '0%' },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '100%' }];\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n newOptions.path = options.path ? options.path.map((x) => {\r\n return {\r\n lat: x[0],\r\n lng: x[1]\r\n };\r\n }) : [];\r\n\r\n const polyline = new this.google.maps.Polyline(newOptions);\r\n\r\n if (eventClick) {\r\n this.google.maps.event.addListener(polyline, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, polyline.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n polyline.setMap(self.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(self.getPolylineBounds(polyline));\r\n }\r\n\r\n return polyline;\r\n }\r\n\r\n public drawPolylineWithNavigation(options: PolylineOptions, eventClick?: any) {\r\n const polyline = this.drawPolyline(options, null);\r\n\r\n polyline.navigationHandlerClick = eventClick;\r\n this.navigationOptions = options.navigateOptions;\r\n this.navigateByPoint = this.navigationOptions ? this.navigationOptions.navigateByPoint : true;\r\n this.addNavigation(polyline);\r\n\r\n return polyline;\r\n }\r\n\r\n public togglePolylines(polylines: any, show: boolean) {\r\n polylines.forEach((polyline: any) => {\r\n const self = this;\r\n polyline.setMap(show ? self.map : null);\r\n });\r\n }\r\n\r\n public alterPolylineOptions(polylines, options: PolylineOptions) {\r\n polylines.forEach((polyline: any) => {\r\n const newOptions: any = {\r\n draggable: options.draggable ? options.draggable : polyline.draggable,\r\n editable: options.editable ? options.editable : polyline.editable,\r\n infowindows: options.infowindows ? options.infowindows : polyline.infowindows,\r\n object: options.object ? options.object : polyline.object,\r\n strokeColor: options.color ? options.color : polyline.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : polyline.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : polyline.strokeWeight,\r\n zIndex: options.zIndex ? options.zIndex : polyline.zIndex\r\n };\r\n\r\n if (options.path) {\r\n polyline.setPath(options.path.map((x) => new google.maps.LatLng(x[0], x[1])));\r\n }\r\n\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scaledSize: new google.maps.Size(20, 20),\r\n size: new google.maps.Size(20, 20)\r\n },\r\n offset: '90%',\r\n repeat: '20%'\r\n },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '0%' },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '100%' }];\r\n break;\r\n default:\r\n newOptions.icons = null;\r\n break;\r\n }\r\n\r\n polyline.setOptions(newOptions);\r\n });\r\n }\r\n\r\n public fitBoundsPolylines(polylines: any) {\r\n const self = this;\r\n self.map.fitBounds(self.getPolylinesBounds(polylines));\r\n }\r\n\r\n public isPolylineOnMap(polyline: any): boolean {\r\n return !!polyline.map;\r\n }\r\n\r\n public addPolylinePath(polylines: any, position: number[]) {\r\n polylines.forEach((polyline: any) => {\r\n const path = polyline.getPath();\r\n\r\n path.push(new this.google.maps.LatLng(position[0], position[1]));\r\n polyline.setPath(path);\r\n });\r\n }\r\n\r\n public getPolylinePath(polyline: any): number[][] {\r\n return polyline.getPath().getArray().map((x: any) => [x.lat(), x.lng()]);\r\n }\r\n\r\n public removePolylineHighlight() {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n if (this.selectedPath) {\r\n this.selectedPath.setMap(null);\r\n this.selectedPath = null;\r\n }\r\n if (this.navigateInfoWindow) {\r\n this.navigateInfoWindow.close();\r\n }\r\n }\r\n\r\n public addPolylineEvent(polylines: any, eventType: PolylineEventType, eventFunction: any) {\r\n polylines.forEach((polyline: any) => {\r\n switch (eventType) {\r\n case PolylineEventType.SetAt:\r\n this.addPolylineEventMove(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.InsertAt:\r\n this.addPolylineEventInsertAt(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.RemoveAt:\r\n this.addPolylineEventRemoveAt(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.DragPolyline:\r\n this.addPolylineEventDragPolyline(polyline, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removePolylineEvent(polylines: any, event: PolylineEventType) {\r\n polylines.forEach((polyline: any) => this.google.maps.event.clearListeners(polyline, 'click'));\r\n\r\n polylines.forEach((polyline: any) => {\r\n switch (event) {\r\n case PolylineEventType.SetAt:\r\n this.google.maps.event.clearListeners(polyline.getPath(), 'set_at');\r\n break;\r\n case PolylineEventType.InsertAt:\r\n this.google.maps.event.clearListeners(polyline.getPath(), 'insert_at');\r\n break;\r\n case PolylineEventType.RemoveAt:\r\n this.google.maps.event.clearListeners(polyline.getPath(), 'remove_at');\r\n break;\r\n case PolylineEventType.DragPolyline:\r\n this.google.maps.event.clearListeners(polyline, 'dragstart');\r\n this.google.maps.event.clearListeners(polyline, 'dragend');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public setIndexPolylineHighlight(polyline: any, index: number) {\r\n this.directionForward = false;\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n this.google.maps.event.addDomListener(document, 'keydown', this.onKeyUp.bind(this));\r\n } else {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.addDomListener(document, 'keyup', this.onKeyUp.bind(this));\r\n }\r\n }\r\n\r\n public getObjectPolyline(polyline: any): object {\r\n return polyline.object;\r\n }\r\n\r\n public getObjectPolylineHighlight() {\r\n if (this.selectedPath) {\r\n return this.selectedPath.object;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n public addPolylineHighlightEvent(eventType: PolylineEventType, eventFunction: any) {\r\n if (this.selectedPath) {\r\n this.addPolylineEvent([this.selectedPath], eventType, eventFunction);\r\n }\r\n }\r\n\r\n public getPolylineHighlightIndex() {\r\n if (this.selectedPath) {\r\n return [this.selectedPath.initialIdx, this.selectedPath.finalIdx];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /* Private methods */\r\n private addNavigation(polyline: any) {\r\n const self = this;\r\n\r\n this.google.maps.event.clearListeners(polyline, 'click');\r\n this.google.maps.event.addListener(polyline, 'click', self.onClickPolyline.bind(self, polyline));\r\n }\r\n\r\n private onClickPolyline(polyline: any, event: any) {\r\n const index = this.checkIdx(polyline, event.latLng);\r\n\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n this.google.maps.event.addDomListener(document, 'keydown', this.onKeyUp.bind(this));\r\n } else {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.addDomListener(document, 'keyup', this.onKeyUp.bind(this));\r\n }\r\n\r\n if (polyline.navigationHandlerClick) {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n polyline.navigationHandlerClick(param, polyline.object);\r\n }\r\n }\r\n\r\n private onKeyUp(event: any) {\r\n const self = this;\r\n\r\n if (self.selectedPath) {\r\n switch (event.which ? event.which : event.keyCode) {\r\n case 38: case 39:\r\n // up arrow or right arrow\r\n self.moveForwards(event.shiftKey);\r\n break;\r\n case 37: case 40:\r\n // left arrow or down arrow\r\n self.moveBackwards(event.shiftKey);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n private moveForwards(multiSelection: boolean) {\r\n const self = this;\r\n const polyline = self.selectedPolyline;\r\n\r\n if ((!self.navigateByPoint || self.directionForward) &&\r\n polyline.finalIdx < polyline.getPath().getArray().length - 1) {\r\n self.navigateForward(multiSelection, polyline);\r\n }\r\n self.directionForward = true;\r\n self.moveSelectedPath(polyline, null);\r\n }\r\n\r\n private navigateForward(multiSelection: boolean, polyline: any) {\r\n const self = this;\r\n if (!multiSelection) {\r\n polyline.finalIdx++;\r\n polyline.initialIdx = self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n } else {\r\n self.multiSelection = true;\r\n if (self.multiSelectionForward) {\r\n polyline.finalIdx++;\r\n }\r\n self.multiSelectionForward = true;\r\n }\r\n }\r\n\r\n private moveBackwards(multiSelection: boolean) {\r\n const self = this;\r\n const polyline = self.selectedPolyline;\r\n\r\n if ((!self.navigateByPoint || !self.directionForward) && polyline.initialIdx > 0) {\r\n self.navigateBackward(multiSelection, polyline);\r\n }\r\n self.directionForward = false;\r\n self.moveSelectedPath(polyline, null);\r\n }\r\n\r\n private navigateBackward(multiSelection: boolean, polyline) {\r\n const self = this;\r\n if (!multiSelection) {\r\n polyline.initialIdx--;\r\n polyline.finalIdx = !self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n } else {\r\n self.multiSelection = true;\r\n if (!self.multiSelectionForward) {\r\n polyline.initialIdx--;\r\n }\r\n self.multiSelectionForward = false;\r\n }\r\n }\r\n\r\n private moveSelectedPath(polyline: any, options: NavigationOptions) {\r\n const pathSelected = polyline.getPath().getArray().slice(polyline.initialIdx, polyline.finalIdx + 1);\r\n\r\n if (this.selectedPath) {\r\n this.selectedPath.setPath(pathSelected);\r\n this.selectedPath.object = polyline.object;\r\n this.updateSelectedPathListeners();\r\n } else {\r\n const newOptions: any = {\r\n editable: options.editable,\r\n keyboardShortcuts: false,\r\n map: this.map,\r\n object: polyline.object,\r\n path: pathSelected,\r\n strokeColor: options && options.color || '#FF0000',\r\n strokeOpacity: options && options.opacity || 1,\r\n strokeWeight: options && options.weight || 10,\r\n zIndex: 9999\r\n };\r\n\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n anchor: new google.maps.Point(0, 2),\r\n fillColor: '#000',\r\n fillOpacity: 0.7,\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scale: 4,\r\n strokeColor: '#000',\r\n strokeWeight: 5,\r\n },\r\n offset: '100%'\r\n }];\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n this.selectedPath = new this.google.maps.Polyline(newOptions);\r\n }\r\n\r\n this.selectedPath.initialIdx = polyline.initialIdx;\r\n this.selectedPath.finalIdx = polyline.finalIdx;\r\n\r\n this.drawPopupNavigation(polyline);\r\n }\r\n\r\n private addPolylineEventMove(polyline: any, eventFunction: any) {\r\n polyline.moveListener = (newEvent: any, lastEvent: any) => {\r\n if (polyline.dragging)\r\n return;\r\n\r\n const path = polyline.getPath().getAt(newEvent);\r\n const newPosition = new EventReturn([path.lat(), path.lng()]);\r\n const lastPosition = new EventReturn([lastEvent.lat(), lastEvent.lng()]);\r\n\r\n eventFunction(newPosition, lastPosition, polyline.object, newEvent, polyline.getPath().getArray().map((x: any) => new EventReturn([x.lat(), x.lng()])));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'set_at', polyline.moveListener);\r\n }\r\n\r\n private addPolylineEventInsertAt(polyline: any, eventFunction: any) {\r\n polyline.insertAtListener = (event: any) => {\r\n const path = polyline.getPath();\r\n const newPath = path.getAt(event);\r\n const newPoint = new EventReturn([newPath.lat(), newPath.lng()]);\r\n\r\n const previousPath = path.getAt(event - 1);\r\n const previousPoint = previousPath ? new EventReturn([previousPath.lat(), previousPath.lng()]) : null;\r\n eventFunction(newPoint, previousPoint, polyline.object, event, polyline.getPath().getArray().map((x: any) => new EventReturn([x.lat(), x.lng()])));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'insert_at', polyline.insertAtListener);\r\n }\r\n\r\n private addPolylineEventRemoveAt(polyline: any, eventFunction: any) {\r\n polyline.removeAtListener = (event: any) => {\r\n const param = new EventReturn([polyline.getPath().getAt(event).lat(), polyline.getPath().getAt(event).lng()]);\r\n eventFunction(param, polyline.object, polyline.getPath().getArray().map((x: any) => new EventReturn([x.lat(), x.lng()])));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'remove_at', polyline.removeAtListener);\r\n }\r\n\r\n private addPolylineEventDragPolyline(polyline: any, eventFunction: any) {\r\n polyline.dragPolylineListener = () => {\r\n polyline.dragging = false;\r\n const param = polyline.getPath().getArray().map((x: any) => new EventReturn([x.lat(), x.lng()]));\r\n eventFunction(param, polyline.object);\r\n };\r\n\r\n this.google.maps.event.addListener(polyline, 'dragend', polyline.dragPolylineListener);\r\n this.google.maps.event.addListener(polyline, 'dragstart', () => polyline.dragging = true);\r\n }\r\n\r\n private updateSelectedPathListeners() {\r\n if (this.selectedPath.moveListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'set_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'set_at', this.selectedPath.moveListener);\r\n }\r\n\r\n if (this.selectedPath.insertAtListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'insert_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'insert_at',\r\n this.selectedPath.insertAtListener);\r\n }\r\n\r\n if (this.selectedPath.removeAtListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'remove_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'remove_at',\r\n this.selectedPath.removeAtListener);\r\n }\r\n }\r\n\r\n private drawPopupNavigation(polyline: any) {\r\n const self = this;\r\n let idx = self.directionForward ? polyline.finalIdx : polyline.initialIdx;\r\n if (!self.navigateByPoint) {\r\n idx = polyline.finalIdx > polyline.initialIdx ? polyline.finalIdx : polyline.initialIdx;\r\n }\r\n\r\n const infowindow = polyline.infowindows ? polyline.infowindows[idx] : null;\r\n\r\n if (infowindow) {\r\n const point = polyline.getPath().getArray()[idx];\r\n\r\n if (self.navigateInfoWindow) {\r\n this.googlePopups.alterPopup(self.navigateInfoWindow, {\r\n content: infowindow,\r\n latlng: [point.lat(), point.lng()]\r\n });\r\n } else {\r\n self.navigateInfoWindow = this.googlePopups.drawPopup({\r\n content: infowindow,\r\n latlng: [point.lat(), point.lng()]\r\n });\r\n }\r\n }\r\n }\r\n\r\n private checkIdx(polyline: any, point: any) {\r\n const self = this;\r\n const path = polyline.getPath();\r\n let distance = 0;\r\n let minDistance = Number.MAX_VALUE;\r\n let returnValue = -1;\r\n\r\n for (let i = 0; i < path.length - 1; i++) {\r\n distance = self.distanceToLine(path.getAt(i), path.getAt(i + 1), point);\r\n\r\n if (distance < minDistance) {\r\n minDistance = distance;\r\n returnValue = i;\r\n }\r\n }\r\n return returnValue;\r\n }\r\n\r\n private distanceToLine(pt1: any, pt2: any, pt: any) {\r\n const self = this;\r\n const deltaX = pt2.lng() - pt1.lng();\r\n const deltaY = pt2.lat() - pt1.lat();\r\n let incIntersect = (pt.lng() - pt1.lng()) * deltaX;\r\n const deltaSum = (deltaX * deltaX) + (deltaY * deltaY);\r\n\r\n incIntersect += (pt.lat() - pt1.lat()) * deltaY;\r\n if (deltaSum > 0) {\r\n incIntersect /= deltaSum;\r\n } else {\r\n incIntersect = -1;\r\n }\r\n\r\n // The intersection occurs outside the line segment, 'before' pt1.\r\n if (incIntersect < 0) {\r\n return self.kmTo(pt, pt1);\r\n } else if (incIntersect > 1) {\r\n return self.kmTo(pt, pt2);\r\n }\r\n\r\n // Intersection point calculation.\r\n const intersect = new this.google.maps\r\n .LatLng(pt1.lat() + incIntersect * deltaY, pt1.lng() + incIntersect * deltaX);\r\n\r\n return self.kmTo(pt, intersect);\r\n }\r\n\r\n private kmTo(pt1: any, pt2: any) {\r\n const e = Math;\r\n const ra = e.PI / 180;\r\n const b = pt1.lat() * ra;\r\n const c = pt2.lat() * ra;\r\n const d = b - c;\r\n const g = pt1.lng() * ra - pt2.lng() * ra;\r\n const f = 2 * e.asin(e.sqrt(e.pow(e.sin(d / 2), 2) + e.cos(b) * e.cos(c) * e.pow(e.sin(g / 2), 2)));\r\n\r\n return f * 6378.137 * 1000;\r\n }\r\n\r\n private getPolylinesBounds(polylines: any) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n\r\n polylines.forEach((polyline: any) => {\r\n const paths = polyline.getPath().getArray();\r\n paths.forEach((path: any) => bounds.extend(path));\r\n });\r\n\r\n return bounds;\r\n }\r\n\r\n private getPolylineBounds(polyline: any) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n const paths = polyline.getPath().getArray();\r\n\r\n paths.forEach((path) => bounds.extend(path));\r\n return bounds;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-polylines.ts","import PopupOptions from '../../features/popup/popup-options';\r\n\r\nexport default class GooglePopups {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public drawPopup(options: PopupOptions, marker?: any) {\r\n const self = this;\r\n const infowindow = new this.google.maps.InfoWindow({\r\n content: options.content\r\n });\r\n\r\n if (options.latlng) {\r\n infowindow.setPosition({\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n });\r\n }\r\n\r\n infowindow.open(self.map, marker || null);\r\n\r\n if (options.object) {\r\n infowindow.object = options.object;\r\n }\r\n return infowindow;\r\n }\r\n\r\n public alterPopup(popup: any, options: PopupOptions, marker?: any) {\r\n const self = this;\r\n self.alterPopupContent(popup, options, marker);\r\n\r\n if (!popup.getMap()) {\r\n popup.open(self.map, marker || null);\r\n }\r\n\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n\r\n return popup;\r\n }\r\n\r\n public alterPopupContent(popup: any, options: PopupOptions, marker?: any) {\r\n if (options.content) {\r\n popup.setContent(options.content);\r\n }\r\n\r\n if (options.latlng) {\r\n popup.setPosition({\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n });\r\n } else if (marker) {\r\n popup.setPosition(marker.getPosition());\r\n }\r\n\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n }\r\n\r\n public closePopup(popup: any) {\r\n popup.close();\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-popup.ts","import { OverlayOptions } from '../..';\r\nimport { MapsApiLoaderService } from '../../utils/maps-api-loader.service';\r\nimport { CircleEventType, MapEventType, MarkerEventType, PolygonEventType, PolylineEventType } from '../dto/event-type';\r\nimport { MapType } from '../dto/map-type';\r\nimport CircleAlterOptions from '../features/circle/circle-alter-options';\r\nimport CircleOptions from '../features/circle/circle-options';\r\nimport GeoJsonOptions from '../features/geojson/geojson-options';\r\nimport MarkerClustererConfig from '../features/marker-clusterer/marker-clusterer-config';\r\nimport CircleMarkerOptions from '../features/marker/circle-marker-options';\r\nimport MarkerAlterOptions from '../features/marker/marker-alter-options';\r\nimport MarkerOptions from '../features/marker/marker-options';\r\nimport PolygonAlterOptions from '../features/polygons/polygon-alter-options';\r\nimport PolygonOptions from '../features/polygons/polygon-options';\r\nimport PolylineOptions from '../features/polyline/polyline-options';\r\nimport PopupOptions from '../features/popup/popup-options';\r\nimport LeafletCircles from './leaflet/leaflet-circle';\r\nimport LeafletGeoJson from './leaflet/leaflet-geojson';\r\nimport LeafletMap from './leaflet/leaflet-map';\r\nimport LeafletMarkers from './leaflet/leaflet-markers';\r\nimport LeafletOverlays from './leaflet/leaflet-overlay';\r\nimport LeafletPolygons from './leaflet/leaflet-polygons';\r\nimport LeafletPolylines from './leaflet/leaflet-polylines';\r\nimport LeafletPopups from './leaflet/leaflet-popup';\r\nimport IMapFunctions from './mapFunctions';\r\n\r\nexport default class Leaflet implements IMapFunctions {\r\n private leafletMarkers: LeafletMarkers;\r\n private leafletPolygons: LeafletPolygons;\r\n private leafletCircles: LeafletCircles;\r\n private leafletPolylines: LeafletPolylines;\r\n private leafletPopups: LeafletPopups;\r\n private leafletMap: LeafletMap;\r\n private leafletOverlays: LeafletOverlays;\r\n private leafletGeoJson: LeafletGeoJson;\r\n\r\n private mapsApiLoader: MapsApiLoaderService = new MapsApiLoaderService();\r\n\r\n constructor() { /* */ }\r\n\r\n public async initialize(mapType: MapType, params: any, elementId: string): Promise<any> {\r\n try {\r\n const api = await this.mapsApiLoader.loadApi(mapType, params);\r\n const leaflet = api;\r\n this.loadDependencies(params);\r\n await this.mapTimeout(1000);\r\n\r\n const mapOptions: any = {\r\n center: new leaflet.LatLng(-14, -54),\r\n editable: true,\r\n keyboard: false,\r\n maxZoom: params.wikimedia ? 18 : 19,\r\n minZoom: 4,\r\n zoom: 4,\r\n zoomControl: false\r\n };\r\n\r\n if (params.gestureHandling) {\r\n mapOptions.gestureHandling = true;\r\n }\r\n\r\n await this.mapTimeout(200);\r\n const osm = new leaflet.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', mapOptions);\r\n const wikimedia = new leaflet.tileLayer('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', {\r\n attribution: '<a href=\"https://wikimediafoundation.org/wiki/Maps_Terms_of_Use\">Wikimedia</a>'\r\n });\r\n\r\n const satelliteURL = 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\r\n 'World_Imagery/MapServer/tile/{z}/{y}/{x}';\r\n const satellite = L.tileLayer(satelliteURL, {\r\n attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye,' +\r\n ' Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',\r\n maxZoom: 18\r\n });\r\n mapOptions.layers = [params.wikimedia ? wikimedia : osm];\r\n\r\n const map = new leaflet.Map(elementId, mapOptions);\r\n const baseLayers = {\r\n Map: params.wikimedia ? wikimedia : osm,\r\n Satellite: satellite\r\n };\r\n\r\n if (params.mapTiles && params.mapTiles.length) {\r\n params.mapTiles.forEach((tile: any) => {\r\n const layer = new leaflet.tileLayer(tile.url, tile.options);\r\n baseLayers[tile.name] = layer;\r\n });\r\n }\r\n\r\n leaflet.control.layers(baseLayers, null, { position: 'topleft' }).addTo(map);\r\n leaflet.control.zoom({ position: 'bottomright' }).addTo(map);\r\n\r\n this.leafletMarkers = new LeafletMarkers(map, leaflet);\r\n this.leafletPolygons = new LeafletPolygons(map, leaflet);\r\n this.leafletCircles = new LeafletCircles(map, leaflet);\r\n this.leafletPopups = new LeafletPopups(map, leaflet);\r\n this.leafletPolylines = new LeafletPolylines(map, leaflet, this.leafletPopups);\r\n this.leafletMap = new LeafletMap(map, leaflet);\r\n this.leafletOverlays = new LeafletOverlays(map, leaflet, this.leafletPolygons);\r\n this.leafletGeoJson = new LeafletGeoJson(map, leaflet);\r\n return this;\r\n } catch (err) {\r\n console.error(err);\r\n return err;\r\n }\r\n }\r\n\r\n /* GEOJson */\r\n public loadGEOJson(data: object, options: GeoJsonOptions, eventClick: any): void {\r\n this.leafletGeoJson.loadGEOJson(data, options, eventClick);\r\n }\r\n\r\n /* Markers */\r\n public drawMarker(options: MarkerOptions, eventClick: any): any {\r\n return this.leafletMarkers.drawMarker(options, eventClick);\r\n }\r\n\r\n public drawCircleMarker(options: CircleMarkerOptions, eventClick: any): any {\r\n return this.leafletMarkers.drawCircleMarker(options, eventClick);\r\n }\r\n\r\n public toggleMarkers(markers: any[], show: boolean, markerClusterer?: any): void {\r\n this.leafletMarkers.toggleMarkers(markers, show, markerClusterer);\r\n }\r\n\r\n public alterMarkerOptions(markers: any[], options: MarkerAlterOptions): void {\r\n this.leafletMarkers.alterMarkerOptions(markers, options);\r\n }\r\n\r\n public alterMarkerPosition(markers: any[], position: number[], addTransition: boolean): void {\r\n this.leafletMarkers.alterMarkerPosition(markers, position, addTransition);\r\n }\r\n\r\n public fitBoundsPositions(markers: any[]): void {\r\n this.leafletMarkers.fitBoundsPositions(markers);\r\n }\r\n\r\n public isMarkerOnMap(marker: any): boolean {\r\n return this.leafletMarkers.isMarkerOnMap(marker);\r\n }\r\n\r\n public setCenterMarker(marker: any): void {\r\n this.leafletMarkers.setCenterMarker(marker);\r\n }\r\n\r\n public addMarkerEvent(markers: any, eventType: MarkerEventType, eventFunction: any): void {\r\n this.leafletMarkers.addMarkerEvent(markers, eventType, eventFunction);\r\n }\r\n\r\n public removeMarkerEvent(markers: any, event: MarkerEventType): void {\r\n this.leafletMarkers.removeMarkerEvent(markers, event);\r\n }\r\n\r\n /* Marker Clusterer */\r\n public addMarkerClusterer(config: MarkerClustererConfig): any {\r\n return this.leafletMarkers.addMarkerClusterer(config);\r\n }\r\n\r\n public alterMarkerClustererConfig(markerClusterer: any, config: MarkerClustererConfig): void {\r\n this.leafletMarkers.alterMarkerClustererConfig(markerClusterer, config);\r\n }\r\n\r\n public refreshClusterer(markerClusterer: any): void {\r\n this.leafletMarkers.refreshClusterer(markerClusterer);\r\n }\r\n\r\n public addMarkerOnClusterer(marker: any, markerClusterer: any): void {\r\n this.leafletMarkers.addMarkerOnClusterer(marker, markerClusterer);\r\n }\r\n\r\n public removeMarkerFromClusterer(marker: any, markerClusterer: any): void {\r\n this.leafletMarkers.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n\r\n public clearMarkersClusterer(markerClusterer: any): void {\r\n this.leafletMarkers.clearMarkersClusterer(markerClusterer);\r\n }\r\n\r\n public countMarkersOnCluster(markerClusterer: any): number {\r\n return this.leafletMarkers.countMarkersOnCluster(markerClusterer);\r\n }\r\n\r\n /* Polygons */\r\n public drawPolygon(options: PolygonOptions, eventClick: any): any {\r\n return this.leafletPolygons.drawPolygon(options, eventClick);\r\n }\r\n\r\n public togglePolygons(polygons: any[], show: boolean): void {\r\n this.leafletPolygons.togglePolygons(polygons, show);\r\n }\r\n\r\n public alterPolygonOptions(polygons: any[], options: PolygonAlterOptions): void {\r\n this.leafletPolygons.alterPolygonOptions(polygons, options);\r\n }\r\n\r\n public fitBoundsPolygons(polygons: any): void {\r\n this.leafletPolygons.fitBoundsPolygons(polygons);\r\n }\r\n\r\n public setCenterPolygons(polygons: any): void {\r\n this.leafletPolygons.setCenterPolygons(polygons);\r\n }\r\n\r\n public isPolygonOnMap(polygon: any): boolean {\r\n return this.leafletPolygons.isPolygonOnMap(polygon);\r\n }\r\n\r\n public getPolygonPath(polygon: any): number[][] {\r\n return this.leafletPolygons.getPolygonPath(polygon);\r\n }\r\n\r\n public addPolygonEvent(polygons: any, eventType: PolygonEventType, eventFunction: any): void {\r\n this.leafletPolygons.addPolygonEvent(polygons, eventType, eventFunction);\r\n }\r\n\r\n public removePolygonEvent(polygons: any, event: PolygonEventType): void {\r\n this.leafletPolygons.removePolygonEvent(polygons, event);\r\n }\r\n\r\n /* Circles */\r\n public drawCircle(options: CircleOptions, eventClick: any): any {\r\n return this.leafletCircles.drawCircle(options, eventClick);\r\n }\r\n\r\n public toggleCircles(circles: any[], show: boolean): void {\r\n this.leafletCircles.toggleCircles(circles, show);\r\n }\r\n\r\n public alterCircleOptions(circles: any[], options: CircleAlterOptions): void {\r\n this.leafletCircles.alterCircleOptions(circles, options);\r\n }\r\n\r\n public fitBoundsCircles(circles: any) {\r\n this.leafletCircles.fitBoundsCircles(circles);\r\n }\r\n\r\n public isCircleOnMap(circle: any): boolean {\r\n return this.leafletCircles.isCircleOnMap(circle);\r\n }\r\n\r\n public getCircleCenter(circle: any): number[] {\r\n return this.leafletCircles.getCircleCenter(circle);\r\n }\r\n\r\n public getCircleRadius(circle: any): number {\r\n return this.leafletCircles.getCircleRadius(circle);\r\n }\r\n\r\n public addCircleEvent(circles: any, eventType: CircleEventType, eventFunction: any): void {\r\n this.leafletCircles.addCircleEvent(circles, eventType, eventFunction);\r\n }\r\n\r\n public removeCircleEvent(circles: any, event: CircleEventType): void {\r\n this.leafletCircles.removeCircleEvent(circles, event);\r\n }\r\n\r\n /* Polylines */\r\n public drawPolyline(options: PolylineOptions, eventClick: any): any {\r\n return this.leafletPolylines.drawPolyline(options, eventClick);\r\n }\r\n\r\n public drawPolylineWithNavigation(options: PolylineOptions, eventClick?: any): any {\r\n return this.leafletPolylines.drawPolylineWithNavigation(options, eventClick);\r\n }\r\n\r\n public togglePolylines(polylines: any, show: boolean): void {\r\n this.leafletPolylines.togglePolylines(polylines, show);\r\n }\r\n\r\n public alterPolylineOptions(polylines: any, options: PolylineOptions): void {\r\n this.leafletPolylines.alterPolylineOptions(polylines, options);\r\n }\r\n\r\n public fitBoundsPolylines(polylines: any): void {\r\n this.leafletPolylines.fitBoundsPolylines(polylines);\r\n }\r\n\r\n public isPolylineOnMap(polyline: any): boolean {\r\n return this.leafletPolylines.isPolylineOnMap(polyline);\r\n }\r\n\r\n public addPolylinePath(polylines: any, position: number[]): void {\r\n this.leafletPolylines.addPolylinePath(polylines, position);\r\n }\r\n\r\n public getPolylinePath(polyline: any): number[][] {\r\n return this.leafletPolylines.getPolylinePath(polyline);\r\n }\r\n\r\n public removePolylineHighlight(): void {\r\n this.leafletPolylines.removePolylineHighlight();\r\n }\r\n\r\n public addPolylineEvent(polylines: any, eventType: PolylineEventType, eventFunction: any): void {\r\n this.leafletPolylines.addPolylineEvent(polylines, eventType, eventFunction);\r\n }\r\n\r\n public removePolylineEvent(polylines: any, event: PolylineEventType): void {\r\n this.leafletPolylines.removePolylineEvent(polylines, event);\r\n }\r\n\r\n public setIndexPolylineHighlight(polyline: any, index: number): void {\r\n this.leafletPolylines.setIndexPolylineHighlight(polyline, index);\r\n }\r\n\r\n public getObjectPolyline(polyline: any): object {\r\n return this.leafletPolylines.getObjectPolyline(polyline);\r\n }\r\n public getObjectPolylineHighlight(): object {\r\n return this.leafletPolylines.getObjectPolylineHighlight();\r\n }\r\n\r\n public addPolylineHighlightEvent(eventType: PolylineEventType, eventFunction: any): void {\r\n this.leafletPolylines.addPolylineHighlightEvent(eventType, eventFunction);\r\n }\r\n\r\n public getPolylineHighlightIndex(): number[] {\r\n return this.leafletPolylines.getPolylineHighlightIndex();\r\n }\r\n\r\n /* Popups */\r\n public drawPopup(options: PopupOptions, marker?: any): any {\r\n return this.leafletPopups.drawPopup(options, marker);\r\n }\r\n\r\n public alterPopup(popup: any, options: PopupOptions, marker?: any): any {\r\n return this.leafletPopups.alterPopup(popup, options, marker);\r\n }\r\n\r\n public alterPopupContent(popup: any, options: PopupOptions, marker?: any): any {\r\n this.leafletPopups.alterPopupContent(popup, options, marker);\r\n }\r\n\r\n public closePopup(popup: any): any {\r\n this.leafletPopups.closePopup(popup);\r\n }\r\n\r\n /* Map */\r\n public resizeMap(): void {\r\n this.leafletMap.resizeMap();\r\n }\r\n\r\n public addEventMap(eventType: MapEventType, eventFunction: any): void {\r\n this.leafletMap.addEventMap(eventType, eventFunction);\r\n }\r\n\r\n public removeEventMap(eventType: MapEventType): void {\r\n this.leafletMap.removeEventMap(eventType);\r\n }\r\n\r\n public getZoom(): number {\r\n return this.leafletMap.getZoom();\r\n }\r\n\r\n public setZoom(zoom: number): void {\r\n this.leafletMap.setZoom(zoom);\r\n }\r\n\r\n public getCenter(): number[] {\r\n return this.leafletMap.getCenter();\r\n }\r\n\r\n public setCenter(position: number[]): void {\r\n this.leafletMap.setCenter(position);\r\n }\r\n\r\n public pixelsToLatLng(offsetx: number, offsety: number): number[] {\r\n return this.leafletMap.pixelsToLatLng(offsetx, offsety);\r\n }\r\n\r\n public fitBoundsElements(markers: any, circles: any, polygons: any, polylines: any): void {\r\n this.leafletMap.fitBoundsElements(markers, circles, polygons, polylines);\r\n }\r\n\r\n /* Overlay */\r\n public drawOverlay(options: OverlayOptions, polygons: any): any {\r\n return this.leafletOverlays.drawOverlay(options, polygons);\r\n }\r\n\r\n public toggleOverlay(overlays: any[], show: boolean): void {\r\n this.leafletOverlays.toggleOverlay(overlays, show);\r\n }\r\n\r\n /* Private Methods */\r\n private mapTimeout(ms: number) {\r\n return new Promise((resolve) => setTimeout(resolve, ms));\r\n }\r\n\r\n private loadDependencies(params: any) {\r\n const styles = params.cssDependencies;\r\n if (styles && styles.length > 0) {\r\n styles.forEach((path: any) => {\r\n const link = document.createElement('link');\r\n link.rel = 'stylesheet';\r\n link.href = path;\r\n document.querySelector('head').appendChild(link);\r\n });\r\n }\r\n\r\n const scripts = params.scriptsDependencies;\r\n if (scripts && scripts.length > 0) {\r\n scripts.forEach((path: any) => {\r\n const script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = path;\r\n document.querySelector('head').appendChild(script);\r\n });\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet.ts","import { CircleEventType } from '../../dto/event-type';\r\nimport CircleAlterOptions from '../../features/circle/circle-alter-options';\r\nimport CircleOptions from '../../features/circle/circle-options';\r\nimport EventReturn from '../../features/events/event-return';\r\n\r\nexport default class LeafletCircles {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n public drawCircle(options: CircleOptions, eventClick: any) {\r\n const self = this;\r\n const newOptions = {\r\n color: options.color,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n opacity: options.opacity,\r\n radius: options.radius,\r\n weight: options.weight\r\n };\r\n const circle = new this.leaflet.Circle(options.center, newOptions);\r\n\r\n if (eventClick) {\r\n circle.on('click', (event: any) => {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n circle.addTo(self.map);\r\n\r\n if (options.editable) {\r\n circle.enableEdit();\r\n }\r\n }\r\n\r\n if (options.object) {\r\n circle.object = options.object;\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(circle.getBounds());\r\n }\r\n\r\n return circle;\r\n }\r\n\r\n public toggleCircles(circles: any[], show: boolean) {\r\n const self = this;\r\n circles.forEach((circle) => show ? self.map.addLayer(circle) : self.map.removeLayer(circle));\r\n }\r\n\r\n public alterCircleOptions(circles: any[], options: CircleAlterOptions) {\r\n circles.forEach((circle) => {\r\n const style = {\r\n color: options.color ? options.color : circle.options.color,\r\n draggable: options.draggable ? options.draggable : circle.options.draggable,\r\n editable: options.editable ? options.editable : circle.options.editable,\r\n fillColor: options.fillColor ? options.fillColor : circle.options.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : circle.options.fillOpacity,\r\n opacity: options.opacity ? options.opacity : circle.options.opacity,\r\n weight: options.weight ? options.weight : circle.options.weight\r\n };\r\n\r\n circle.setStyle(style);\r\n\r\n if (options.radius) {\r\n circle.setRadius(options.radius);\r\n }\r\n\r\n if (options.center) {\r\n circle.setLatLng(options.center);\r\n }\r\n\r\n if (options.editable !== null && options.editable !== undefined) {\r\n if (options.editable) {\r\n circle.enableEdit();\r\n } else {\r\n circle.disableEdit();\r\n }\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsCircles(circles: any) {\r\n this.map.fitBounds(this.getBoundsCircles(circles));\r\n }\r\n\r\n public isCircleOnMap(circle: any): boolean {\r\n return this.map.hasLayer(circle);\r\n }\r\n\r\n public getCircleCenter(circle: any): number[] {\r\n const center = circle.getLatLng();\r\n\r\n return [center.lat, center.lng];\r\n }\r\n\r\n public getCircleRadius(circle: any): number {\r\n return circle.getRadius();\r\n }\r\n\r\n public addCircleEvent(circles: any, eventType: CircleEventType, eventFunction: any): void {\r\n circles.forEach((circle: any) => {\r\n switch (eventType) {\r\n case CircleEventType.Click:\r\n circle.on('click', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, circle.object);\r\n });\r\n case CircleEventType.CenterChanged:\r\n circle.on('dragend', (event: any) => {\r\n const param = new EventReturn([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, circle.object);\r\n });\r\n case CircleEventType.RadiusChanged:\r\n circle.on('editable:vertex:dragend', (event: any) => {\r\n const param = new EventReturn([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(param, circle.object, circle.getRadius());\r\n });\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removeCircleEvent(circles: any, event: CircleEventType): void {\r\n circles.forEach((circle: any) => {\r\n switch (event) {\r\n case CircleEventType.Click:\r\n circle.off('click');\r\n case CircleEventType.CenterChanged:\r\n circle.off('dragend');\r\n case CircleEventType.RadiusChanged:\r\n circle.off('editable:vertex:dragend');\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private getBoundsCircles(circles: any) {\r\n const group = new this.leaflet.FeatureGroup(circles);\r\n return group.getBounds();\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-circle.ts","import EventReturn from '../../features/events/event-return';\r\nimport GeoJsonOptions from '../../features/geojson/geojson-options';\r\n\r\nexport default class LeafletGeoJson {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n public loadGEOJson(data: object, options: GeoJsonOptions, eventClick: any) {\r\n const self = this;\r\n const objects = self.parseGeoJson(data, options);\r\n\r\n objects.forEach((elem) => self.map.addLayer(elem));\r\n\r\n if (self.map.options) {\r\n if (self.map.options.editable) {\r\n objects.forEach((obj) => {\r\n if (obj.enableEdit) {\r\n obj.enableEdit();\r\n }\r\n\r\n if (eventClick) {\r\n obj.on('click', (event) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param);\r\n });\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n private parseGeoJson(data: any, options: GeoJsonOptions) {\r\n const self = this;\r\n const parsedFeatures = [];\r\n\r\n if (Array.isArray(data.features)) {\r\n for (const feature of data.features) {\r\n parsedFeatures.push(self.parseGeoJsonToObject(feature, options));\r\n }\r\n } else {\r\n parsedFeatures.push(self.parseGeoJsonToObject(data, options));\r\n }\r\n\r\n return parsedFeatures;\r\n }\r\n\r\n private parseGeoJsonToObject(data: any, objectOptions: any) {\r\n const geometry = data.geometry;\r\n let parsedCoordinates = [];\r\n\r\n if (data.properties) {\r\n Object.assign(objectOptions, data.properties);\r\n }\r\n\r\n switch (geometry.type) {\r\n case 'Point':\r\n parsedCoordinates = geometry.coordinates.reverse();\r\n return new this.leaflet.Marker(parsedCoordinates, objectOptions);\r\n case 'Polygon':\r\n geometry.coordinates\r\n .forEach((polygon) => parsedCoordinates.push(polygon.map((elem) => elem.reverse())));\r\n return new this.leaflet.Polygon(parsedCoordinates, objectOptions);\r\n case 'LineString':\r\n parsedCoordinates = geometry.coordinates.map((elem) => elem.reverse());\r\n return new this.leaflet.Polyline(parsedCoordinates, objectOptions);\r\n default:\r\n throw new Error('Unknown object shape.');\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-geojson.ts","import { MapEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\n\r\nexport default class LeafletMap {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n public resizeMap(): void {\r\n this.map.invalidateSize();\r\n }\r\n\r\n public addEventMap(eventType: MapEventType, eventFunction: any) {\r\n const self = this;\r\n\r\n switch (eventType) {\r\n case MapEventType.Click:\r\n self.map.on('click', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param);\r\n });\r\n break;\r\n case MapEventType.ZoomChanged:\r\n self.map.on('zoomend', (event: any) => {\r\n const param = new EventReturn([event.target.getCenter().lat, event.target.getCenter().lng]);\r\n eventFunction(param);\r\n });\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n public removeEventMap(eventType: MapEventType) {\r\n const self = this;\r\n switch (eventType) {\r\n case MapEventType.Click: self.map.off('click'); break;\r\n case MapEventType.ZoomChanged: self.map.off('zoomend');\r\n default: break;\r\n }\r\n }\r\n\r\n public getZoom(): number {\r\n return this.map.getZoom();\r\n }\r\n\r\n public setZoom(zoom: number) {\r\n this.map.setZoom(zoom);\r\n }\r\n\r\n public getCenter(): number[] {\r\n const center = this.map.getCenter();\r\n return [center.lat, center.lng];\r\n }\r\n\r\n public setCenter(position: number[]) {\r\n this.map.panTo(position);\r\n }\r\n\r\n public pixelsToLatLng(offsetx: number, offsety: number) {\r\n const scale = Math.pow(2, this.map.getZoom());\r\n const worldCoordinateCenter = this.leaflet.CRS.Simple.project(this.map.getCenter())\r\n const pixelOffset = new this.leaflet.Point(offsetx / scale || 0, offsety / scale || 0);\r\n\r\n const worldCoordinateNewCenter = new this.leaflet.Point(\r\n worldCoordinateCenter.x - pixelOffset.x,\r\n worldCoordinateCenter.y + pixelOffset.y\r\n );\r\n\r\n const latlng = this.leaflet.CRS.Simple.unproject(worldCoordinateNewCenter);\r\n return [latlng.lat, latlng.lng];\r\n }\r\n\r\n public fitBoundsElements(markers: any, circles: any, polygons: any, polylines: any): void {\r\n const group = [];\r\n\r\n if (markers && markers.length) {\r\n markers.forEach((marker: any) => group.push(marker));\r\n }\r\n\r\n if (circles && circles.length) {\r\n circles.forEach((circle: any) => group.push(circle));\r\n }\r\n\r\n if (polygons && polygons.length) {\r\n polygons.forEach((polygon: any) => group.push(polygon));\r\n }\r\n\r\n if (polylines && polylines.length) {\r\n polylines.forEach((polyline: any) => group.push(polyline));\r\n }\r\n\r\n if (group && group.length) {\r\n const bounds = this.leaflet.featureGroup(group).getBounds();\r\n this.map.fitBounds(bounds);\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-map.ts","import { MarkerEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport MarkerClustererConfig from '../../features/marker-clusterer/marker-clusterer-config';\r\nimport CircleMarkerOptions from '../../features/marker/circle-marker-options';\r\nimport MarkerAlterOptions from '../../features/marker/marker-alter-options';\r\nimport MarkerOptions from '../../features/marker/marker-options';\r\n\r\nexport default class LeafletMarkers {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n /* Markers */\r\n public drawMarker(options: MarkerOptions, eventClick: any) {\r\n const newOptions: any = {\r\n draggable: options.draggable\r\n };\r\n\r\n if (options.icon) {\r\n newOptions.icon = new this.leaflet.Icon({\r\n iconUrl: options.icon.url\r\n });\r\n\r\n const size = options.icon.size;\r\n if (size) {\r\n newOptions.icon.options.iconSize = size;\r\n newOptions.icon.options.iconAnchor = [size[0] / 2, size[1]];\r\n newOptions.icon.options.popupAnchor = [0, -size[1]];\r\n }\r\n }\r\n\r\n const marker = new this.leaflet.Marker(options.latlng, newOptions);\r\n\r\n if (options.object) {\r\n marker.object = options.object;\r\n }\r\n\r\n if (eventClick) {\r\n marker.on('click', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n\r\n if (options.addToMap && !options.addClusterer) {\r\n marker.addTo(this.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n const group = new this.leaflet.FeatureGroup([marker]);\r\n this.map.fitBounds(group.getBounds());\r\n }\r\n\r\n return marker;\r\n }\r\n\r\n public drawCircleMarker(options: CircleMarkerOptions, eventClick: any) {\r\n const self = this;\r\n const marker = new this.leaflet.circleMarker(options.latlng, options.style);\r\n\r\n if (eventClick) {\r\n marker.on('click', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n marker.addTo(self.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n const group = new this.leaflet.FeatureGroup([marker]);\r\n self.map.fitBounds(group.getBounds());\r\n }\r\n\r\n marker.object = options.object;\r\n return marker;\r\n }\r\n\r\n public toggleMarkers(markers: any[], show: boolean, markerClusterer?: any) {\r\n const self = this;\r\n markers.forEach((marker) => {\r\n if (markerClusterer) {\r\n if (show) {\r\n self.addMarkerOnClusterer(marker, markerClusterer);\r\n } else {\r\n self.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n } else {\r\n if (show) {\r\n self.map.addLayer(marker);\r\n } else {\r\n self.map.removeLayer(marker);\r\n }\r\n }\r\n });\r\n }\r\n\r\n public alterMarkerOptions(markers: any[], options: MarkerAlterOptions) {\r\n markers.forEach((marker) => {\r\n if (marker.type === 'circle' && options.style) {\r\n const style = {\r\n fillColor: options.style.fillColor ? options.style.fillColor : marker.options.fillColor,\r\n fillOpacity: options.style.fillOpacity ? options.style.fillOpacity : marker.options.fillOpacity,\r\n radius: options.style.radius ? options.style.radius : marker.options.radius,\r\n strokeColor: options.style.color ? options.style.color : marker.options.strokeColor,\r\n strokeWeight: options.style.weight ? options.style.weight : marker.options.strokeWeight\r\n };\r\n\r\n marker.setStyle(style);\r\n }\r\n\r\n if (options.icon) {\r\n const icon = new this.leaflet.icon({ iconUrl: options.icon.url });\r\n const size = options.icon.size;\r\n\r\n if (size) {\r\n icon.options.iconSize = size;\r\n icon.options.iconAnchor = [size[0] / 2, size[1]];\r\n }\r\n\r\n marker.setIcon(icon);\r\n }\r\n\r\n if (options.latlng) {\r\n marker.setLatLng(options.latlng);\r\n }\r\n });\r\n }\r\n\r\n public alterMarkerPosition(markers: any[], position: number[], addTransition: boolean) {\r\n markers.forEach((marker) => {\r\n if (addTransition) {\r\n this.moveTransitionMarker(position, marker);\r\n } else {\r\n marker.setLatLng(position);\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsPositions(markers: any[]) {\r\n const group = new this.leaflet.featureGroup(markers);\r\n this.map.fitBounds(group.getBounds());\r\n }\r\n\r\n public isMarkerOnMap(marker: any): boolean {\r\n return this.map.hasLayer(marker);\r\n }\r\n\r\n public setCenterMarker(marker: any) {\r\n this.map.panTo(marker.getLatLng());\r\n }\r\n\r\n public addMarkerEvent(markers: any, eventType: MarkerEventType, eventFunction: any) {\r\n markers.forEach((marker: any) => {\r\n switch (eventType) {\r\n case MarkerEventType.Click:\r\n marker.on('click', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.RightClick:\r\n marker.on('contextmenu', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.AfterDrag:\r\n marker.on('dragend', (event: any) => {\r\n const param = new EventReturn([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.MouseOver:\r\n marker.on('mouseover', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.MouseOut:\r\n marker.on('mouseout', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.BeforeDrag:\r\n marker.on('dragstart', (event: any) => {\r\n const param = new EventReturn([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removeMarkerEvent(markers: any, event: MarkerEventType): void {\r\n markers.forEach((marker: any) => {\r\n switch (event) {\r\n case MarkerEventType.Click:\r\n marker.off('click');\r\n break;\r\n case MarkerEventType.RightClick:\r\n marker.off('contextmenu');\r\n break;\r\n case MarkerEventType.AfterDrag:\r\n marker.off('dragend');\r\n break;\r\n case MarkerEventType.MouseOver:\r\n marker.off('mouseover');\r\n break;\r\n case MarkerEventType.MouseOut:\r\n marker.off('mouseout');\r\n break;\r\n case MarkerEventType.BeforeDrag:\r\n marker.off('dragstart');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n /* Marker Clusterer */\r\n public addMarkerClusterer(config: MarkerClustererConfig): any {\r\n const layer = this.leaflet.markerClusterGroup({\r\n maxClusterRadius: 50,\r\n showCoverageOnHover: false,\r\n zoomToBoundsOnClick: config.clusterZoomOnClick\r\n });\r\n\r\n this.map.addLayer(layer);\r\n return layer;\r\n }\r\n\r\n public alterMarkerClustererConfig(markerClusterer: any, config: MarkerClustererConfig): void {\r\n markerClusterer.options.zoomToBoundsOnClick = config.clusterZoomOnClick;\r\n }\r\n\r\n public refreshClusterer(markerClusterer: any): void {\r\n markerClusterer.refreshClusters();\r\n }\r\n\r\n public addMarkerOnClusterer(marker: any, markerClusterer: any): void {\r\n markerClusterer.addLayer(marker);\r\n }\r\n\r\n public removeMarkerFromClusterer(marker: any, markerClusterer: any): void {\r\n markerClusterer.removeLayer(marker);\r\n }\r\n\r\n public clearMarkersClusterer(markerClusterer: any): void {\r\n markerClusterer.clearLayers();\r\n }\r\n\r\n public countMarkersOnCluster(markerClusterer: any): number {\r\n return markerClusterer.getLayers().length;\r\n }\r\n\r\n private moveTransitionMarker(position: any, marker: any) {\r\n const numDeltas = 5;\r\n const reference = {\r\n deltaLat: (position[0] - marker.getLatLng().lat) / numDeltas,\r\n deltaLng: (position[1] - marker.getLatLng().lng) / numDeltas,\r\n i: 0,\r\n position: [marker.getLatLng().lat, marker.getLatLng().lng],\r\n lastPosition: position\r\n };\r\n\r\n this.moveMarker(marker, reference, numDeltas);\r\n }\r\n\r\n private moveMarker(marker: any, reference: any, numDeltas: number) {\r\n reference.position[0] += reference.deltaLat;\r\n reference.position[1] += reference.deltaLng;\r\n marker.setLatLng(reference.position);\r\n if (reference.i < numDeltas) {\r\n reference.i++;\r\n setTimeout(() => this.moveMarker(marker, reference, numDeltas), 20);\r\n } else if (reference.i === numDeltas) {\r\n setTimeout(() => marker.setLatLng(reference.lastPosition), 20);\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-markers.ts","import EventReturn from '../../features/events/event-return';\r\nimport OverlayOptions from '../../features/overlay/overlay-options';\r\nimport LeafletPolygons from './leaflet-polygons';\r\n\r\nexport default class LeafletOverlay {\r\n private map = null;\r\n private leaflet = null;\r\n private leafletPolygons: LeafletPolygons;\r\n\r\n constructor(map: any, leaflet: any, leafletPolygons: LeafletPolygons) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n this.leafletPolygons = leafletPolygons;\r\n }\r\n\r\n public drawOverlay(options: OverlayOptions, polygons: any) {\r\n const html: string = options.divElement.outerHTML;\r\n const myIcon = new this.leaflet.DivIcon({ html });\r\n\r\n const position = polygons && polygons.length > 0 ?\r\n this.leafletPolygons.getBoundsPolygons(polygons).getCenter() : options.position;\r\n\r\n const overlay = new this.leaflet.Marker(position, { icon: myIcon, draggable: options.draggable });\r\n\r\n if (options.addToMap) {\r\n overlay.addTo(this.map);\r\n }\r\n\r\n overlay.object = options.object;\r\n\r\n if (options.draggable && options.afterEventDragHandler) {\r\n overlay.on('dragend', (event: any) => {\r\n const param = new EventReturn([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n options.afterEventDragHandler(param, options.object);\r\n });\r\n }\r\n\r\n return overlay;\r\n }\r\n\r\n public toggleOverlay(overlays: any[], show: boolean) {\r\n const self = this;\r\n overlays.forEach((overlay) => show ? self.map.addLayer(overlay) : self.map.removeLayer(overlay));\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-overlay.ts","import { PolygonEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport PolygonAlterOptions from '../../features/polygons/polygon-alter-options';\r\nimport PolygonOptions from '../../features/polygons/polygon-options';\r\n\r\nexport default class LeafletPolygons {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n public drawPolygon(options: PolygonOptions, eventClick: any) {\r\n const self = this;\r\n const newOptions = {\r\n color: options.color || '#000',\r\n draggable: options.draggable,\r\n fillColor: options.fillColor || '#fff',\r\n fillOpacity: options.fillOpacity || 1,\r\n opacity: options.opacity || 1,\r\n weight: options.weight || 2\r\n };\r\n const polygon = new this.leaflet.Polygon(options.path, newOptions);\r\n\r\n if (eventClick) {\r\n polygon.on('click', (event: any) => {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n polygon.addTo(self.map);\r\n\r\n if (options.editable) {\r\n polygon.enableEdit();\r\n }\r\n }\r\n\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(polygon.getBounds());\r\n }\r\n\r\n return polygon;\r\n }\r\n\r\n public togglePolygons(polygons: any[], show: boolean) {\r\n const self = this;\r\n polygons.forEach((polygon) => show ? self.map.addLayer(polygon) : self.map.removeLayer(polygon));\r\n }\r\n\r\n public alterPolygonOptions(polygons: any[], options: PolygonAlterOptions) {\r\n polygons.forEach((polygon) => {\r\n const style = {\r\n color: options.color ? options.color : polygon.options.color,\r\n draggable: options.draggable ? options.draggable : polygon.options.draggable,\r\n fillColor: options.fillColor ? options.fillColor : polygon.options.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : polygon.options.fillOpacity,\r\n opacity: options.opacity ? options.opacity : polygon.options.opacity,\r\n weight: options.weight ? options.weight : polygon.options.weight\r\n };\r\n\r\n if (options.path) {\r\n polygon.setLatLngs(options.path);\r\n }\r\n\r\n polygon.setStyle(style);\r\n\r\n if (options.editable !== null && options.editable !== undefined) {\r\n polygon.disableEdit();\r\n\r\n if (options.editable) {\r\n polygon.enableEdit();\r\n }\r\n }\r\n\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsPolygons(polygons: any): void {\r\n this.map.fitBounds(this.getBoundsPolygons(polygons));\r\n }\r\n\r\n public setCenterPolygons(polygons: any): void {\r\n this.map.panTo(this.getBoundsPolygons(polygons).getCenter());\r\n }\r\n\r\n public isPolygonOnMap(polygon: any): boolean {\r\n return this.map.hasLayer(polygon);\r\n }\r\n\r\n public getPolygonPath(polygon: any): number[][] {\r\n return polygon.getLatLngs()[0].map((x: any) => [x.lat, x.lng]);\r\n }\r\n\r\n public addPolygonEvent(polygons: any, eventType: PolygonEventType, eventFunction: any): void {\r\n const self = this;\r\n polygons.forEach((polygon: any) => {\r\n switch (eventType) {\r\n case PolygonEventType.SetAt:\r\n this.addPolygonEventMove(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.InsertAt:\r\n this.addPolygonEventInsertAt(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.RemoveAt:\r\n this.addPolygonEventRemoveAt(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.DragPolygon:\r\n this.addPolygonEventDragPolygon(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.Click:\r\n this.addPolygonEventClick(polygon, eventFunction, self);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removePolygonEvent(polygons: any, event: PolygonEventType): void {\r\n polygons.forEach((polygon: any) => {\r\n switch (event) {\r\n case PolygonEventType.SetAt:\r\n polygon.off('editable:vertex:dragstart');\r\n break;\r\n case PolygonEventType.InsertAt:\r\n polygon.off('editable:vertex:new');\r\n break;\r\n case PolygonEventType.RemoveAt:\r\n polygon.off('editable:vertex:clicked');\r\n polygon.off('editable:vertex:deleted');\r\n break;\r\n case PolygonEventType.DragPolygon:\r\n polygon.off('dragend');\r\n break;\r\n case PolygonEventType.Click:\r\n polygon.off('click');\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public getBoundsPolygons(polygons) {\r\n const group = new this.leaflet.FeatureGroup(polygons);\r\n return group.getBounds();\r\n }\r\n\r\n private addPolygonEventMove(polygon: any, eventFunction: any) {\r\n polygon.on('editable:vertex:dragstart', (eventStart: any) => {\r\n const lastPosition = new EventReturn([eventStart.vertex.latlng.lat, eventStart.vertex.latlng.lng]);\r\n\r\n polygon.on('editable:vertex:dragend', (eventEnd: any) => {\r\n const newPosition = new EventReturn([eventEnd.vertex.latlng.lat, eventEnd.vertex.latlng.lng]);\r\n const path = polygon.getLatLngs().map((x: any) => {\r\n if (Array.isArray(x[0])) {\r\n return x.map((y: any) => y.map(z => new EventReturn([z.lat, z.lng])));\r\n } else {\r\n return [x.map((y: any) => new EventReturn([y.lat, y.lng]))];\r\n }\r\n });\r\n\r\n eventFunction(newPosition, lastPosition, eventEnd.target.object, eventEnd.vertex.getIndex(), path[0]);\r\n polygon.off('editable:vertex:dragend');\r\n });\r\n });\r\n }\r\n\r\n private addPolygonEventInsertAt(polygon: any, eventFunction: any) {\r\n polygon.on('editable:vertex:new', (eventNew: any) => {\r\n const latlngs = eventNew.vertex.latlngs;\r\n const previous = latlngs[latlngs.findIndex((x: any) => x === eventNew.vertex.latlng) - 1];\r\n\r\n if (previous) {\r\n const previousPoint = new EventReturn([previous.lat, previous.lng]);\r\n\r\n polygon.on('editable:vertex:dragend', (event: any) => {\r\n const newPoint = new EventReturn([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n const path = polygon.getLatLngs().map((x: any) => {\r\n if (Array.isArray(x[0])) {\r\n return x.map((y: any) => y.map(z => new EventReturn([z.lat, z.lng])));\r\n } else {\r\n return [x.map((y: any) => new EventReturn([y.lat, y.lng]))];\r\n }\r\n });\r\n\r\n eventFunction(newPoint, previousPoint, event.target.object, event.vertex.getIndex(), path[0]);\r\n polygon.off('editable:vertex:dragend');\r\n });\r\n }\r\n });\r\n }\r\n\r\n private addPolygonEventRemoveAt(polygon: any, eventFunction: any) {\r\n polygon.on('editable:vertex:deleted', (event: any) => {\r\n const param = new EventReturn([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n\r\n const path = polygon.getLatLngs().map((x: any) => {\r\n if (Array.isArray(x[0])) {\r\n return x.map((y: any) => y.map(z => new EventReturn([z.lat, z.lng])));\r\n } else {\r\n return [x.map((y: any) => new EventReturn([y.lat, y.lng]))];\r\n }\r\n });\r\n\r\n eventFunction(param, path[0], event.target.object);\r\n });\r\n }\r\n\r\n private addPolygonEventDragPolygon(polygon: any, eventFunction: any) {\r\n polygon.on('dragend', (event: any) => {\r\n const path = polygon.getLatLngs().map((x: any) => {\r\n if (Array.isArray(x[0])) {\r\n return x.map((y: any) => y.map(z => new EventReturn([z.lat, z.lng])));\r\n } else {\r\n return [x.map((y: any) => new EventReturn([y.lat, y.lng]))];\r\n }\r\n });\r\n\r\n eventFunction(path[0], event.target.object);\r\n });\r\n }\r\n\r\n private addPolygonEventClick(polygon: any, eventFunction: any, self: any) {\r\n polygon.on('click', (event: any) => {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, event.target.object);\r\n });\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-polygons.ts","import { Polyline } from 'leaflet';\r\nimport { PolylineEventType } from '../../dto/event-type';\r\nimport { PolylineType } from '../../dto/polyline-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport NavigationOptions from '../../features/polyline/navigations-options';\r\nimport PolylineOptions from '../../features/polyline/polyline-options';\r\nimport LeafletPopup from './leaflet-popup';\r\n\r\nexport default class LeafletPolylines {\r\n private map = null;\r\n private leaflet = null;\r\n private leafletPopup: LeafletPopup;\r\n\r\n private selectedPolyline = null;\r\n private selectedPath = null;\r\n private navigateInfoWindow = null;\r\n private directionForward = false;\r\n private multiSelectionForward = false;\r\n private multiSelection = false;\r\n private navigateByPoint: boolean;\r\n private navigationOptions: NavigationOptions;\r\n\r\n constructor(map: any, leaflet: any, leafletPopup: LeafletPopup) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n this.leafletPopup = leafletPopup;\r\n }\r\n\r\n public drawPolyline(options: PolylineOptions, eventClick: any) {\r\n const self = this;\r\n const newOptions = {\r\n color: options.color || '#000000',\r\n dashArray: null,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n infowindows: options.infowindows,\r\n opacity: options.opacity || 1,\r\n weight: options.weight || 3,\r\n zIndex: options.zIndex\r\n };\r\n\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n newOptions.opacity = .7;\r\n newOptions.dashArray = '20,15';\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n const polyline = new this.leaflet.Polyline(options.path || [], newOptions);\r\n polyline.on('editable:vertex:rawclick', (e) => e.cancel());\r\n\r\n if (eventClick) {\r\n polyline.on('click', (event: any) => {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n\r\n polyline.on('editable:vertex:rawclick', (event) => {\r\n event.cancel()\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n\r\n }\r\n\r\n if (options.style && options.style === PolylineType.Arrow) {\r\n const pathOptions = { fillOpacity: 1, weight: 0, color: polyline.options.color };\r\n\r\n polyline.decorator = self.leaflet.polylineDecorator(polyline, {\r\n patterns: [{\r\n offset: '20%',\r\n repeat: '90px',\r\n symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions })\r\n },\r\n { offset: '0%', symbol: self.leaflet.Symbol.arrowHead({ pathOptions, pixelSize: 20 }) },\r\n { offset: '100%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions }) }]\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n polyline.addTo(self.map);\r\n if (polyline.decorator) { polyline.decorator.addTo(self.map); }\r\n if (options.editable) { polyline.enableEdit(); }\r\n }\r\n\r\n if (options.object) {\r\n polyline.object = options.object;\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(polyline.getBounds());\r\n }\r\n\r\n return polyline;\r\n }\r\n\r\n public drawPolylineWithNavigation(options: PolylineOptions, eventClick?: any) {\r\n const polyline = this.drawPolyline(options, null);\r\n\r\n polyline.navigationHandlerClick = eventClick;\r\n this.navigationOptions = options.navigateOptions;\r\n this.navigateByPoint = this.navigationOptions ? this.navigationOptions.navigateByPoint : true;\r\n this.addNavigation(polyline);\r\n return polyline;\r\n }\r\n\r\n public togglePolylines(polylines: any, show: boolean) {\r\n const self = this;\r\n polylines.forEach((polyline: any) => {\r\n if (show) {\r\n self.map.addLayer(polyline);\r\n if (polyline.options.editable) {\r\n polyline.enableEdit();\r\n }\r\n if (polyline.decorator) { self.map.addLayer(polyline.decorator); }\r\n } else {\r\n self.map.removeLayer(polyline);\r\n if (polyline.options.editable) {\r\n polyline.disableEdit();\r\n }\r\n if (polyline.decorator) { self.map.removeLayer(polyline.decorator); }\r\n }\r\n });\r\n }\r\n\r\n public alterPolylineOptions(polylines: any, options: PolylineOptions) {\r\n const self = this;\r\n\r\n polylines.forEach((polyline: any) => {\r\n const style: any = {\r\n color: options.color ? options.color : polyline.options.color,\r\n draggable: options.draggable ? options.draggable : polyline.options.draggable,\r\n opacity: options.opacity ? options.opacity : polyline.options.opacity,\r\n weight: options.weight ? options.weight : polyline.options.weight,\r\n zIndex: options.zIndex ? options.zIndex : polyline.options.zIndex\r\n };\r\n\r\n if (options.path) {\r\n polyline.setLatLngs(options.path);\r\n }\r\n\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n style.dashArray = '20,15';\r\n break;\r\n case PolylineType.Arrow:\r\n const pathOptions = { fillOpacity: 1, weight: 0, color: style.color };\r\n\r\n if (polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n }\r\n\r\n polyline.decorator = self.leaflet.polylineDecorator(polyline, {\r\n patterns: [{\r\n offset: '20%',\r\n repeat: '90px',\r\n symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions })\r\n },\r\n { offset: '0%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions }) },\r\n { offset: '100%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions }) }]\r\n });\r\n\r\n if (self.map.hasLayer(polyline)) {\r\n polyline.decorator.addTo(self.map);\r\n }\r\n break;\r\n default:\r\n if (polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n polyline.decorator = null;\r\n }\r\n break;\r\n }\r\n\r\n polyline.setStyle(style);\r\n\r\n if (options.object) {\r\n polyline.object = options.object;\r\n }\r\n\r\n if (options.editable) {\r\n polyline.disableEdit();\r\n polyline.enableEdit();\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsPolylines(polylines: any) {\r\n const self = this;\r\n self.map.fitBounds(self.getBoundsPolylines(polylines));\r\n }\r\n\r\n public isPolylineOnMap(polyline: any): boolean {\r\n return this.map.hasLayer(polyline);\r\n }\r\n\r\n public addPolylinePath(polylines: any, position: number[]) {\r\n polylines.forEach((polyline: any) => {\r\n const path = polyline.getLatLngs();\r\n\r\n path.push(new this.leaflet.LatLng(position[0], position[1]));\r\n polyline.setLatLngs(path);\r\n\r\n if (polyline.editEnabled && polyline.editEnabled()) {\r\n polyline.disableEdit();\r\n polyline.enableEdit();\r\n }\r\n });\r\n }\r\n\r\n public getPolylinePath(polyline: any): number[][] {\r\n return polyline.getLatLngs().map((x: any) => [x.lat, x.lng]);\r\n }\r\n\r\n public removePolylineHighlight() {\r\n const self = this;\r\n\r\n if (self.selectedPath) {\r\n if (this.selectedPath.decorator) {\r\n this.map.removeLayer(this.selectedPath.decorator);\r\n }\r\n\r\n this.map.removeLayer(self.selectedPath);\r\n self.selectedPath = null;\r\n }\r\n\r\n if (self.navigateInfoWindow) {\r\n self.navigateInfoWindow.remove();\r\n }\r\n\r\n document.onkeyup = null;\r\n document.onkeydown = null;\r\n }\r\n\r\n public addPolylineEvent(polylines: any, eventType: PolylineEventType, eventFunction: any) {\r\n polylines.forEach((polyline: any) => {\r\n switch (eventType) {\r\n case PolylineEventType.SetAt:\r\n this.addPolylineEventMove(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.InsertAt:\r\n this.addPolylineEventInsertAt(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.RemoveAt:\r\n this.addPolylineEventRemoveAt(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.DragPolyline:\r\n this.addPolylineEventDragPolyline(polyline, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removePolylineEvent(polylines: any, event: PolylineEventType) {\r\n polylines.forEach((polyline: any) => {\r\n switch (event) {\r\n case PolylineEventType.SetAt:\r\n polyline.off('editable:vertex:dragstart');\r\n break;\r\n case PolylineEventType.InsertAt:\r\n polyline.off('editable:vertex:new');\r\n break;\r\n case PolylineEventType.RemoveAt:\r\n polyline.off('editable:vertex:deleted');\r\n break;\r\n case PolylineEventType.DragPolyline:\r\n polyline.off('dragend');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public setIndexPolylineHighlight(polyline: any, index: number) {\r\n this.directionForward = false;\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n document.onkeydown = this.onKeyUp.bind(this);\r\n } else {\r\n document.onkeyup = this.onKeyUp.bind(this);\r\n }\r\n\r\n }\r\n\r\n public getObjectPolyline(polyline: any): object {\r\n return polyline.object;\r\n }\r\n\r\n public getObjectPolylineHighlight(): object {\r\n if (this.selectedPath) {\r\n return this.selectedPath.object;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n public addPolylineHighlightEvent(eventType: PolylineEventType, eventFunction: any) {\r\n if (this.selectedPolyline) {\r\n this.addPolylineEvent([this.selectedPath], eventType, eventFunction);\r\n }\r\n }\r\n\r\n public getPolylineHighlightIndex() {\r\n if (this.selectedPath) {\r\n return [this.selectedPath.initialIdx, this.selectedPath.finalIdx];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /* Private methods */\r\n private addNavigation(polyline: any) {\r\n polyline.clearAllEventListeners();\r\n polyline.on('click', this.onClickPolyline.bind(this, polyline));\r\n }\r\n\r\n private onClickPolyline(polyline: any, event: any) {\r\n const index = this.checkIdx(polyline, event.latlng);\r\n\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n document.onkeydown = this.onKeyUp.bind(this);\r\n } else {\r\n document.onkeyup = this.onKeyUp.bind(this);\r\n }\r\n\r\n if (polyline.navigationHandlerClick) {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n polyline.navigationHandlerClick(param, event.target.object);\r\n }\r\n }\r\n\r\n private onKeyUp(event: any) {\r\n const self = this;\r\n\r\n if (self.selectedPath) {\r\n if (event.ctrlKey) {\r\n console.warn('Deprecated: CTRL is not needed in navigation anymore');\r\n }\r\n\r\n switch (event.which ? event.which : event.keyCode) {\r\n case 38: case 39:\r\n // up arrow or right arrow\r\n self.moveFowards(event.shiftKey);\r\n break;\r\n case 37: case 40:\r\n // left arrow or down arrow\r\n self.moveBackwards(event.shiftKey);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n private moveFowards(multiselection: boolean) {\r\n const polyline = this.selectedPolyline;\r\n\r\n if ((!this.navigateByPoint || this.directionForward) && polyline.finalIdx < polyline.getLatLngs().length - 1) {\r\n this.navigateFoward(multiselection, polyline);\r\n }\r\n this.directionForward = true;\r\n this.moveSelectedPath(polyline, null);\r\n }\r\n\r\n private navigateFoward(multiSelection: boolean, polyline: any) {\r\n if (!multiSelection) {\r\n polyline.finalIdx++;\r\n polyline.initialIdx = this.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n this.multiSelection = false;\r\n } else {\r\n this.multiSelection = true;\r\n if (this.multiSelectionForward) {\r\n polyline.finalIdx++;\r\n }\r\n this.multiSelectionForward = true;\r\n }\r\n }\r\n\r\n private moveBackwards(multiSelection: boolean) {\r\n const polyline = this.selectedPolyline;\r\n\r\n if ((!this.navigateByPoint || !this.directionForward) && polyline.initialIdx > 0) {\r\n this.navigateBackward(multiSelection, polyline);\r\n }\r\n this.directionForward = false;\r\n this.moveSelectedPath(polyline, null);\r\n }\r\n\r\n private navigateBackward(multiSelection: boolean, polyline: any) {\r\n const self = this;\r\n if (!multiSelection) {\r\n polyline.initialIdx--;\r\n polyline.finalIdx = !self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n } else {\r\n self.multiSelection = true;\r\n if (!self.multiSelectionForward) {\r\n polyline.initialIdx--;\r\n }\r\n self.multiSelectionForward = false;\r\n }\r\n }\r\n\r\n private moveSelectedPath(polyline: any, options: NavigationOptions) {\r\n const self = this;\r\n const pathSelected = polyline.getLatLngs().map((x: any) => [x.lat, x.lng])\r\n .slice(polyline.initialIdx, polyline.finalIdx + 1);\r\n\r\n if (self.selectedPath) {\r\n self.selectedPath.setLatLngs(pathSelected);\r\n this.selectedPath.object = polyline.object;\r\n } else {\r\n this.addNewSelectedPath(pathSelected, options, polyline.object);\r\n this.selectedPath.addTo(this.map);\r\n }\r\n\r\n if (this.selectedPath.decorator) {\r\n this.map.removeLayer(this.selectedPath.decorator);\r\n this.setArrowSelectedPath();\r\n }\r\n\r\n if ((options && options.editable) ||\r\n (this.selectedPath.editEnabled && this.selectedPath.editEnabled())) {\r\n this.selectedPath.disableEdit();\r\n this.selectedPath.enableEdit();\r\n }\r\n\r\n this.selectedPath.initialIdx = polyline.initialIdx;\r\n this.selectedPath.finalIdx = polyline.finalIdx;\r\n\r\n let idx = self.directionForward ? polyline.finalIdx : polyline.initialIdx;\r\n if (!this.navigateByPoint) {\r\n idx = polyline.finalIdx > polyline.initialIdx ? polyline.finalIdx : polyline.initialIdx;\r\n }\r\n\r\n const infowindow = polyline.options.infowindows ? polyline.options.infowindows[idx] : null;\r\n if (infowindow) {\r\n const point = polyline.getLatLngs()[idx];\r\n\r\n if (self.navigateInfoWindow) {\r\n self.leafletPopup.alterPopup(self.navigateInfoWindow, {\r\n content: infowindow,\r\n latlng: [point.lat, point.lng]\r\n });\r\n } else {\r\n self.navigateInfoWindow = self.leafletPopup.drawPopup({\r\n content: infowindow,\r\n latlng: [point.lat, point.lng]\r\n });\r\n }\r\n }\r\n }\r\n\r\n private setArrowSelectedPath() {\r\n const pathOptions = { fillOpacity: 1, weight: 0, color: this.selectedPath.options.color };\r\n this.selectedPath.decorator = this.leaflet.polylineDecorator(this.selectedPath, {\r\n patterns: [{ offset: '100%', symbol: this.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions }) }]\r\n });\r\n\r\n this.selectedPath.decorator.addTo(this.map);\r\n }\r\n\r\n private addNewSelectedPath(pathSelected, options, object) {\r\n const newOptions: any = {\r\n color: options && options.color || '#FF0000',\r\n draggable: false,\r\n editable: options.editable,\r\n opacity: options && options.opacity || 1,\r\n weight: options && options.weight || 10,\r\n zIndex: 9999\r\n };\r\n\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n newOptions.opacity = .7;\r\n newOptions.dashArray = '20,15';\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n this.selectedPath = new this.leaflet.Polyline(pathSelected, newOptions);\r\n this.selectedPath.on('editable:vertex:rawclick', (e: any) => e.cancel());\r\n\r\n if (options.style && options.style === PolylineType.Arrow) {\r\n this.setArrowSelectedPath();\r\n }\r\n\r\n this.selectedPath.object = object;\r\n this.selectedPath.highlight = true;\r\n }\r\n\r\n private checkIdx(polyline: any, point: any) {\r\n const self = this;\r\n const path = polyline.getLatLngs();\r\n let distance = 0;\r\n let minDistance = Number.MAX_VALUE;\r\n let returnValue = -1;\r\n\r\n for (let i = 0; i < path.length - 1; i++) {\r\n distance = self.distanceToLine(path[i], path[i + 1], point);\r\n\r\n if (distance < minDistance) {\r\n minDistance = distance;\r\n returnValue = i;\r\n }\r\n }\r\n return returnValue;\r\n }\r\n\r\n private distanceToLine(pt1: any, pt2: any, pt: any) {\r\n const self = this;\r\n const deltaX = pt2.lng - pt1.lng;\r\n const deltaY = pt2.lat - pt1.lat;\r\n let incIntersect = (pt.lng - pt1.lng) * deltaX;\r\n const deltaSum = (deltaX * deltaX) + (deltaY * deltaY);\r\n\r\n incIntersect += (pt.lat - pt1.lat) * deltaY;\r\n if (deltaSum > 0) {\r\n incIntersect /= deltaSum;\r\n } else {\r\n incIntersect = -1;\r\n }\r\n\r\n // The intersection occurs outside the line segment, 'before' pt1.\r\n if (incIntersect < 0) {\r\n return self.kmTo(pt, pt1);\r\n } else if (incIntersect > 1) {\r\n return self.kmTo(pt, pt2);\r\n }\r\n\r\n // Intersection point calculation.\r\n const intersect = new this.leaflet.LatLng(pt1.lat + incIntersect * deltaY, pt1.lng + incIntersect * deltaX);\r\n\r\n return self.kmTo(pt, intersect);\r\n }\r\n\r\n private kmTo(pt1: any, pt2: any) {\r\n const e = Math;\r\n const ra = e.PI / 180;\r\n const b = pt1.lat * ra;\r\n const c = pt2.lat * ra;\r\n const d = b - c;\r\n const g = pt1.lng * ra - pt2.lng * ra;\r\n const f = 2 * e.asin(e.sqrt(e.pow(e.sin(d / 2), 2) + e.cos(b) * e.cos(c) * e.pow(e.sin(g / 2), 2)));\r\n\r\n return f * 6378.137 * 1000;\r\n }\r\n\r\n private getBoundsPolylines(polylines: any) {\r\n const group = new this.leaflet.FeatureGroup(polylines);\r\n return group.getBounds();\r\n }\r\n\r\n private addPolylineEventMove(polyline: any, eventFunction: any) {\r\n const self = this;\r\n polyline.on('editable:vertex:dragstart', (eventStart: any) => {\r\n const lastPosition = new EventReturn([eventStart.vertex.latlng.lat, eventStart.vertex.latlng.lng]);\r\n\r\n polyline.on('editable:vertex:dragend', (eventEnd: any) => {\r\n if (polyline.highlight && polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n self.setArrowSelectedPath();\r\n }\r\n\r\n const newPosition = new EventReturn([eventEnd.vertex.latlng.lat, eventEnd.vertex.latlng.lng]);\r\n eventFunction(newPosition, lastPosition, eventEnd.target.object, eventEnd.vertex.getIndex(), polyline.getLatLngs().map((x: any) => new EventReturn([x.lat, x.lng])));\r\n polyline.off('editable:vertex:dragend');\r\n });\r\n });\r\n }\r\n\r\n private addPolylineEventInsertAt(polyline: any, eventFunction: any) {\r\n const self = this;\r\n polyline.on('editable:vertex:new', (eventNew: any) => {\r\n const latlngs = eventNew.vertex.latlngs;\r\n const previous = latlngs[latlngs.findIndex((x: any) => x === eventNew.vertex.latlng) - 1];\r\n const previousPoint = new EventReturn([previous.lat, previous.lng]);\r\n\r\n polyline.on('editable:vertex:dragend', (event: any) => {\r\n if (polyline.highlight && polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n self.setArrowSelectedPath();\r\n }\r\n\r\n const newPoint = new EventReturn([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(newPoint, previousPoint, event.target.object, event.vertex.getIndex(), polyline.getLatLngs().map((x: any) => new EventReturn([x.lat, x.lng])));\r\n polyline.off('editable:vertex:dragend');\r\n });\r\n });\r\n }\r\n\r\n private addPolylineEventRemoveAt(polyline: any, eventFunction: any) {\r\n polyline.on('editable:vertex:deleted', (event: any) => {\r\n const param = new EventReturn([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(param, event.target.object, polyline.getLatLngs().map((x: any) => new EventReturn([x.lat, x.lng])));\r\n });\r\n }\r\n\r\n private addPolylineEventDragPolyline(polyline: any, eventFunction: any) {\r\n polyline.on('dragend', (event: any) => {\r\n const param = event.target.getLatLngs().map((x: any) => new EventReturn([x.lat, x.lng]));\r\n eventFunction(param, event.target.object);\r\n });\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-polylines.ts","import PopupOptions from '../../features/popup/popup-options';\r\n\r\nexport default class LeafletPopup {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n public drawPopup(options: PopupOptions, marker?: any) {\r\n const self = this;\r\n let popup = null;\r\n\r\n if (!marker) {\r\n popup = new this.leaflet.Popup();\r\n popup.setLatLng(options.latlng);\r\n popup.setContent(options.content);\r\n popup.openOn(self.map);\r\n\r\n } else {\r\n popup = self.drawPopupOnMarker(marker, options);\r\n }\r\n\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n return popup;\r\n }\r\n\r\n public alterPopup(popup: any, options: PopupOptions, marker?: any) {\r\n const self = this;\r\n\r\n if (marker && !marker.getPopup()) {\r\n popup = self.drawPopup(options, marker);\r\n } else {\r\n self.alterPopupContent(popup, options, marker);\r\n\r\n if (!popup.isOpen()) {\r\n if (!marker) {\r\n popup.openOn(self.map);\r\n } else if (options.notCalledByMap) {\r\n marker.openPopup();\r\n }\r\n }\r\n }\r\n\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n\r\n return popup;\r\n }\r\n\r\n public alterPopupContent(popup: any, options: PopupOptions, marker?: any) {\r\n if (marker) {\r\n popup = marker._popup;\r\n }\r\n\r\n if (popup) {\r\n if (options.content) {\r\n popup.setContent(options.content);\r\n }\r\n\r\n if (options.latlng) {\r\n popup.setLatLng(options.latlng);\r\n }\r\n }\r\n\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n }\r\n\r\n public closePopup(popup: any) {\r\n popup.remove();\r\n }\r\n\r\n private drawPopupOnMarker(marker: any, options: PopupOptions) {\r\n marker.bindPopup(options.content);\r\n const popup = marker.getPopup();\r\n\r\n marker.openPopup();\r\n return popup;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-popup.ts","export default class CircleAlterOptions {\r\n public center: number[];\r\n public radius: number;\r\n public weight: number;\r\n public fillOpacity?: number;\r\n public fillColor?: string;\r\n public color?: string;\r\n public opacity?: number;\r\n public editable?: boolean;\r\n public draggable?: boolean;\r\n\r\n constructor(center: number[], radius: number, weight: number, fillOpacity?: number,\r\n fillColor?: string, color?: string, opacity?: number) {\r\n\r\n this.center = center;\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.fillOpacity = fillOpacity;\r\n this.fillColor = fillColor;\r\n this.color = color;\r\n this.opacity = opacity;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/circle/circle-alter-options.ts","export default class CircleOptions {\r\n public center: number[];\r\n public radius: number;\r\n public weight: number;\r\n public addToMap?: boolean;\r\n public fillOpacity?: number;\r\n public fillColor?: string;\r\n public color?: string;\r\n public opacity?: number;\r\n public draggable?: boolean;\r\n public editable?: boolean;\r\n public fitBounds?: boolean;\r\n public object?: object;\r\n\r\n constructor(center: number[], radius: number, weight: number, addToMap?: boolean, fillOpacity?: number,\r\n fillColor?: string, color?: string, opacity?: number, draggable?: boolean, editable?: boolean,\r\n fitBounds?: boolean, object?: object) {\r\n\r\n this.center = center;\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.addToMap = addToMap;\r\n this.fillOpacity = fillOpacity;\r\n this.fillColor = fillColor;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/circle/circle-options.ts","\r\nexport default class GeoJsonOptions {\r\n public draggable?: boolean;\r\n public editable?: boolean;\r\n\r\n constructor(draggable?: boolean, editable?: boolean) {\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/geojson/geojson-options.ts","import CircleMarkerStyle from './circle-marker-style';\r\n\r\nexport default class CircleMarkerOptions {\r\n public latlng: number[];\r\n public addToMap?: boolean;\r\n public style: CircleMarkerStyle;\r\n public fitBounds?: boolean;\r\n public object?: object;\r\n\r\n constructor(latlng: number[], style: CircleMarkerStyle, addToMap?: boolean, fitBounds?: boolean, object?: object) {\r\n this.latlng = latlng;\r\n this.addToMap = addToMap;\r\n this.style = style;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker/circle-marker-options.ts","export default class CircleMarkerStyle {\r\n public radius: number;\r\n public weight?: number;\r\n public color?: string;\r\n public fillColor?: string;\r\n public fillOpacity?: number;\r\n\r\n constructor(radius: number, weight?: number, color?: string, fillColor?: string, fillOpacity?: number) {\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.color = color;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker/circle-marker-style.ts","import CircleMarkerStyle from './circle-marker-style';\r\nimport MarkerIcon from './marker-icon';\r\n\r\nexport default class MarkerAlterOptions {\r\n public latlng?: number[];\r\n public icon?: MarkerIcon;\r\n public style?: CircleMarkerStyle;\r\n\r\n constructor(latlng?: number[], icon?: MarkerIcon, style?: CircleMarkerStyle) {\r\n this.latlng = latlng;\r\n this.icon = icon;\r\n this.style = style;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker/marker-alter-options.ts","export default class MarkerIcon {\r\n public url: string;\r\n public size?: number[];\r\n\r\n constructor(url: string, size?: number[]) {\r\n this.url = url;\r\n this.size = size;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker/marker-icon.ts","import MarkerIcon from './marker-icon';\r\n\r\nexport default class MarkerOptions {\r\n public latlng: number[];\r\n public addToMap?: boolean;\r\n public draggable?: boolean;\r\n public icon?: MarkerIcon;\r\n public fitBounds?: boolean;\r\n public object?: object;\r\n public addClusterer?: boolean;\r\n\r\n constructor(latlng: number[], addToMap: boolean = false, draggable: boolean = false, icon?: MarkerIcon,\r\n fitBounds: boolean = false, object?: object, addClusterer = false) {\r\n\r\n this.latlng = latlng;\r\n this.addToMap = addToMap;\r\n this.draggable = draggable;\r\n this.icon = icon;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n this.addClusterer = addClusterer;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker/marker-options.ts","export default class OverlayOptions {\r\n public position: number[];\r\n public divElement: HTMLDivElement;\r\n public addToMap: boolean;\r\n public object: any;\r\n public polygon: string;\r\n public conditionPolygon: any;\r\n public draggable: boolean;\r\n public afterEventDragHandler: any;\r\n\r\n constructor(divElement: HTMLDivElement, addToMap: boolean, position?: number[], object?: any,\r\n polygon?: string, conditionPolygon?: any, draggable: boolean = false) {\r\n this.position = position;\r\n this.divElement = divElement;\r\n this.addToMap = addToMap;\r\n this.object = object;\r\n this.polygon = polygon;\r\n this.conditionPolygon = conditionPolygon;\r\n this.draggable = draggable;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/overlay/overlay-options.ts","export default class PolygonAlterOptions {\r\n public weight: number;\r\n public color?: string;\r\n public opacity?: number;\r\n public fillColor?: string;\r\n public fillOpacity?: number;\r\n public addToMap: boolean;\r\n public object: any;\r\n public path: number[][];\r\n public editable?: boolean;\r\n public draggable?: boolean;\r\n\r\n constructor(addToMap: boolean, color?: string, opacity?: number, fillColor?: string, fillOpacity?: number,\r\n weight?: number) {\r\n this.addToMap = addToMap;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n this.weight = weight;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/polygons/polygon-alter-options.ts","export default class PolygonOptions {\r\n public path: number[][];\r\n public weight: number;\r\n public addToMap?: boolean;\r\n public color?: string;\r\n public opacity?: number;\r\n public fillColor?: string;\r\n public fillOpacity?: number;\r\n public draggable?: boolean;\r\n public editable?: boolean;\r\n public fitBounds?: boolean;\r\n public object?: object;\r\n public zIndex: number;\r\n\r\n constructor(path: number[][], weight: number, addToMap?: boolean, color?: string, opacity?: number,\r\n fillColor?: string, fillOpacity?: number, draggable?: boolean, editable?: boolean, fitBounds?: boolean,\r\n object?: object) {\r\n\r\n this.path = path;\r\n this.weight = weight;\r\n this.addToMap = addToMap;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/polygons/polygon-options.ts","import { PolylineType } from '../../dto/polyline-type';\r\n\r\nexport default class NavigationOptions {\r\n public color?: string;\r\n public weight?: number;\r\n public opacity?: number;\r\n public navigateByPoint: boolean; // Set to false when you want to navigate by stretch, and not by points\r\n public style: PolylineType;\r\n public editable: boolean;\r\n public navegateOnKeyPress: boolean;\r\n\r\n constructor(color?: string, weight?: number, navigateByPoint: boolean = true, opacity = 1) {\r\n this.color = color;\r\n this.weight = weight;\r\n this.opacity = opacity;\r\n this.navigateByPoint = navigateByPoint;\r\n this.navegateOnKeyPress = false\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/polyline/navigations-options.ts","export default class PopupOptions {\r\n public latlng: number[];\r\n public content: string;\r\n public marker?: string;\r\n public conditionMarker?: any;\r\n public notCalledByMap?: boolean; /* Property to set if open is called from map event or not, only used on leaflet */\r\n public object?: object;\r\n\r\n constructor(latlng: number[], content: string, marker?: string, conditionMarker?: any,\r\n notCalledByMap?: boolean, object?: object) {\r\n this.latlng = latlng;\r\n this.content = content;\r\n this.marker = marker;\r\n this.conditionMarker = conditionMarker;\r\n this.notCalledByMap = notCalledByMap;\r\n this.object = object;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/popup/popup-options.ts","/**\r\n * urlBuilder\r\n *\r\n * @param {object} params\r\n * @param {string} params.base the base url\r\n * @param {array} params.libraries an array of the libraries to be requested\r\n * @param {string} params.callback the callback function\r\n *\r\n * @return {string}\r\n */\r\nexport const urlBuilder = (params) => {\r\n let builtUrl = params.base;\r\n\r\n builtUrl += '?';\r\n\r\n if (params.apiKey) {\r\n builtUrl += 'key=' + params.apiKey + '&';\r\n }\r\n if (params.integrity) {\r\n builtUrl += 'integrity=' + params.integrity + '&';\r\n }\r\n\r\n if (params.client) {\r\n builtUrl += 'client=' + params.client + '&';\r\n }\r\n\r\n if (params.crossorigin) {\r\n builtUrl += 'crossorigin=' + params.crossorigin + '&';\r\n }\r\n\r\n if (params.libraries && params.libraries.length > 0) {\r\n builtUrl += 'libraries=';\r\n\r\n params.libraries.forEach(function (library, index) {\r\n builtUrl += library;\r\n\r\n if (index !== params.libraries.length - 1) {\r\n builtUrl += ',';\r\n }\r\n });\r\n\r\n builtUrl += '&';\r\n }\r\n\r\n if (params.language) {\r\n builtUrl += 'language=' + params.language + '&';\r\n }\r\n\r\n if (params.callback) {\r\n builtUrl += 'callback=' + params.callback + '&';\r\n }\r\n\r\n return builtUrl;\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/url-builder.ts"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6","webpack:///inlog-maps.min.js","webpack:///webpack/bootstrap 0775c726c0583dea30a0?5d7c","webpack:///./src/models/features/events/event-return.ts?6cf4","webpack:///./src/models/dto/event-type.ts?15ce","webpack:///./src/models/dto/map-type.ts?ec1b","webpack:///./src/models/dto/polyline-type.ts?c49e","webpack:///./src/models/features/marker-clusterer/marker-clusterer-config.ts?bc48","webpack:///./src/models/features/polyline/polyline-options.ts?ca16","webpack:///./src/utils/maps-api-loader.service.ts?696b","webpack:///./src/index.ts?eac3","webpack:///./~/@google/markerclustererplus/src/markerclusterer.js?a612","webpack:///./src/map.ts?cf28","webpack:///./src/models/apis/googleMaps.ts?f10e","webpack:///./src/models/apis/google/google-circles.ts?363e","webpack:///./src/models/apis/google/google-geojson.ts?a37d","webpack:///./src/models/apis/google/google-map.ts?3851","webpack:///./src/models/apis/google/google-markers.ts?53ea","webpack:///./src/models/apis/google/google-overlay.ts?0e38","webpack:///./src/models/apis/google/google-polygons.ts?9913","webpack:///./src/models/apis/google/google-polylines.ts?eb20","webpack:///./src/models/apis/google/google-popup.ts?f08c","webpack:///./src/models/apis/leaflet.ts?c2ad","webpack:///./src/models/apis/leaflet/leaflet-circle.ts?e648","webpack:///./src/models/apis/leaflet/leaflet-geojson.ts?de26","webpack:///./src/models/apis/leaflet/leaflet-map.ts?9245","webpack:///./src/models/apis/leaflet/leaflet-markers.ts?38e3","webpack:///./src/models/apis/leaflet/leaflet-overlay.ts?a19a","webpack:///./src/models/apis/leaflet/leaflet-polygons.ts?718f","webpack:///./src/models/apis/leaflet/leaflet-polylines.ts?373c","webpack:///./src/models/apis/leaflet/leaflet-popup.ts?4e83","webpack:///./src/models/features/circle/circle-alter-options.ts?0e19","webpack:///./src/models/features/circle/circle-options.ts?c36a","webpack:///./src/models/features/geojson/geojson-options.ts?9fe6","webpack:///./src/models/features/marker/circle-marker-options.ts?ab05","webpack:///./src/models/features/marker/circle-marker-style.ts?3a4b","webpack:///./src/models/features/marker/marker-alter-options.ts?4b8f","webpack:///./src/models/features/marker/marker-icon.ts?e85b","webpack:///./src/models/features/marker/marker-options.ts?5d42","webpack:///./src/models/features/overlay/overlay-options.ts?55e0","webpack:///./src/models/features/polygons/polygon-alter-options.ts?346d","webpack:///./src/models/features/polygons/polygon-options.ts?01f9","webpack:///./src/models/features/polyline/navigations-options.ts?7ec9","webpack:///./src/models/features/popup/popup-options.ts?ab91","webpack:///./src/utils/url-builder.ts?2855"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","value","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","EventReturn","latlng","default","MapEventType","MarkerEventType","CircleEventType","PolygonEventType","PolylineEventType","MapType","PolylineType","MarkerClustererConfig","clusterZoomOnClick","clusterMinSize","clusterMaxZoom","PolylineOptions","path","addToMap","fitBounds","editable","draggable","color","weight","infowindows","navigateOptions","style","opacity","zIndex","map_type_1","url_builder_1","MapsApiLoaderService","loadGoogleAPI","params","script","document","createElement","type","setAttribute","src","urlBuilder","apiKey","base","callback","client","language","libraries","querySelector","hasAttribute","appendChild","loadLeafletAPI","link","rel","href","loadApi","mapType","mapsApi","Promise","resolve","windowRef","window","api","mapsAPILoadCallback","deferred","reject","Google","Leaflet","setTimeout","L","google","Error","map_1","Map","circle_alter_options_1","CircleAlterOptions","circle_options_1","CircleOptions","event_return_1","geojson_options_1","GeoJsonOptions","circle_marker_options_1","CircleMarkerOptions","circle_marker_style_1","CircleMarkerStyle","marker_alter_options_1","MarkerAlterOptions","marker_icon_1","MarkerIcon","marker_options_1","MarkerOptions","overlay_options_1","OverlayOptions","polygon_alter_options_1","PolygonAlterOptions","polygon_options_1","PolygonOptions","navigations_options_1","NavigationOptions","polyline_options_1","popup_options_1","PopupOptions","marker_clusterer_config_1","event_type_1","polyline_type_1","ClusterIcon","cluster","styles","getMarkerClusterer","extend","maps","OverlayView","cluster_","className_","getClusterClass","styles_","center_","div_","sums_","visible_","setMap","getMap","Cluster","mc","markerClusterer_","map_","gridSize_","getGridSize","minClusterSize_","getMinimumClusterSize","averageCenter_","getAverageCenter","markers_","bounds_","clusterIcon_","getStyles","MarkerClusterer","map","opt_markers","opt_options","clusters_","listeners_","activeMap_","ready_","gridSize","minimumClusterSize","maxZoom_","maxZoom","title_","title","zoomOnClick_","undefined","zoomOnClick","averageCenter","ignoreHidden_","ignoreHidden","enableRetinaIcons_","enableRetinaIcons","imagePath_","imagePath","IMAGE_PATH","imageExtension_","imageExtension","IMAGE_EXTENSION","imageSizes_","imageSizes","IMAGE_SIZES","calculator_","calculator","CALCULATOR","batchSize_","batchSize","BATCH_SIZE","batchSizeIE_","batchSizeIE","BATCH_SIZE_IE","clusterClass_","clusterClass","navigator","userAgent","toLowerCase","indexOf","setupStyles_","addMarkers","onAdd","cMouseDownInCluster","cDraggingMapByCluster","cClusterIcon","gmVersion","version","split","parseInt","className","show","getPanes","overlayMouseTarget","boundsChangedListener_","event","addListener","addDomListener","e","stopPropagation","theBounds","mz","trigger","getZoomOnClick","getMaxZoom","getBounds","getZoom","setZoom","cancelBubble","onRemove","parentNode","hide","removeListener","clearInstanceListeners","removeChild","draw","pos","getPosFromLatLng_","top","y","left","x","Marker","MAX_ZINDEX","display","img","bp","backgroundPosition_","spriteH","replace","spriteV","cssText","createCss","url_","width_","height_","innerHTML","anchorText_","textColor_","textSize_","fontFamily_","fontWeight_","fontStyle_","textDecoration_","text","getTitle","useStyle","sums","index","Math","max","min","length","url","height","width","anchorText","anchorIcon_","anchorIcon","textColor","textSize","textDecoration","fontWeight","fontStyle","fontFamily","backgroundPosition","setCenter","center","push","join","getProjection","fromLatLngToDivPixel","getSize","getMarkers","getCenter","bounds","LatLngBounds","markers","getPosition","remove","addMarker","marker","mCount","isMarkerAlreadyAdded_","lat","lng","LatLng","calculateBounds_","isAdded","updateIcon_","isMarkerInClusterBounds","contains","getExtendedBounds","numStyles","getCalculator","cMarkerClusterer","repaint","prevZoom_","zoom","minZoom","mapTypes","getMapTypeId","resetViewport_","bind","redraw_","size","fitMapToMarkers","getVisible","getIgnoreHidden","setGridSize","setMinimumClusterSize","setMaxZoom","setStyles","setTitle","setZoomOnClick","setAverageCenter","setIgnoreHidden","getEnableRetinaIcons","setEnableRetinaIcons","getImageExtension","setImageExtension","getImagePath","setImagePath","getImageSizes","setImageSizes","setCalculator","getBatchSizeIE","setBatchSizeIE","setClusterClass","getTotalMarkers","getClusters","getTotalClusters","opt_nodraw","pushMarkerTo_","key","getDraggable","removeMarker","removed","removeMarker_","removeMarkers","r","splice","clearMarkers","oldClusters","slice","projection","tr","getNorthEast","bl","getSouthWest","trPix","blPix","ne","fromDivPixelToLatLng","sw","createClusters_","opt_hide","distanceBetweenPoints_","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","isMarkerInBounds_","addToClosestCluster_","distance","clusterToAddTo","iFirst","mapBounds","timerRefStatic","clearTimeout","iLast","obj1","obj2","apply","count","toString","dv","googleMaps_1","leaflet_1","markersList","polygonsList","circlesList","polylinesList","infoWindowList","overlayList","markerClusterer","initialize","options","elementId","loadGEOJson","data","eventClick","drawMarker","addClusterer","addMarkerClusterer","addMarkerOnClusterer","drawCircleMarker","toggleMarkers","condition","filter","removeAllMarkers","alterMarkerOptions","alterMarkerPosition","position","addTransition","fitBoundsMarkers","onlyMarkersOnMap","_this","isMarkerOnMap","fitBoundsPositions","setCenterMarker","find","markerExists","countMarkers","onlyOnMap","countMarkersOnCluster","addMarkerEvent","eventFunction","removeMarkerEvent","config","alterMarkerClustererConfig","refreshClusterer","clearMarkersClusterer","drawPolygon","polygon","togglePolygons","polygons","getPolygons","removePolygons","removeAllPolygons","alterPolygonOptions","fitBoundsPolygons","isPolygonOnMap","setCenterPolygons","polygonExists","getPolygonPath","addPolygonEvent","removePolygonEvent","drawCircle","circle","toggleCircles","circles","getCircles","removeCircles","removeAllCircles","alterCircleOptions","fitBoundsCircles","isCircleOnMap","circleExists","getCircleCenter","getCircleRadius","addCircleEvent","removeCircleEvent","drawPolyline","polyline","drawPolylineWithNavigation","togglePolylines","getPolylines","removePolylines","polylines","removeAllPolylines","alterPolylineOptions","fitBoundsPolylines","isPolylineOnMap","polylineExists","addPolylinePath","getPolylinePath","removePolylineHighlight","addPolylineEvent","removePolylineEvent","setIndexPolylineHighlight","initialIndex","getObjectPolyline","getObjectPolylineHighlight","addPolylineHighlightEvent","getPolylineHighlightIndex","drawPopup","conditionMarker","popup","alterPopup","popups","alterPopupContent","getObjectOpenPopup","closePopup","closeAllPopups","resizeMap","addEventMap","eventType","removeEventMap","pixelsToLatLng","offsetx","offsety","fitBoundsElements","drawOverlay","overlay","conditionPolygon","toggleOverlay","overlays","getOverlays","removeOverlays","removeAllOverlays","__awaiter","thisArg","_arguments","P","generator","fulfilled","step","next","rejected","result","done","then","__generator","body","verb","v","op","f","TypeError","_","t","label","ops","pop","trys","g","sent","throw","return","Symbol","iterator","maps_api_loader_service_1","google_circles_1","google_geojson_1","google_map_1","google_markers_1","google_overlay_1","google_polygons_1","google_polylines_1","google_popup_1","GoogleMaps","mapsApiLoader","google_1","imageMapTypes_1","ids_1","trafficLayer","err_1","_a","fullscreenControl","keyboardShortcuts","mapTypeControl","rotateControl","scaleControl","streetViewControl","zoomControl","gestureHandling","mapTiles","MapTypeId","ROADMAP","SATELLITE","forEach","tile","mapTypeOptions","getTileUrl","coord","isPng","tileSize","Size","imageMapType","ImageMapType","id","mapTypeControlOptions","mapTypeIds","MapTypeControlStyle","HORIZONTAL_BAR","getElementById","googleMarkers","googlePolygons","googleCircles","googlePopups","googlePolylines","googleMap","googleOverlays","googleGeoJson","image","set","showTraffic","TrafficLayer","removeMarkerFromClusterer","GoogleCircles","self","newOptions","fillColor","fillOpacity","radius","strokeColor","strokeOpacity","strokeWeight","suppressUndo","Circle","param","latLng","setOptions","getCirclesBounds","getRadius","Click","CenterChanged","RadiusChanged","clearListeners","circulo","union","GoogleGeoJson","parseGeoJson","elem","parsedFeatures","Array","isArray","features","_i","feature","parseGeoJsonToObject","objectOptions","geometry","properties","assign","coordinates","paths","Polygon","Polyline","GoogleMap","ZoomChanged","scale","pow","worldCoordinateCenter","fromLatLngToPoint","pixelOffset","Point","worldCoordinateNewCenter","fromPointToLatLng","getPaths","getArray","ponto","getPath","GoogleMarkers","icon","SymbolPath","CIRCLE","newPosition","moveTransitionMarker","setPosition","RightClick","AfterDrag","MouseOver","MouseOut","BeforeDrag","reference","deltaLat","deltaLng","lastPosition","moveMarker","numDeltas","GoogleOverlays","OverlayGoogle","div","obj","afterDrag","afterDragHandler","that","panes","overlayLayer","getDiv","cursor","moveHandler","origin","clientX","clientY","overlayProjection","getPolygonsBounds","divElement","afterEventDragHandler","GooglePolygons","getPathRecursiveArray","getPathPolylineArray","getPolygonBounds","paths_1","setPath","SetAt","addPolygonEventMove","InsertAt","addPolygonEventInsertAt","RemoveAt","addPolygonEventRemoveAt","DragPolygon","addPolygonEventDragPolygon","addPolygonEventClick","polygonPathIdx","getLength","addPolygonEventMoveAllPaths","getAt","innerPolygon","newEvent","lastEvent","dragging","addPolygonEventInsertAtAllPaths","newPath","newPoint","previousPath","previousPoint","addPolygonEventRemoveAtAllPaths","GooglePolylines","selectedPolyline","selectedPath","navigateInfoWindow","directionForward","multiSelectionForward","multiSelection","icons","Dotted","console","warn","Dashed","offset","repeat","Arrow","FORWARD_OPEN_ARROW","scaledSize","getPolylineBounds","navigationHandlerClick","navigationOptions","navigateByPoint","addNavigation","getPolylinesBounds","close","addPolylineEventMove","addPolylineEventInsertAt","addPolylineEventRemoveAt","DragPolyline","addPolylineEventDragPolyline","addPolylineEventMouseOver","addPolylineEventMouseOut","initialIdx","finalIdx","moveSelectedPath","navegateOnKeyPress","onKeyUp","onClickPolyline","checkIdx","which","keyCode","moveForwards","shiftKey","moveBackwards","navigateForward","navigateBackward","pathSelected","updateSelectedPathListeners","anchor","drawPopupNavigation","moveListener","insertAtListener","removeAtListener","overPolylineListener","outPolylineListener","dragPolylineListener","idx","infowindow","point","content","minDistance","Number","MAX_VALUE","returnValue","distanceToLine","pt1","pt2","pt","deltaX","deltaY","incIntersect","deltaSum","kmTo","intersect","ra","b","asin","GooglePopups","InfoWindow","open","setContent","leaflet_circle_1","leaflet_geojson_1","leaflet_map_1","leaflet_markers_1","leaflet_overlay_1","leaflet_polygons_1","leaflet_polylines_1","leaflet_popup_1","mapOptions","osm","wikimedia","satelliteURL","satellite","baseLayers_1","loadDependencies","mapTimeout","keyboard","tileLayer","attribution","layers","Satellite","layer","control","addTo","leafletMarkers","leafletPolygons","leafletCircles","leafletPopups","leafletPolylines","leafletMap","leafletOverlays","leafletGeoJson","error","ms","cssDependencies","scripts","scriptsDependencies","LeafletCircles","leaflet","on","DomEvent","target","enableEdit","addLayer","removeLayer","setStyle","setRadius","setLatLng","disableEdit","getBoundsCircles","hasLayer","getLatLng","vertex","off","FeatureGroup","LeafletGeoJson","objects","parsedCoordinates","reverse","LeafletMap","invalidateSize","panTo","CRS","Simple","project","unproject","group","featureGroup","LeafletMarkers","Icon","iconUrl","iconSize","iconAnchor","popupAnchor","circleMarker","setIcon","markerClusterGroup","maxClusterRadius","showCoverageOnHover","zoomToBoundsOnClick","refreshClusters","clearLayers","getLayers","LeafletOverlay","html","outerHTML","myIcon","DivIcon","getBoundsPolygons","LeafletPolygons","setLatLngs","getLatLngs","eventStart","eventEnd","z","getIndex","eventNew","latlngs","previous","findIndex","previousPoint_1","LeafletPolylines","leafletPopup","dashArray","cancel","pathOptions","decorator","polylineDecorator","patterns","symbol","arrowHead","pixelSize","getBoundsPolylines","editEnabled","onkeyup","onkeydown","clearAllEventListeners","ctrlKey","moveFowards","multiselection","navigateFoward","addNewSelectedPath","setArrowSelectedPath","highlight","LeafletPopup","drawPopupOnMarker","Popup","openOn","getPopup","isOpen","notCalledByMap","openPopup","_popup","bindPopup","builtUrl","integrity","crossorigin","library"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,OAAA,eAAAH,GACA,gBAAAC,SACAA,QAAA,UAAAD,IAEAD,EAAA,UAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,G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,EACtBz7B,KAAKsB,OAASA,EAEtB,MAAAwG,K1Co9NAlI,GAAQkC,QAAUgG,GAKZ,SAAUjI,EAAQD,EAASM,GAEjC,YAEAa,QAAOC,eAAepB,EAAS,cAAgBc,OAAO,I2Cp+NzCd,EAAAsE,WAAa,SAACP,GACvB,GAAIk4B,GAAWl4B,EAAOS,IAyCtB,OAvCAy3B,IAAY,IAERl4B,EAAOQ,SACP03B,GAAY,OAASl4B,EAAOQ,OAAS,KAErCR,EAAOm4B,YACPD,GAAY,aAAel4B,EAAOm4B,UAAY,KAG9Cn4B,EAAOW,SACPu3B,GAAY,UAAYl4B,EAAOW,OAAS,KAGxCX,EAAOo4B,cACPF,GAAY,eAAiBl4B,EAAOo4B,YAAc,KAGlDp4B,EAAOa,WAAab,EAAOa,UAAU+M,OAAS,IAC9CsqB,GAAY,aAEZl4B,EAAOa,UAAU0gB,QAAQ,SAAU8W,EAAS7qB,GACxC0qB,GAAYG,EAER7qB,IAAUxN,EAAOa,UAAU+M,OAAS,IACpCsqB,GAAY,OAIpBA,GAAY,KAGZl4B,EAAOY,WACPs3B,GAAY,YAAcl4B,EAAOY,SAAW,KAG5CZ,EAAOU,WACPw3B,GAAY,YAAcl4B,EAAOU,SAAW,KAGzCw3B,I3C0+NL,SAAUh8B,EAAQD,EAASM,GAEjCL,EAAOD,QAAUM,EAAoB","file":"inlog-maps.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"InlogMaps\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"InlogMaps\"] = factory();\n\telse\n\t\troot[\"InlogMaps\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"InlogMaps\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"InlogMaps\"] = factory();\n\telse\n\t\troot[\"InlogMaps\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 42);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar EventReturn = /** @class */ (function () {\r\n function EventReturn(latlng) {\r\n this.latlng = latlng;\r\n }\r\n return EventReturn;\r\n}());\r\nexports.default = EventReturn;\r\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MapEventType;\r\n(function (MapEventType) {\r\n MapEventType[MapEventType[\"Click\"] = 0] = \"Click\";\r\n MapEventType[MapEventType[\"ZoomChanged\"] = 1] = \"ZoomChanged\";\r\n})(MapEventType = exports.MapEventType || (exports.MapEventType = {}));\r\nvar MarkerEventType;\r\n(function (MarkerEventType) {\r\n MarkerEventType[MarkerEventType[\"Click\"] = 0] = \"Click\";\r\n MarkerEventType[MarkerEventType[\"RightClick\"] = 1] = \"RightClick\";\r\n MarkerEventType[MarkerEventType[\"AfterDrag\"] = 2] = \"AfterDrag\";\r\n MarkerEventType[MarkerEventType[\"MouseOver\"] = 3] = \"MouseOver\";\r\n MarkerEventType[MarkerEventType[\"MouseOut\"] = 4] = \"MouseOut\";\r\n MarkerEventType[MarkerEventType[\"BeforeDrag\"] = 5] = \"BeforeDrag\";\r\n})(MarkerEventType = exports.MarkerEventType || (exports.MarkerEventType = {}));\r\nvar CircleEventType;\r\n(function (CircleEventType) {\r\n CircleEventType[CircleEventType[\"Click\"] = 0] = \"Click\";\r\n CircleEventType[CircleEventType[\"CenterChanged\"] = 1] = \"CenterChanged\";\r\n CircleEventType[CircleEventType[\"RadiusChanged\"] = 2] = \"RadiusChanged\";\r\n})(CircleEventType = exports.CircleEventType || (exports.CircleEventType = {}));\r\nvar PolygonEventType;\r\n(function (PolygonEventType) {\r\n PolygonEventType[PolygonEventType[\"SetAt\"] = 0] = \"SetAt\";\r\n PolygonEventType[PolygonEventType[\"InsertAt\"] = 1] = \"InsertAt\";\r\n PolygonEventType[PolygonEventType[\"RemoveAt\"] = 2] = \"RemoveAt\";\r\n PolygonEventType[PolygonEventType[\"DragPolygon\"] = 3] = \"DragPolygon\";\r\n PolygonEventType[PolygonEventType[\"Click\"] = 4] = \"Click\";\r\n})(PolygonEventType = exports.PolygonEventType || (exports.PolygonEventType = {}));\r\nvar PolylineEventType;\r\n(function (PolylineEventType) {\r\n PolylineEventType[PolylineEventType[\"SetAt\"] = 0] = \"SetAt\";\r\n PolylineEventType[PolylineEventType[\"InsertAt\"] = 1] = \"InsertAt\";\r\n PolylineEventType[PolylineEventType[\"RemoveAt\"] = 2] = \"RemoveAt\";\r\n PolylineEventType[PolylineEventType[\"DragPolyline\"] = 3] = \"DragPolyline\";\r\n PolylineEventType[PolylineEventType[\"MouseOver\"] = 4] = \"MouseOver\";\r\n PolylineEventType[PolylineEventType[\"MouseOut\"] = 5] = \"MouseOut\";\r\n})(PolylineEventType = exports.PolylineEventType || (exports.PolylineEventType = {}));\r\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MapType;\r\n(function (MapType) {\r\n MapType[MapType[\"Google\"] = 0] = \"Google\";\r\n MapType[MapType[\"Leaflet\"] = 1] = \"Leaflet\";\r\n})(MapType = exports.MapType || (exports.MapType = {}));\r\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PolylineType;\r\n(function (PolylineType) {\r\n PolylineType[PolylineType[\"Dashed\"] = 0] = \"Dashed\";\r\n PolylineType[PolylineType[\"Dotted\"] = 1] = \"Dotted\";\r\n PolylineType[PolylineType[\"Arrow\"] = 2] = \"Arrow\";\r\n})(PolylineType = exports.PolylineType || (exports.PolylineType = {}));\r\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MarkerClustererConfig = /** @class */ (function () {\r\n function MarkerClustererConfig(clusterZoomOnClick, clusterMinSize, clusterMaxZoom) {\r\n this.clusterZoomOnClick = clusterZoomOnClick;\r\n this.clusterMinSize = clusterMinSize;\r\n this.clusterMaxZoom = clusterMaxZoom;\r\n }\r\n return MarkerClustererConfig;\r\n}());\r\nexports.default = MarkerClustererConfig;\r\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PolylineOptions = /** @class */ (function () {\r\n function PolylineOptions(path, addToMap, fitBounds, editable, draggable, color, weight, object, infowindows, navigateOptions, style, opacity, zIndex) {\r\n this.path = path;\r\n this.addToMap = addToMap;\r\n this.fitBounds = fitBounds;\r\n this.editable = editable;\r\n this.draggable = draggable;\r\n this.color = color;\r\n this.weight = weight;\r\n this.object = object;\r\n this.infowindows = infowindows;\r\n this.navigateOptions = navigateOptions;\r\n this.style = style;\r\n this.opacity = opacity;\r\n this.zIndex = zIndex;\r\n }\r\n return PolylineOptions;\r\n}());\r\nexports.default = PolylineOptions;\r\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar map_type_1 = __webpack_require__(2);\r\nvar url_builder_1 = __webpack_require__(41);\r\nvar MapsApiLoaderService = /** @class */ (function () {\r\n function MapsApiLoaderService() {\r\n }\r\n MapsApiLoaderService.loadGoogleAPI = function (params) {\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.setAttribute('data-google-inlogmaps', 'true');\r\n script.src = url_builder_1.urlBuilder({\r\n apiKey: params.apiKey,\r\n base: 'https://maps.googleapis.com/maps/api/js',\r\n callback: 'mapsAPILoadCallback',\r\n client: params.client,\r\n language: params.language,\r\n libraries: params.libraries || []\r\n });\r\n var has_script = document.querySelector('script').hasAttribute('data-google-inlogmaps');\r\n if (!has_script)\r\n document.querySelector('head').appendChild(script);\r\n };\r\n MapsApiLoaderService.loadLeafletAPI = function (params) {\r\n var link = document.createElement('link');\r\n link.rel = 'stylesheet';\r\n link.href = 'https://desenvolvimentoweb.blob.core.windows.net/inlog-leaflet/leaflet.css';\r\n // link.integrity = params.cssIntegrity;\r\n // link.setAttribute('crossorigin', params.crossorigin);\r\n document.querySelector('head').appendChild(link);\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = url_builder_1.urlBuilder({\r\n base: 'https://desenvolvimentoweb.blob.core.windows.net/inlog-leaflet/leaflet.js',\r\n callback: 'mapsAPILoadCallback',\r\n });\r\n document.querySelector('head').appendChild(script);\r\n };\r\n // TODO: needs refactoring\r\n MapsApiLoaderService.prototype.loadApi = function (mapType, params) {\r\n if (MapsApiLoaderService.mapsApi) {\r\n return Promise.resolve(MapsApiLoaderService.mapsApi);\r\n }\r\n MapsApiLoaderService.windowRef = window ? window : { api: null, mapsAPILoadCallback: null };\r\n var deferred = function (resolve, reject) {\r\n if (mapType === map_type_1.MapType.Google) {\r\n MapsApiLoaderService.loadGoogleAPI(params);\r\n }\r\n else {\r\n MapsApiLoaderService.loadLeafletAPI(params);\r\n }\r\n // Temporaria para testar Leaflet\r\n if (mapType === map_type_1.MapType.Leaflet) {\r\n setTimeout(function () {\r\n MapsApiLoaderService.mapsApi = MapsApiLoaderService.windowRef.L;\r\n resolve(MapsApiLoaderService.mapsApi);\r\n }, 2000);\r\n }\r\n else {\r\n MapsApiLoaderService.windowRef.mapsAPILoadCallback = function () {\r\n MapsApiLoaderService.mapsApi = MapsApiLoaderService.windowRef.google;\r\n resolve(MapsApiLoaderService.mapsApi);\r\n };\r\n }\r\n setTimeout(function () {\r\n if (!MapsApiLoaderService.windowRef.api) {\r\n reject(new Error('Loading took too long'));\r\n }\r\n }, 5000);\r\n };\r\n return new Promise(deferred);\r\n };\r\n MapsApiLoaderService.windowRef = null;\r\n MapsApiLoaderService.mapsApi = null;\r\n return MapsApiLoaderService;\r\n}());\r\nexports.MapsApiLoaderService = MapsApiLoaderService;\r\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar map_1 = __webpack_require__(9);\r\nexports.Map = map_1.default;\r\nvar circle_alter_options_1 = __webpack_require__(28);\r\nexports.CircleAlterOptions = circle_alter_options_1.default;\r\nvar circle_options_1 = __webpack_require__(29);\r\nexports.CircleOptions = circle_options_1.default;\r\nvar event_return_1 = __webpack_require__(0);\r\nexports.EventReturn = event_return_1.default;\r\nvar geojson_options_1 = __webpack_require__(30);\r\nexports.GeoJsonOptions = geojson_options_1.default;\r\nvar circle_marker_options_1 = __webpack_require__(31);\r\nexports.CircleMarkerOptions = circle_marker_options_1.default;\r\nvar circle_marker_style_1 = __webpack_require__(32);\r\nexports.CircleMarkerStyle = circle_marker_style_1.default;\r\nvar marker_alter_options_1 = __webpack_require__(33);\r\nexports.MarkerAlterOptions = marker_alter_options_1.default;\r\nvar marker_icon_1 = __webpack_require__(34);\r\nexports.MarkerIcon = marker_icon_1.default;\r\nvar marker_options_1 = __webpack_require__(35);\r\nexports.MarkerOptions = marker_options_1.default;\r\nvar overlay_options_1 = __webpack_require__(36);\r\nexports.OverlayOptions = overlay_options_1.default;\r\nvar polygon_alter_options_1 = __webpack_require__(37);\r\nexports.PolygonAlterOptions = polygon_alter_options_1.default;\r\nvar polygon_options_1 = __webpack_require__(38);\r\nexports.PolygonOptions = polygon_options_1.default;\r\nvar navigations_options_1 = __webpack_require__(39);\r\nexports.NavigationOptions = navigations_options_1.default;\r\nvar polyline_options_1 = __webpack_require__(5);\r\nexports.PolylineOptions = polyline_options_1.default;\r\nvar popup_options_1 = __webpack_require__(40);\r\nexports.PopupOptions = popup_options_1.default;\r\nvar marker_clusterer_config_1 = __webpack_require__(4);\r\nexports.MarkerClustererConfig = marker_clusterer_config_1.default;\r\nvar event_type_1 = __webpack_require__(1);\r\nexports.MarkerEventType = event_type_1.MarkerEventType;\r\nexports.CircleEventType = event_type_1.CircleEventType;\r\nexports.PolygonEventType = event_type_1.PolygonEventType;\r\nexports.PolylineEventType = event_type_1.PolylineEventType;\r\nexports.MapEventType = event_type_1.MapEventType;\r\nvar map_type_1 = __webpack_require__(2);\r\nexports.MapType = map_type_1.MapType;\r\nvar polyline_type_1 = __webpack_require__(3);\r\nexports.PolylineType = polyline_type_1.PolylineType;\r\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/**\n * @name MarkerClustererPlus for Google Maps V3\n * @version 2.1.11\n * @author Gary Little\n * @fileoverview\n * The library creates and manages per-zoom-level clusters for large amounts of markers.\n * <p>\n * This is an enhanced V3 implementation of the V2 MarkerClusterer by Xiaoxi Wu. It is\n * based on the V3 MarkerClusterer port by Luke Mahe. MarkerClustererPlus was created\n * by Gary Little.\n * <p>\n * v2.0 release: MarkerClustererPlus v2.0 is backward compatible with MarkerClusterer v1.0. It\n * adds support for the <code>ignoreHidden</code>, <code>title</code>, <code>batchSizeIE</code>,\n * and <code>calculator</code> properties as well as support for four more events. It also allows\n * greater control over the styling of the text that appears on the cluster marker. The\n * documentation has been significantly improved and the overall code has been simplified and\n * polished. Very large numbers of markers can now be managed without causing Javascript timeout\n * errors on Internet Explorer. Note that the name of the <code>clusterclick</code> event has been\n * deprecated. The new name is <code>click</code>, so please change your application code now.\n */\n\n/**\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @name ClusterIconStyle\n * @class This class represents the object for values in the <code>styles</code> array passed\n * to the {@link MarkerClusterer} constructor. The element in this array that is used to\n * style the cluster icon is determined by calling the <code>calculator</code> function.\n *\n * @property {string} url The URL of the cluster icon image file. Required.\n * @property {number} height The display height (in pixels) of the cluster icon. Required.\n * @property {number} width The display width (in pixels) of the cluster icon. Required.\n * @property {Array} [anchorText] The position (in pixels) from the center of the cluster icon to\n * where the text label is to be centered and drawn. The format is <code>[yoffset, xoffset]</code>\n * where <code>yoffset</code> increases as you go down from center and <code>xoffset</code>\n * increases to the right of center. The default is <code>[0, 0]</code>.\n * @property {Array} [anchorIcon] The anchor position (in pixels) of the cluster icon. This is the\n * spot on the cluster icon that is to be aligned with the cluster position. The format is\n * <code>[yoffset, xoffset]</code> where <code>yoffset</code> increases as you go down and\n * <code>xoffset</code> increases to the right of the top-left corner of the icon. The default\n * anchor position is the center of the cluster icon.\n * @property {string} [textColor=\"black\"] The color of the label text shown on the\n * cluster icon.\n * @property {number} [textSize=11] The size (in pixels) of the label text shown on the\n * cluster icon.\n * @property {string} [textDecoration=\"none\"] The value of the CSS <code>text-decoration</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontWeight=\"bold\"] The value of the CSS <code>font-weight</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontStyle=\"normal\"] The value of the CSS <code>font-style</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontFamily=\"Arial,sans-serif\"] The value of the CSS <code>font-family</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [backgroundPosition=\"0 0\"] The position of the cluster icon image\n * within the image defined by <code>url</code>. The format is <code>\"xpos ypos\"</code>\n * (the same format as for the CSS <code>background-position</code> property). You must set\n * this property appropriately when the image defined by <code>url</code> represents a sprite\n * containing multiple images. Note that the position <i>must</i> be specified in px units.\n */\n/**\n * @name ClusterIconInfo\n * @class This class is an object containing general information about a cluster icon. This is\n * the object that a <code>calculator</code> function returns.\n *\n * @property {string} text The text of the label to be shown on the cluster icon.\n * @property {number} index The index plus 1 of the element in the <code>styles</code>\n * array to be used to style the cluster icon.\n * @property {string} title The tooltip to display when the mouse moves over the cluster icon.\n * If this value is <code>undefined</code> or <code>\"\"</code>, <code>title</code> is set to the\n * value of the <code>title</code> property passed to the MarkerClusterer.\n */\n/**\n * A cluster icon.\n *\n * @constructor\n * @extends google.maps.OverlayView\n * @param {Cluster} cluster The cluster with which the icon is to be associated.\n * @param {Array} [styles] An array of {@link ClusterIconStyle} defining the cluster icons\n * to use for various cluster sizes.\n * @private\n */\nfunction ClusterIcon(cluster, styles) {\n cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);\n\n this.cluster_ = cluster;\n this.className_ = cluster.getMarkerClusterer().getClusterClass();\n this.styles_ = styles;\n this.center_ = null;\n this.div_ = null;\n this.sums_ = null;\n this.visible_ = false;\n\n this.setMap(cluster.getMap()); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Adds the icon to the DOM.\n */\nClusterIcon.prototype.onAdd = function () {\n var cClusterIcon = this;\n var cMouseDownInCluster;\n var cDraggingMapByCluster;\n var gmVersion = google.maps.version.split(\".\");\n\n gmVersion = parseInt(gmVersion[0] * 100, 10) + parseInt(gmVersion[1], 10);\n\n this.div_ = document.createElement(\"div\");\n this.div_.className = this.className_;\n if (this.visible_) {\n this.show();\n }\n\n this.getPanes().overlayMouseTarget.appendChild(this.div_);\n\n // Fix for Issue 157\n this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), \"bounds_changed\", function () {\n cDraggingMapByCluster = cMouseDownInCluster;\n });\n\n google.maps.event.addDomListener(this.div_, \"mousedown\", function () {\n cMouseDownInCluster = true;\n cDraggingMapByCluster = false;\n });\n\n// March 1, 2018: Fix for this 3.32 exp bug, https://issuetracker.google.com/issues/73571522\n// But it doesn't work with earlier releases so do a version check.\n if (gmVersion >= 332) { // Ugly version-dependent code\n google.maps.event.addDomListener(this.div_, \"touchstart\", function (e) {\n e.stopPropagation();\n });\n }\n\n google.maps.event.addDomListener(this.div_, \"click\", function (e) {\n cMouseDownInCluster = false;\n if (!cDraggingMapByCluster) {\n var theBounds;\n var mz;\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(mc, \"click\", cClusterIcon.cluster_);\n google.maps.event.trigger(mc, \"clusterclick\", cClusterIcon.cluster_); // deprecated name\n\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (mc.getZoomOnClick()) {\n // Zoom into the cluster.\n mz = mc.getMaxZoom();\n theBounds = cClusterIcon.cluster_.getBounds();\n mc.getMap().fitBounds(theBounds);\n // There is a fix for Issue 170 here:\n setTimeout(function () {\n mc.getMap().fitBounds(theBounds);\n // Don't zoom beyond the max zoom level\n if (mz !== null && (mc.getMap().getZoom() > mz)) {\n mc.getMap().setZoom(mz + 1);\n }\n }, 100);\n }\n\n // Prevent event propagation to the map:\n e.cancelBubble = true;\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n }\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseover\", function () {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseover\", cClusterIcon.cluster_);\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseout\", function () {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseout\", cClusterIcon.cluster_);\n });\n};\n\n\n/**\n * Removes the icon from the DOM.\n */\nClusterIcon.prototype.onRemove = function () {\n if (this.div_ && this.div_.parentNode) {\n this.hide();\n google.maps.event.removeListener(this.boundsChangedListener_);\n google.maps.event.clearInstanceListeners(this.div_);\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n};\n\n\n/**\n * Draws the icon.\n */\nClusterIcon.prototype.draw = function () {\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.top = pos.y + \"px\";\n this.div_.style.left = pos.x + \"px\";\n this.div_.style.zIndex = google.maps.Marker.MAX_ZINDEX + 1; // Put above all unclustered markers\n }\n};\n\n\n/**\n * Hides the icon.\n */\nClusterIcon.prototype.hide = function () {\n if (this.div_) {\n this.div_.style.display = \"none\";\n }\n this.visible_ = false;\n};\n\n\n/**\n * Positions and shows the icon.\n */\nClusterIcon.prototype.show = function () {\n if (this.div_) {\n var img = \"\";\n // NOTE: values must be specified in px units\n var bp = this.backgroundPosition_.split(\" \");\n var spriteH = parseInt(bp[0].replace(/^\\s+|\\s+$/g, \"\"), 10);\n var spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, \"\"), 10);\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos);\n img = \"<img src='\" + this.url_ + \"' style='position: absolute; top: \" + spriteV + \"px; left: \" + spriteH + \"px; \";\n if (this.cluster_.getMarkerClusterer().enableRetinaIcons_) {\n img += \"width: \" + this.width_ + \"px; height: \" + this.height_ + \"px;\";\n } else {\n img += \"clip: rect(\" + (-1 * spriteV) + \"px, \" + ((-1 * spriteH) + this.width_) + \"px, \" +\n ((-1 * spriteV) + this.height_) + \"px, \" + (-1 * spriteH) + \"px);\";\n }\n img += \"'>\";\n this.div_.innerHTML = img + \"<div style='\" +\n \"position: absolute;\" +\n \"top: \" + this.anchorText_[0] + \"px;\" +\n \"left: \" + this.anchorText_[1] + \"px;\" +\n \"color: \" + this.textColor_ + \";\" +\n \"font-size: \" + this.textSize_ + \"px;\" +\n \"font-family: \" + this.fontFamily_ + \";\" +\n \"font-weight: \" + this.fontWeight_ + \";\" +\n \"font-style: \" + this.fontStyle_ + \";\" +\n \"text-decoration: \" + this.textDecoration_ + \";\" +\n \"text-align: center;\" +\n \"width: \" + this.width_ + \"px;\" +\n \"line-height:\" + this.height_ + \"px;\" +\n \"'>\" + this.sums_.text + \"</div>\";\n if (typeof this.sums_.title === \"undefined\" || this.sums_.title === \"\") {\n this.div_.title = this.cluster_.getMarkerClusterer().getTitle();\n } else {\n this.div_.title = this.sums_.title;\n }\n this.div_.style.display = \"\";\n }\n this.visible_ = true;\n};\n\n\n/**\n * Sets the icon styles to the appropriate element in the styles array.\n *\n * @param {ClusterIconInfo} sums The icon label text and styles index.\n */\nClusterIcon.prototype.useStyle = function (sums) {\n this.sums_ = sums;\n var index = Math.max(0, sums.index - 1);\n index = Math.min(this.styles_.length - 1, index);\n var style = this.styles_[index];\n this.url_ = style.url;\n this.height_ = style.height;\n this.width_ = style.width;\n this.anchorText_ = style.anchorText || [0, 0];\n this.anchorIcon_ = style.anchorIcon || [parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)];\n this.textColor_ = style.textColor || \"black\";\n this.textSize_ = style.textSize || 11;\n this.textDecoration_ = style.textDecoration || \"none\";\n this.fontWeight_ = style.fontWeight || \"bold\";\n this.fontStyle_ = style.fontStyle || \"normal\";\n this.fontFamily_ = style.fontFamily || \"Arial,sans-serif\";\n this.backgroundPosition_ = style.backgroundPosition || \"0 0\";\n};\n\n\n/**\n * Sets the position at which to center the icon.\n *\n * @param {google.maps.LatLng} center The latlng to set as the center.\n */\nClusterIcon.prototype.setCenter = function (center) {\n this.center_ = center;\n};\n\n\n/**\n * Creates the cssText style parameter based on the position of the icon.\n *\n * @param {google.maps.Point} pos The position of the icon.\n * @return {string} The CSS style text.\n */\nClusterIcon.prototype.createCss = function (pos) {\n var style = [];\n style.push(\"cursor: pointer;\");\n style.push(\"position: absolute; top: \" + pos.y + \"px; left: \" + pos.x + \"px;\");\n style.push(\"width: \" + this.width_ + \"px; height: \" + this.height_ + \"px;\");\n style.push(\"-webkit-user-select: none;\");\n style.push(\"-khtml-user-select: none;\");\n style.push(\"-moz-user-select: none;\");\n style.push(\"-o-user-select: none;\");\n style.push(\"user-select: none;\");\n return style.join(\"\");\n};\n\n\n/**\n * Returns the position at which to place the DIV depending on the latlng.\n *\n * @param {google.maps.LatLng} latlng The position in latlng.\n * @return {google.maps.Point} The position in pixels.\n */\nClusterIcon.prototype.getPosFromLatLng_ = function (latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n pos.x -= this.anchorIcon_[1];\n pos.y -= this.anchorIcon_[0];\n pos.x = parseInt(pos.x, 10);\n pos.y = parseInt(pos.y, 10);\n return pos;\n};\n\n\n/**\n * Creates a single cluster that manages a group of proximate markers.\n * Used internally, do not call this constructor directly.\n * @constructor\n * @param {MarkerClusterer} mc The <code>MarkerClusterer</code> object with which this\n * cluster is associated.\n */\nfunction Cluster(mc) {\n this.markerClusterer_ = mc;\n this.map_ = mc.getMap();\n this.gridSize_ = mc.getGridSize();\n this.minClusterSize_ = mc.getMinimumClusterSize();\n this.averageCenter_ = mc.getAverageCenter();\n this.markers_ = [];\n this.center_ = null;\n this.bounds_ = null;\n this.clusterIcon_ = new ClusterIcon(this, mc.getStyles());\n}\n\n\n/**\n * Returns the number of markers managed by the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {number} The number of markers in the cluster.\n */\nCluster.prototype.getSize = function () {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the array of markers managed by the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {Array} The array of markers in the cluster.\n */\nCluster.prototype.getMarkers = function () {\n return this.markers_;\n};\n\n\n/**\n * Returns the center of the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {google.maps.LatLng} The center of the cluster.\n */\nCluster.prototype.getCenter = function () {\n return this.center_;\n};\n\n\n/**\n * Returns the map with which the cluster is associated.\n *\n * @return {google.maps.Map} The map.\n * @ignore\n */\nCluster.prototype.getMap = function () {\n return this.map_;\n};\n\n\n/**\n * Returns the <code>MarkerClusterer</code> object with which the cluster is associated.\n *\n * @return {MarkerClusterer} The associated marker clusterer.\n * @ignore\n */\nCluster.prototype.getMarkerClusterer = function () {\n return this.markerClusterer_;\n};\n\n\n/**\n * Returns the bounds of the cluster.\n *\n * @return {google.maps.LatLngBounds} the cluster bounds.\n * @ignore\n */\nCluster.prototype.getBounds = function () {\n var i;\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n var markers = this.getMarkers();\n for (i = 0; i < markers.length; i++) {\n bounds.extend(markers[i].getPosition());\n }\n return bounds;\n};\n\n\n/**\n * Removes the cluster from the map.\n *\n * @ignore\n */\nCluster.prototype.remove = function () {\n this.clusterIcon_.setMap(null);\n this.markers_ = [];\n delete this.markers_;\n};\n\n\n/**\n * Adds a marker to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to be added.\n * @return {boolean} True if the marker was added.\n * @ignore\n */\nCluster.prototype.addMarker = function (marker) {\n var i;\n var mCount;\n var mz;\n\n if (this.isMarkerAlreadyAdded_(marker)) {\n return false;\n }\n\n if (!this.center_) {\n this.center_ = marker.getPosition();\n this.calculateBounds_();\n } else {\n if (this.averageCenter_) {\n var l = this.markers_.length + 1;\n var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\n var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\n this.center_ = new google.maps.LatLng(lat, lng);\n this.calculateBounds_();\n }\n }\n\n marker.isAdded = true;\n this.markers_.push(marker);\n\n mCount = this.markers_.length;\n mz = this.markerClusterer_.getMaxZoom();\n if (mz !== null && this.map_.getZoom() > mz) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount < this.minClusterSize_) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount === this.minClusterSize_) {\n // Hide the markers that were showing.\n for (i = 0; i < mCount; i++) {\n this.markers_[i].setMap(null);\n }\n } else {\n marker.setMap(null);\n }\n\n this.updateIcon_();\n return true;\n};\n\n\n/**\n * Determines if a marker lies within the cluster's bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker lies in the bounds.\n * @ignore\n */\nCluster.prototype.isMarkerInClusterBounds = function (marker) {\n return this.bounds_.contains(marker.getPosition());\n};\n\n\n/**\n * Calculates the extended bounds of the cluster with the grid.\n */\nCluster.prototype.calculateBounds_ = function () {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\n};\n\n\n/**\n * Updates the cluster icon.\n */\nCluster.prototype.updateIcon_ = function () {\n var mCount = this.markers_.length;\n var mz = this.markerClusterer_.getMaxZoom();\n\n if (mz !== null && this.map_.getZoom() > mz) {\n this.clusterIcon_.hide();\n return;\n }\n\n if (mCount < this.minClusterSize_) {\n // Min cluster size not yet reached.\n this.clusterIcon_.hide();\n return;\n }\n\n var numStyles = this.markerClusterer_.getStyles().length;\n var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\n this.clusterIcon_.setCenter(this.center_);\n this.clusterIcon_.useStyle(sums);\n this.clusterIcon_.show();\n};\n\n\n/**\n * Determines if a marker has already been added to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker has already been added.\n */\nCluster.prototype.isMarkerAlreadyAdded_ = function (marker) {\n var i;\n if (this.markers_.indexOf) {\n return this.markers_.indexOf(marker) !== -1;\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n return true;\n }\n }\n }\n return false;\n};\n\n\n/**\n * @name MarkerClustererOptions\n * @class This class represents the optional parameter passed to\n * the {@link MarkerClusterer} constructor.\n * @property {number} [gridSize=60] The grid size of a cluster in pixels. The grid is a square.\n * @property {number} [maxZoom=null] The maximum zoom level at which clustering is enabled or\n * <code>null</code> if clustering is to be enabled at all zoom levels.\n * @property {boolean} [zoomOnClick=true] Whether to zoom the map when a cluster marker is\n * clicked. You may want to set this to <code>false</code> if you have installed a handler\n * for the <code>click</code> event and it deals with zooming on its own.\n * @property {boolean} [averageCenter=false] Whether the position of a cluster marker should be\n * the average position of all markers in the cluster. If set to <code>false</code>, the\n * cluster marker is positioned at the location of the first marker added to the cluster.\n * @property {number} [minimumClusterSize=2] The minimum number of markers needed in a cluster\n * before the markers are hidden and a cluster marker appears.\n * @property {boolean} [ignoreHidden=false] Whether to ignore hidden markers in clusters. You\n * may want to set this to <code>true</code> to ensure that hidden markers are not included\n * in the marker count that appears on a cluster marker (this count is the value of the\n * <code>text</code> property of the result returned by the default <code>calculator</code>).\n * If set to <code>true</code> and you change the visibility of a marker being clustered, be\n * sure to also call <code>MarkerClusterer.repaint()</code>.\n * @property {string} [title=\"\"] The tooltip to display when the mouse moves over a cluster\n * marker. (Alternatively, you can use a custom <code>calculator</code> function to specify a\n * different tooltip for each cluster marker.)\n * @property {function} [calculator=MarkerClusterer.CALCULATOR] The function used to determine\n * the text to be displayed on a cluster marker and the index indicating which style to use\n * for the cluster marker. The input parameters for the function are (1) the array of markers\n * represented by a cluster marker and (2) the number of cluster icon styles. It returns a\n * {@link ClusterIconInfo} object. The default <code>calculator</code> returns a\n * <code>text</code> property which is the number of markers in the cluster and an\n * <code>index</code> property which is one higher than the lowest integer such that\n * <code>10^i</code> exceeds the number of markers in the cluster, or the size of the styles\n * array, whichever is less. The <code>styles</code> array element used has an index of\n * <code>index</code> minus 1. For example, the default <code>calculator</code> returns a\n * <code>text</code> value of <code>\"125\"</code> and an <code>index</code> of <code>3</code>\n * for a cluster icon representing 125 markers so the element used in the <code>styles</code>\n * array is <code>2</code>. A <code>calculator</code> may also return a <code>title</code>\n * property that contains the text of the tooltip to be used for the cluster marker. If\n * <code>title</code> is not defined, the tooltip is set to the value of the <code>title</code>\n * property for the MarkerClusterer.\n * @property {string} [clusterClass=\"cluster\"] The name of the CSS class defining general styles\n * for the cluster markers. Use this class to define CSS styles that are not set up by the code\n * that processes the <code>styles</code> array.\n * @property {Array} [styles] An array of {@link ClusterIconStyle} elements defining the styles\n * of the cluster markers to be used. The element to be used to style a given cluster marker\n * is determined by the function defined by the <code>calculator</code> property.\n * The default is an array of {@link ClusterIconStyle} elements whose properties are derived\n * from the values for <code>imagePath</code>, <code>imageExtension</code>, and\n * <code>imageSizes</code>.\n * @property {boolean} [enableRetinaIcons=false] Whether to allow the use of cluster icons that\n * have sizes that are some multiple (typically double) of their actual display size. Icons such\n * as these look better when viewed on high-resolution monitors such as Apple's Retina displays.\n * Note: if this property is <code>true</code>, sprites cannot be used as cluster icons.\n * @property {number} [batchSize=MarkerClusterer.BATCH_SIZE] Set this property to the\n * number of markers to be processed in a single batch when using a browser other than\n * Internet Explorer (for Internet Explorer, use the batchSizeIE property instead).\n * @property {number} [batchSizeIE=MarkerClusterer.BATCH_SIZE_IE] When Internet Explorer is\n * being used, markers are processed in several batches with a small delay inserted between\n * each batch in an attempt to avoid Javascript timeout errors. Set this property to the\n * number of markers to be processed in a single batch; select as high a number as you can\n * without causing a timeout error in the browser. This number might need to be as low as 100\n * if 15,000 markers are being managed, for example.\n * @property {string} [imagePath=MarkerClusterer.IMAGE_PATH]\n * The full URL of the root name of the group of image files to use for cluster icons.\n * The complete file name is of the form <code>imagePath</code>n.<code>imageExtension</code>\n * where n is the image file number (1, 2, etc.).\n * @property {string} [imageExtension=MarkerClusterer.IMAGE_EXTENSION]\n * The extension name for the cluster icon image files (e.g., <code>\"png\"</code> or\n * <code>\"jpg\"</code>).\n * @property {Array} [imageSizes=MarkerClusterer.IMAGE_SIZES]\n * An array of numbers containing the widths of the group of\n * <code>imagePath</code>n.<code>imageExtension</code> image files.\n * (The images are assumed to be square.)\n */\n/**\n * Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}.\n * @constructor\n * @extends google.maps.OverlayView\n * @param {google.maps.Map} map The Google map to attach to.\n * @param {Array.<google.maps.Marker>} [opt_markers] The markers to be added to the cluster.\n * @param {MarkerClustererOptions} [opt_options] The optional parameters.\n */\nfunction MarkerClusterer(map, opt_markers, opt_options) {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n this.extend(MarkerClusterer, google.maps.OverlayView);\n\n opt_markers = opt_markers || [];\n opt_options = opt_options || {};\n\n this.markers_ = [];\n this.clusters_ = [];\n this.listeners_ = [];\n this.activeMap_ = null;\n this.ready_ = false;\n\n this.gridSize_ = opt_options.gridSize || 60;\n this.minClusterSize_ = opt_options.minimumClusterSize || 2;\n this.maxZoom_ = opt_options.maxZoom || null;\n this.styles_ = opt_options.styles || [];\n this.title_ = opt_options.title || \"\";\n this.zoomOnClick_ = true;\n if (opt_options.zoomOnClick !== undefined) {\n this.zoomOnClick_ = opt_options.zoomOnClick;\n }\n this.averageCenter_ = false;\n if (opt_options.averageCenter !== undefined) {\n this.averageCenter_ = opt_options.averageCenter;\n }\n this.ignoreHidden_ = false;\n if (opt_options.ignoreHidden !== undefined) {\n this.ignoreHidden_ = opt_options.ignoreHidden;\n }\n this.enableRetinaIcons_ = false;\n if (opt_options.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons_ = opt_options.enableRetinaIcons;\n }\n this.imagePath_ = opt_options.imagePath || MarkerClusterer.IMAGE_PATH;\n this.imageExtension_ = opt_options.imageExtension || MarkerClusterer.IMAGE_EXTENSION;\n this.imageSizes_ = opt_options.imageSizes || MarkerClusterer.IMAGE_SIZES;\n this.calculator_ = opt_options.calculator || MarkerClusterer.CALCULATOR;\n this.batchSize_ = opt_options.batchSize || MarkerClusterer.BATCH_SIZE;\n this.batchSizeIE_ = opt_options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE;\n this.clusterClass_ = opt_options.clusterClass || \"cluster\";\n\n if (navigator.userAgent.toLowerCase().indexOf(\"msie\") !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize_ = this.batchSizeIE_;\n }\n\n this.setupStyles_();\n\n this.addMarkers(opt_markers, true);\n this.setMap(map); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Implementation of the onAdd interface method.\n * @ignore\n */\nMarkerClusterer.prototype.onAdd = function () {\n var cMarkerClusterer = this;\n\n this.activeMap_ = this.getMap();\n this.ready_ = true;\n\n this.repaint();\n\n this.prevZoom_ = this.getMap().getZoom();\n\n // Add the map event listeners\n this.listeners_ = [\n google.maps.event.addListener(this.getMap(), \"zoom_changed\", function () {\n // Fix for bug #407\n // Determines map type and prevents illegal zoom levels\n var zoom = this.getMap().getZoom();\n var minZoom = this.getMap().minZoom || 0;\n var maxZoom = Math.min(this.getMap().maxZoom || 100,\n this.getMap().mapTypes[this.getMap().getMapTypeId()].maxZoom);\n zoom = Math.min(Math.max(zoom, minZoom), maxZoom);\n\n if (this.prevZoom_ != zoom) {\n this.prevZoom_ = zoom;\n this.resetViewport_(false);\n }\n }.bind(this)),\n google.maps.event.addListener(this.getMap(), \"idle\", function () {\n cMarkerClusterer.redraw_();\n })\n ];\n};\n\n\n/**\n * Implementation of the onRemove interface method.\n * Removes map event listeners and all cluster icons from the DOM.\n * All managed markers are also put back on the map.\n * @ignore\n */\nMarkerClusterer.prototype.onRemove = function () {\n var i;\n\n // Put all the managed markers back on the map:\n for (i = 0; i < this.markers_.length; i++) {\n if (this.markers_[i].getMap() !== this.activeMap_) {\n this.markers_[i].setMap(this.activeMap_);\n }\n }\n\n // Remove all clusters:\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Remove map event listeners:\n for (i = 0; i < this.listeners_.length; i++) {\n google.maps.event.removeListener(this.listeners_[i]);\n }\n this.listeners_ = [];\n\n this.activeMap_ = null;\n this.ready_ = false;\n};\n\n\n/**\n * Implementation of the draw interface method.\n * @ignore\n */\nMarkerClusterer.prototype.draw = function () {};\n\n\n/**\n * Sets up the styles object.\n */\nMarkerClusterer.prototype.setupStyles_ = function () {\n var i, size;\n if (this.styles_.length > 0) {\n return;\n }\n\n for (i = 0; i < this.imageSizes_.length; i++) {\n size = this.imageSizes_[i];\n this.styles_.push({\n url: this.imagePath_ + (i + 1) + \".\" + this.imageExtension_,\n height: size,\n width: size\n });\n }\n};\n\n\n/**\n * Fits the map to the bounds of the markers managed by the clusterer.\n */\nMarkerClusterer.prototype.fitMapToMarkers = function () {\n var i;\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (i = 0; i < markers.length; i++) {\n // March 3, 2018: Bug fix -- honor the ignoreHidden property\n if (markers[i].getVisible() || !this.getIgnoreHidden()) {\n bounds.extend(markers[i].getPosition());\n }\n }\n\n this.getMap().fitBounds(bounds);\n};\n\n\n/**\n * Returns the value of the <code>gridSize</code> property.\n *\n * @return {number} The grid size.\n */\nMarkerClusterer.prototype.getGridSize = function () {\n return this.gridSize_;\n};\n\n\n/**\n * Sets the value of the <code>gridSize</code> property.\n *\n * @param {number} gridSize The grid size.\n */\nMarkerClusterer.prototype.setGridSize = function (gridSize) {\n this.gridSize_ = gridSize;\n};\n\n\n/**\n * Returns the value of the <code>minimumClusterSize</code> property.\n *\n * @return {number} The minimum cluster size.\n */\nMarkerClusterer.prototype.getMinimumClusterSize = function () {\n return this.minClusterSize_;\n};\n\n/**\n * Sets the value of the <code>minimumClusterSize</code> property.\n *\n * @param {number} minimumClusterSize The minimum cluster size.\n */\nMarkerClusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) {\n this.minClusterSize_ = minimumClusterSize;\n};\n\n\n/**\n * Returns the value of the <code>maxZoom</code> property.\n *\n * @return {number} The maximum zoom level.\n */\nMarkerClusterer.prototype.getMaxZoom = function () {\n return this.maxZoom_;\n};\n\n\n/**\n * Sets the value of the <code>maxZoom</code> property.\n *\n * @param {number} maxZoom The maximum zoom level.\n */\nMarkerClusterer.prototype.setMaxZoom = function (maxZoom) {\n this.maxZoom_ = maxZoom;\n};\n\n\n/**\n * Returns the value of the <code>styles</code> property.\n *\n * @return {Array} The array of styles defining the cluster markers to be used.\n */\nMarkerClusterer.prototype.getStyles = function () {\n return this.styles_;\n};\n\n\n/**\n * Sets the value of the <code>styles</code> property.\n *\n * @param {Array.<ClusterIconStyle>} styles The array of styles to use.\n */\nMarkerClusterer.prototype.setStyles = function (styles) {\n this.styles_ = styles;\n};\n\n\n/**\n * Returns the value of the <code>title</code> property.\n *\n * @return {string} The content of the title text.\n */\nMarkerClusterer.prototype.getTitle = function () {\n return this.title_;\n};\n\n\n/**\n * Sets the value of the <code>title</code> property.\n *\n * @param {string} title The value of the title property.\n */\nMarkerClusterer.prototype.setTitle = function (title) {\n this.title_ = title;\n};\n\n\n/**\n * Returns the value of the <code>zoomOnClick</code> property.\n *\n * @return {boolean} True if zoomOnClick property is set.\n */\nMarkerClusterer.prototype.getZoomOnClick = function () {\n return this.zoomOnClick_;\n};\n\n\n/**\n * Sets the value of the <code>zoomOnClick</code> property.\n *\n * @param {boolean} zoomOnClick The value of the zoomOnClick property.\n */\nMarkerClusterer.prototype.setZoomOnClick = function (zoomOnClick) {\n this.zoomOnClick_ = zoomOnClick;\n};\n\n\n/**\n * Returns the value of the <code>averageCenter</code> property.\n *\n * @return {boolean} True if averageCenter property is set.\n */\nMarkerClusterer.prototype.getAverageCenter = function () {\n return this.averageCenter_;\n};\n\n\n/**\n * Sets the value of the <code>averageCenter</code> property.\n *\n * @param {boolean} averageCenter The value of the averageCenter property.\n */\nMarkerClusterer.prototype.setAverageCenter = function (averageCenter) {\n this.averageCenter_ = averageCenter;\n};\n\n\n/**\n * Returns the value of the <code>ignoreHidden</code> property.\n *\n * @return {boolean} True if ignoreHidden property is set.\n */\nMarkerClusterer.prototype.getIgnoreHidden = function () {\n return this.ignoreHidden_;\n};\n\n\n/**\n * Sets the value of the <code>ignoreHidden</code> property.\n *\n * @param {boolean} ignoreHidden The value of the ignoreHidden property.\n */\nMarkerClusterer.prototype.setIgnoreHidden = function (ignoreHidden) {\n this.ignoreHidden_ = ignoreHidden;\n};\n\n\n/**\n * Returns the value of the <code>enableRetinaIcons</code> property.\n *\n * @return {boolean} True if enableRetinaIcons property is set.\n */\nMarkerClusterer.prototype.getEnableRetinaIcons = function () {\n return this.enableRetinaIcons_;\n};\n\n\n/**\n * Sets the value of the <code>enableRetinaIcons</code> property.\n *\n * @param {boolean} enableRetinaIcons The value of the enableRetinaIcons property.\n */\nMarkerClusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) {\n this.enableRetinaIcons_ = enableRetinaIcons;\n};\n\n\n/**\n * Returns the value of the <code>imageExtension</code> property.\n *\n * @return {string} The value of the imageExtension property.\n */\nMarkerClusterer.prototype.getImageExtension = function () {\n return this.imageExtension_;\n};\n\n\n/**\n * Sets the value of the <code>imageExtension</code> property.\n *\n * @param {string} imageExtension The value of the imageExtension property.\n */\nMarkerClusterer.prototype.setImageExtension = function (imageExtension) {\n this.imageExtension_ = imageExtension;\n};\n\n\n/**\n * Returns the value of the <code>imagePath</code> property.\n *\n * @return {string} The value of the imagePath property.\n */\nMarkerClusterer.prototype.getImagePath = function () {\n return this.imagePath_;\n};\n\n\n/**\n * Sets the value of the <code>imagePath</code> property.\n *\n * @param {string} imagePath The value of the imagePath property.\n */\nMarkerClusterer.prototype.setImagePath = function (imagePath) {\n this.imagePath_ = imagePath;\n};\n\n\n/**\n * Returns the value of the <code>imageSizes</code> property.\n *\n * @return {Array} The value of the imageSizes property.\n */\nMarkerClusterer.prototype.getImageSizes = function () {\n return this.imageSizes_;\n};\n\n\n/**\n * Sets the value of the <code>imageSizes</code> property.\n *\n * @param {Array} imageSizes The value of the imageSizes property.\n */\nMarkerClusterer.prototype.setImageSizes = function (imageSizes) {\n this.imageSizes_ = imageSizes;\n};\n\n\n/**\n * Returns the value of the <code>calculator</code> property.\n *\n * @return {function} the value of the calculator property.\n */\nMarkerClusterer.prototype.getCalculator = function () {\n return this.calculator_;\n};\n\n\n/**\n * Sets the value of the <code>calculator</code> property.\n *\n * @param {function(Array.<google.maps.Marker>, number)} calculator The value\n * of the calculator property.\n */\nMarkerClusterer.prototype.setCalculator = function (calculator) {\n this.calculator_ = calculator;\n};\n\n\n/**\n * Returns the value of the <code>batchSizeIE</code> property.\n *\n * @return {number} the value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.getBatchSizeIE = function () {\n return this.batchSizeIE_;\n};\n\n\n/**\n * Sets the value of the <code>batchSizeIE</code> property.\n *\n * @param {number} batchSizeIE The value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.setBatchSizeIE = function (batchSizeIE) {\n this.batchSizeIE_ = batchSizeIE;\n};\n\n\n/**\n * Returns the value of the <code>clusterClass</code> property.\n *\n * @return {string} the value of the clusterClass property.\n */\nMarkerClusterer.prototype.getClusterClass = function () {\n return this.clusterClass_;\n};\n\n\n/**\n * Sets the value of the <code>clusterClass</code> property.\n *\n * @param {string} clusterClass The value of the clusterClass property.\n */\nMarkerClusterer.prototype.setClusterClass = function (clusterClass) {\n this.clusterClass_ = clusterClass;\n};\n\n\n/**\n * Returns the array of markers managed by the clusterer.\n *\n * @return {Array} The array of markers managed by the clusterer.\n */\nMarkerClusterer.prototype.getMarkers = function () {\n return this.markers_;\n};\n\n\n/**\n * Returns the number of markers managed by the clusterer.\n *\n * @return {number} The number of markers.\n */\nMarkerClusterer.prototype.getTotalMarkers = function () {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the current array of clusters formed by the clusterer.\n *\n * @return {Array} The array of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getClusters = function () {\n return this.clusters_;\n};\n\n\n/**\n * Returns the number of clusters formed by the clusterer.\n *\n * @return {number} The number of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getTotalClusters = function () {\n return this.clusters_.length;\n};\n\n\n/**\n * Adds a marker to the clusterer. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarker = function (marker, opt_nodraw) {\n this.pushMarkerTo_(marker);\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Adds an array of markers to the clusterer. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>.\n *\n * @param {Array.<google.maps.Marker>} markers The markers to add.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarkers = function (markers, opt_nodraw) {\n var key;\n for (key in markers) {\n if (markers.hasOwnProperty(key)) {\n this.pushMarkerTo_(markers[key]);\n }\n }\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Pushes a marker to the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.pushMarkerTo_ = function (marker) {\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n var cMarkerClusterer = this;\n google.maps.event.addListener(marker, \"dragend\", function () {\n if (cMarkerClusterer.ready_) {\n this.isAdded = false;\n cMarkerClusterer.repaint();\n }\n });\n }\n marker.isAdded = false;\n this.markers_.push(marker);\n};\n\n\n/**\n * Removes a marker from the cluster. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if the\n * marker was removed from the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to remove.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n * @return {boolean} True if the marker was removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarker = function (marker, opt_nodraw) {\n var removed = this.removeMarker_(marker);\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes an array of markers from the cluster. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if markers\n * were removed from the clusterer.\n *\n * @param {Array.<google.maps.Marker>} markers The markers to remove.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n * @return {boolean} True if markers were removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarkers = function (markers, opt_nodraw) {\n var i, r;\n var removed = false;\n\n for (i = 0; i < markers.length; i++) {\n r = this.removeMarker_(markers[i]);\n removed = removed || r;\n }\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes a marker and returns true if removed, false if not.\n *\n * @param {google.maps.Marker} marker The marker to remove\n * @return {boolean} Whether the marker was removed or not\n */\nMarkerClusterer.prototype.removeMarker_ = function (marker) {\n var i;\n var index = -1;\n if (this.markers_.indexOf) {\n index = this.markers_.indexOf(marker);\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n index = i;\n break;\n }\n }\n }\n\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n\n marker.setMap(null);\n this.markers_.splice(index, 1); // Remove the marker from the list of managed markers\n return true;\n};\n\n\n/**\n * Removes all clusters and markers from the map and also removes all markers\n * managed by the clusterer.\n */\nMarkerClusterer.prototype.clearMarkers = function () {\n this.resetViewport_(true);\n this.markers_ = [];\n};\n\n\n/**\n * Recalculates and redraws all the marker clusters from scratch.\n * Call this after changing any properties.\n */\nMarkerClusterer.prototype.repaint = function () {\n var oldClusters = this.clusters_.slice();\n this.clusters_ = [];\n this.resetViewport_(false);\n this.redraw_();\n\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function () {\n var i;\n for (i = 0; i < oldClusters.length; i++) {\n oldClusters[i].remove();\n }\n }, 0);\n};\n\n\n/**\n * Returns the current bounds extended by the grid size.\n *\n * @param {google.maps.LatLngBounds} bounds The bounds to extend.\n * @return {google.maps.LatLngBounds} The extended bounds.\n * @ignore\n */\nMarkerClusterer.prototype.getExtendedBounds = function (bounds) {\n var projection = this.getProjection();\n\n // Turn the bounds into latlng.\n var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),\n bounds.getNorthEast().lng());\n var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),\n bounds.getSouthWest().lng());\n\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(tr);\n trPix.x += this.gridSize_;\n trPix.y -= this.gridSize_;\n\n var blPix = projection.fromLatLngToDivPixel(bl);\n blPix.x -= this.gridSize_;\n blPix.y += this.gridSize_;\n\n // Convert the pixel points back to LatLng\n var ne = projection.fromDivPixelToLatLng(trPix);\n var sw = projection.fromDivPixelToLatLng(blPix);\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(ne);\n bounds.extend(sw);\n\n return bounds;\n};\n\n\n/**\n * Redraws all the clusters.\n */\nMarkerClusterer.prototype.redraw_ = function () {\n this.createClusters_(0);\n};\n\n\n/**\n * Removes all clusters from the map. The markers are also removed from the map\n * if <code>opt_hide</code> is set to <code>true</code>.\n *\n * @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers\n * from the map.\n */\nMarkerClusterer.prototype.resetViewport_ = function (opt_hide) {\n var i, marker;\n // Remove all the clusters\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Reset the markers to not be added and to be removed from the map.\n for (i = 0; i < this.markers_.length; i++) {\n marker = this.markers_[i];\n marker.isAdded = false;\n if (opt_hide) {\n marker.setMap(null);\n }\n }\n};\n\n\n/**\n * Calculates the distance between two latlng locations in km.\n *\n * @param {google.maps.LatLng} p1 The first lat lng point.\n * @param {google.maps.LatLng} p2 The second lat lng point.\n * @return {number} The distance between the two points in km.\n * @see http://www.movable-type.co.uk/scripts/latlong.html\n*/\nMarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) {\n var R = 6371; // Radius of the Earth in km\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *\n Math.sin(dLon / 2) * Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c;\n return d;\n};\n\n\n/**\n * Determines if a marker is contained in a bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @param {google.maps.LatLngBounds} bounds The bounds to check against.\n * @return {boolean} True if the marker is in the bounds.\n */\nMarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) {\n return bounds.contains(marker.getPosition());\n};\n\n\n/**\n * Adds a marker to a cluster, or creates a new cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.addToClosestCluster_ = function (marker) {\n var i, d, cluster, center;\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n for (i = 0; i < this.clusters_.length; i++) {\n cluster = this.clusters_[i];\n center = cluster.getCenter();\n if (center) {\n d = this.distanceBetweenPoints_(center, marker.getPosition());\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n cluster = new Cluster(this);\n cluster.addMarker(marker);\n this.clusters_.push(cluster);\n }\n};\n\n\n/**\n * Creates the clusters. This is done in batches to avoid timeout errors\n * in some browsers when there is a huge number of markers.\n *\n * @param {number} iFirst The index of the first marker in the batch of\n * markers to be added to clusters.\n */\nMarkerClusterer.prototype.createClusters_ = function (iFirst) {\n var i, marker;\n var mapBounds;\n var cMarkerClusterer = this;\n if (!this.ready_) {\n return;\n }\n\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the <code>MarkerClusterer</code> begins\n * clustering markers.\n * @name MarkerClusterer#clusteringbegin\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringbegin\", this);\n\n if (typeof this.timerRefStatic !== \"undefined\") {\n clearTimeout(this.timerRefStatic);\n delete this.timerRefStatic;\n }\n }\n\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n if (this.getMap().getZoom() > 3) {\n mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),\n this.getMap().getBounds().getNorthEast());\n } else {\n mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n }\n var bounds = this.getExtendedBounds(mapBounds);\n\n var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);\n\n for (i = iFirst; i < iLast; i++) {\n marker = this.markers_[i];\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\n if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {\n this.addToClosestCluster_(marker);\n }\n }\n }\n\n if (iLast < this.markers_.length) {\n this.timerRefStatic = setTimeout(function () {\n cMarkerClusterer.createClusters_(iLast);\n }, 0);\n } else {\n delete this.timerRefStatic;\n\n /**\n * This event is fired when the <code>MarkerClusterer</code> stops\n * clustering markers.\n * @name MarkerClusterer#clusteringend\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringend\", this);\n }\n};\n\n\n/**\n * Extends an object's prototype by another's.\n *\n * @param {Object} obj1 The object to be extended.\n * @param {Object} obj2 The object to extend with.\n * @return {Object} The new extended object.\n * @ignore\n */\nMarkerClusterer.prototype.extend = function (obj1, obj2) {\n return (function (object) {\n var property;\n for (property in object.prototype) {\n this.prototype[property] = object.prototype[property];\n }\n return this;\n }).apply(obj1, [obj2]);\n};\n\n\n/**\n * The default function for determining the label text and style\n * for a cluster icon.\n *\n * @param {Array.<google.maps.Marker>} markers The array of markers represented by the cluster.\n * @param {number} numStyles The number of marker styles available.\n * @return {ClusterIconInfo} The information resource for the cluster.\n * @constant\n * @ignore\n */\nMarkerClusterer.CALCULATOR = function (markers, numStyles) {\n var index = 0;\n var title = \"\";\n var count = markers.length.toString();\n\n var dv = count;\n while (dv !== 0) {\n dv = parseInt(dv / 10, 10);\n index++;\n }\n\n index = Math.min(index, numStyles);\n return {\n text: count,\n index: index,\n title: title\n };\n};\n\n\n/**\n * The number of markers to process in one batch.\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE = 2000;\n\n\n/**\n * The number of markers to process in one batch (IE only).\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE_IE = 500;\n\n\n/**\n * The default root name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_PATH = \"https://cdn.rawgit.com/googlemaps/js-marker-clusterer/gh-pages/images/m\";\n\n\n/**\n * The default extension name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_EXTENSION = \"png\";\n\n\n/**\n * The default array of sizes for the marker cluster images.\n *\n * @type {Array.<number>}\n * @constant\n */\nMarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90];\n\nif (true) {\n module.exports = MarkerClusterer;\n}\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar googleMaps_1 = __webpack_require__(10);\r\nvar leaflet_1 = __webpack_require__(19);\r\nvar map_type_1 = __webpack_require__(2);\r\nvar marker_clusterer_config_1 = __webpack_require__(4);\r\nvar polyline_options_1 = __webpack_require__(5);\r\nvar Map = /** @class */ (function () {\r\n function Map() {\r\n this.markersList = {};\r\n this.polygonsList = {};\r\n this.circlesList = {};\r\n this.polylinesList = {};\r\n this.infoWindowList = {};\r\n this.overlayList = {};\r\n this.markerClusterer = {};\r\n }\r\n /**\r\n * Use this to initialize map\r\n * @param {InlogMaps.MapType} mapType\r\n * @param {any} options\r\n * @param {string} elementId default: 'inlog-map' [nullable]\r\n * @returns {Promisse<any>}\r\n */\r\n Map.prototype.initialize = function (mapType, options, elementId) {\r\n if (elementId === void 0) { elementId = 'inlog-map'; }\r\n this.map = mapType === map_type_1.MapType.Google ? new googleMaps_1.default() : new leaflet_1.default();\r\n return this.map.initialize(mapType, options, elementId);\r\n };\r\n /* GEOJson */\r\n /**\r\n * Use this function to add GEOJSON to the currentMap\r\n * @param {object} data Geojson\r\n * @param {InlogMaps.GeoJsonOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n Map.prototype.loadGEOJson = function (data, options, eventClick) {\r\n this.map.loadGEOJson(data, options, eventClick);\r\n };\r\n /* Markers */\r\n /**\r\n * Use this function to draw markers in the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n Map.prototype.drawMarker = function (type, options, eventClick) {\r\n var marker = this.map.drawMarker(options, eventClick);\r\n if (!this.markersList[type]) {\r\n this.markersList[type] = [];\r\n }\r\n marker.type = 'simple';\r\n this.markersList[type].push(marker);\r\n if (options.addClusterer) {\r\n if (!this.markerClusterer[type]) {\r\n this.addMarkerClusterer(type, new marker_clusterer_config_1.default(true, 1, 10));\r\n }\r\n this.map.addMarkerOnClusterer(marker, this.markerClusterer[type]);\r\n }\r\n };\r\n /**\r\n * Use this function to draw circle markers in the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.CircleMarkerOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n Map.prototype.drawCircleMarker = function (type, options, eventClick) {\r\n var marker = this.map.drawCircleMarker(options, eventClick);\r\n if (!this.markersList[type]) {\r\n this.markersList[type] = [];\r\n }\r\n marker.type = 'circle';\r\n this.markersList[type].push(marker);\r\n };\r\n /**\r\n * Use this function to show/hide markers from a specific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toogle markers with the condition [nullable]\r\n */\r\n Map.prototype.toggleMarkers = function (show, type, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n if (markers && markers.length) {\r\n this.map.toggleMarkers(markers, show, this.markerClusterer[type]);\r\n }\r\n };\r\n /**\r\n * Remove markers from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove markers with the condition [nullable]\r\n */\r\n Map.prototype.removeMarkers = function (type, condition) {\r\n if (this.markersList[type] && condition) {\r\n var markers = this.getMarkers(type, condition);\r\n // Hide markers with the condition\r\n this.map.toggleMarkers(markers, false, this.markerClusterer[type]);\r\n // Keep markers that doesn't have the condition\r\n this.markersList[type] = this.markersList[type].filter(function (marker) { return !condition(marker.object); });\r\n }\r\n else {\r\n if (this.markersList[type]) {\r\n this.map.toggleMarkers(this.markersList[type], false, this.markerClusterer[type]);\r\n }\r\n this.markersList[type] = [];\r\n }\r\n if (this.markersList[type].length === 0) {\r\n delete this.markersList[type];\r\n }\r\n };\r\n /**\r\n * Remove all markers from the map and from the internal list\r\n */\r\n Map.prototype.removeAllMarkers = function () {\r\n for (var type in this.markersList) {\r\n if (this.markersList.hasOwnProperty(type)) {\r\n this.removeMarkers(type);\r\n }\r\n }\r\n };\r\n /**\r\n * Use this function to alter marker style\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerAlterOptions} options\r\n * @param {any} condition alter markers with the condition [nullable]\r\n */\r\n Map.prototype.alterMarkerOptions = function (type, options, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n if (markers && markers.length) {\r\n this.map.alterMarkerOptions(markers, options);\r\n }\r\n };\r\n /**\r\n * Use this functions to alterar marker position\r\n * @param {string } type\r\n * @param {number[]} position\r\n * @param {boolean} addTransition [nullable]\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.alterMarkerPosition = function (type, position, addTransition, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n if (markers && markers.length) {\r\n this.map.alterMarkerPosition(markers, position, addTransition);\r\n }\r\n };\r\n /**\r\n * Use this function to fit bounds in the markers with the especified type\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @param {boolean} onlyMarkersOnMap default true\r\n */\r\n Map.prototype.fitBoundsMarkers = function (type, condition, onlyMarkersOnMap) {\r\n var _this = this;\r\n if (onlyMarkersOnMap === void 0) { onlyMarkersOnMap = true; }\r\n var markers = this.getMarkers(type, condition);\r\n if (onlyMarkersOnMap) {\r\n markers = markers.filter(function (x) { return _this.map.isMarkerOnMap(x); });\r\n }\r\n if (markers && markers.length) {\r\n this.map.fitBoundsPositions(markers);\r\n }\r\n };\r\n /**\r\n * Use this functions to set the center of the map on marker\r\n * @param {string} type\r\n * @param {any} condition center on marker with the condition [nullable]\r\n */\r\n Map.prototype.setCenterMarker = function (type, condition) {\r\n if (this.markersList[type] && condition) {\r\n var marker = this.markersList[type].find(function (marker) { return condition(marker.object); });\r\n // Center on the marker with the condition\r\n this.map.setCenterMarker(marker);\r\n }\r\n else {\r\n if (this.markersList[type] && this.markersList[type].length) {\r\n this.map.setCenterMarker(this.markersList[type][0]);\r\n }\r\n }\r\n };\r\n /**\r\n * This functions returns if marker exists\r\n * @param type\r\n * @param condition [nullable]\r\n * @returns {boolean}\r\n */\r\n Map.prototype.markerExists = function (type, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n return markers && markers.length > 0;\r\n };\r\n /**\r\n * Use this function to count markers by type\r\n * @param {string} type\r\n * @param {boolean} onlyOnMap exclude hidden markers, default true\r\n * @param {any} condition\r\n * @returns {number}\r\n */\r\n Map.prototype.countMarkers = function (type, onlyOnMap, condition) {\r\n var _this = this;\r\n if (onlyOnMap === void 0) { onlyOnMap = true; }\r\n if (this.markerClusterer[type]) {\r\n return this.map.countMarkersOnCluster(this.markerClusterer[type]);\r\n }\r\n var markers = this.getMarkers(type, condition);\r\n if (onlyOnMap) {\r\n markers = markers.filter(function (x) { return _this.map.isMarkerOnMap(x); });\r\n }\r\n return markers.length;\r\n };\r\n /**\r\n * This function add new events on marker\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.addMarkerEvent = function (type, event, eventFunction, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n this.map.addMarkerEvent(markers, event, eventFunction);\r\n };\r\n /**\r\n * This function remove events of marker\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.removeMarkerEvent = function (type, event, condition) {\r\n var markers = this.getMarkers(type, condition);\r\n this.map.removeMarkerEvent(markers, event);\r\n };\r\n /* Marker Clusterer */\r\n /**\r\n * Use this function to add MarkerClusterer on the map\r\n * @param {string} type same type of markers\r\n * @param {InlogMaps.MarkerClusterConfig} config\r\n */\r\n Map.prototype.addMarkerClusterer = function (type, config) {\r\n this.markerClusterer[type] = this.map.addMarkerClusterer(config);\r\n };\r\n /**\r\n * Use this function to alter clusterer options\r\n * @param type same type of markers\r\n * @param {InlogMaps.MarkerClusterConfig} config\r\n */\r\n Map.prototype.alterMarkerClustererConfig = function (type, config) {\r\n if (this.markerClusterer[type]) {\r\n this.map.alterMarkerClustererConfig(this.markerClusterer[type], config);\r\n }\r\n };\r\n /**\r\n * Use this function to redraw marker clusterer\r\n * @param type same type of markers\r\n */\r\n Map.prototype.refreshClusterer = function (type) {\r\n if (this.markerClusterer[type]) {\r\n this.map.refreshClusterer(this.markerClusterer[type]);\r\n }\r\n };\r\n /**\r\n * Use this to clear markers on clusterer\r\n * @param type same type of markers\r\n */\r\n Map.prototype.clearMarkersClusterer = function (type) {\r\n if (this.markerClusterer[type]) {\r\n this.map.clearMarkersClusterer(this.markerClusterer[type]);\r\n }\r\n };\r\n /* Polygons */\r\n /**\r\n * Use this function to draw polygons\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n Map.prototype.drawPolygon = function (type, options, eventClick) {\r\n var polygon = this.map.drawPolygon(options, eventClick);\r\n if (!this.polygonsList[type]) {\r\n this.polygonsList[type] = [];\r\n }\r\n this.polygonsList[type].push(polygon);\r\n };\r\n /**\r\n * Use this function to show/hide polygon from a especific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle polygon with the condition [nullable]\r\n */\r\n Map.prototype.togglePolygons = function (show, type, condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n if (polygons && polygons.length) {\r\n this.map.togglePolygons(polygons, show);\r\n }\r\n };\r\n /**\r\n * Remove polygons from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove polygons with the condition [nullable]\r\n */\r\n Map.prototype.removePolygons = function (type, condition) {\r\n if (this.polygonsList[type] && condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n // Hide markers with the condition\r\n this.map.togglePolygons(polygons, false);\r\n // Keep markers that doesn't have the condition\r\n this.polygonsList[type] = this.polygonsList[type].filter(function (polygon) { return !condition(polygon.object); });\r\n }\r\n else {\r\n if (this.polygonsList[type]) {\r\n this.map.togglePolygons(this.polygonsList[type], false);\r\n }\r\n this.polygonsList[type] = [];\r\n }\r\n if (this.polygonsList[type].length === 0) {\r\n delete this.polygonsList[type];\r\n }\r\n };\r\n /**\r\n * Remove all polygons from the map and from the internal list\r\n */\r\n Map.prototype.removeAllPolygons = function () {\r\n for (var type in this.polygonsList) {\r\n if (this.polygonsList.hasOwnProperty(type)) {\r\n this.removePolygons(type);\r\n }\r\n }\r\n };\r\n /**\r\n * Use this function to alter polygons options/style\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonAlterOptions} options\r\n * @param {any} condition alter polygon with the condition [nullable]\r\n */\r\n Map.prototype.alterPolygonOptions = function (type, options, condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n if (polygons && polygons.length) {\r\n this.map.alterPolygonOptions(polygons, options);\r\n }\r\n };\r\n /**\r\n * Use this function to fit bounds of a polygon\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n Map.prototype.fitBoundsPolygons = function (type, condition) {\r\n var _this = this;\r\n var polygons = this.getPolygons(type, condition)\r\n .filter(function (polygon) { return _this.map.isPolygonOnMap(polygon); });\r\n if (polygons && polygons.length) {\r\n this.map.fitBoundsPolygons(polygons);\r\n }\r\n };\r\n /**\r\n * Set center on polygon bounds\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n Map.prototype.setCenterPolygons = function (type, condition) {\r\n var _this = this;\r\n var polygons = this.getPolygons(type, condition)\r\n .filter(function (polygon) { return _this.map.isPolygonOnMap(polygon); });\r\n if (polygons && polygons.length) {\r\n this.map.setCenterPolygons(polygons);\r\n }\r\n };\r\n /**\r\n * This functions returns if polygon exists\r\n * @param type\r\n * @param condition [nullable]\r\n * @returns {boolean}\r\n */\r\n Map.prototype.polygonExists = function (type, condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n return polygons && polygons.length > 0;\r\n };\r\n /**\r\n * Use this function to get the path of some polygon\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {number[]}\r\n */\r\n Map.prototype.getPolygonPath = function (type, condition) {\r\n var polygon = this.getPolygons(type, condition);\r\n if (polygon && polygon.length) {\r\n return this.map.getPolygonPath(polygon[0]);\r\n }\r\n };\r\n /**\r\n * This function add new events on polygon\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.addPolygonEvent = function (type, event, eventFunction, condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n this.map.addPolygonEvent(polygons, event, eventFunction);\r\n };\r\n /**\r\n * This function remove events of polygon\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.removePolygonEvent = function (type, event, condition) {\r\n var polygons = this.getPolygons(type, condition);\r\n this.map.removePolygonEvent(polygons, event);\r\n };\r\n /* Circles */\r\n /**\r\n * Use this function to draw circles on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.CircleOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n Map.prototype.drawCircle = function (type, options, eventClick) {\r\n var circle = this.map.drawCircle(options, eventClick);\r\n if (!this.circlesList[type]) {\r\n this.circlesList[type] = [];\r\n }\r\n this.circlesList[type].push(circle);\r\n };\r\n /**\r\n * Use this function to show/hide circles from a especific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle circles with the condition [nullable]\r\n */\r\n Map.prototype.toggleCircles = function (show, type, condition) {\r\n var circles = this.getCircles(type, condition);\r\n if (circles && circles.length) {\r\n this.map.toggleCircles(circles, show);\r\n }\r\n };\r\n /**\r\n * Remove circles from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove circles with the condition [nullable]\r\n */\r\n Map.prototype.removeCircles = function (type, condition) {\r\n if (this.circlesList[type] && condition) {\r\n var circles = this.getCircles(type, condition);\r\n // Hide circles with the condition\r\n this.map.toggleCircles(circles, false);\r\n // Keep circles that doesn't have the condition\r\n this.circlesList[type] = this.circlesList[type].filter(function (circle) { return !condition(circle.object); });\r\n }\r\n else {\r\n if (this.circlesList[type]) {\r\n this.map.toggleCircles(this.circlesList[type], false);\r\n }\r\n this.circlesList[type] = [];\r\n }\r\n if (this.circlesList[type].length === 0) {\r\n delete this.circlesList[type];\r\n }\r\n };\r\n /**\r\n * Remove all circles from the map and from the internal list\r\n */\r\n Map.prototype.removeAllCircles = function () {\r\n for (var type in this.circlesList) {\r\n if (this.circlesList.hasOwnProperty(type)) {\r\n this.removeCircles(type);\r\n }\r\n }\r\n };\r\n /**\r\n * Use this function to alter circle options\r\n * @param {string} type\r\n * @param {InlogMaps.CircleAlterOptions} options\r\n * @param {any} condition alter circle with the condition [nullable]\r\n */\r\n Map.prototype.alterCircleOptions = function (type, options, condition) {\r\n var circles = this.getCircles(type, condition);\r\n if (circles && circles.length) {\r\n this.map.alterCircleOptions(circles, options);\r\n }\r\n };\r\n /**\r\n * Use this function to fit bounds of a polygon\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n Map.prototype.fitBoundsCircles = function (type, condition) {\r\n var _this = this;\r\n var circles = this.getCircles(type, condition)\r\n .filter(function (circle) { return _this.map.isCircleOnMap(circle); });\r\n if (circles && circles.length) {\r\n this.map.fitBoundsCircles(circles);\r\n }\r\n };\r\n /**\r\n * This functions returns if circle exists\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {boolean}\r\n */\r\n Map.prototype.circleExists = function (type, condition) {\r\n var circles = this.getCircles(type, condition);\r\n return circles && circles.length > 0;\r\n };\r\n /**\r\n * This function return circle center\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {number[]}\r\n */\r\n Map.prototype.getCircleCenter = function (type, condition) {\r\n var circles = this.getCircles(type, condition);\r\n if (circles && circles.length) {\r\n return this.map.getCircleCenter(circles[0]);\r\n }\r\n return null;\r\n };\r\n /**\r\n * This function return circle center\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {number}\r\n */\r\n Map.prototype.getCircleRadius = function (type, condition) {\r\n var circles = this.getCircles(type, condition);\r\n if (circles && circles.length) {\r\n return this.map.getCircleRadius(circles[0]);\r\n }\r\n return null;\r\n };\r\n /**\r\n * This function add new events on circle\r\n * @param {string} type\r\n * @param {InlogMaps.CircleEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.addCircleEvent = function (type, event, eventFunction, condition) {\r\n var circles = this.getCircles(type, condition);\r\n this.map.addCircleEvent(circles, event, eventFunction);\r\n };\r\n /**\r\n * This function remove events of circle\r\n * @param {string} type\r\n * @param {InlogMaps.CircleEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.removeCircleEvent = function (type, event, condition) {\r\n var circles = this.getCircles(type, condition);\r\n this.map.removeCircleEvent(circles, event);\r\n };\r\n /* Polylines */\r\n /**\r\n * Use this function to draw polylines on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n Map.prototype.drawPolyline = function (type, options, eventClick) {\r\n var polyline = this.map.drawPolyline(options, eventClick);\r\n if (!this.polylinesList[type]) {\r\n this.polylinesList[type] = [];\r\n }\r\n this.polylinesList[type].push(polyline);\r\n };\r\n /**\r\n * Use this function to draw polylines with navigation on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n */\r\n Map.prototype.drawPolylineWithNavigation = function (type, options, eventClick) {\r\n var polyline = this.map.drawPolylineWithNavigation(options, eventClick);\r\n if (!this.polylinesList[type]) {\r\n this.polylinesList[type] = [];\r\n }\r\n this.polylinesList[type].push(polyline);\r\n };\r\n /**\r\n * Use this function to toggle polylines\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle polyline with the condition [nullable]\r\n */\r\n Map.prototype.togglePolylines = function (show, type, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n if (polyline && polyline.length) {\r\n this.map.togglePolylines(polyline, show);\r\n }\r\n };\r\n /**\r\n * Use this function to remove polylines\r\n * @param {string} type\r\n * @param {any} condition remove polyline with the condition [nullable]\r\n */\r\n Map.prototype.removePolylines = function (type, condition) {\r\n if (this.polylinesList[type] && condition) {\r\n var polylines = this.getPolylines(type, condition);\r\n // Hide markers with the condition\r\n this.map.togglePolylines(polylines, false);\r\n // Keep markers that doesn't have the condition\r\n this.polylinesList[type] = this.polylinesList[type].filter(function (polyline) { return !condition(polyline.object); });\r\n }\r\n else {\r\n if (this.polylinesList[type]) {\r\n this.map.togglePolylines(this.polylinesList[type], false);\r\n }\r\n this.polylinesList[type] = [];\r\n }\r\n if (this.polylinesList[type].length === 0) {\r\n delete this.polylinesList[type];\r\n }\r\n };\r\n /**\r\n * Remove all polylines from the map and from the internal list\r\n */\r\n Map.prototype.removeAllPolylines = function () {\r\n for (var type in this.polylinesList) {\r\n if (this.polylinesList.hasOwnProperty(type)) {\r\n this.removePolylines(type);\r\n }\r\n }\r\n };\r\n /**\r\n * Use this function to alter polyline options\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n * @param {any} condition alter polyline with the condition [nullable]\r\n */\r\n Map.prototype.alterPolylineOptions = function (type, options, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n if (polyline && polyline.length) {\r\n this.map.alterPolylineOptions(polyline, options);\r\n }\r\n };\r\n /**\r\n * Use this functions to fit polylines bounds\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.fitBoundsPolylines = function (type, condition) {\r\n var _this = this;\r\n var polylines = this.getPolylines(type, condition)\r\n .filter(function (polyline) { return _this.map.isPolylineOnMap(polyline); });\r\n if (polylines && polylines.length) {\r\n this.map.fitBoundsPolylines(polylines);\r\n }\r\n };\r\n /**\r\n * This functions returns if polyline exists\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {boolean}\r\n */\r\n Map.prototype.polylineExists = function (type, condition) {\r\n var polylines = this.getPolylines(type, condition);\r\n return polylines && polylines.length > 0;\r\n };\r\n /**\r\n * Use this function to add more paths to a polyline\r\n * @param {string} type\r\n * @param {number[]} position\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.addPolylinePath = function (type, position, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n if (polyline && polyline.length) {\r\n this.map.addPolylinePath(polyline, position);\r\n }\r\n else {\r\n var options = new polyline_options_1.default();\r\n options.addToMap = true;\r\n this.drawPolyline(type, options, null);\r\n }\r\n };\r\n /**\r\n * Use this function to get the path of some polyline\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {number[]}\r\n */\r\n Map.prototype.getPolylinePath = function (type, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n if (polyline && polyline.length) {\r\n return this.map.getPolylinePath(polyline[0]);\r\n }\r\n };\r\n /**\r\n * Use this function to clear polyline selected from the currentMap\r\n */\r\n Map.prototype.removePolylineHighlight = function () {\r\n this.map.removePolylineHighlight();\r\n };\r\n /**\r\n * Use this function to add listeners on polyline\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.addPolylineEvent = function (type, event, eventFunction, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n this.map.addPolylineEvent(polyline, event, eventFunction);\r\n };\r\n /**\r\n * Use this function to remove listeners of polyline\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.removePolylineEvent = function (type, event, condition) {\r\n var polyline = this.getPolylines(type, condition);\r\n this.map.removePolylineEvent(polyline, event);\r\n };\r\n /**\r\n * Use this function to set position of polyline highlight\r\n * @param {string} type\r\n * @param {number} initialIndex\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.setIndexPolylineHighlight = function (type, initialIndex, condition) {\r\n var polylines = this.getPolylines(type, condition);\r\n if (polylines && polylines.length) {\r\n this.map.setIndexPolylineHighlight(polylines[0], initialIndex);\r\n }\r\n };\r\n /**\r\n * Use this function to get the object of a polyline\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {object}\r\n */\r\n Map.prototype.getObjectPolyline = function (type, condition) {\r\n var polylines = this.getPolylines(type, condition);\r\n if (polylines && polylines.length) {\r\n return this.map.getObjectPolyline(polylines[0]);\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n /**\r\n * Use this function to get the object of the polyline highligth\r\n * @returns {object}\r\n */\r\n Map.prototype.getObjectPolylineHighlight = function () {\r\n return this.map.getObjectPolylineHighlight();\r\n };\r\n /**\r\n * Use this function to add events on polyline highligtht / selected polyline\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} eventFunction\r\n */\r\n Map.prototype.addPolylineHighlightEvent = function (event, eventFunction) {\r\n this.map.addPolylineHighlightEvent(event, eventFunction);\r\n };\r\n /**\r\n * Use this function to get initial and final index of the polyline highlight\r\n * @returns {number[]} returns an array with initial index and final index\r\n */\r\n Map.prototype.getPolylineHighlightIndex = function () {\r\n return this.map.getPolylineHighlightIndex();\r\n };\r\n /* Info Windows */\r\n /**\r\n * Use this function to draw popups on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PopupOptions} options\r\n */\r\n Map.prototype.drawPopup = function (type, options) {\r\n var marker = null;\r\n if (options.marker) {\r\n var markers = this.getMarkers(options.marker, options.conditionMarker);\r\n marker = markers[0];\r\n }\r\n var popup;\r\n if (this.infoWindowList[type]) {\r\n popup = this.map.alterPopup(this.infoWindowList[type], options, marker);\r\n }\r\n else {\r\n popup = this.map.drawPopup(options, marker);\r\n }\r\n this.infoWindowList[type] = popup;\r\n };\r\n /**\r\n * Use this function to alter popups\r\n * @param {string} type\r\n * @param {InlogMaps.PopupOptions} options\r\n */\r\n Map.prototype.alterPopup = function (type, options) {\r\n var popups = this.infoWindowList[type];\r\n var markers;\r\n if (options.marker) {\r\n markers = this.getMarkers(options.marker, options.conditionMarker);\r\n }\r\n if (popups) {\r\n this.map.alterPopupContent(popups, options, markers ? markers[0] : null);\r\n }\r\n };\r\n /**\r\n *\r\n * @param {string} type\r\n * @returns {object}\r\n */\r\n Map.prototype.getObjectOpenPopup = function (type) {\r\n return this.infoWindowList[type] ? this.infoWindowList[type].object : null;\r\n };\r\n /**\r\n * Use this function to close popup by type\r\n * @param {string} type\r\n */\r\n Map.prototype.closePopup = function (type) {\r\n if (this.infoWindowList[type]) {\r\n this.map.closePopup(this.infoWindowList[type]);\r\n }\r\n };\r\n /**\r\n * Use this function to close all popups\r\n * @param {string} type\r\n */\r\n Map.prototype.closeAllPopups = function () {\r\n for (var type in this.infoWindowList) {\r\n if (this.infoWindowList.hasOwnProperty(type)) {\r\n this.closePopup(type);\r\n }\r\n }\r\n };\r\n /* Map */\r\n /**\r\n * Resize de map based on html size\r\n */\r\n Map.prototype.resizeMap = function () {\r\n this.map.resizeMap();\r\n };\r\n /**\r\n * Use this function to add event clicks on the currentMap\r\n * @param {InlogMaps.MapEventType} eventType\r\n * @param eventFunction function callback\r\n */\r\n Map.prototype.addEventMap = function (eventType, eventFunction) {\r\n this.map.addEventMap(eventType, eventFunction);\r\n };\r\n /**\r\n * Use this function to remove event clicks from the currentMap\r\n * @param {InlogMaps.MapEventType} eventType\r\n */\r\n Map.prototype.removeEventMap = function (eventType) {\r\n this.map.removeEventMap(eventType);\r\n };\r\n /**\r\n * Returns the current zoom level of the map view\r\n * @returns {number}\r\n */\r\n Map.prototype.getZoom = function () {\r\n return this.map.getZoom();\r\n };\r\n /**\r\n * Set the current zoom level of the map view\r\n * @param {number} zoom\r\n */\r\n Map.prototype.setZoom = function (zoom) {\r\n this.map.setZoom(zoom);\r\n };\r\n /**\r\n * Returns the center position of the map\r\n * @returns {number[]}\r\n */\r\n Map.prototype.getCenter = function () {\r\n return this.map.getCenter();\r\n };\r\n /**\r\n * Set the position center of the map\r\n * @param {number[]} position\r\n */\r\n Map.prototype.setCenter = function (position) {\r\n this.map.setCenter(position);\r\n };\r\n /**\r\n * Returns the coordinates from pixels\r\n * @param {number} offsetx\r\n * @param {number} offsety\r\n * @returns {number[]}\r\n */\r\n Map.prototype.pixelsToLatLng = function (offsetx, offsety) {\r\n return this.map.pixelsToLatLng(offsetx, offsety);\r\n };\r\n /**\r\n * Use this functions to fit bounds on elements with same type and condition\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.fitBoundsElements = function (type, condition) {\r\n var _this = this;\r\n var markers = this.getMarkers(type, condition)\r\n .filter(function (marker) { return _this.map.isMarkerOnMap(marker); });\r\n var circles = this.getCircles(type, condition)\r\n .filter(function (circle) { return _this.map.isCircleOnMap(circle); });\r\n var polygons = this.getPolygons(type, condition)\r\n .filter(function (polygon) { return _this.map.isPolygonOnMap(polygon); });\r\n var polylines = this.getPolylines(type, condition)\r\n .filter(function (polyline) { return _this.map.isPolylineOnMap(polyline); });\r\n this.map.fitBoundsElements(markers, circles, polygons, polylines);\r\n };\r\n /* Overlay */\r\n /**\r\n * Use this function to dray overlays on the current map\r\n * @param {string} type\r\n * @param {InlogMaps.OverlayOptions} options\r\n */\r\n Map.prototype.drawOverlay = function (type, options) {\r\n var overlay = null;\r\n if (options.polygon) {\r\n var polygons = this.getPolygons(options.polygon, options.conditionPolygon);\r\n if (polygons && polygons.length) {\r\n overlay = this.map.drawOverlay(options, polygons);\r\n }\r\n }\r\n else {\r\n overlay = this.map.drawOverlay(options);\r\n }\r\n if (overlay != null) {\r\n if (!this.overlayList[type]) {\r\n this.overlayList[type] = [];\r\n }\r\n this.overlayList[type].push(overlay);\r\n }\r\n };\r\n /**\r\n * Use this function to show or hide overlay\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n Map.prototype.toggleOverlay = function (show, type, condition) {\r\n var overlays = this.getOverlays(type, condition);\r\n if (overlays && overlays.length) {\r\n this.map.toggleOverlay(overlays, show);\r\n }\r\n };\r\n /**\r\n * Remove overlays from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove overlays with the condition [nullable]\r\n */\r\n Map.prototype.removeOverlays = function (type, condition) {\r\n if (this.overlayList[type] && condition) {\r\n var overlays = this.getOverlays(type, condition);\r\n // Hide markers with the condition\r\n this.map.toggleOverlay(overlays, false);\r\n // Keep markers that doesn't have the condition\r\n this.overlayList[type] = this.overlayList[type].filter(function (overlay) { return !condition(overlay.object); });\r\n }\r\n else {\r\n if (this.overlayList[type]) {\r\n this.map.toggleOverlay(this.overlayList[type], false);\r\n }\r\n this.overlayList[type] = [];\r\n }\r\n if (this.overlayList[type].length === 0) {\r\n delete this.overlayList[type];\r\n }\r\n };\r\n /**\r\n * Remove all overlays from the map and from the internal list\r\n */\r\n Map.prototype.removeAllOverlays = function () {\r\n for (var type in this.overlayList) {\r\n if (this.overlayList.hasOwnProperty(type)) {\r\n this.removeOverlays(type);\r\n }\r\n }\r\n };\r\n /* Private Methods */\r\n Map.prototype.getMarkers = function (type, condition) {\r\n var markers = this.markersList[type];\r\n if (markers && markers.length) {\r\n return condition ? markers.filter(function (marker) { return condition(marker.object); }) : markers;\r\n }\r\n else\r\n return [];\r\n };\r\n Map.prototype.getPolygons = function (type, condition) {\r\n var polygons = this.polygonsList[type];\r\n if (polygons && polygons.length) {\r\n return condition ? polygons.filter(function (polygon) { return condition(polygon.object); }) : polygons;\r\n }\r\n else\r\n return [];\r\n };\r\n Map.prototype.getCircles = function (type, condition) {\r\n var circles = this.circlesList[type];\r\n if (circles && circles.length) {\r\n return condition ? circles.filter(function (circle) { return condition(circle.object); }) : circles;\r\n }\r\n else\r\n return [];\r\n };\r\n Map.prototype.getPolylines = function (type, condition) {\r\n var polylines = this.polylinesList[type];\r\n if (polylines && polylines.length) {\r\n return condition ? polylines.filter(function (polyline) { return condition(polyline.object); }) : polylines;\r\n }\r\n else\r\n return [];\r\n };\r\n Map.prototype.getOverlays = function (type, condition) {\r\n var overlays = this.overlayList[type];\r\n if (overlays && overlays.length) {\r\n return condition ? overlays.filter(function (overlay) { return condition(overlay.object); }) : overlays;\r\n }\r\n else\r\n return [];\r\n };\r\n return Map;\r\n}());\r\nexports.default = Map;\r\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar maps_api_loader_service_1 = __webpack_require__(6);\r\nvar google_circles_1 = __webpack_require__(11);\r\nvar google_geojson_1 = __webpack_require__(12);\r\nvar google_map_1 = __webpack_require__(13);\r\nvar google_markers_1 = __webpack_require__(14);\r\nvar google_overlay_1 = __webpack_require__(15);\r\nvar google_polygons_1 = __webpack_require__(16);\r\nvar google_polylines_1 = __webpack_require__(17);\r\nvar google_popup_1 = __webpack_require__(18);\r\nvar GoogleMaps = /** @class */ (function () {\r\n function GoogleMaps() {\r\n this.mapsApiLoader = new maps_api_loader_service_1.MapsApiLoaderService();\r\n }\r\n GoogleMaps.prototype.initialize = function (mapType, params, elementId) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var api, google_1, options, key, imageMapTypes_1, ids_1, map_1, trafficLayer, err_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 3]);\r\n return [4 /*yield*/, this.mapsApiLoader.loadApi(mapType, params)];\r\n case 1:\r\n api = _a.sent();\r\n google_1 = api;\r\n options = {\r\n center: new google_1.maps.LatLng(-14, -54),\r\n fullscreenControl: false,\r\n keyboardShortcuts: false,\r\n mapTypeControl: true,\r\n minZoom: 4,\r\n rotateControl: false,\r\n scaleControl: false,\r\n streetViewControl: false,\r\n zoom: 4,\r\n zoomControl: true\r\n };\r\n if (params.gestureHandling) {\r\n options.gestureHandling = 'cooperative';\r\n }\r\n else {\r\n options.gestureHandling = 'greedy';\r\n }\r\n if (params.options) {\r\n for (key in params.options) {\r\n if (params.options.hasOwnProperty(key)) {\r\n options[key] = params.options[key];\r\n }\r\n }\r\n }\r\n imageMapTypes_1 = [];\r\n if (params.mapTiles) {\r\n ids_1 = [google_1.maps.MapTypeId.ROADMAP, google_1.maps.MapTypeId.SATELLITE];\r\n params.mapTiles.forEach(function (tile) {\r\n ids_1.push(tile.name);\r\n var mapTypeOptions = {\r\n getTileUrl: function (coord, zoom) {\r\n return \"https://tile.openstreetmap.org/\" + zoom + \"/\" + coord.x + \"/\" + coord.y + \".png\";\r\n },\r\n isPng: true,\r\n maxZoom: 19,\r\n minZoom: 0,\r\n name: 'OpenStreetMap',\r\n tileSize: new google_1.maps.Size(256, 256),\r\n };\r\n for (var key in tile) {\r\n if (tile.hasOwnProperty(key)) {\r\n mapTypeOptions[key] = tile[key];\r\n }\r\n }\r\n var imageMapType = new google_1.maps.ImageMapType(mapTypeOptions);\r\n imageMapTypes_1.push({ id: tile.name, tile: imageMapType });\r\n });\r\n options.mapTypeControlOptions = {\r\n mapTypeIds: ids_1,\r\n style: google_1.maps.MapTypeControlStyle.HORIZONTAL_BAR\r\n };\r\n }\r\n map_1 = new google_1.maps.Map(document.getElementById(elementId), options);\r\n this.googleMarkers = new google_markers_1.default(map_1, google_1);\r\n this.googlePolygons = new google_polygons_1.default(map_1, google_1);\r\n this.googleCircles = new google_circles_1.default(map_1, google_1);\r\n this.googlePopups = new google_popup_1.default(map_1, google_1);\r\n this.googlePolylines = new google_polylines_1.default(map_1, google_1, this.googlePopups);\r\n this.googleMap = new google_map_1.default(map_1, google_1);\r\n this.googleOverlays = new google_overlay_1.default(map_1, google_1, this.googlePolygons);\r\n this.googleGeoJson = new google_geojson_1.default(map_1, google_1);\r\n if (imageMapTypes_1 && imageMapTypes_1.length) {\r\n imageMapTypes_1.forEach(function (image) {\r\n map_1.mapTypes.set(image.id, image.tile);\r\n });\r\n }\r\n if (params.showTraffic) {\r\n trafficLayer = new google_1.maps.TrafficLayer();\r\n trafficLayer.setMap(map_1);\r\n }\r\n return [2 /*return*/, this];\r\n case 2:\r\n err_1 = _a.sent();\r\n return [2 /*return*/, err_1];\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /* GEOJson */\r\n GoogleMaps.prototype.loadGEOJson = function (data, options, eventClick) {\r\n this.googleGeoJson.loadGEOJson(data, options, eventClick);\r\n };\r\n /* Markers */\r\n GoogleMaps.prototype.drawMarker = function (options, eventClick) {\r\n return this.googleMarkers.drawMarker(options, eventClick);\r\n };\r\n GoogleMaps.prototype.drawCircleMarker = function (options, eventClick) {\r\n return this.googleMarkers.drawCircleMarker(options, eventClick);\r\n };\r\n GoogleMaps.prototype.toggleMarkers = function (markers, show, markerClusterer) {\r\n this.googleMarkers.toggleMarkers(markers, show, markerClusterer);\r\n };\r\n GoogleMaps.prototype.alterMarkerOptions = function (markers, options) {\r\n this.googleMarkers.alterMarkerOptions(markers, options);\r\n };\r\n GoogleMaps.prototype.alterMarkerPosition = function (markers, position, addTransition) {\r\n this.googleMarkers.alterMarkerPosition(markers, position, addTransition);\r\n };\r\n GoogleMaps.prototype.fitBoundsPositions = function (markers) {\r\n this.googleMarkers.fitBoundsPositions(markers);\r\n };\r\n GoogleMaps.prototype.isMarkerOnMap = function (marker) {\r\n return this.googleMarkers.isMarkerOnMap(marker);\r\n };\r\n GoogleMaps.prototype.setCenterMarker = function (marker) {\r\n this.googleMarkers.setCenterMarker(marker);\r\n };\r\n GoogleMaps.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {\r\n this.googleMarkers.addMarkerEvent(markers, eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.removeMarkerEvent = function (markers, event) {\r\n this.googleMarkers.removeMarkerEvent(markers, event);\r\n };\r\n /* Marker Clusterer */\r\n GoogleMaps.prototype.addMarkerClusterer = function (config) {\r\n return this.googleMarkers.addMarkerClusterer(config);\r\n };\r\n GoogleMaps.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {\r\n this.googleMarkers.alterMarkerClustererConfig(markerClusterer, config);\r\n };\r\n GoogleMaps.prototype.refreshClusterer = function (markerClusterer) {\r\n this.googleMarkers.refreshClusterer(markerClusterer);\r\n };\r\n GoogleMaps.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {\r\n this.googleMarkers.addMarkerOnClusterer(marker, markerClusterer);\r\n };\r\n GoogleMaps.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {\r\n this.googleMarkers.removeMarkerFromClusterer(marker, markerClusterer);\r\n };\r\n GoogleMaps.prototype.clearMarkersClusterer = function (markerClusterer) {\r\n this.googleMarkers.clearMarkersClusterer(markerClusterer);\r\n };\r\n GoogleMaps.prototype.countMarkersOnCluster = function (markerClusterer) {\r\n return this.googleMarkers.countMarkersOnCluster(markerClusterer);\r\n };\r\n /* Polygons */\r\n GoogleMaps.prototype.drawPolygon = function (options, eventClick) {\r\n return this.googlePolygons.drawPolygon(options, eventClick);\r\n };\r\n GoogleMaps.prototype.togglePolygons = function (polygons, show) {\r\n this.googlePolygons.togglePolygons(polygons, show);\r\n };\r\n GoogleMaps.prototype.alterPolygonOptions = function (polygons, options) {\r\n this.googlePolygons.alterPolygonOptions(polygons, options);\r\n };\r\n GoogleMaps.prototype.fitBoundsPolygons = function (polygons) {\r\n this.googlePolygons.fitBoundsPolygons(polygons);\r\n };\r\n GoogleMaps.prototype.setCenterPolygons = function (polygons) {\r\n this.googlePolygons.setCenterPolygons(polygons);\r\n };\r\n GoogleMaps.prototype.isPolygonOnMap = function (polygon) {\r\n return this.googlePolygons.isPolygonOnMap(polygon);\r\n };\r\n GoogleMaps.prototype.getPolygonPath = function (polygon) {\r\n return this.googlePolygons.getPolygonPath(polygon);\r\n };\r\n GoogleMaps.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {\r\n return this.googlePolygons.addPolygonEvent(polygons, eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.removePolygonEvent = function (polygons, event) {\r\n this.googlePolygons.removePolygonEvent(polygons, event);\r\n };\r\n /* Circles */\r\n GoogleMaps.prototype.drawCircle = function (options, eventClick) {\r\n return this.googleCircles.drawCircle(options, eventClick);\r\n };\r\n GoogleMaps.prototype.toggleCircles = function (circles, show) {\r\n this.googleCircles.toggleCircles(circles, show);\r\n };\r\n GoogleMaps.prototype.alterCircleOptions = function (circles, options) {\r\n this.googleCircles.alterCircleOptions(circles, options);\r\n };\r\n GoogleMaps.prototype.fitBoundsCircles = function (circles) {\r\n this.googleCircles.fitBoundsCircles(circles);\r\n };\r\n GoogleMaps.prototype.isCircleOnMap = function (circle) {\r\n return this.googleCircles.isCircleOnMap(circle);\r\n };\r\n GoogleMaps.prototype.getCircleCenter = function (circle) {\r\n return this.googleCircles.getCircleCenter(circle);\r\n };\r\n GoogleMaps.prototype.getCircleRadius = function (circle) {\r\n return this.googleCircles.getCircleRadius(circle);\r\n };\r\n GoogleMaps.prototype.addCircleEvent = function (circles, eventType, eventFunction) {\r\n this.googleCircles.addCircleEvent(circles, eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.removeCircleEvent = function (circles, event) {\r\n this.googleCircles.removeCircleEvent(circles, event);\r\n };\r\n /* Polylines */\r\n GoogleMaps.prototype.drawPolyline = function (options, eventClick) {\r\n return this.googlePolylines.drawPolyline(options, eventClick);\r\n };\r\n GoogleMaps.prototype.drawPolylineWithNavigation = function (options, eventClick) {\r\n return this.googlePolylines.drawPolylineWithNavigation(options, eventClick);\r\n };\r\n GoogleMaps.prototype.togglePolylines = function (polylines, show) {\r\n this.googlePolylines.togglePolylines(polylines, show);\r\n };\r\n GoogleMaps.prototype.alterPolylineOptions = function (polylines, options) {\r\n this.googlePolylines.alterPolylineOptions(polylines, options);\r\n };\r\n GoogleMaps.prototype.fitBoundsPolylines = function (polylines) {\r\n this.googlePolylines.fitBoundsPolylines(polylines);\r\n };\r\n GoogleMaps.prototype.isPolylineOnMap = function (polyline) {\r\n return this.googlePolylines.isPolylineOnMap(polyline);\r\n };\r\n GoogleMaps.prototype.addPolylinePath = function (polylines, position) {\r\n this.googlePolylines.addPolylinePath(polylines, position);\r\n };\r\n GoogleMaps.prototype.getPolylinePath = function (polyline) {\r\n return this.googlePolylines.getPolylinePath(polyline);\r\n };\r\n GoogleMaps.prototype.removePolylineHighlight = function () {\r\n this.googlePolylines.removePolylineHighlight();\r\n };\r\n GoogleMaps.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {\r\n this.googlePolylines.addPolylineEvent(polylines, eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.removePolylineEvent = function (polylines, event) {\r\n this.googlePolylines.removePolylineEvent(polylines, event);\r\n };\r\n GoogleMaps.prototype.setIndexPolylineHighlight = function (polyline, index) {\r\n this.googlePolylines.setIndexPolylineHighlight(polyline, index);\r\n };\r\n GoogleMaps.prototype.getObjectPolyline = function (polyline) {\r\n return this.googlePolylines.getObjectPolyline(polyline);\r\n };\r\n GoogleMaps.prototype.getObjectPolylineHighlight = function () {\r\n return this.googlePolylines.getObjectPolylineHighlight();\r\n };\r\n GoogleMaps.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {\r\n this.googlePolylines.addPolylineHighlightEvent(eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.getPolylineHighlightIndex = function () {\r\n return this.googlePolylines.getPolylineHighlightIndex();\r\n };\r\n /* Info Windows */\r\n GoogleMaps.prototype.drawPopup = function (options, marker) {\r\n return this.googlePopups.drawPopup(options, marker);\r\n };\r\n GoogleMaps.prototype.alterPopup = function (popup, options, marker) {\r\n return this.googlePopups.alterPopup(popup, options, marker);\r\n };\r\n GoogleMaps.prototype.alterPopupContent = function (popup, options, marker) {\r\n this.googlePopups.alterPopupContent(popup, options, marker);\r\n };\r\n GoogleMaps.prototype.closePopup = function (popup) {\r\n this.googlePopups.closePopup(popup);\r\n };\r\n /* Map */\r\n GoogleMaps.prototype.resizeMap = function () {\r\n this.googleMap.resizeMap();\r\n };\r\n GoogleMaps.prototype.addEventMap = function (eventType, eventFunction) {\r\n this.googleMap.addEventMap(eventType, eventFunction);\r\n };\r\n GoogleMaps.prototype.removeEventMap = function (eventType) {\r\n this.googleMap.removeEventMap(eventType);\r\n };\r\n GoogleMaps.prototype.getZoom = function () {\r\n return this.googleMap.getZoom();\r\n };\r\n GoogleMaps.prototype.setZoom = function (zoom) {\r\n this.googleMap.setZoom(zoom);\r\n };\r\n GoogleMaps.prototype.getCenter = function () {\r\n return this.googleMap.getCenter();\r\n };\r\n GoogleMaps.prototype.setCenter = function (position) {\r\n this.googleMap.setCenter(position);\r\n };\r\n GoogleMaps.prototype.pixelsToLatLng = function (offsetx, offsety) {\r\n return this.googleMap.pixelsToLatLng(offsetx, offsety);\r\n };\r\n GoogleMaps.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {\r\n this.googleMap.fitBoundsElements(markers, circles, polygons, polylines);\r\n };\r\n /* Overlay */\r\n GoogleMaps.prototype.drawOverlay = function (options, polygons) {\r\n return this.googleOverlays.drawOverlay(options, polygons);\r\n };\r\n GoogleMaps.prototype.toggleOverlay = function (overlays, show) {\r\n this.googleOverlays.toggleOverlay(overlays, show);\r\n };\r\n return GoogleMaps;\r\n}());\r\nexports.default = GoogleMaps;\r\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GoogleCircles = /** @class */ (function () {\r\n function GoogleCircles(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GoogleCircles.prototype.drawCircle = function (options, eventClick) {\r\n var self = this;\r\n var latlng = {\r\n lat: options.center[0],\r\n lng: options.center[1]\r\n };\r\n var newOptions = {\r\n center: latlng,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n object: options.object,\r\n radius: options.radius,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity,\r\n strokeWeight: options.weight,\r\n suppressUndo: true\r\n };\r\n var circle = new this.google.maps.Circle(newOptions);\r\n if (eventClick) {\r\n this.google.maps.event.addListener(circle, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n circle.setMap(self.map);\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(circle.getBounds());\r\n }\r\n return circle;\r\n };\r\n GoogleCircles.prototype.toggleCircles = function (circles, show) {\r\n var self = this;\r\n circles.forEach(function (circle) { return circle.setMap(show ? self.map : null); });\r\n };\r\n GoogleCircles.prototype.alterCircleOptions = function (circles, options) {\r\n circles.forEach(function (circle) {\r\n var latlng = options.center && options.center.length > 0 ?\r\n { lat: options.center[0], lng: options.center[1] } : circle.getCenter();\r\n var newOptions = {\r\n center: latlng,\r\n fillColor: options.fillColor ? options.fillColor : circle.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : circle.fillOpacity,\r\n radius: options.radius ? options.radius : circle.radius,\r\n strokeColor: options.color ? options.color : circle.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : circle.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : circle.strokeWeight,\r\n editable: options.editable !== null && options.editable !== undefined ?\r\n options.editable : circle.editable,\r\n draggable: options.draggable !== null && options.draggable !== undefined ?\r\n options.draggable : circle.draggable\r\n };\r\n circle.setOptions(newOptions);\r\n });\r\n };\r\n GoogleCircles.prototype.fitBoundsCircles = function (circles) {\r\n this.map.fitBounds(this.getCirclesBounds(circles));\r\n };\r\n GoogleCircles.prototype.isCircleOnMap = function (circle) {\r\n return !!circle.map;\r\n };\r\n GoogleCircles.prototype.getCircleCenter = function (circle) {\r\n var center = circle.getCenter();\r\n return [center.lat(), center.lng()];\r\n };\r\n GoogleCircles.prototype.getCircleRadius = function (circle) {\r\n return circle.getRadius();\r\n };\r\n GoogleCircles.prototype.addCircleEvent = function (circles, eventType, eventFunction) {\r\n var _this = this;\r\n circles.forEach(function (circle) {\r\n switch (eventType) {\r\n case event_type_1.CircleEventType.Click:\r\n _this.google.maps.event.addListener(circle, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, circle.object);\r\n });\r\n break;\r\n case event_type_1.CircleEventType.CenterChanged:\r\n _this.google.maps.event.addListener(circle, 'center_changed', function () {\r\n var param = new event_return_1.default([circle.getCenter().lat(), circle.getCenter().lng()]);\r\n eventFunction(param, circle.object);\r\n });\r\n case event_type_1.CircleEventType.RadiusChanged:\r\n _this.google.maps.event.addListener(circle, 'radius_changed', function (event) {\r\n var param = new event_return_1.default([circle.getCenter().lat(), circle.getCenter().lng()]);\r\n eventFunction(param, circle.object, circle.getRadius());\r\n });\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GoogleCircles.prototype.removeCircleEvent = function (circles, event) {\r\n var _this = this;\r\n circles.forEach(function (circle) {\r\n switch (event) {\r\n case event_type_1.CircleEventType.Click:\r\n _this.google.maps.event.clearListeners(circle, 'click');\r\n case event_type_1.CircleEventType.CenterChanged:\r\n _this.google.maps.event.clearListeners(circle, 'center_changed');\r\n case event_type_1.CircleEventType.RadiusChanged:\r\n _this.google.maps.event.clearListeners(circle, 'radius_changed');\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GoogleCircles.prototype.getCirclesBounds = function (circles) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n circles.forEach(function (circulo) { return bounds.union(circulo.getBounds()); });\r\n return bounds;\r\n };\r\n return GoogleCircles;\r\n}());\r\nexports.default = GoogleCircles;\r\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GoogleGeoJson = /** @class */ (function () {\r\n function GoogleGeoJson(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GoogleGeoJson.prototype.loadGEOJson = function (data, options, eventClick) {\r\n var self = this;\r\n var objects = self.parseGeoJson(data, options);\r\n objects.forEach(function (elem) {\r\n if (eventClick) {\r\n elem.addListener('click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param);\r\n });\r\n }\r\n elem.setMap(self.map);\r\n });\r\n };\r\n GoogleGeoJson.prototype.parseGeoJson = function (data, options) {\r\n var self = this;\r\n var parsedFeatures = [];\r\n if (Array.isArray(data.features)) {\r\n for (var _i = 0, _a = data.features; _i < _a.length; _i++) {\r\n var feature = _a[_i];\r\n parsedFeatures.push(self.parseGeoJsonToObject(feature, options));\r\n }\r\n }\r\n else {\r\n parsedFeatures.push(self.parseGeoJsonToObject(data, options));\r\n }\r\n return parsedFeatures;\r\n };\r\n GoogleGeoJson.prototype.parseGeoJsonToObject = function (data, objectOptions) {\r\n var geometry = data.geometry;\r\n if (data.properties) {\r\n Object.assign(objectOptions, data.properties);\r\n }\r\n switch (geometry.type) {\r\n case 'Point':\r\n objectOptions.position = {\r\n lat: geometry.coordinates[1],\r\n lng: geometry.coordinates[0]\r\n };\r\n return new this.google.maps.Marker(objectOptions);\r\n case 'Polygon':\r\n objectOptions.paths = [];\r\n geometry.coordinates.forEach(function (polygon) {\r\n return objectOptions.paths.push(polygon.map(function (elem) { return ({\r\n lat: elem[1],\r\n lng: elem[0]\r\n }); }));\r\n });\r\n return new this.google.maps.Polygon(objectOptions);\r\n case 'LineString':\r\n objectOptions.path = geometry.coordinates.map(function (elem) { return ({\r\n lat: elem[1],\r\n lng: elem[0]\r\n }); });\r\n return new this.google.maps.Polyline(objectOptions);\r\n default:\r\n throw new Error('Forma de objeto desconhecida.');\r\n }\r\n };\r\n return GoogleGeoJson;\r\n}());\r\nexports.default = GoogleGeoJson;\r\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GoogleMap = /** @class */ (function () {\r\n function GoogleMap(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GoogleMap.prototype.resizeMap = function () {\r\n google.maps.event.trigger(this.map, 'resize');\r\n };\r\n GoogleMap.prototype.addEventMap = function (eventType, eventFunction) {\r\n var self = this;\r\n switch (eventType) {\r\n case event_type_1.MapEventType.Click:\r\n this.google.maps.event.addListener(self.map, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param);\r\n });\r\n break;\r\n case event_type_1.MapEventType.ZoomChanged:\r\n self.map.addListener('zoom_changed', function () {\r\n var param = new event_return_1.default([self.map.getCenter().lat(), self.map.getCenter().lng()]);\r\n eventFunction(param);\r\n });\r\n default:\r\n break;\r\n }\r\n };\r\n GoogleMap.prototype.removeEventMap = function (eventType) {\r\n var self = this;\r\n switch (eventType) {\r\n case event_type_1.MapEventType.Click:\r\n this.google.maps.event.clearListeners(self.map, 'click');\r\n break;\r\n case event_type_1.MapEventType.ZoomChanged:\r\n this.google.maps.event.clearListeners(self.map, 'zoom_changed');\r\n default:\r\n break;\r\n }\r\n };\r\n GoogleMap.prototype.getZoom = function () {\r\n return this.map.getZoom();\r\n };\r\n GoogleMap.prototype.setZoom = function (zoom) {\r\n return this.map.setZoom(zoom);\r\n };\r\n GoogleMap.prototype.getCenter = function () {\r\n var center = this.map.getCenter();\r\n return [center.lat(), center.lng()];\r\n };\r\n GoogleMap.prototype.setCenter = function (position) {\r\n this.map.setCenter(new google.maps.LatLng(position[0], position[1]));\r\n };\r\n GoogleMap.prototype.pixelsToLatLng = function (offsetx, offsety) {\r\n var scale = Math.pow(2, this.map.getZoom());\r\n var worldCoordinateCenter = this.map.getProjection().fromLatLngToPoint(this.map.getCenter());\r\n var pixelOffset = new google.maps.Point(offsetx / scale || 0, offsety / scale || 0);\r\n var worldCoordinateNewCenter = new google.maps.Point(worldCoordinateCenter.x - pixelOffset.x, worldCoordinateCenter.y + pixelOffset.y);\r\n var latlng = this.map.getProjection().fromPointToLatLng(worldCoordinateNewCenter);\r\n return [latlng.lat(), latlng.lng()];\r\n };\r\n GoogleMap.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {\r\n var bounds = new google.maps.LatLngBounds();\r\n if (markers && markers.length) {\r\n markers.forEach(function (marker) { return bounds.extend(marker.getPosition()); });\r\n this.map.fitBounds(bounds);\r\n }\r\n if (circles && circles.length) {\r\n circles.forEach(function (circle) { return bounds.union(circle.getBounds()); });\r\n this.map.fitBounds(bounds);\r\n }\r\n if (polygons && polygons.length) {\r\n polygons.forEach(function (polygon) { return polygon.getPaths()\r\n .forEach(function (path) { return path.getArray()\r\n .forEach(function (ponto) { return bounds.extend(ponto); }); }); });\r\n this.map.fitBounds(bounds);\r\n }\r\n if (polylines && polylines.length) {\r\n polylines.forEach(function (polyline) { return polyline.getPath()\r\n .forEach(function (path) { return bounds.extend(new google.maps.LatLng(path.lat(), path.lng())); }); });\r\n this.map.fitBounds(bounds);\r\n }\r\n };\r\n return GoogleMap;\r\n}());\r\nexports.default = GoogleMap;\r\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar MarkerClusterer = __webpack_require__(8);\r\nvar GoogleMarkers = /** @class */ (function () {\r\n function GoogleMarkers(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GoogleMarkers.prototype.drawMarker = function (options, eventClick) {\r\n var newOptions = {\r\n draggable: options.draggable,\r\n icon: null,\r\n object: options.object,\r\n position: {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n }\r\n };\r\n if (options.icon) {\r\n newOptions.icon = {\r\n url: options.icon.url\r\n };\r\n if (options.icon.size) {\r\n newOptions.icon.size = new this.google.maps.Size(options.icon.size[0], options.icon.size[1]);\r\n }\r\n }\r\n var marker = new this.google.maps.Marker(newOptions);\r\n if (eventClick) {\r\n this.google.maps.event.addListener(marker, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n marker.setMap(this.map);\r\n }\r\n if (options.fitBounds) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n bounds.extend(marker.getPosition());\r\n this.map.fitBounds(bounds);\r\n }\r\n return marker;\r\n };\r\n GoogleMarkers.prototype.drawCircleMarker = function (options, eventClick) {\r\n var self = this;\r\n var newOptions = {\r\n icon: {\r\n fillColor: options.style.fillColor,\r\n fillOpacity: options.style.fillOpacity,\r\n path: this.google.maps.SymbolPath.CIRCLE,\r\n scale: options.style.radius,\r\n strokeColor: options.style.color,\r\n strokeWeight: options.style.weight\r\n },\r\n object: options.object,\r\n position: {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n }\r\n };\r\n var marker = new this.google.maps.Marker(newOptions);\r\n if (eventClick) {\r\n this.google.maps.event.addListener(marker, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n marker.setMap(self.map);\r\n }\r\n if (options.fitBounds) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n bounds.extend(marker.getPosition());\r\n self.map.fitBounds(bounds);\r\n }\r\n return marker;\r\n };\r\n GoogleMarkers.prototype.toggleMarkers = function (markers, show, markerClusterer) {\r\n var self = this;\r\n markers.forEach(function (marker) {\r\n marker.setMap(show ? self.map : null);\r\n if (markerClusterer) {\r\n if (show) {\r\n self.addMarkerOnClusterer(marker, markerClusterer);\r\n }\r\n else {\r\n self.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n }\r\n });\r\n };\r\n GoogleMarkers.prototype.alterMarkerOptions = function (markers, options) {\r\n var _this = this;\r\n var icon = null;\r\n var position = null;\r\n if (options.latlng) {\r\n position = {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n };\r\n }\r\n if (options.icon) {\r\n icon = options.icon;\r\n if (options.icon.size) {\r\n icon.size = new this.google.maps.Size(options.icon.size[0], options.icon.size[1]);\r\n }\r\n }\r\n markers.forEach(function (marker) {\r\n if (options.style) {\r\n icon = {\r\n fillColor: options.style.fillColor ? options.style.fillColor : marker.icon.fillColor,\r\n fillOpacity: options.style.fillOpacity ? options.style.fillOpacity : marker.icon.fillOpacity,\r\n path: _this.google.maps.SymbolPath.CIRCLE,\r\n scale: options.style.radius ? options.style.radius : marker.icon.scale,\r\n strokeColor: options.style.color ? options.style.color : marker.icon.strokeColor,\r\n strokeWeight: options.style.weight ? options.style.weight : marker.icon.strokeWeight\r\n };\r\n }\r\n var newOptions = null;\r\n if (position && icon) {\r\n newOptions = { icon: icon, position: position };\r\n }\r\n else if (position) {\r\n newOptions = { position: position };\r\n }\r\n else {\r\n newOptions = { icon: icon };\r\n }\r\n marker.setOptions(newOptions);\r\n });\r\n };\r\n GoogleMarkers.prototype.alterMarkerPosition = function (markers, position, addTransition) {\r\n var _this = this;\r\n var newPosition = {\r\n lat: position[0],\r\n lng: position[1]\r\n };\r\n markers.forEach(function (marker) {\r\n if (addTransition) {\r\n _this.moveTransitionMarker(newPosition, marker);\r\n }\r\n else {\r\n marker.setPosition(newPosition);\r\n }\r\n });\r\n };\r\n GoogleMarkers.prototype.fitBoundsPositions = function (markers) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n markers.map(function (marker) { return marker.position; }).forEach(function (position) { return bounds.extend(position); });\r\n this.map.fitBounds(bounds);\r\n };\r\n GoogleMarkers.prototype.isMarkerOnMap = function (marker) {\r\n return !!marker.map;\r\n };\r\n GoogleMarkers.prototype.setCenterMarker = function (marker) {\r\n this.map.setCenter(marker.getPosition());\r\n };\r\n GoogleMarkers.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {\r\n var _this = this;\r\n markers.forEach(function (marker) {\r\n switch (eventType) {\r\n case event_type_1.MarkerEventType.Click:\r\n _this.google.maps.event.addListener(marker, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.RightClick:\r\n _this.google.maps.event.addListener(marker, 'rightclick', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.AfterDrag:\r\n _this.google.maps.event.addListener(marker, 'dragend', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.MouseOver:\r\n _this.google.maps.event.addListener(marker, 'mouseover', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.MouseOut:\r\n _this.google.maps.event.addListener(marker, 'mouseout', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.BeforeDrag:\r\n _this.google.maps.event.addListener(marker, 'dragstart', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GoogleMarkers.prototype.removeMarkerEvent = function (markers, event) {\r\n var _this = this;\r\n markers.forEach(function (marker) {\r\n switch (event) {\r\n case event_type_1.MarkerEventType.Click:\r\n _this.google.maps.event.clearListeners(marker, 'click');\r\n break;\r\n case event_type_1.MarkerEventType.RightClick:\r\n _this.google.maps.event.clearListeners(marker, 'rightclick');\r\n break;\r\n case event_type_1.MarkerEventType.AfterDrag:\r\n _this.google.maps.event.clearListeners(marker, 'dragend');\r\n break;\r\n case event_type_1.MarkerEventType.MouseOver:\r\n _this.google.maps.event.clearListeners(marker, 'mouseover');\r\n break;\r\n case event_type_1.MarkerEventType.MouseOut:\r\n _this.google.maps.event.clearListeners(marker, 'mouseout');\r\n break;\r\n case event_type_1.MarkerEventType.BeforeDrag:\r\n _this.google.maps.event.clearListeners(marker, \"dragstart\");\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n /* Marker Clusterer */\r\n GoogleMarkers.prototype.addMarkerClusterer = function (config) {\r\n return new MarkerClusterer(this.map, [], {\r\n maxZoom: config.clusterMaxZoom,\r\n minimumClusterSize: config.clusterMinSize,\r\n zoomOnClick: config.clusterZoomOnClick\r\n });\r\n };\r\n GoogleMarkers.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {\r\n markerClusterer.setZoomOnClick(config.clusterZoomOnClick);\r\n markerClusterer.setMinimumClusterSize(config.clusterMinSize);\r\n markerClusterer.setMaxZoom(config.clusterMaxZoom);\r\n };\r\n GoogleMarkers.prototype.refreshClusterer = function (markerClusterer) {\r\n markerClusterer.repaint();\r\n };\r\n GoogleMarkers.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {\r\n if (markerClusterer.getMarkers().indexOf(marker) === -1) {\r\n markerClusterer.addMarker(marker, true);\r\n }\r\n };\r\n GoogleMarkers.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {\r\n markerClusterer.removeMarker(marker);\r\n };\r\n GoogleMarkers.prototype.clearMarkersClusterer = function (markerClusterer) {\r\n markerClusterer.clearMarkers();\r\n };\r\n GoogleMarkers.prototype.countMarkersOnCluster = function (markerClusterer) {\r\n return markerClusterer.getMarkers().length;\r\n };\r\n GoogleMarkers.prototype.moveTransitionMarker = function (position, marker) {\r\n var numDeltas = 5;\r\n var reference = {\r\n deltaLat: (position.lat - marker.getPosition().lat()) / numDeltas,\r\n deltaLng: (position.lng - marker.getPosition().lng()) / numDeltas,\r\n i: 0,\r\n position: [marker.getPosition().lat(), marker.getPosition().lng()],\r\n lastPosition: position\r\n };\r\n this.moveMarker(marker, reference, numDeltas);\r\n };\r\n GoogleMarkers.prototype.moveMarker = function (marker, reference, numDeltas) {\r\n var _this = this;\r\n reference.position[0] += reference.deltaLat;\r\n reference.position[1] += reference.deltaLng;\r\n marker.setPosition(new google.maps.LatLng(reference.position[0], reference.position[1]));\r\n if (reference.i < numDeltas) {\r\n reference.i++;\r\n setTimeout(function () { return _this.moveMarker(marker, reference, numDeltas); }, 20);\r\n }\r\n else if (reference.i === numDeltas) {\r\n setTimeout(function () { return marker.setPosition(reference.lastPosition); }, 20);\r\n }\r\n };\r\n return GoogleMarkers;\r\n}());\r\nexports.default = GoogleMarkers;\r\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GoogleOverlays = /** @class */ (function () {\r\n function GoogleOverlays(map, google, googlePolygons) {\r\n this.map = null;\r\n this.google = null;\r\n this.OverlayGoogle = null;\r\n this.map = map;\r\n this.google = google;\r\n this.googlePolygons = googlePolygons;\r\n OverlayGoogle.prototype = new this.google.maps.OverlayView();\r\n function OverlayGoogle(bounds, div, draggable, obj, afterDrag) {\r\n this.bounds_ = bounds;\r\n this.div_ = div;\r\n this.draggable = draggable;\r\n this.afterDragHandler = afterDrag;\r\n this.object = obj;\r\n this.setMap(map);\r\n }\r\n OverlayGoogle.prototype.onAdd = function () {\r\n var that = this;\r\n var panes = this.getPanes();\r\n panes.overlayLayer.appendChild(this.div_);\r\n panes.overlayMouseTarget.appendChild(this.div_);\r\n google.maps.event.addDomListener(this.div_, 'click', function () {\r\n google.maps.event.trigger(this.div_, 'click');\r\n });\r\n if (this.draggable) {\r\n google.maps.event.addDomListener(this.get('map').getDiv(), 'mouseleave', function () {\r\n google.maps.event.trigger(this.div_, 'mouseup');\r\n });\r\n google.maps.event.addDomListener(this.div_, 'mousedown', function (e) {\r\n this.style.cursor = 'move';\r\n that.map.set('draggable', false);\r\n that.set('origin', e);\r\n that.moveHandler = google.maps.event.addDomListener(that.get('map').getDiv(), 'mousemove', function (e) {\r\n var origin = that.get('origin');\r\n var left = origin.clientX - e.clientX;\r\n var top = origin.clientY - e.clientY;\r\n var pos = that.getProjection().fromLatLngToDivPixel(that.bounds_.getCenter());\r\n var latLng = that.getProjection()\r\n .fromDivPixelToLatLng(new google.maps.Point(pos.x - left, pos.y - top));\r\n that.set('origin', e);\r\n that.bounds_ = new google.maps.LatLngBounds();\r\n that.bounds_.extend(latLng);\r\n that.draw();\r\n });\r\n });\r\n google.maps.event.addDomListener(this.div_, 'mouseup', function () {\r\n that.map.set('draggable', true);\r\n this.style.cursor = 'default';\r\n google.maps.event.removeListener(that.moveHandler);\r\n if (that.afterDragHandler) {\r\n var latLng = that.bounds_.getCenter();\r\n var param = new event_return_1.default([latLng.lat(), latLng.lng()]);\r\n that.afterDragHandler(param, that.object);\r\n }\r\n });\r\n }\r\n };\r\n OverlayGoogle.prototype.draw = function () {\r\n var overlayProjection = this.getProjection();\r\n var center = overlayProjection.fromLatLngToDivPixel(this.bounds_.getCenter());\r\n var div = this.div_;\r\n div.style.left = center.x + 'px';\r\n div.style.top = center.y + 'px';\r\n };\r\n OverlayGoogle.prototype.onRemove = function () {\r\n this.div_.parentNode.removeChild(this.div_);\r\n };\r\n this.OverlayGoogle = OverlayGoogle;\r\n }\r\n GoogleOverlays.prototype.drawOverlay = function (options, polygons) {\r\n var bounds = null;\r\n if (polygons && polygons.length > 0) {\r\n bounds = this.googlePolygons.getPolygonsBounds(polygons);\r\n }\r\n else {\r\n bounds = new this.google.maps.LatLngBounds();\r\n bounds.extend(new this.google.maps.LatLng(options.position[0], options.position[1]));\r\n }\r\n var overlay = new this.OverlayGoogle(bounds, options.divElement, options.draggable, options.object, options.afterEventDragHandler);\r\n if (options.addToMap) {\r\n overlay.setMap(this.map);\r\n }\r\n overlay.object = options.object;\r\n return overlay;\r\n };\r\n GoogleOverlays.prototype.toggleOverlay = function (overlays, show) {\r\n var self = this;\r\n overlays.forEach(function (overlay) { return overlay.setMap(show ? self.map : null); });\r\n };\r\n return GoogleOverlays;\r\n}());\r\nexports.default = GoogleOverlays;\r\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GooglePolygons = /** @class */ (function () {\r\n function GooglePolygons(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GooglePolygons.prototype.drawPolygon = function (options, eventClick) {\r\n var self = this;\r\n var paths = this.getPathRecursiveArray(options.path);\r\n paths = this.getPathPolylineArray(paths);\r\n var newOptions = {\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n object: options.object,\r\n paths: paths,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity,\r\n strokeWeight: options.weight,\r\n suppressUndo: true,\r\n zIndex: options.zIndex\r\n };\r\n var polygon = new this.google.maps.Polygon(newOptions);\r\n if (eventClick) {\r\n this.google.maps.event.addListener(polygon, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n polygon.setMap(self.map);\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(self.getPolygonBounds(polygon));\r\n }\r\n return polygon;\r\n };\r\n GooglePolygons.prototype.togglePolygons = function (polygons, show) {\r\n var self = this;\r\n polygons.forEach(function (polygon) { return polygon.setMap(show ? self.map : null); });\r\n };\r\n GooglePolygons.prototype.alterPolygonOptions = function (polygons, options) {\r\n var newOptions = {};\r\n polygons.forEach(function (polygon) {\r\n newOptions = {\r\n editable: options.editable !== null && options.editable !== undefined ?\r\n options.editable : polygon.editable,\r\n fillColor: options.fillColor ? options.fillColor : polygon.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : polygon.fillOpacity,\r\n strokeColor: options.color ? options.color : polygon.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : polygon.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : polygon.strokeWeight,\r\n draggable: options.draggable !== null && options.draggable !== undefined ?\r\n options.draggable : polygon.draggable\r\n };\r\n if (options.path) {\r\n var paths_1 = [];\r\n options.path.forEach(function (path) { return paths_1.push({ lat: path[0], lng: path[1] }); });\r\n polygon.setPath(paths_1);\r\n }\r\n polygon.setOptions(newOptions);\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n });\r\n };\r\n GooglePolygons.prototype.fitBoundsPolygons = function (polygons) {\r\n this.map.fitBounds(this.getPolygonsBounds(polygons));\r\n };\r\n GooglePolygons.prototype.setCenterPolygons = function (polygons) {\r\n this.map.setCenter(this.getPolygonsBounds(polygons).getCenter());\r\n };\r\n GooglePolygons.prototype.isPolygonOnMap = function (polygon) {\r\n return !!polygon.map;\r\n };\r\n GooglePolygons.prototype.getPolygonPath = function (polygon) {\r\n return polygon.getPaths().getArray().map(function (x) { return x.getArray().map(function (y) { return new event_return_1.default([y.lat(), y.lng()]); }); });\r\n };\r\n GooglePolygons.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {\r\n var _this = this;\r\n polygons.forEach(function (polygon) {\r\n switch (eventType) {\r\n case event_type_1.PolygonEventType.SetAt:\r\n _this.addPolygonEventMove(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.InsertAt:\r\n _this.addPolygonEventInsertAt(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.RemoveAt:\r\n _this.addPolygonEventRemoveAt(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.DragPolygon:\r\n _this.addPolygonEventDragPolygon(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.Click:\r\n _this.addPolygonEventClick(polygon, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GooglePolygons.prototype.removePolygonEvent = function (polygons, event) {\r\n var _this = this;\r\n polygons.forEach(function (polygon) {\r\n switch (event) {\r\n case event_type_1.PolygonEventType.SetAt:\r\n _this.google.maps.event.clearListeners(polygon.getPaths(), 'set_at');\r\n break;\r\n case event_type_1.PolygonEventType.InsertAt:\r\n _this.google.maps.event.clearListeners(polygon.getPaths(), 'insert_at');\r\n break;\r\n case event_type_1.PolygonEventType.RemoveAt:\r\n _this.google.maps.event.clearListeners(polygon.getPaths(), 'remove_at');\r\n break;\r\n case event_type_1.PolygonEventType.DragPolygon:\r\n _this.google.maps.event.clearListeners(polygon, 'dragstart');\r\n _this.google.maps.event.clearListeners(polygon, 'dragend');\r\n break;\r\n case event_type_1.PolygonEventType.Click:\r\n _this.google.maps.event.clearListeners(polygon, 'click');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GooglePolygons.prototype.getPolygonsBounds = function (polygons) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n polygons.forEach(function (polygon) {\r\n var paths = polygon.getPaths().getArray();\r\n paths.forEach(function (path) { return path.getArray().forEach(function (x) { return bounds.extend(x); }); });\r\n });\r\n return bounds;\r\n };\r\n GooglePolygons.prototype.getPolygonBounds = function (polygon) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n var paths = polygon.getPaths().getArray();\r\n paths.forEach(function (path) { return path.getArray().forEach(function (x) { return bounds.extend(x); }); });\r\n return bounds;\r\n };\r\n GooglePolygons.prototype.addPolygonEventMove = function (polygon, eventFunction) {\r\n var polygonPathIdx = polygon.getPaths().getLength();\r\n for (var index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventMoveAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction);\r\n }\r\n };\r\n GooglePolygons.prototype.addPolygonEventMoveAllPaths = function (polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'set_at', function (newEvent, lastEvent) {\r\n if (polygon.dragging)\r\n return;\r\n var path = innerPolygon.getAt(newEvent);\r\n var newPosition = new event_return_1.default([path.lat(), path.lng()]);\r\n var lastPosition = new event_return_1.default([lastEvent.lat(), lastEvent.lng()]);\r\n eventFunction(newPosition, lastPosition, polygon.object, newEvent, polygon.getPaths().getArray().map(function (x) { return x.getArray().map(function (y) { return new event_return_1.default([y.lat(), y.lng()]); }); }));\r\n });\r\n };\r\n GooglePolygons.prototype.addPolygonEventInsertAt = function (polygon, eventFunction) {\r\n var polygonPathIdx = polygon.getPaths().getLength();\r\n for (var index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventInsertAtAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction);\r\n }\r\n };\r\n GooglePolygons.prototype.addPolygonEventInsertAtAllPaths = function (polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'insert_at', function (event) {\r\n var newPath = innerPolygon.getAt(event);\r\n var newPoint = new event_return_1.default([newPath.lat(), newPath.lng()]);\r\n var previousPath = innerPolygon.getAt(event - 1);\r\n var previousPoint = previousPath ? new event_return_1.default([previousPath.lat(), previousPath.lng()]) : null;\r\n eventFunction(newPoint, previousPoint, polygon.object, event, polygon.getPaths().getArray().map(function (x) { return x.getArray().map(function (y) { return new event_return_1.default([y.lat(), y.lng()]); }); }));\r\n });\r\n };\r\n GooglePolygons.prototype.addPolygonEventRemoveAt = function (polygon, eventFunction) {\r\n var polygonPathIdx = polygon.getPaths().getLength();\r\n for (var index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventRemoveAtAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction);\r\n }\r\n };\r\n GooglePolygons.prototype.addPolygonEventRemoveAtAllPaths = function (polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'remove_at', function (event) {\r\n var param = new event_return_1.default([innerPolygon.getAt(event).lat(), innerPolygon.getAt(event).lng()]);\r\n eventFunction(param, polygon.getPaths().getArray().map(function (x) { return x.getArray().map(function (y) { return new event_return_1.default([y.lat(), y.lng()]); }); }), polygon.object);\r\n });\r\n };\r\n GooglePolygons.prototype.addPolygonEventDragPolygon = function (polygon, eventFunction) {\r\n this.google.maps.event.addListener(polygon, 'dragstart', function (event) {\r\n polygon.dragging = true;\r\n });\r\n this.google.maps.event.addListener(polygon, 'dragend', function (event) {\r\n polygon.dragging = false;\r\n eventFunction(polygon.getPaths().getArray().map(function (x) { return x.getArray().map(function (y) { return new event_return_1.default([y.lat(), y.lng()]); }); }), polygon.object);\r\n });\r\n };\r\n GooglePolygons.prototype.addPolygonEventClick = function (polygon, eventFunction) {\r\n this.google.maps.event.addListener(polygon, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, polygon.object);\r\n });\r\n };\r\n GooglePolygons.prototype.getPathRecursiveArray = function (path) {\r\n var _this = this;\r\n if (Array.isArray(path) && typeof path[0] !== 'number') {\r\n return path.map(function (x) { return _this.getPathRecursiveArray(x); });\r\n }\r\n else\r\n return { lat: path[0], lng: path[1] };\r\n };\r\n GooglePolygons.prototype.getPathPolylineArray = function (path) {\r\n if (typeof path[0].lat === 'number') {\r\n return path;\r\n }\r\n else if (typeof path[0][0].lat !== 'number') {\r\n path = path[0];\r\n return this.getPathPolylineArray(path);\r\n }\r\n else\r\n return path;\r\n };\r\n return GooglePolygons;\r\n}());\r\nexports.default = GooglePolygons;\r\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar polyline_type_1 = __webpack_require__(3);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar GooglePolylines = /** @class */ (function () {\r\n function GooglePolylines(map, google, googlePopups) {\r\n this.map = null;\r\n this.google = null;\r\n this.selectedPolyline = null;\r\n this.selectedPath = null;\r\n this.navigateInfoWindow = null;\r\n this.directionForward = false;\r\n this.multiSelectionForward = false;\r\n this.multiSelection = false;\r\n this.map = map;\r\n this.google = google;\r\n this.googlePopups = googlePopups;\r\n }\r\n GooglePolylines.prototype.drawPolyline = function (options, eventClick) {\r\n var self = this;\r\n var newOptions = {\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n icons: null,\r\n infowindows: options.infowindows,\r\n object: options.object,\r\n path: null,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity || 1,\r\n strokeWeight: options.weight,\r\n suppressUndo: true,\r\n zIndex: options.zIndex\r\n };\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1,\r\n strokeWeight: options.weight\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case polyline_type_1.PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scaledSize: new google.maps.Size(20, 20),\r\n size: new google.maps.Size(20, 20)\r\n },\r\n offset: '100%',\r\n repeat: '100px'\r\n },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '0%' },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '100%' }];\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n newOptions.path = options.path ? options.path.map(function (x) {\r\n return {\r\n lat: x[0],\r\n lng: x[1]\r\n };\r\n }) : [];\r\n var polyline = new this.google.maps.Polyline(newOptions);\r\n if (eventClick) {\r\n this.google.maps.event.addListener(polyline, 'click', function (event) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, polyline.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n polyline.setMap(self.map);\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(self.getPolylineBounds(polyline));\r\n }\r\n return polyline;\r\n };\r\n GooglePolylines.prototype.drawPolylineWithNavigation = function (options, eventClick) {\r\n var polyline = this.drawPolyline(options, null);\r\n polyline.navigationHandlerClick = eventClick;\r\n this.navigationOptions = options.navigateOptions;\r\n this.navigateByPoint = this.navigationOptions ? this.navigationOptions.navigateByPoint : true;\r\n this.addNavigation(polyline);\r\n return polyline;\r\n };\r\n GooglePolylines.prototype.togglePolylines = function (polylines, show) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) {\r\n var self = _this;\r\n polyline.setMap(show ? self.map : null);\r\n });\r\n };\r\n GooglePolylines.prototype.alterPolylineOptions = function (polylines, options) {\r\n polylines.forEach(function (polyline) {\r\n var newOptions = {\r\n draggable: options.draggable ? options.draggable : polyline.draggable,\r\n editable: options.editable ? options.editable : polyline.editable,\r\n infowindows: options.infowindows ? options.infowindows : polyline.infowindows,\r\n object: options.object ? options.object : polyline.object,\r\n strokeColor: options.color ? options.color : polyline.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : polyline.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : polyline.strokeWeight,\r\n zIndex: options.zIndex ? options.zIndex : polyline.zIndex\r\n };\r\n if (options.path) {\r\n polyline.setPath(options.path.map(function (x) { return new google.maps.LatLng(x[0], x[1]); }));\r\n }\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case polyline_type_1.PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scaledSize: new google.maps.Size(20, 20),\r\n size: new google.maps.Size(20, 20)\r\n },\r\n offset: '90%',\r\n repeat: '20%'\r\n },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '0%' },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '100%' }];\r\n break;\r\n default:\r\n newOptions.icons = null;\r\n break;\r\n }\r\n polyline.setOptions(newOptions);\r\n });\r\n };\r\n GooglePolylines.prototype.fitBoundsPolylines = function (polylines) {\r\n var self = this;\r\n self.map.fitBounds(self.getPolylinesBounds(polylines));\r\n };\r\n GooglePolylines.prototype.isPolylineOnMap = function (polyline) {\r\n return !!polyline.map;\r\n };\r\n GooglePolylines.prototype.addPolylinePath = function (polylines, position) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) {\r\n var path = polyline.getPath();\r\n path.push(new _this.google.maps.LatLng(position[0], position[1]));\r\n polyline.setPath(path);\r\n });\r\n };\r\n GooglePolylines.prototype.getPolylinePath = function (polyline) {\r\n return polyline.getPath().getArray().map(function (x) { return [x.lat(), x.lng()]; });\r\n };\r\n GooglePolylines.prototype.removePolylineHighlight = function () {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n if (this.selectedPath) {\r\n this.selectedPath.setMap(null);\r\n this.selectedPath = null;\r\n }\r\n if (this.navigateInfoWindow) {\r\n this.navigateInfoWindow.close();\r\n }\r\n };\r\n GooglePolylines.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) {\r\n switch (eventType) {\r\n case event_type_1.PolylineEventType.SetAt:\r\n _this.addPolylineEventMove(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.InsertAt:\r\n _this.addPolylineEventInsertAt(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.RemoveAt:\r\n _this.addPolylineEventRemoveAt(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.DragPolyline:\r\n _this.addPolylineEventDragPolyline(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.MouseOver:\r\n _this.addPolylineEventMouseOver(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.MouseOut:\r\n _this.addPolylineEventMouseOut(polyline, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GooglePolylines.prototype.removePolylineEvent = function (polylines, event) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) { return _this.google.maps.event.clearListeners(polyline, 'click'); });\r\n polylines.forEach(function (polyline) {\r\n switch (event) {\r\n case event_type_1.PolylineEventType.SetAt:\r\n _this.google.maps.event.clearListeners(polyline.getPath(), 'set_at');\r\n break;\r\n case event_type_1.PolylineEventType.InsertAt:\r\n _this.google.maps.event.clearListeners(polyline.getPath(), 'insert_at');\r\n break;\r\n case event_type_1.PolylineEventType.RemoveAt:\r\n _this.google.maps.event.clearListeners(polyline.getPath(), 'remove_at');\r\n break;\r\n case event_type_1.PolylineEventType.DragPolyline:\r\n _this.google.maps.event.clearListeners(polyline, 'dragstart');\r\n _this.google.maps.event.clearListeners(polyline, 'dragend');\r\n break;\r\n case event_type_1.PolylineEventType.MouseOver:\r\n _this.google.maps.event.clearListeners(polyline, 'mouseover');\r\n break;\r\n case event_type_1.PolylineEventType.MouseOut:\r\n _this.google.maps.event.clearListeners(polyline, 'mouseout');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n GooglePolylines.prototype.setIndexPolylineHighlight = function (polyline, index) {\r\n this.directionForward = false;\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n this.google.maps.event.addDomListener(document, 'keydown', this.onKeyUp.bind(this));\r\n }\r\n else {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.addDomListener(document, 'keyup', this.onKeyUp.bind(this));\r\n }\r\n };\r\n GooglePolylines.prototype.getObjectPolyline = function (polyline) {\r\n return polyline.object;\r\n };\r\n GooglePolylines.prototype.getObjectPolylineHighlight = function () {\r\n if (this.selectedPath) {\r\n return this.selectedPath.object;\r\n }\r\n return null;\r\n };\r\n GooglePolylines.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {\r\n if (this.selectedPath) {\r\n this.addPolylineEvent([this.selectedPath], eventType, eventFunction);\r\n }\r\n };\r\n GooglePolylines.prototype.getPolylineHighlightIndex = function () {\r\n if (this.selectedPath) {\r\n return [this.selectedPath.initialIdx, this.selectedPath.finalIdx];\r\n }\r\n return null;\r\n };\r\n /* Private methods */\r\n GooglePolylines.prototype.addNavigation = function (polyline) {\r\n var self = this;\r\n this.google.maps.event.clearListeners(polyline, 'click');\r\n this.google.maps.event.addListener(polyline, 'click', self.onClickPolyline.bind(self, polyline));\r\n };\r\n GooglePolylines.prototype.onClickPolyline = function (polyline, event) {\r\n var index = this.checkIdx(polyline, event.latLng);\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n this.google.maps.event.addDomListener(document, 'keydown', this.onKeyUp.bind(this));\r\n }\r\n else {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.addDomListener(document, 'keyup', this.onKeyUp.bind(this));\r\n }\r\n if (polyline.navigationHandlerClick) {\r\n var param = new event_return_1.default([event.latLng.lat(), event.latLng.lng()]);\r\n polyline.navigationHandlerClick(param, polyline.object);\r\n }\r\n };\r\n GooglePolylines.prototype.onKeyUp = function (event) {\r\n var self = this;\r\n if (self.selectedPath) {\r\n switch (event.which ? event.which : event.keyCode) {\r\n case 38:\r\n case 39:\r\n // up arrow or right arrow\r\n self.moveForwards(event.shiftKey);\r\n break;\r\n case 37:\r\n case 40:\r\n // left arrow or down arrow\r\n self.moveBackwards(event.shiftKey);\r\n break;\r\n }\r\n }\r\n };\r\n GooglePolylines.prototype.moveForwards = function (multiSelection) {\r\n var self = this;\r\n var polyline = self.selectedPolyline;\r\n if ((!self.navigateByPoint || self.directionForward) &&\r\n polyline.finalIdx < polyline.getPath().getArray().length - 1) {\r\n self.navigateForward(multiSelection, polyline);\r\n }\r\n self.directionForward = true;\r\n self.moveSelectedPath(polyline, null);\r\n };\r\n GooglePolylines.prototype.navigateForward = function (multiSelection, polyline) {\r\n var self = this;\r\n if (!multiSelection) {\r\n polyline.finalIdx++;\r\n polyline.initialIdx = self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n }\r\n else {\r\n self.multiSelection = true;\r\n if (self.multiSelectionForward) {\r\n polyline.finalIdx++;\r\n }\r\n self.multiSelectionForward = true;\r\n }\r\n };\r\n GooglePolylines.prototype.moveBackwards = function (multiSelection) {\r\n var self = this;\r\n var polyline = self.selectedPolyline;\r\n if ((!self.navigateByPoint || !self.directionForward) && polyline.initialIdx > 0) {\r\n self.navigateBackward(multiSelection, polyline);\r\n }\r\n self.directionForward = false;\r\n self.moveSelectedPath(polyline, null);\r\n };\r\n GooglePolylines.prototype.navigateBackward = function (multiSelection, polyline) {\r\n var self = this;\r\n if (!multiSelection) {\r\n polyline.initialIdx--;\r\n polyline.finalIdx = !self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n }\r\n else {\r\n self.multiSelection = true;\r\n if (!self.multiSelectionForward) {\r\n polyline.initialIdx--;\r\n }\r\n self.multiSelectionForward = false;\r\n }\r\n };\r\n GooglePolylines.prototype.moveSelectedPath = function (polyline, options) {\r\n var pathSelected = polyline.getPath().getArray().slice(polyline.initialIdx, polyline.finalIdx + 1);\r\n if (this.selectedPath) {\r\n this.selectedPath.setPath(pathSelected);\r\n this.selectedPath.object = polyline.object;\r\n this.updateSelectedPathListeners();\r\n }\r\n else {\r\n var newOptions = {\r\n editable: options.editable,\r\n keyboardShortcuts: false,\r\n map: this.map,\r\n object: polyline.object,\r\n path: pathSelected,\r\n strokeColor: options && options.color || '#FF0000',\r\n strokeOpacity: options && options.opacity || 1,\r\n strokeWeight: options && options.weight || 10,\r\n zIndex: 9999\r\n };\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case polyline_type_1.PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n anchor: new google.maps.Point(0, 2),\r\n fillColor: '#000',\r\n fillOpacity: 0.7,\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scale: 4,\r\n strokeColor: '#000',\r\n strokeWeight: 5,\r\n },\r\n offset: '100%'\r\n }];\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n this.selectedPath = new this.google.maps.Polyline(newOptions);\r\n }\r\n this.selectedPath.initialIdx = polyline.initialIdx;\r\n this.selectedPath.finalIdx = polyline.finalIdx;\r\n this.drawPopupNavigation(polyline);\r\n };\r\n GooglePolylines.prototype.addPolylineEventMove = function (polyline, eventFunction) {\r\n polyline.moveListener = function (newEvent, lastEvent) {\r\n if (polyline.dragging)\r\n return;\r\n var path = polyline.getPath().getAt(newEvent);\r\n var newPosition = new event_return_1.default([path.lat(), path.lng()]);\r\n var lastPosition = new event_return_1.default([lastEvent.lat(), lastEvent.lng()]);\r\n eventFunction(newPosition, lastPosition, polyline.object, newEvent, polyline.getPath().getArray().map(function (x) { return new event_return_1.default([x.lat(), x.lng()]); }));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'set_at', polyline.moveListener);\r\n };\r\n GooglePolylines.prototype.addPolylineEventInsertAt = function (polyline, eventFunction) {\r\n polyline.insertAtListener = function (event) {\r\n var path = polyline.getPath();\r\n var newPath = path.getAt(event);\r\n var newPoint = new event_return_1.default([newPath.lat(), newPath.lng()]);\r\n var previousPath = path.getAt(event - 1);\r\n var previousPoint = previousPath ? new event_return_1.default([previousPath.lat(), previousPath.lng()]) : null;\r\n eventFunction(newPoint, previousPoint, polyline.object, event, polyline.getPath().getArray().map(function (x) { return new event_return_1.default([x.lat(), x.lng()]); }));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'insert_at', polyline.insertAtListener);\r\n };\r\n GooglePolylines.prototype.addPolylineEventRemoveAt = function (polyline, eventFunction) {\r\n polyline.removeAtListener = function (event) {\r\n var param = new event_return_1.default([polyline.getPath().getAt(event).lat(), polyline.getPath().getAt(event).lng()]);\r\n eventFunction(param, polyline.object, polyline.getPath().getArray().map(function (x) { return new event_return_1.default([x.lat(), x.lng()]); }));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'remove_at', polyline.removeAtListener);\r\n };\r\n GooglePolylines.prototype.addPolylineEventMouseOver = function (polyline, eventFunction) {\r\n polyline.overPolylineListener = function () {\r\n polyline.dragging = false;\r\n var param = polyline.getPath().getArray().map(function (x) { return new event_return_1.default([x.lat(), x.lng()]); });\r\n eventFunction(param, polyline.object);\r\n };\r\n this.google.maps.event.addListener(polyline, 'mouseover', polyline.overPolylineListener);\r\n };\r\n GooglePolylines.prototype.addPolylineEventMouseOut = function (polyline, eventFunction) {\r\n polyline.outPolylineListener = function () {\r\n polyline.dragging = false;\r\n var param = polyline.getPath().getArray().map(function (x) { return new event_return_1.default([x.lat(), x.lng()]); });\r\n eventFunction(param, polyline.object);\r\n };\r\n this.google.maps.event.addListener(polyline, 'mouseout', polyline.outPolylineListener);\r\n };\r\n GooglePolylines.prototype.addPolylineEventDragPolyline = function (polyline, eventFunction) {\r\n polyline.dragPolylineListener = function () {\r\n polyline.dragging = false;\r\n var param = polyline.getPath().getArray().map(function (x) { return new event_return_1.default([x.lat(), x.lng()]); });\r\n eventFunction(param, polyline.object);\r\n };\r\n this.google.maps.event.addListener(polyline, 'dragend', polyline.dragPolylineListener);\r\n this.google.maps.event.addListener(polyline, 'dragstart', function () { return polyline.dragging = true; });\r\n };\r\n GooglePolylines.prototype.updateSelectedPathListeners = function () {\r\n if (this.selectedPath.moveListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'set_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'set_at', this.selectedPath.moveListener);\r\n }\r\n if (this.selectedPath.insertAtListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'insert_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'insert_at', this.selectedPath.insertAtListener);\r\n }\r\n if (this.selectedPath.removeAtListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'remove_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'remove_at', this.selectedPath.removeAtListener);\r\n }\r\n };\r\n GooglePolylines.prototype.drawPopupNavigation = function (polyline) {\r\n var self = this;\r\n var idx = self.directionForward ? polyline.finalIdx : polyline.initialIdx;\r\n if (!self.navigateByPoint) {\r\n idx = polyline.finalIdx > polyline.initialIdx ? polyline.finalIdx : polyline.initialIdx;\r\n }\r\n var infowindow = polyline.infowindows ? polyline.infowindows[idx] : null;\r\n if (infowindow) {\r\n var point = polyline.getPath().getArray()[idx];\r\n if (self.navigateInfoWindow) {\r\n this.googlePopups.alterPopup(self.navigateInfoWindow, {\r\n content: infowindow,\r\n latlng: [point.lat(), point.lng()]\r\n });\r\n }\r\n else {\r\n self.navigateInfoWindow = this.googlePopups.drawPopup({\r\n content: infowindow,\r\n latlng: [point.lat(), point.lng()]\r\n });\r\n }\r\n }\r\n };\r\n GooglePolylines.prototype.checkIdx = function (polyline, point) {\r\n var self = this;\r\n var path = polyline.getPath();\r\n var distance = 0;\r\n var minDistance = Number.MAX_VALUE;\r\n var returnValue = -1;\r\n for (var i = 0; i < path.length - 1; i++) {\r\n distance = self.distanceToLine(path.getAt(i), path.getAt(i + 1), point);\r\n if (distance < minDistance) {\r\n minDistance = distance;\r\n returnValue = i;\r\n }\r\n }\r\n return returnValue;\r\n };\r\n GooglePolylines.prototype.distanceToLine = function (pt1, pt2, pt) {\r\n var self = this;\r\n var deltaX = pt2.lng() - pt1.lng();\r\n var deltaY = pt2.lat() - pt1.lat();\r\n var incIntersect = (pt.lng() - pt1.lng()) * deltaX;\r\n var deltaSum = (deltaX * deltaX) + (deltaY * deltaY);\r\n incIntersect += (pt.lat() - pt1.lat()) * deltaY;\r\n if (deltaSum > 0) {\r\n incIntersect /= deltaSum;\r\n }\r\n else {\r\n incIntersect = -1;\r\n }\r\n // The intersection occurs outside the line segment, 'before' pt1.\r\n if (incIntersect < 0) {\r\n return self.kmTo(pt, pt1);\r\n }\r\n else if (incIntersect > 1) {\r\n return self.kmTo(pt, pt2);\r\n }\r\n // Intersection point calculation.\r\n var intersect = new this.google.maps\r\n .LatLng(pt1.lat() + incIntersect * deltaY, pt1.lng() + incIntersect * deltaX);\r\n return self.kmTo(pt, intersect);\r\n };\r\n GooglePolylines.prototype.kmTo = function (pt1, pt2) {\r\n var e = Math;\r\n var ra = e.PI / 180;\r\n var b = pt1.lat() * ra;\r\n var c = pt2.lat() * ra;\r\n var d = b - c;\r\n var g = pt1.lng() * ra - pt2.lng() * ra;\r\n var f = 2 * e.asin(e.sqrt(e.pow(e.sin(d / 2), 2) + e.cos(b) * e.cos(c) * e.pow(e.sin(g / 2), 2)));\r\n return f * 6378.137 * 1000;\r\n };\r\n GooglePolylines.prototype.getPolylinesBounds = function (polylines) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n polylines.forEach(function (polyline) {\r\n var paths = polyline.getPath().getArray();\r\n paths.forEach(function (path) { return bounds.extend(path); });\r\n });\r\n return bounds;\r\n };\r\n GooglePolylines.prototype.getPolylineBounds = function (polyline) {\r\n var bounds = new this.google.maps.LatLngBounds();\r\n var paths = polyline.getPath().getArray();\r\n paths.forEach(function (path) { return bounds.extend(path); });\r\n return bounds;\r\n };\r\n return GooglePolylines;\r\n}());\r\nexports.default = GooglePolylines;\r\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar GooglePopups = /** @class */ (function () {\r\n function GooglePopups(map, google) {\r\n this.map = null;\r\n this.google = null;\r\n this.map = map;\r\n this.google = google;\r\n }\r\n GooglePopups.prototype.drawPopup = function (options, marker) {\r\n var self = this;\r\n var infowindow = new this.google.maps.InfoWindow({\r\n content: options.content\r\n });\r\n if (options.latlng) {\r\n infowindow.setPosition({\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n });\r\n }\r\n infowindow.open(self.map, marker || null);\r\n if (options.object) {\r\n infowindow.object = options.object;\r\n }\r\n return infowindow;\r\n };\r\n GooglePopups.prototype.alterPopup = function (popup, options, marker) {\r\n var self = this;\r\n self.alterPopupContent(popup, options, marker);\r\n if (!popup.getMap()) {\r\n popup.open(self.map, marker || null);\r\n }\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n return popup;\r\n };\r\n GooglePopups.prototype.alterPopupContent = function (popup, options, marker) {\r\n if (options.content) {\r\n popup.setContent(options.content);\r\n }\r\n if (options.latlng) {\r\n popup.setPosition({\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n });\r\n }\r\n else if (marker) {\r\n popup.setPosition(marker.getPosition());\r\n }\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n };\r\n GooglePopups.prototype.closePopup = function (popup) {\r\n popup.close();\r\n };\r\n return GooglePopups;\r\n}());\r\nexports.default = GooglePopups;\r\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar maps_api_loader_service_1 = __webpack_require__(6);\r\nvar leaflet_circle_1 = __webpack_require__(20);\r\nvar leaflet_geojson_1 = __webpack_require__(21);\r\nvar leaflet_map_1 = __webpack_require__(22);\r\nvar leaflet_markers_1 = __webpack_require__(23);\r\nvar leaflet_overlay_1 = __webpack_require__(24);\r\nvar leaflet_polygons_1 = __webpack_require__(25);\r\nvar leaflet_polylines_1 = __webpack_require__(26);\r\nvar leaflet_popup_1 = __webpack_require__(27);\r\nvar Leaflet = /** @class */ (function () {\r\n function Leaflet() {\r\n this.mapsApiLoader = new maps_api_loader_service_1.MapsApiLoaderService();\r\n }\r\n Leaflet.prototype.initialize = function (mapType, params, elementId) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var api, leaflet_1, mapOptions, osm, wikimedia, satelliteURL, satellite, map, baseLayers_1, err_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 4, , 5]);\r\n return [4 /*yield*/, this.mapsApiLoader.loadApi(mapType, params)];\r\n case 1:\r\n api = _a.sent();\r\n leaflet_1 = api;\r\n this.loadDependencies(params);\r\n return [4 /*yield*/, this.mapTimeout(1000)];\r\n case 2:\r\n _a.sent();\r\n mapOptions = {\r\n center: new leaflet_1.LatLng(-14, -54),\r\n editable: true,\r\n keyboard: false,\r\n maxZoom: params.wikimedia ? 18 : 19,\r\n minZoom: 4,\r\n zoom: 4,\r\n zoomControl: false\r\n };\r\n if (params.gestureHandling) {\r\n mapOptions.gestureHandling = true;\r\n }\r\n return [4 /*yield*/, this.mapTimeout(200)];\r\n case 3:\r\n _a.sent();\r\n osm = new leaflet_1.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', mapOptions);\r\n wikimedia = new leaflet_1.tileLayer('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', {\r\n attribution: '<a href=\"https://wikimediafoundation.org/wiki/Maps_Terms_of_Use\">Wikimedia</a>'\r\n });\r\n satelliteURL = 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\r\n 'World_Imagery/MapServer/tile/{z}/{y}/{x}';\r\n satellite = L.tileLayer(satelliteURL, {\r\n attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye,' +\r\n ' Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',\r\n maxZoom: 18\r\n });\r\n mapOptions.layers = [params.wikimedia ? wikimedia : osm];\r\n map = new leaflet_1.Map(elementId, mapOptions);\r\n baseLayers_1 = {\r\n Map: params.wikimedia ? wikimedia : osm,\r\n Satellite: satellite\r\n };\r\n if (params.mapTiles && params.mapTiles.length) {\r\n params.mapTiles.forEach(function (tile) {\r\n var layer = new leaflet_1.tileLayer(tile.url, tile.options);\r\n baseLayers_1[tile.name] = layer;\r\n });\r\n }\r\n leaflet_1.control.layers(baseLayers_1, null, { position: 'topleft' }).addTo(map);\r\n leaflet_1.control.zoom({ position: 'bottomright' }).addTo(map);\r\n this.leafletMarkers = new leaflet_markers_1.default(map, leaflet_1);\r\n this.leafletPolygons = new leaflet_polygons_1.default(map, leaflet_1);\r\n this.leafletCircles = new leaflet_circle_1.default(map, leaflet_1);\r\n this.leafletPopups = new leaflet_popup_1.default(map, leaflet_1);\r\n this.leafletPolylines = new leaflet_polylines_1.default(map, leaflet_1, this.leafletPopups);\r\n this.leafletMap = new leaflet_map_1.default(map, leaflet_1);\r\n this.leafletOverlays = new leaflet_overlay_1.default(map, leaflet_1, this.leafletPolygons);\r\n this.leafletGeoJson = new leaflet_geojson_1.default(map, leaflet_1);\r\n return [2 /*return*/, this];\r\n case 4:\r\n err_1 = _a.sent();\r\n console.error(err_1);\r\n return [2 /*return*/, err_1];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /* GEOJson */\r\n Leaflet.prototype.loadGEOJson = function (data, options, eventClick) {\r\n this.leafletGeoJson.loadGEOJson(data, options, eventClick);\r\n };\r\n /* Markers */\r\n Leaflet.prototype.drawMarker = function (options, eventClick) {\r\n return this.leafletMarkers.drawMarker(options, eventClick);\r\n };\r\n Leaflet.prototype.drawCircleMarker = function (options, eventClick) {\r\n return this.leafletMarkers.drawCircleMarker(options, eventClick);\r\n };\r\n Leaflet.prototype.toggleMarkers = function (markers, show, markerClusterer) {\r\n this.leafletMarkers.toggleMarkers(markers, show, markerClusterer);\r\n };\r\n Leaflet.prototype.alterMarkerOptions = function (markers, options) {\r\n this.leafletMarkers.alterMarkerOptions(markers, options);\r\n };\r\n Leaflet.prototype.alterMarkerPosition = function (markers, position, addTransition) {\r\n this.leafletMarkers.alterMarkerPosition(markers, position, addTransition);\r\n };\r\n Leaflet.prototype.fitBoundsPositions = function (markers) {\r\n this.leafletMarkers.fitBoundsPositions(markers);\r\n };\r\n Leaflet.prototype.isMarkerOnMap = function (marker) {\r\n return this.leafletMarkers.isMarkerOnMap(marker);\r\n };\r\n Leaflet.prototype.setCenterMarker = function (marker) {\r\n this.leafletMarkers.setCenterMarker(marker);\r\n };\r\n Leaflet.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {\r\n this.leafletMarkers.addMarkerEvent(markers, eventType, eventFunction);\r\n };\r\n Leaflet.prototype.removeMarkerEvent = function (markers, event) {\r\n this.leafletMarkers.removeMarkerEvent(markers, event);\r\n };\r\n /* Marker Clusterer */\r\n Leaflet.prototype.addMarkerClusterer = function (config) {\r\n return this.leafletMarkers.addMarkerClusterer(config);\r\n };\r\n Leaflet.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {\r\n this.leafletMarkers.alterMarkerClustererConfig(markerClusterer, config);\r\n };\r\n Leaflet.prototype.refreshClusterer = function (markerClusterer) {\r\n this.leafletMarkers.refreshClusterer(markerClusterer);\r\n };\r\n Leaflet.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {\r\n this.leafletMarkers.addMarkerOnClusterer(marker, markerClusterer);\r\n };\r\n Leaflet.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {\r\n this.leafletMarkers.removeMarkerFromClusterer(marker, markerClusterer);\r\n };\r\n Leaflet.prototype.clearMarkersClusterer = function (markerClusterer) {\r\n this.leafletMarkers.clearMarkersClusterer(markerClusterer);\r\n };\r\n Leaflet.prototype.countMarkersOnCluster = function (markerClusterer) {\r\n return this.leafletMarkers.countMarkersOnCluster(markerClusterer);\r\n };\r\n /* Polygons */\r\n Leaflet.prototype.drawPolygon = function (options, eventClick) {\r\n return this.leafletPolygons.drawPolygon(options, eventClick);\r\n };\r\n Leaflet.prototype.togglePolygons = function (polygons, show) {\r\n this.leafletPolygons.togglePolygons(polygons, show);\r\n };\r\n Leaflet.prototype.alterPolygonOptions = function (polygons, options) {\r\n this.leafletPolygons.alterPolygonOptions(polygons, options);\r\n };\r\n Leaflet.prototype.fitBoundsPolygons = function (polygons) {\r\n this.leafletPolygons.fitBoundsPolygons(polygons);\r\n };\r\n Leaflet.prototype.setCenterPolygons = function (polygons) {\r\n this.leafletPolygons.setCenterPolygons(polygons);\r\n };\r\n Leaflet.prototype.isPolygonOnMap = function (polygon) {\r\n return this.leafletPolygons.isPolygonOnMap(polygon);\r\n };\r\n Leaflet.prototype.getPolygonPath = function (polygon) {\r\n return this.leafletPolygons.getPolygonPath(polygon);\r\n };\r\n Leaflet.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {\r\n this.leafletPolygons.addPolygonEvent(polygons, eventType, eventFunction);\r\n };\r\n Leaflet.prototype.removePolygonEvent = function (polygons, event) {\r\n this.leafletPolygons.removePolygonEvent(polygons, event);\r\n };\r\n /* Circles */\r\n Leaflet.prototype.drawCircle = function (options, eventClick) {\r\n return this.leafletCircles.drawCircle(options, eventClick);\r\n };\r\n Leaflet.prototype.toggleCircles = function (circles, show) {\r\n this.leafletCircles.toggleCircles(circles, show);\r\n };\r\n Leaflet.prototype.alterCircleOptions = function (circles, options) {\r\n this.leafletCircles.alterCircleOptions(circles, options);\r\n };\r\n Leaflet.prototype.fitBoundsCircles = function (circles) {\r\n this.leafletCircles.fitBoundsCircles(circles);\r\n };\r\n Leaflet.prototype.isCircleOnMap = function (circle) {\r\n return this.leafletCircles.isCircleOnMap(circle);\r\n };\r\n Leaflet.prototype.getCircleCenter = function (circle) {\r\n return this.leafletCircles.getCircleCenter(circle);\r\n };\r\n Leaflet.prototype.getCircleRadius = function (circle) {\r\n return this.leafletCircles.getCircleRadius(circle);\r\n };\r\n Leaflet.prototype.addCircleEvent = function (circles, eventType, eventFunction) {\r\n this.leafletCircles.addCircleEvent(circles, eventType, eventFunction);\r\n };\r\n Leaflet.prototype.removeCircleEvent = function (circles, event) {\r\n this.leafletCircles.removeCircleEvent(circles, event);\r\n };\r\n /* Polylines */\r\n Leaflet.prototype.drawPolyline = function (options, eventClick) {\r\n return this.leafletPolylines.drawPolyline(options, eventClick);\r\n };\r\n Leaflet.prototype.drawPolylineWithNavigation = function (options, eventClick) {\r\n return this.leafletPolylines.drawPolylineWithNavigation(options, eventClick);\r\n };\r\n Leaflet.prototype.togglePolylines = function (polylines, show) {\r\n this.leafletPolylines.togglePolylines(polylines, show);\r\n };\r\n Leaflet.prototype.alterPolylineOptions = function (polylines, options) {\r\n this.leafletPolylines.alterPolylineOptions(polylines, options);\r\n };\r\n Leaflet.prototype.fitBoundsPolylines = function (polylines) {\r\n this.leafletPolylines.fitBoundsPolylines(polylines);\r\n };\r\n Leaflet.prototype.isPolylineOnMap = function (polyline) {\r\n return this.leafletPolylines.isPolylineOnMap(polyline);\r\n };\r\n Leaflet.prototype.addPolylinePath = function (polylines, position) {\r\n this.leafletPolylines.addPolylinePath(polylines, position);\r\n };\r\n Leaflet.prototype.getPolylinePath = function (polyline) {\r\n return this.leafletPolylines.getPolylinePath(polyline);\r\n };\r\n Leaflet.prototype.removePolylineHighlight = function () {\r\n this.leafletPolylines.removePolylineHighlight();\r\n };\r\n Leaflet.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {\r\n this.leafletPolylines.addPolylineEvent(polylines, eventType, eventFunction);\r\n };\r\n Leaflet.prototype.removePolylineEvent = function (polylines, event) {\r\n this.leafletPolylines.removePolylineEvent(polylines, event);\r\n };\r\n Leaflet.prototype.setIndexPolylineHighlight = function (polyline, index) {\r\n this.leafletPolylines.setIndexPolylineHighlight(polyline, index);\r\n };\r\n Leaflet.prototype.getObjectPolyline = function (polyline) {\r\n return this.leafletPolylines.getObjectPolyline(polyline);\r\n };\r\n Leaflet.prototype.getObjectPolylineHighlight = function () {\r\n return this.leafletPolylines.getObjectPolylineHighlight();\r\n };\r\n Leaflet.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {\r\n this.leafletPolylines.addPolylineHighlightEvent(eventType, eventFunction);\r\n };\r\n Leaflet.prototype.getPolylineHighlightIndex = function () {\r\n return this.leafletPolylines.getPolylineHighlightIndex();\r\n };\r\n /* Popups */\r\n Leaflet.prototype.drawPopup = function (options, marker) {\r\n return this.leafletPopups.drawPopup(options, marker);\r\n };\r\n Leaflet.prototype.alterPopup = function (popup, options, marker) {\r\n return this.leafletPopups.alterPopup(popup, options, marker);\r\n };\r\n Leaflet.prototype.alterPopupContent = function (popup, options, marker) {\r\n this.leafletPopups.alterPopupContent(popup, options, marker);\r\n };\r\n Leaflet.prototype.closePopup = function (popup) {\r\n this.leafletPopups.closePopup(popup);\r\n };\r\n /* Map */\r\n Leaflet.prototype.resizeMap = function () {\r\n this.leafletMap.resizeMap();\r\n };\r\n Leaflet.prototype.addEventMap = function (eventType, eventFunction) {\r\n this.leafletMap.addEventMap(eventType, eventFunction);\r\n };\r\n Leaflet.prototype.removeEventMap = function (eventType) {\r\n this.leafletMap.removeEventMap(eventType);\r\n };\r\n Leaflet.prototype.getZoom = function () {\r\n return this.leafletMap.getZoom();\r\n };\r\n Leaflet.prototype.setZoom = function (zoom) {\r\n this.leafletMap.setZoom(zoom);\r\n };\r\n Leaflet.prototype.getCenter = function () {\r\n return this.leafletMap.getCenter();\r\n };\r\n Leaflet.prototype.setCenter = function (position) {\r\n this.leafletMap.setCenter(position);\r\n };\r\n Leaflet.prototype.pixelsToLatLng = function (offsetx, offsety) {\r\n return this.leafletMap.pixelsToLatLng(offsetx, offsety);\r\n };\r\n Leaflet.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {\r\n this.leafletMap.fitBoundsElements(markers, circles, polygons, polylines);\r\n };\r\n /* Overlay */\r\n Leaflet.prototype.drawOverlay = function (options, polygons) {\r\n return this.leafletOverlays.drawOverlay(options, polygons);\r\n };\r\n Leaflet.prototype.toggleOverlay = function (overlays, show) {\r\n this.leafletOverlays.toggleOverlay(overlays, show);\r\n };\r\n /* Private Methods */\r\n Leaflet.prototype.mapTimeout = function (ms) {\r\n return new Promise(function (resolve) { return setTimeout(resolve, ms); });\r\n };\r\n Leaflet.prototype.loadDependencies = function (params) {\r\n var styles = params.cssDependencies;\r\n if (styles && styles.length > 0) {\r\n styles.forEach(function (path) {\r\n var link = document.createElement('link');\r\n link.rel = 'stylesheet';\r\n link.href = path;\r\n document.querySelector('head').appendChild(link);\r\n });\r\n }\r\n var scripts = params.scriptsDependencies;\r\n if (scripts && scripts.length > 0) {\r\n scripts.forEach(function (path) {\r\n var script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = path;\r\n document.querySelector('head').appendChild(script);\r\n });\r\n }\r\n };\r\n return Leaflet;\r\n}());\r\nexports.default = Leaflet;\r\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletCircles = /** @class */ (function () {\r\n function LeafletCircles(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n LeafletCircles.prototype.drawCircle = function (options, eventClick) {\r\n var self = this;\r\n var newOptions = {\r\n color: options.color,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n opacity: options.opacity,\r\n radius: options.radius,\r\n weight: options.weight\r\n };\r\n var circle = new this.leaflet.Circle(options.center, newOptions);\r\n if (eventClick) {\r\n circle.on('click', function (event) {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n circle.addTo(self.map);\r\n if (options.editable) {\r\n circle.enableEdit();\r\n }\r\n }\r\n if (options.object) {\r\n circle.object = options.object;\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(circle.getBounds());\r\n }\r\n return circle;\r\n };\r\n LeafletCircles.prototype.toggleCircles = function (circles, show) {\r\n var self = this;\r\n circles.forEach(function (circle) { return show ? self.map.addLayer(circle) : self.map.removeLayer(circle); });\r\n };\r\n LeafletCircles.prototype.alterCircleOptions = function (circles, options) {\r\n circles.forEach(function (circle) {\r\n var style = {\r\n color: options.color ? options.color : circle.options.color,\r\n draggable: options.draggable ? options.draggable : circle.options.draggable,\r\n editable: options.editable ? options.editable : circle.options.editable,\r\n fillColor: options.fillColor ? options.fillColor : circle.options.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : circle.options.fillOpacity,\r\n opacity: options.opacity ? options.opacity : circle.options.opacity,\r\n weight: options.weight ? options.weight : circle.options.weight\r\n };\r\n circle.setStyle(style);\r\n if (options.radius) {\r\n circle.setRadius(options.radius);\r\n }\r\n if (options.center) {\r\n circle.setLatLng(options.center);\r\n }\r\n if (options.editable !== null && options.editable !== undefined) {\r\n if (options.editable) {\r\n circle.enableEdit();\r\n }\r\n else {\r\n circle.disableEdit();\r\n }\r\n }\r\n });\r\n };\r\n LeafletCircles.prototype.fitBoundsCircles = function (circles) {\r\n this.map.fitBounds(this.getBoundsCircles(circles));\r\n };\r\n LeafletCircles.prototype.isCircleOnMap = function (circle) {\r\n return this.map.hasLayer(circle);\r\n };\r\n LeafletCircles.prototype.getCircleCenter = function (circle) {\r\n var center = circle.getLatLng();\r\n return [center.lat, center.lng];\r\n };\r\n LeafletCircles.prototype.getCircleRadius = function (circle) {\r\n return circle.getRadius();\r\n };\r\n LeafletCircles.prototype.addCircleEvent = function (circles, eventType, eventFunction) {\r\n circles.forEach(function (circle) {\r\n switch (eventType) {\r\n case event_type_1.CircleEventType.Click:\r\n circle.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, circle.object);\r\n });\r\n case event_type_1.CircleEventType.CenterChanged:\r\n circle.on('dragend', function (event) {\r\n var param = new event_return_1.default([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, circle.object);\r\n });\r\n case event_type_1.CircleEventType.RadiusChanged:\r\n circle.on('editable:vertex:dragend', function (event) {\r\n var param = new event_return_1.default([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(param, circle.object, circle.getRadius());\r\n });\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletCircles.prototype.removeCircleEvent = function (circles, event) {\r\n circles.forEach(function (circle) {\r\n switch (event) {\r\n case event_type_1.CircleEventType.Click:\r\n circle.off('click');\r\n case event_type_1.CircleEventType.CenterChanged:\r\n circle.off('dragend');\r\n case event_type_1.CircleEventType.RadiusChanged:\r\n circle.off('editable:vertex:dragend');\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletCircles.prototype.getBoundsCircles = function (circles) {\r\n var group = new this.leaflet.FeatureGroup(circles);\r\n return group.getBounds();\r\n };\r\n return LeafletCircles;\r\n}());\r\nexports.default = LeafletCircles;\r\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletGeoJson = /** @class */ (function () {\r\n function LeafletGeoJson(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n LeafletGeoJson.prototype.loadGEOJson = function (data, options, eventClick) {\r\n var self = this;\r\n var objects = self.parseGeoJson(data, options);\r\n objects.forEach(function (elem) { return self.map.addLayer(elem); });\r\n if (self.map.options) {\r\n if (self.map.options.editable) {\r\n objects.forEach(function (obj) {\r\n if (obj.enableEdit) {\r\n obj.enableEdit();\r\n }\r\n if (eventClick) {\r\n obj.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param);\r\n });\r\n }\r\n });\r\n }\r\n }\r\n };\r\n LeafletGeoJson.prototype.parseGeoJson = function (data, options) {\r\n var self = this;\r\n var parsedFeatures = [];\r\n if (Array.isArray(data.features)) {\r\n for (var _i = 0, _a = data.features; _i < _a.length; _i++) {\r\n var feature = _a[_i];\r\n parsedFeatures.push(self.parseGeoJsonToObject(feature, options));\r\n }\r\n }\r\n else {\r\n parsedFeatures.push(self.parseGeoJsonToObject(data, options));\r\n }\r\n return parsedFeatures;\r\n };\r\n LeafletGeoJson.prototype.parseGeoJsonToObject = function (data, objectOptions) {\r\n var geometry = data.geometry;\r\n var parsedCoordinates = [];\r\n if (data.properties) {\r\n Object.assign(objectOptions, data.properties);\r\n }\r\n switch (geometry.type) {\r\n case 'Point':\r\n parsedCoordinates = geometry.coordinates.reverse();\r\n return new this.leaflet.Marker(parsedCoordinates, objectOptions);\r\n case 'Polygon':\r\n geometry.coordinates\r\n .forEach(function (polygon) { return parsedCoordinates.push(polygon.map(function (elem) { return elem.reverse(); })); });\r\n return new this.leaflet.Polygon(parsedCoordinates, objectOptions);\r\n case 'LineString':\r\n parsedCoordinates = geometry.coordinates.map(function (elem) { return elem.reverse(); });\r\n return new this.leaflet.Polyline(parsedCoordinates, objectOptions);\r\n default:\r\n throw new Error('Unknown object shape.');\r\n }\r\n };\r\n return LeafletGeoJson;\r\n}());\r\nexports.default = LeafletGeoJson;\r\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletMap = /** @class */ (function () {\r\n function LeafletMap(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n LeafletMap.prototype.resizeMap = function () {\r\n this.map.invalidateSize();\r\n };\r\n LeafletMap.prototype.addEventMap = function (eventType, eventFunction) {\r\n var self = this;\r\n switch (eventType) {\r\n case event_type_1.MapEventType.Click:\r\n self.map.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param);\r\n });\r\n break;\r\n case event_type_1.MapEventType.ZoomChanged:\r\n self.map.on('zoomend', function (event) {\r\n var param = new event_return_1.default([event.target.getCenter().lat, event.target.getCenter().lng]);\r\n eventFunction(param);\r\n });\r\n default:\r\n break;\r\n }\r\n };\r\n LeafletMap.prototype.removeEventMap = function (eventType) {\r\n var self = this;\r\n switch (eventType) {\r\n case event_type_1.MapEventType.Click:\r\n self.map.off('click');\r\n break;\r\n case event_type_1.MapEventType.ZoomChanged: self.map.off('zoomend');\r\n default: break;\r\n }\r\n };\r\n LeafletMap.prototype.getZoom = function () {\r\n return this.map.getZoom();\r\n };\r\n LeafletMap.prototype.setZoom = function (zoom) {\r\n this.map.setZoom(zoom);\r\n };\r\n LeafletMap.prototype.getCenter = function () {\r\n var center = this.map.getCenter();\r\n return [center.lat, center.lng];\r\n };\r\n LeafletMap.prototype.setCenter = function (position) {\r\n this.map.panTo(position);\r\n };\r\n LeafletMap.prototype.pixelsToLatLng = function (offsetx, offsety) {\r\n var scale = Math.pow(2, this.map.getZoom());\r\n var worldCoordinateCenter = this.leaflet.CRS.Simple.project(this.map.getCenter());\r\n var pixelOffset = new this.leaflet.Point(offsetx / scale || 0, offsety / scale || 0);\r\n var worldCoordinateNewCenter = new this.leaflet.Point(worldCoordinateCenter.x - pixelOffset.x, worldCoordinateCenter.y + pixelOffset.y);\r\n var latlng = this.leaflet.CRS.Simple.unproject(worldCoordinateNewCenter);\r\n return [latlng.lat, latlng.lng];\r\n };\r\n LeafletMap.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {\r\n var group = [];\r\n if (markers && markers.length) {\r\n markers.forEach(function (marker) { return group.push(marker); });\r\n }\r\n if (circles && circles.length) {\r\n circles.forEach(function (circle) { return group.push(circle); });\r\n }\r\n if (polygons && polygons.length) {\r\n polygons.forEach(function (polygon) { return group.push(polygon); });\r\n }\r\n if (polylines && polylines.length) {\r\n polylines.forEach(function (polyline) { return group.push(polyline); });\r\n }\r\n if (group && group.length) {\r\n var bounds = this.leaflet.featureGroup(group).getBounds();\r\n this.map.fitBounds(bounds);\r\n }\r\n };\r\n return LeafletMap;\r\n}());\r\nexports.default = LeafletMap;\r\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletMarkers = /** @class */ (function () {\r\n function LeafletMarkers(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n /* Markers */\r\n LeafletMarkers.prototype.drawMarker = function (options, eventClick) {\r\n var newOptions = {\r\n draggable: options.draggable\r\n };\r\n if (options.icon) {\r\n newOptions.icon = new this.leaflet.Icon({\r\n iconUrl: options.icon.url\r\n });\r\n var size = options.icon.size;\r\n if (size) {\r\n newOptions.icon.options.iconSize = size;\r\n newOptions.icon.options.iconAnchor = [size[0] / 2, size[1]];\r\n newOptions.icon.options.popupAnchor = [0, -size[1]];\r\n }\r\n }\r\n var marker = new this.leaflet.Marker(options.latlng, newOptions);\r\n if (options.object) {\r\n marker.object = options.object;\r\n }\r\n if (eventClick) {\r\n marker.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n if (options.addToMap && !options.addClusterer) {\r\n marker.addTo(this.map);\r\n }\r\n if (options.fitBounds) {\r\n var group = new this.leaflet.FeatureGroup([marker]);\r\n this.map.fitBounds(group.getBounds());\r\n }\r\n return marker;\r\n };\r\n LeafletMarkers.prototype.drawCircleMarker = function (options, eventClick) {\r\n var self = this;\r\n var marker = new this.leaflet.circleMarker(options.latlng, options.style);\r\n if (eventClick) {\r\n marker.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n marker.addTo(self.map);\r\n }\r\n if (options.fitBounds) {\r\n var group = new this.leaflet.FeatureGroup([marker]);\r\n self.map.fitBounds(group.getBounds());\r\n }\r\n marker.object = options.object;\r\n return marker;\r\n };\r\n LeafletMarkers.prototype.toggleMarkers = function (markers, show, markerClusterer) {\r\n var self = this;\r\n markers.forEach(function (marker) {\r\n if (markerClusterer) {\r\n if (show) {\r\n self.addMarkerOnClusterer(marker, markerClusterer);\r\n }\r\n else {\r\n self.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n }\r\n else {\r\n if (show) {\r\n self.map.addLayer(marker);\r\n }\r\n else {\r\n self.map.removeLayer(marker);\r\n }\r\n }\r\n });\r\n };\r\n LeafletMarkers.prototype.alterMarkerOptions = function (markers, options) {\r\n var _this = this;\r\n markers.forEach(function (marker) {\r\n if (marker.type === 'circle' && options.style) {\r\n var style = {\r\n fillColor: options.style.fillColor ? options.style.fillColor : marker.options.fillColor,\r\n fillOpacity: options.style.fillOpacity ? options.style.fillOpacity : marker.options.fillOpacity,\r\n radius: options.style.radius ? options.style.radius : marker.options.radius,\r\n strokeColor: options.style.color ? options.style.color : marker.options.strokeColor,\r\n strokeWeight: options.style.weight ? options.style.weight : marker.options.strokeWeight\r\n };\r\n marker.setStyle(style);\r\n }\r\n if (options.icon) {\r\n var icon = new _this.leaflet.icon({ iconUrl: options.icon.url });\r\n var size = options.icon.size;\r\n if (size) {\r\n icon.options.iconSize = size;\r\n icon.options.iconAnchor = [size[0] / 2, size[1]];\r\n }\r\n marker.setIcon(icon);\r\n }\r\n if (options.latlng) {\r\n marker.setLatLng(options.latlng);\r\n }\r\n });\r\n };\r\n LeafletMarkers.prototype.alterMarkerPosition = function (markers, position, addTransition) {\r\n var _this = this;\r\n markers.forEach(function (marker) {\r\n if (addTransition) {\r\n _this.moveTransitionMarker(position, marker);\r\n }\r\n else {\r\n marker.setLatLng(position);\r\n }\r\n });\r\n };\r\n LeafletMarkers.prototype.fitBoundsPositions = function (markers) {\r\n var group = new this.leaflet.featureGroup(markers);\r\n this.map.fitBounds(group.getBounds());\r\n };\r\n LeafletMarkers.prototype.isMarkerOnMap = function (marker) {\r\n return this.map.hasLayer(marker);\r\n };\r\n LeafletMarkers.prototype.setCenterMarker = function (marker) {\r\n this.map.panTo(marker.getLatLng());\r\n };\r\n LeafletMarkers.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {\r\n markers.forEach(function (marker) {\r\n switch (eventType) {\r\n case event_type_1.MarkerEventType.Click:\r\n marker.on('click', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.RightClick:\r\n marker.on('contextmenu', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.AfterDrag:\r\n marker.on('dragend', function (event) {\r\n var param = new event_return_1.default([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.MouseOver:\r\n marker.on('mouseover', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.MouseOut:\r\n marker.on('mouseout', function (event) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case event_type_1.MarkerEventType.BeforeDrag:\r\n marker.on('dragstart', function (event) {\r\n var param = new event_return_1.default([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletMarkers.prototype.removeMarkerEvent = function (markers, event) {\r\n markers.forEach(function (marker) {\r\n switch (event) {\r\n case event_type_1.MarkerEventType.Click:\r\n marker.off('click');\r\n break;\r\n case event_type_1.MarkerEventType.RightClick:\r\n marker.off('contextmenu');\r\n break;\r\n case event_type_1.MarkerEventType.AfterDrag:\r\n marker.off('dragend');\r\n break;\r\n case event_type_1.MarkerEventType.MouseOver:\r\n marker.off('mouseover');\r\n break;\r\n case event_type_1.MarkerEventType.MouseOut:\r\n marker.off('mouseout');\r\n break;\r\n case event_type_1.MarkerEventType.BeforeDrag:\r\n marker.off('dragstart');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n /* Marker Clusterer */\r\n LeafletMarkers.prototype.addMarkerClusterer = function (config) {\r\n var layer = this.leaflet.markerClusterGroup({\r\n maxClusterRadius: 50,\r\n showCoverageOnHover: false,\r\n zoomToBoundsOnClick: config.clusterZoomOnClick\r\n });\r\n this.map.addLayer(layer);\r\n return layer;\r\n };\r\n LeafletMarkers.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {\r\n markerClusterer.options.zoomToBoundsOnClick = config.clusterZoomOnClick;\r\n };\r\n LeafletMarkers.prototype.refreshClusterer = function (markerClusterer) {\r\n markerClusterer.refreshClusters();\r\n };\r\n LeafletMarkers.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {\r\n markerClusterer.addLayer(marker);\r\n };\r\n LeafletMarkers.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {\r\n markerClusterer.removeLayer(marker);\r\n };\r\n LeafletMarkers.prototype.clearMarkersClusterer = function (markerClusterer) {\r\n markerClusterer.clearLayers();\r\n };\r\n LeafletMarkers.prototype.countMarkersOnCluster = function (markerClusterer) {\r\n return markerClusterer.getLayers().length;\r\n };\r\n LeafletMarkers.prototype.moveTransitionMarker = function (position, marker) {\r\n var numDeltas = 5;\r\n var reference = {\r\n deltaLat: (position[0] - marker.getLatLng().lat) / numDeltas,\r\n deltaLng: (position[1] - marker.getLatLng().lng) / numDeltas,\r\n i: 0,\r\n position: [marker.getLatLng().lat, marker.getLatLng().lng],\r\n lastPosition: position\r\n };\r\n this.moveMarker(marker, reference, numDeltas);\r\n };\r\n LeafletMarkers.prototype.moveMarker = function (marker, reference, numDeltas) {\r\n var _this = this;\r\n reference.position[0] += reference.deltaLat;\r\n reference.position[1] += reference.deltaLng;\r\n marker.setLatLng(reference.position);\r\n if (reference.i < numDeltas) {\r\n reference.i++;\r\n setTimeout(function () { return _this.moveMarker(marker, reference, numDeltas); }, 20);\r\n }\r\n else if (reference.i === numDeltas) {\r\n setTimeout(function () { return marker.setLatLng(reference.lastPosition); }, 20);\r\n }\r\n };\r\n return LeafletMarkers;\r\n}());\r\nexports.default = LeafletMarkers;\r\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletOverlay = /** @class */ (function () {\r\n function LeafletOverlay(map, leaflet, leafletPolygons) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n this.leafletPolygons = leafletPolygons;\r\n }\r\n LeafletOverlay.prototype.drawOverlay = function (options, polygons) {\r\n var html = options.divElement.outerHTML;\r\n var myIcon = new this.leaflet.DivIcon({ html: html });\r\n var position = polygons && polygons.length > 0 ?\r\n this.leafletPolygons.getBoundsPolygons(polygons).getCenter() : options.position;\r\n var overlay = new this.leaflet.Marker(position, { icon: myIcon, draggable: options.draggable });\r\n if (options.addToMap) {\r\n overlay.addTo(this.map);\r\n }\r\n overlay.object = options.object;\r\n if (options.draggable && options.afterEventDragHandler) {\r\n overlay.on('dragend', function (event) {\r\n var param = new event_return_1.default([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n options.afterEventDragHandler(param, options.object);\r\n });\r\n }\r\n return overlay;\r\n };\r\n LeafletOverlay.prototype.toggleOverlay = function (overlays, show) {\r\n var self = this;\r\n overlays.forEach(function (overlay) { return show ? self.map.addLayer(overlay) : self.map.removeLayer(overlay); });\r\n };\r\n return LeafletOverlay;\r\n}());\r\nexports.default = LeafletOverlay;\r\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletPolygons = /** @class */ (function () {\r\n function LeafletPolygons(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n LeafletPolygons.prototype.drawPolygon = function (options, eventClick) {\r\n var self = this;\r\n var newOptions = {\r\n color: options.color || '#000',\r\n draggable: options.draggable,\r\n fillColor: options.fillColor || '#fff',\r\n fillOpacity: options.fillOpacity || 1,\r\n opacity: options.opacity || 1,\r\n weight: options.weight || 2\r\n };\r\n var polygon = new this.leaflet.Polygon(options.path, newOptions);\r\n if (eventClick) {\r\n polygon.on('click', function (event) {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n if (options.addToMap) {\r\n polygon.addTo(self.map);\r\n if (options.editable) {\r\n polygon.enableEdit();\r\n }\r\n }\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(polygon.getBounds());\r\n }\r\n return polygon;\r\n };\r\n LeafletPolygons.prototype.togglePolygons = function (polygons, show) {\r\n var self = this;\r\n polygons.forEach(function (polygon) { return show ? self.map.addLayer(polygon) : self.map.removeLayer(polygon); });\r\n };\r\n LeafletPolygons.prototype.alterPolygonOptions = function (polygons, options) {\r\n polygons.forEach(function (polygon) {\r\n var style = {\r\n color: options.color ? options.color : polygon.options.color,\r\n draggable: options.draggable ? options.draggable : polygon.options.draggable,\r\n fillColor: options.fillColor ? options.fillColor : polygon.options.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : polygon.options.fillOpacity,\r\n opacity: options.opacity ? options.opacity : polygon.options.opacity,\r\n weight: options.weight ? options.weight : polygon.options.weight\r\n };\r\n if (options.path) {\r\n polygon.setLatLngs(options.path);\r\n }\r\n polygon.setStyle(style);\r\n if (options.editable !== null && options.editable !== undefined) {\r\n polygon.disableEdit();\r\n if (options.editable) {\r\n polygon.enableEdit();\r\n }\r\n }\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n });\r\n };\r\n LeafletPolygons.prototype.fitBoundsPolygons = function (polygons) {\r\n this.map.fitBounds(this.getBoundsPolygons(polygons));\r\n };\r\n LeafletPolygons.prototype.setCenterPolygons = function (polygons) {\r\n this.map.panTo(this.getBoundsPolygons(polygons).getCenter());\r\n };\r\n LeafletPolygons.prototype.isPolygonOnMap = function (polygon) {\r\n return this.map.hasLayer(polygon);\r\n };\r\n LeafletPolygons.prototype.getPolygonPath = function (polygon) {\r\n return polygon.getLatLngs()[0].map(function (x) { return [x.lat, x.lng]; });\r\n };\r\n LeafletPolygons.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {\r\n var _this = this;\r\n var self = this;\r\n polygons.forEach(function (polygon) {\r\n switch (eventType) {\r\n case event_type_1.PolygonEventType.SetAt:\r\n _this.addPolygonEventMove(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.InsertAt:\r\n _this.addPolygonEventInsertAt(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.RemoveAt:\r\n _this.addPolygonEventRemoveAt(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.DragPolygon:\r\n _this.addPolygonEventDragPolygon(polygon, eventFunction);\r\n break;\r\n case event_type_1.PolygonEventType.Click:\r\n _this.addPolygonEventClick(polygon, eventFunction, self);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletPolygons.prototype.removePolygonEvent = function (polygons, event) {\r\n polygons.forEach(function (polygon) {\r\n switch (event) {\r\n case event_type_1.PolygonEventType.SetAt:\r\n polygon.off('editable:vertex:dragstart');\r\n break;\r\n case event_type_1.PolygonEventType.InsertAt:\r\n polygon.off('editable:vertex:new');\r\n break;\r\n case event_type_1.PolygonEventType.RemoveAt:\r\n polygon.off('editable:vertex:clicked');\r\n polygon.off('editable:vertex:deleted');\r\n break;\r\n case event_type_1.PolygonEventType.DragPolygon:\r\n polygon.off('dragend');\r\n break;\r\n case event_type_1.PolygonEventType.Click:\r\n polygon.off('click');\r\n break;\r\n }\r\n });\r\n };\r\n LeafletPolygons.prototype.getBoundsPolygons = function (polygons) {\r\n var group = new this.leaflet.FeatureGroup(polygons);\r\n return group.getBounds();\r\n };\r\n LeafletPolygons.prototype.addPolygonEventMove = function (polygon, eventFunction) {\r\n polygon.on('editable:vertex:dragstart', function (eventStart) {\r\n var lastPosition = new event_return_1.default([eventStart.vertex.latlng.lat, eventStart.vertex.latlng.lng]);\r\n polygon.on('editable:vertex:dragend', function (eventEnd) {\r\n var newPosition = new event_return_1.default([eventEnd.vertex.latlng.lat, eventEnd.vertex.latlng.lng]);\r\n var path = polygon.getLatLngs().map(function (x) {\r\n if (Array.isArray(x[0])) {\r\n return x.map(function (y) { return y.map(function (z) { return new event_return_1.default([z.lat, z.lng]); }); });\r\n }\r\n else {\r\n return [x.map(function (y) { return new event_return_1.default([y.lat, y.lng]); })];\r\n }\r\n });\r\n eventFunction(newPosition, lastPosition, eventEnd.target.object, eventEnd.vertex.getIndex(), path[0]);\r\n polygon.off('editable:vertex:dragend');\r\n });\r\n });\r\n };\r\n LeafletPolygons.prototype.addPolygonEventInsertAt = function (polygon, eventFunction) {\r\n polygon.on('editable:vertex:new', function (eventNew) {\r\n var latlngs = eventNew.vertex.latlngs;\r\n var previous = latlngs[latlngs.findIndex(function (x) { return x === eventNew.vertex.latlng; }) - 1];\r\n if (previous) {\r\n var previousPoint_1 = new event_return_1.default([previous.lat, previous.lng]);\r\n polygon.on('editable:vertex:dragend', function (event) {\r\n var newPoint = new event_return_1.default([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n var path = polygon.getLatLngs().map(function (x) {\r\n if (Array.isArray(x[0])) {\r\n return x.map(function (y) { return y.map(function (z) { return new event_return_1.default([z.lat, z.lng]); }); });\r\n }\r\n else {\r\n return [x.map(function (y) { return new event_return_1.default([y.lat, y.lng]); })];\r\n }\r\n });\r\n eventFunction(newPoint, previousPoint_1, event.target.object, event.vertex.getIndex(), path[0]);\r\n polygon.off('editable:vertex:dragend');\r\n });\r\n }\r\n });\r\n };\r\n LeafletPolygons.prototype.addPolygonEventRemoveAt = function (polygon, eventFunction) {\r\n polygon.on('editable:vertex:deleted', function (event) {\r\n var param = new event_return_1.default([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n var path = polygon.getLatLngs().map(function (x) {\r\n if (Array.isArray(x[0])) {\r\n return x.map(function (y) { return y.map(function (z) { return new event_return_1.default([z.lat, z.lng]); }); });\r\n }\r\n else {\r\n return [x.map(function (y) { return new event_return_1.default([y.lat, y.lng]); })];\r\n }\r\n });\r\n eventFunction(param, path[0], event.target.object);\r\n });\r\n };\r\n LeafletPolygons.prototype.addPolygonEventDragPolygon = function (polygon, eventFunction) {\r\n polygon.on('dragend', function (event) {\r\n var path = polygon.getLatLngs().map(function (x) {\r\n if (Array.isArray(x[0])) {\r\n return x.map(function (y) { return y.map(function (z) { return new event_return_1.default([z.lat, z.lng]); }); });\r\n }\r\n else {\r\n return [x.map(function (y) { return new event_return_1.default([y.lat, y.lng]); })];\r\n }\r\n });\r\n eventFunction(path[0], event.target.object);\r\n });\r\n };\r\n LeafletPolygons.prototype.addPolygonEventClick = function (polygon, eventFunction, self) {\r\n polygon.on('click', function (event) {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, event.target.object);\r\n });\r\n };\r\n return LeafletPolygons;\r\n}());\r\nexports.default = LeafletPolygons;\r\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar event_type_1 = __webpack_require__(1);\r\nvar polyline_type_1 = __webpack_require__(3);\r\nvar event_return_1 = __webpack_require__(0);\r\nvar LeafletPolylines = /** @class */ (function () {\r\n function LeafletPolylines(map, leaflet, leafletPopup) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.selectedPolyline = null;\r\n this.selectedPath = null;\r\n this.navigateInfoWindow = null;\r\n this.directionForward = false;\r\n this.multiSelectionForward = false;\r\n this.multiSelection = false;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n this.leafletPopup = leafletPopup;\r\n }\r\n LeafletPolylines.prototype.drawPolyline = function (options, eventClick) {\r\n var self = this;\r\n var newOptions = {\r\n color: options.color || '#000000',\r\n dashArray: null,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n infowindows: options.infowindows,\r\n opacity: options.opacity || 1,\r\n weight: options.weight || 3,\r\n zIndex: options.zIndex\r\n };\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n newOptions.opacity = .7;\r\n newOptions.dashArray = '20,15';\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n var polyline = new this.leaflet.Polyline(options.path || [], newOptions);\r\n polyline.on('editable:vertex:rawclick', function (e) { return e.cancel(); });\r\n if (eventClick) {\r\n polyline.on('click', function (event) {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n polyline.on('editable:vertex:rawclick', function (event) {\r\n event.cancel();\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n if (options.style && options.style === polyline_type_1.PolylineType.Arrow) {\r\n var pathOptions = { fillOpacity: 1, weight: 0, color: polyline.options.color };\r\n polyline.decorator = self.leaflet.polylineDecorator(polyline, {\r\n patterns: [{\r\n offset: '20%',\r\n repeat: '90px',\r\n symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions })\r\n },\r\n { offset: '0%', symbol: self.leaflet.Symbol.arrowHead({ pathOptions: pathOptions, pixelSize: 20 }) },\r\n { offset: '100%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions }) }]\r\n });\r\n }\r\n if (options.addToMap) {\r\n polyline.addTo(self.map);\r\n if (polyline.decorator) {\r\n polyline.decorator.addTo(self.map);\r\n }\r\n if (options.editable) {\r\n polyline.enableEdit();\r\n }\r\n }\r\n if (options.object) {\r\n polyline.object = options.object;\r\n }\r\n if (options.fitBounds) {\r\n self.map.fitBounds(polyline.getBounds());\r\n }\r\n return polyline;\r\n };\r\n LeafletPolylines.prototype.drawPolylineWithNavigation = function (options, eventClick) {\r\n var polyline = this.drawPolyline(options, null);\r\n polyline.navigationHandlerClick = eventClick;\r\n this.navigationOptions = options.navigateOptions;\r\n this.navigateByPoint = this.navigationOptions ? this.navigationOptions.navigateByPoint : true;\r\n this.addNavigation(polyline);\r\n return polyline;\r\n };\r\n LeafletPolylines.prototype.togglePolylines = function (polylines, show) {\r\n var self = this;\r\n polylines.forEach(function (polyline) {\r\n if (show) {\r\n self.map.addLayer(polyline);\r\n if (polyline.options.editable) {\r\n polyline.enableEdit();\r\n }\r\n if (polyline.decorator) {\r\n self.map.addLayer(polyline.decorator);\r\n }\r\n }\r\n else {\r\n self.map.removeLayer(polyline);\r\n if (polyline.options.editable) {\r\n polyline.disableEdit();\r\n }\r\n if (polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n }\r\n }\r\n });\r\n };\r\n LeafletPolylines.prototype.alterPolylineOptions = function (polylines, options) {\r\n var self = this;\r\n polylines.forEach(function (polyline) {\r\n var style = {\r\n color: options.color ? options.color : polyline.options.color,\r\n draggable: options.draggable ? options.draggable : polyline.options.draggable,\r\n opacity: options.opacity ? options.opacity : polyline.options.opacity,\r\n weight: options.weight ? options.weight : polyline.options.weight,\r\n zIndex: options.zIndex ? options.zIndex : polyline.options.zIndex\r\n };\r\n if (options.path) {\r\n polyline.setLatLngs(options.path);\r\n }\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n style.dashArray = '20,15';\r\n break;\r\n case polyline_type_1.PolylineType.Arrow:\r\n var pathOptions = { fillOpacity: 1, weight: 0, color: style.color };\r\n if (polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n }\r\n polyline.decorator = self.leaflet.polylineDecorator(polyline, {\r\n patterns: [{\r\n offset: '20%',\r\n repeat: '90px',\r\n symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions })\r\n },\r\n { offset: '0%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions }) },\r\n { offset: '100%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions }) }]\r\n });\r\n if (self.map.hasLayer(polyline)) {\r\n polyline.decorator.addTo(self.map);\r\n }\r\n break;\r\n default:\r\n if (polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n polyline.decorator = null;\r\n }\r\n break;\r\n }\r\n polyline.setStyle(style);\r\n if (options.object) {\r\n polyline.object = options.object;\r\n }\r\n if (options.editable) {\r\n polyline.disableEdit();\r\n polyline.enableEdit();\r\n }\r\n });\r\n };\r\n LeafletPolylines.prototype.fitBoundsPolylines = function (polylines) {\r\n var self = this;\r\n self.map.fitBounds(self.getBoundsPolylines(polylines));\r\n };\r\n LeafletPolylines.prototype.isPolylineOnMap = function (polyline) {\r\n return this.map.hasLayer(polyline);\r\n };\r\n LeafletPolylines.prototype.addPolylinePath = function (polylines, position) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) {\r\n var path = polyline.getLatLngs();\r\n path.push(new _this.leaflet.LatLng(position[0], position[1]));\r\n polyline.setLatLngs(path);\r\n if (polyline.editEnabled && polyline.editEnabled()) {\r\n polyline.disableEdit();\r\n polyline.enableEdit();\r\n }\r\n });\r\n };\r\n LeafletPolylines.prototype.getPolylinePath = function (polyline) {\r\n return polyline.getLatLngs().map(function (x) { return [x.lat, x.lng]; });\r\n };\r\n LeafletPolylines.prototype.removePolylineHighlight = function () {\r\n var self = this;\r\n if (self.selectedPath) {\r\n if (this.selectedPath.decorator) {\r\n this.map.removeLayer(this.selectedPath.decorator);\r\n }\r\n this.map.removeLayer(self.selectedPath);\r\n self.selectedPath = null;\r\n }\r\n if (self.navigateInfoWindow) {\r\n self.navigateInfoWindow.remove();\r\n }\r\n document.onkeyup = null;\r\n document.onkeydown = null;\r\n };\r\n LeafletPolylines.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {\r\n var _this = this;\r\n polylines.forEach(function (polyline) {\r\n switch (eventType) {\r\n case event_type_1.PolylineEventType.SetAt:\r\n _this.addPolylineEventMove(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.InsertAt:\r\n _this.addPolylineEventInsertAt(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.RemoveAt:\r\n _this.addPolylineEventRemoveAt(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.MouseOver:\r\n _this.addPolylineEventMouseOver(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.MouseOut:\r\n _this.addPolylineEventMouseOut(polyline, eventFunction);\r\n break;\r\n case event_type_1.PolylineEventType.DragPolyline:\r\n _this.addPolylineEventDragPolyline(polyline, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletPolylines.prototype.removePolylineEvent = function (polylines, event) {\r\n polylines.forEach(function (polyline) {\r\n switch (event) {\r\n case event_type_1.PolylineEventType.SetAt:\r\n polyline.off('editable:vertex:dragstart');\r\n break;\r\n case event_type_1.PolylineEventType.InsertAt:\r\n polyline.off('editable:vertex:new');\r\n break;\r\n case event_type_1.PolylineEventType.RemoveAt:\r\n polyline.off('editable:vertex:deleted');\r\n break;\r\n case event_type_1.PolylineEventType.DragPolyline:\r\n polyline.off('dragend');\r\n break;\r\n case event_type_1.PolylineEventType.MouseOver:\r\n polyline.off('mouseover');\r\n break;\r\n case event_type_1.PolylineEventType.MouseOut:\r\n polyline.off('mouseout');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n };\r\n LeafletPolylines.prototype.setIndexPolylineHighlight = function (polyline, index) {\r\n this.directionForward = false;\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n document.onkeydown = this.onKeyUp.bind(this);\r\n }\r\n else {\r\n document.onkeyup = this.onKeyUp.bind(this);\r\n }\r\n };\r\n LeafletPolylines.prototype.getObjectPolyline = function (polyline) {\r\n return polyline.object;\r\n };\r\n LeafletPolylines.prototype.getObjectPolylineHighlight = function () {\r\n if (this.selectedPath) {\r\n return this.selectedPath.object;\r\n }\r\n return null;\r\n };\r\n LeafletPolylines.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {\r\n if (this.selectedPolyline) {\r\n this.addPolylineEvent([this.selectedPath], eventType, eventFunction);\r\n }\r\n };\r\n LeafletPolylines.prototype.getPolylineHighlightIndex = function () {\r\n if (this.selectedPath) {\r\n return [this.selectedPath.initialIdx, this.selectedPath.finalIdx];\r\n }\r\n return null;\r\n };\r\n /* Private methods */\r\n LeafletPolylines.prototype.addNavigation = function (polyline) {\r\n polyline.clearAllEventListeners();\r\n polyline.on('click', this.onClickPolyline.bind(this, polyline));\r\n };\r\n LeafletPolylines.prototype.onClickPolyline = function (polyline, event) {\r\n var index = this.checkIdx(polyline, event.latlng);\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n document.onkeydown = this.onKeyUp.bind(this);\r\n }\r\n else {\r\n document.onkeyup = this.onKeyUp.bind(this);\r\n }\r\n if (polyline.navigationHandlerClick) {\r\n var param = new event_return_1.default([event.latlng.lat, event.latlng.lng]);\r\n polyline.navigationHandlerClick(param, event.target.object);\r\n }\r\n };\r\n LeafletPolylines.prototype.onKeyUp = function (event) {\r\n var self = this;\r\n if (self.selectedPath) {\r\n if (event.ctrlKey) {\r\n console.warn('Deprecated: CTRL is not needed in navigation anymore');\r\n }\r\n switch (event.which ? event.which : event.keyCode) {\r\n case 38:\r\n case 39:\r\n // up arrow or right arrow\r\n self.moveFowards(event.shiftKey);\r\n break;\r\n case 37:\r\n case 40:\r\n // left arrow or down arrow\r\n self.moveBackwards(event.shiftKey);\r\n break;\r\n }\r\n }\r\n };\r\n LeafletPolylines.prototype.moveFowards = function (multiselection) {\r\n var polyline = this.selectedPolyline;\r\n if ((!this.navigateByPoint || this.directionForward) && polyline.finalIdx < polyline.getLatLngs().length - 1) {\r\n this.navigateFoward(multiselection, polyline);\r\n }\r\n this.directionForward = true;\r\n this.moveSelectedPath(polyline, null);\r\n };\r\n LeafletPolylines.prototype.navigateFoward = function (multiSelection, polyline) {\r\n if (!multiSelection) {\r\n polyline.finalIdx++;\r\n polyline.initialIdx = this.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n this.multiSelection = false;\r\n }\r\n else {\r\n this.multiSelection = true;\r\n if (this.multiSelectionForward) {\r\n polyline.finalIdx++;\r\n }\r\n this.multiSelectionForward = true;\r\n }\r\n };\r\n LeafletPolylines.prototype.moveBackwards = function (multiSelection) {\r\n var polyline = this.selectedPolyline;\r\n if ((!this.navigateByPoint || !this.directionForward) && polyline.initialIdx > 0) {\r\n this.navigateBackward(multiSelection, polyline);\r\n }\r\n this.directionForward = false;\r\n this.moveSelectedPath(polyline, null);\r\n };\r\n LeafletPolylines.prototype.navigateBackward = function (multiSelection, polyline) {\r\n var self = this;\r\n if (!multiSelection) {\r\n polyline.initialIdx--;\r\n polyline.finalIdx = !self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n }\r\n else {\r\n self.multiSelection = true;\r\n if (!self.multiSelectionForward) {\r\n polyline.initialIdx--;\r\n }\r\n self.multiSelectionForward = false;\r\n }\r\n };\r\n LeafletPolylines.prototype.moveSelectedPath = function (polyline, options) {\r\n var self = this;\r\n var pathSelected = polyline.getLatLngs().map(function (x) { return [x.lat, x.lng]; })\r\n .slice(polyline.initialIdx, polyline.finalIdx + 1);\r\n if (self.selectedPath) {\r\n self.selectedPath.setLatLngs(pathSelected);\r\n this.selectedPath.object = polyline.object;\r\n }\r\n else {\r\n this.addNewSelectedPath(pathSelected, options, polyline.object);\r\n this.selectedPath.addTo(this.map);\r\n }\r\n if (this.selectedPath.decorator) {\r\n this.map.removeLayer(this.selectedPath.decorator);\r\n this.setArrowSelectedPath();\r\n }\r\n if ((options && options.editable) ||\r\n (this.selectedPath.editEnabled && this.selectedPath.editEnabled())) {\r\n this.selectedPath.disableEdit();\r\n this.selectedPath.enableEdit();\r\n }\r\n this.selectedPath.initialIdx = polyline.initialIdx;\r\n this.selectedPath.finalIdx = polyline.finalIdx;\r\n var idx = self.directionForward ? polyline.finalIdx : polyline.initialIdx;\r\n if (!this.navigateByPoint) {\r\n idx = polyline.finalIdx > polyline.initialIdx ? polyline.finalIdx : polyline.initialIdx;\r\n }\r\n var infowindow = polyline.options.infowindows ? polyline.options.infowindows[idx] : null;\r\n if (infowindow) {\r\n var point = polyline.getLatLngs()[idx];\r\n if (self.navigateInfoWindow) {\r\n self.leafletPopup.alterPopup(self.navigateInfoWindow, {\r\n content: infowindow,\r\n latlng: [point.lat, point.lng]\r\n });\r\n }\r\n else {\r\n self.navigateInfoWindow = self.leafletPopup.drawPopup({\r\n content: infowindow,\r\n latlng: [point.lat, point.lng]\r\n });\r\n }\r\n }\r\n };\r\n LeafletPolylines.prototype.setArrowSelectedPath = function () {\r\n var pathOptions = { fillOpacity: 1, weight: 0, color: this.selectedPath.options.color };\r\n this.selectedPath.decorator = this.leaflet.polylineDecorator(this.selectedPath, {\r\n patterns: [{ offset: '100%', symbol: this.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions: pathOptions }) }]\r\n });\r\n this.selectedPath.decorator.addTo(this.map);\r\n };\r\n LeafletPolylines.prototype.addNewSelectedPath = function (pathSelected, options, object) {\r\n var newOptions = {\r\n color: options && options.color || '#FF0000',\r\n draggable: false,\r\n editable: options.editable,\r\n opacity: options && options.opacity || 1,\r\n weight: options && options.weight || 10,\r\n zIndex: 9999\r\n };\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case polyline_type_1.PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case polyline_type_1.PolylineType.Dashed:\r\n newOptions.opacity = .7;\r\n newOptions.dashArray = '20,15';\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n this.selectedPath = new this.leaflet.Polyline(pathSelected, newOptions);\r\n this.selectedPath.on('editable:vertex:rawclick', function (e) { return e.cancel(); });\r\n if (options.style && options.style === polyline_type_1.PolylineType.Arrow) {\r\n this.setArrowSelectedPath();\r\n }\r\n this.selectedPath.object = object;\r\n this.selectedPath.highlight = true;\r\n };\r\n LeafletPolylines.prototype.checkIdx = function (polyline, point) {\r\n var self = this;\r\n var path = polyline.getLatLngs();\r\n var distance = 0;\r\n var minDistance = Number.MAX_VALUE;\r\n var returnValue = -1;\r\n for (var i = 0; i < path.length - 1; i++) {\r\n distance = self.distanceToLine(path[i], path[i + 1], point);\r\n if (distance < minDistance) {\r\n minDistance = distance;\r\n returnValue = i;\r\n }\r\n }\r\n return returnValue;\r\n };\r\n LeafletPolylines.prototype.distanceToLine = function (pt1, pt2, pt) {\r\n var self = this;\r\n var deltaX = pt2.lng - pt1.lng;\r\n var deltaY = pt2.lat - pt1.lat;\r\n var incIntersect = (pt.lng - pt1.lng) * deltaX;\r\n var deltaSum = (deltaX * deltaX) + (deltaY * deltaY);\r\n incIntersect += (pt.lat - pt1.lat) * deltaY;\r\n if (deltaSum > 0) {\r\n incIntersect /= deltaSum;\r\n }\r\n else {\r\n incIntersect = -1;\r\n }\r\n // The intersection occurs outside the line segment, 'before' pt1.\r\n if (incIntersect < 0) {\r\n return self.kmTo(pt, pt1);\r\n }\r\n else if (incIntersect > 1) {\r\n return self.kmTo(pt, pt2);\r\n }\r\n // Intersection point calculation.\r\n var intersect = new this.leaflet.LatLng(pt1.lat + incIntersect * deltaY, pt1.lng + incIntersect * deltaX);\r\n return self.kmTo(pt, intersect);\r\n };\r\n LeafletPolylines.prototype.kmTo = function (pt1, pt2) {\r\n var e = Math;\r\n var ra = e.PI / 180;\r\n var b = pt1.lat * ra;\r\n var c = pt2.lat * ra;\r\n var d = b - c;\r\n var g = pt1.lng * ra - pt2.lng * ra;\r\n var f = 2 * e.asin(e.sqrt(e.pow(e.sin(d / 2), 2) + e.cos(b) * e.cos(c) * e.pow(e.sin(g / 2), 2)));\r\n return f * 6378.137 * 1000;\r\n };\r\n LeafletPolylines.prototype.getBoundsPolylines = function (polylines) {\r\n var group = new this.leaflet.FeatureGroup(polylines);\r\n return group.getBounds();\r\n };\r\n LeafletPolylines.prototype.addPolylineEventMove = function (polyline, eventFunction) {\r\n var self = this;\r\n polyline.on('editable:vertex:dragstart', function (eventStart) {\r\n var lastPosition = new event_return_1.default([eventStart.vertex.latlng.lat, eventStart.vertex.latlng.lng]);\r\n polyline.on('editable:vertex:dragend', function (eventEnd) {\r\n if (polyline.highlight && polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n self.setArrowSelectedPath();\r\n }\r\n var newPosition = new event_return_1.default([eventEnd.vertex.latlng.lat, eventEnd.vertex.latlng.lng]);\r\n eventFunction(newPosition, lastPosition, eventEnd.target.object, eventEnd.vertex.getIndex(), polyline.getLatLngs().map(function (x) { return new event_return_1.default([x.lat, x.lng]); }));\r\n polyline.off('editable:vertex:dragend');\r\n });\r\n });\r\n };\r\n LeafletPolylines.prototype.addPolylineEventInsertAt = function (polyline, eventFunction) {\r\n var self = this;\r\n polyline.on('editable:vertex:new', function (eventNew) {\r\n var latlngs = eventNew.vertex.latlngs;\r\n var previous = latlngs[latlngs.findIndex(function (x) { return x === eventNew.vertex.latlng; }) - 1];\r\n var previousPoint = new event_return_1.default([previous.lat, previous.lng]);\r\n polyline.on('editable:vertex:dragend', function (event) {\r\n if (polyline.highlight && polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n self.setArrowSelectedPath();\r\n }\r\n var newPoint = new event_return_1.default([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(newPoint, previousPoint, event.target.object, event.vertex.getIndex(), polyline.getLatLngs().map(function (x) { return new event_return_1.default([x.lat, x.lng]); }));\r\n polyline.off('editable:vertex:dragend');\r\n });\r\n });\r\n };\r\n LeafletPolylines.prototype.addPolylineEventRemoveAt = function (polyline, eventFunction) {\r\n polyline.on('editable:vertex:deleted', function (event) {\r\n var param = new event_return_1.default([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(param, event.target.object, polyline.getLatLngs().map(function (x) { return new event_return_1.default([x.lat, x.lng]); }));\r\n });\r\n };\r\n LeafletPolylines.prototype.addPolylineEventMouseOver = function (polyline, eventFunction) {\r\n polyline.on('mouseover', function (event) {\r\n var param = event.target.getLatLngs().map(function (x) { return new event_return_1.default([x.lat, x.lng]); });\r\n eventFunction(param, event.target.object);\r\n });\r\n };\r\n LeafletPolylines.prototype.addPolylineEventMouseOut = function (polyline, eventFunction) {\r\n polyline.on('mouseout', function (event) {\r\n var param = event.target.getLatLngs().map(function (x) { return new event_return_1.default([x.lat, x.lng]); });\r\n eventFunction(param, event.target.object);\r\n });\r\n };\r\n LeafletPolylines.prototype.addPolylineEventDragPolyline = function (polyline, eventFunction) {\r\n polyline.on('dragend', function (event) {\r\n var param = event.target.getLatLngs().map(function (x) { return new event_return_1.default([x.lat, x.lng]); });\r\n eventFunction(param, event.target.object);\r\n });\r\n };\r\n return LeafletPolylines;\r\n}());\r\nexports.default = LeafletPolylines;\r\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar LeafletPopup = /** @class */ (function () {\r\n function LeafletPopup(map, leaflet) {\r\n this.map = null;\r\n this.leaflet = null;\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n LeafletPopup.prototype.drawPopup = function (options, marker) {\r\n var self = this;\r\n var popup = null;\r\n if (!marker) {\r\n popup = new this.leaflet.Popup();\r\n popup.setLatLng(options.latlng);\r\n popup.setContent(options.content);\r\n popup.openOn(self.map);\r\n }\r\n else {\r\n popup = self.drawPopupOnMarker(marker, options);\r\n }\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n return popup;\r\n };\r\n LeafletPopup.prototype.alterPopup = function (popup, options, marker) {\r\n var self = this;\r\n if (marker && !marker.getPopup()) {\r\n popup = self.drawPopup(options, marker);\r\n }\r\n else {\r\n self.alterPopupContent(popup, options, marker);\r\n if (!popup.isOpen()) {\r\n if (!marker) {\r\n popup.openOn(self.map);\r\n }\r\n else if (options.notCalledByMap) {\r\n marker.openPopup();\r\n }\r\n }\r\n }\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n return popup;\r\n };\r\n LeafletPopup.prototype.alterPopupContent = function (popup, options, marker) {\r\n if (marker) {\r\n popup = marker._popup;\r\n }\r\n if (popup) {\r\n if (options.content) {\r\n popup.setContent(options.content);\r\n }\r\n if (options.latlng) {\r\n popup.setLatLng(options.latlng);\r\n }\r\n }\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n };\r\n LeafletPopup.prototype.closePopup = function (popup) {\r\n popup.remove();\r\n };\r\n LeafletPopup.prototype.drawPopupOnMarker = function (marker, options) {\r\n marker.bindPopup(options.content);\r\n var popup = marker.getPopup();\r\n marker.openPopup();\r\n return popup;\r\n };\r\n return LeafletPopup;\r\n}());\r\nexports.default = LeafletPopup;\r\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar CircleAlterOptions = /** @class */ (function () {\r\n function CircleAlterOptions(center, radius, weight, fillOpacity, fillColor, color, opacity) {\r\n this.center = center;\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.fillOpacity = fillOpacity;\r\n this.fillColor = fillColor;\r\n this.color = color;\r\n this.opacity = opacity;\r\n }\r\n return CircleAlterOptions;\r\n}());\r\nexports.default = CircleAlterOptions;\r\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar CircleOptions = /** @class */ (function () {\r\n function CircleOptions(center, radius, weight, addToMap, fillOpacity, fillColor, color, opacity, draggable, editable, fitBounds, object) {\r\n this.center = center;\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.addToMap = addToMap;\r\n this.fillOpacity = fillOpacity;\r\n this.fillColor = fillColor;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n return CircleOptions;\r\n}());\r\nexports.default = CircleOptions;\r\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar GeoJsonOptions = /** @class */ (function () {\r\n function GeoJsonOptions(draggable, editable) {\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n }\r\n return GeoJsonOptions;\r\n}());\r\nexports.default = GeoJsonOptions;\r\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar CircleMarkerOptions = /** @class */ (function () {\r\n function CircleMarkerOptions(latlng, style, addToMap, fitBounds, object) {\r\n this.latlng = latlng;\r\n this.addToMap = addToMap;\r\n this.style = style;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n return CircleMarkerOptions;\r\n}());\r\nexports.default = CircleMarkerOptions;\r\n\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar CircleMarkerStyle = /** @class */ (function () {\r\n function CircleMarkerStyle(radius, weight, color, fillColor, fillOpacity) {\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.color = color;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n }\r\n return CircleMarkerStyle;\r\n}());\r\nexports.default = CircleMarkerStyle;\r\n\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MarkerAlterOptions = /** @class */ (function () {\r\n function MarkerAlterOptions(latlng, icon, style) {\r\n this.latlng = latlng;\r\n this.icon = icon;\r\n this.style = style;\r\n }\r\n return MarkerAlterOptions;\r\n}());\r\nexports.default = MarkerAlterOptions;\r\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MarkerIcon = /** @class */ (function () {\r\n function MarkerIcon(url, size) {\r\n this.url = url;\r\n this.size = size;\r\n }\r\n return MarkerIcon;\r\n}());\r\nexports.default = MarkerIcon;\r\n\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar MarkerOptions = /** @class */ (function () {\r\n function MarkerOptions(latlng, addToMap, draggable, icon, fitBounds, object, addClusterer) {\r\n if (addToMap === void 0) { addToMap = false; }\r\n if (draggable === void 0) { draggable = false; }\r\n if (fitBounds === void 0) { fitBounds = false; }\r\n if (addClusterer === void 0) { addClusterer = false; }\r\n this.latlng = latlng;\r\n this.addToMap = addToMap;\r\n this.draggable = draggable;\r\n this.icon = icon;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n this.addClusterer = addClusterer;\r\n }\r\n return MarkerOptions;\r\n}());\r\nexports.default = MarkerOptions;\r\n\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar OverlayOptions = /** @class */ (function () {\r\n function OverlayOptions(divElement, addToMap, position, object, polygon, conditionPolygon, draggable) {\r\n if (draggable === void 0) { draggable = false; }\r\n this.position = position;\r\n this.divElement = divElement;\r\n this.addToMap = addToMap;\r\n this.object = object;\r\n this.polygon = polygon;\r\n this.conditionPolygon = conditionPolygon;\r\n this.draggable = draggable;\r\n }\r\n return OverlayOptions;\r\n}());\r\nexports.default = OverlayOptions;\r\n\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PolygonAlterOptions = /** @class */ (function () {\r\n function PolygonAlterOptions(addToMap, color, opacity, fillColor, fillOpacity, weight) {\r\n this.addToMap = addToMap;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n this.weight = weight;\r\n }\r\n return PolygonAlterOptions;\r\n}());\r\nexports.default = PolygonAlterOptions;\r\n\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PolygonOptions = /** @class */ (function () {\r\n function PolygonOptions(path, weight, addToMap, color, opacity, fillColor, fillOpacity, draggable, editable, fitBounds, object) {\r\n this.path = path;\r\n this.weight = weight;\r\n this.addToMap = addToMap;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n return PolygonOptions;\r\n}());\r\nexports.default = PolygonOptions;\r\n\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar NavigationOptions = /** @class */ (function () {\r\n function NavigationOptions(color, weight, navigateByPoint, opacity) {\r\n if (navigateByPoint === void 0) { navigateByPoint = true; }\r\n if (opacity === void 0) { opacity = 1; }\r\n this.color = color;\r\n this.weight = weight;\r\n this.opacity = opacity;\r\n this.navigateByPoint = navigateByPoint;\r\n this.navegateOnKeyPress = false;\r\n }\r\n return NavigationOptions;\r\n}());\r\nexports.default = NavigationOptions;\r\n\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PopupOptions = /** @class */ (function () {\r\n function PopupOptions(latlng, content, marker, conditionMarker, notCalledByMap, object) {\r\n this.latlng = latlng;\r\n this.content = content;\r\n this.marker = marker;\r\n this.conditionMarker = conditionMarker;\r\n this.notCalledByMap = notCalledByMap;\r\n this.object = object;\r\n }\r\n return PopupOptions;\r\n}());\r\nexports.default = PopupOptions;\r\n\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n/**\r\n * urlBuilder\r\n *\r\n * @param {object} params\r\n * @param {string} params.base the base url\r\n * @param {array} params.libraries an array of the libraries to be requested\r\n * @param {string} params.callback the callback function\r\n *\r\n * @return {string}\r\n */\r\nexports.urlBuilder = function (params) {\r\n var builtUrl = params.base;\r\n builtUrl += '?';\r\n if (params.apiKey) {\r\n builtUrl += 'key=' + params.apiKey + '&';\r\n }\r\n if (params.integrity) {\r\n builtUrl += 'integrity=' + params.integrity + '&';\r\n }\r\n if (params.client) {\r\n builtUrl += 'client=' + params.client + '&';\r\n }\r\n if (params.crossorigin) {\r\n builtUrl += 'crossorigin=' + params.crossorigin + '&';\r\n }\r\n if (params.libraries && params.libraries.length > 0) {\r\n builtUrl += 'libraries=';\r\n params.libraries.forEach(function (library, index) {\r\n builtUrl += library;\r\n if (index !== params.libraries.length - 1) {\r\n builtUrl += ',';\r\n }\r\n });\r\n builtUrl += '&';\r\n }\r\n if (params.language) {\r\n builtUrl += 'language=' + params.language + '&';\r\n }\r\n if (params.callback) {\r\n builtUrl += 'callback=' + params.callback + '&';\r\n }\r\n return builtUrl;\r\n};\r\n\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(7);\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// inlog-maps.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 42);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0775c726c0583dea30a0","export default class EventReturn {\r\n public latlng: number[];\r\n\r\n constructor(latlng: number[]) {\r\n this.latlng = latlng;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/events/event-return.ts","export enum MapEventType {\r\n Click,\r\n ZoomChanged\r\n}\r\n\r\nexport enum MarkerEventType {\r\n Click,\r\n RightClick,\r\n AfterDrag,\r\n MouseOver,\r\n MouseOut,\r\n BeforeDrag\r\n}\r\n\r\nexport enum CircleEventType {\r\n Click,\r\n CenterChanged,\r\n RadiusChanged\r\n}\r\n\r\nexport enum PolygonEventType {\r\n SetAt,\r\n InsertAt,\r\n RemoveAt,\r\n DragPolygon,\r\n Click\r\n}\r\n\r\nexport enum PolylineEventType {\r\n SetAt,\r\n InsertAt,\r\n RemoveAt,\r\n DragPolyline,\r\n MouseOver,\r\n MouseOut\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/dto/event-type.ts","export enum MapType {\r\n Google,\r\n Leaflet\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/dto/map-type.ts","export enum PolylineType {\r\n Dashed,\r\n Dotted,\r\n Arrow\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/dto/polyline-type.ts","export default class MarkerClustererConfig {\r\n public clusterZoomOnClick: boolean;\r\n public clusterMinSize: number;\r\n public clusterMaxZoom: number;\r\n\r\n constructor(clusterZoomOnClick: boolean, clusterMinSize: number, clusterMaxZoom: number) {\r\n this.clusterZoomOnClick = clusterZoomOnClick;\r\n this.clusterMinSize = clusterMinSize;\r\n this.clusterMaxZoom = clusterMaxZoom;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker-clusterer/marker-clusterer-config.ts","import NavigationOptions from './navigations-options';\r\nimport { PolylineType } from '../../dto/polyline-type';\r\n\r\nexport default class PolylineOptions {\r\n public path: number[][];\r\n public addToMap?: boolean;\r\n public fitBounds?: boolean;\r\n public editable?: boolean;\r\n public draggable?: boolean;\r\n public color?: string;\r\n public weight: number;\r\n public object?: object;\r\n public infowindows?: string[];\r\n public style?: PolylineType;\r\n public navigateOptions?: NavigationOptions;\r\n public opacity: number;\r\n public zIndex: number;\r\n\r\n constructor(path?: number[][], addToMap?: boolean, fitBounds?: boolean,\r\n editable?: boolean, draggable?: boolean, color?: string, weight?: number,\r\n object?: object, infowindows?: string[], navigateOptions?: NavigationOptions, style?: PolylineType,\r\n opacity?: number, zIndex?: number) {\r\n\r\n this.path = path;\r\n this.addToMap = addToMap;\r\n this.fitBounds = fitBounds;\r\n this.editable = editable;\r\n this.draggable = draggable;\r\n this.color = color;\r\n this.weight = weight;\r\n this.object = object;\r\n this.infowindows = infowindows;\r\n this.navigateOptions = navigateOptions;\r\n this.style = style;\r\n this.opacity = opacity;\r\n this.zIndex = zIndex;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/polyline/polyline-options.ts","import { MapType } from '../models/dto/map-type';\r\nimport { urlBuilder } from './url-builder';\r\n\r\nexport class MapsApiLoaderService {\r\n public static loadGoogleAPI(params) {\r\n const script = document.createElement('script');\r\n\r\n script.type = 'text/javascript';\r\n script.setAttribute('data-google-inlogmaps', 'true');\r\n\r\n script.src = urlBuilder({\r\n apiKey: params.apiKey,\r\n base: 'https://maps.googleapis.com/maps/api/js',\r\n callback: 'mapsAPILoadCallback',\r\n client: params.client,\r\n language: params.language,\r\n libraries: params.libraries || []\r\n });\r\n\r\n var has_script = document.querySelector('script').hasAttribute('data-google-inlogmaps');\r\n\r\n if (!has_script) document.querySelector('head').appendChild(script);\r\n }\r\n\r\n public static loadLeafletAPI(params) {\r\n const link = document.createElement('link');\r\n link.rel = 'stylesheet';\r\n link.href = 'https://desenvolvimentoweb.blob.core.windows.net/inlog-leaflet/leaflet.css';\r\n // link.integrity = params.cssIntegrity;\r\n // link.setAttribute('crossorigin', params.crossorigin);\r\n\r\n document.querySelector('head').appendChild(link);\r\n\r\n const script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n\r\n script.src = urlBuilder({\r\n base: 'https://desenvolvimentoweb.blob.core.windows.net/inlog-leaflet/leaflet.js',\r\n callback: 'mapsAPILoadCallback',\r\n // crossorigin: params.crossorigin,\r\n // integrity: params.integrity\r\n });\r\n\r\n document.querySelector('head').appendChild(script);\r\n }\r\n\r\n private static windowRef = null;\r\n private static mapsApi = null;\r\n\r\n constructor() { /* */ }\r\n\r\n // TODO: needs refactoring\r\n public loadApi(mapType: MapType, params) {\r\n if (MapsApiLoaderService.mapsApi) {\r\n return Promise.resolve(MapsApiLoaderService.mapsApi);\r\n }\r\n\r\n MapsApiLoaderService.windowRef = window ? window : { api: null, mapsAPILoadCallback: null };\r\n\r\n const deferred = (resolve, reject) => {\r\n if (mapType === MapType.Google) {\r\n MapsApiLoaderService.loadGoogleAPI(params);\r\n } else {\r\n MapsApiLoaderService.loadLeafletAPI(params);\r\n }\r\n\r\n // Temporaria para testar Leaflet\r\n if (mapType === MapType.Leaflet) {\r\n setTimeout(() => {\r\n MapsApiLoaderService.mapsApi = MapsApiLoaderService.windowRef.L;\r\n resolve(MapsApiLoaderService.mapsApi);\r\n }, 2000);\r\n } else {\r\n MapsApiLoaderService.windowRef.mapsAPILoadCallback = () => {\r\n MapsApiLoaderService.mapsApi = MapsApiLoaderService.windowRef.google;\r\n resolve(MapsApiLoaderService.mapsApi);\r\n };\r\n }\r\n\r\n setTimeout(() => {\r\n if (!MapsApiLoaderService.windowRef.api) {\r\n reject(new Error('Loading took too long'));\r\n }\r\n }, 5000);\r\n };\r\n\r\n return new Promise(deferred);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/maps-api-loader.service.ts","'use strict';\r\n\r\nimport Map from './map';\r\nimport IMapFunctions from './models/apis/mapFunctions';\r\nimport CircleAlterOptions from './models/features/circle/circle-alter-options';\r\nimport CircleOptions from './models/features/circle/circle-options';\r\nimport EventReturn from './models/features/events/event-return';\r\nimport GeoJsonOptions from './models/features/geojson/geojson-options';\r\nimport CircleMarkerOptions from './models/features/marker/circle-marker-options';\r\nimport CircleMarkerStyle from './models/features/marker/circle-marker-style';\r\nimport MarkerAlterOptions from './models/features/marker/marker-alter-options';\r\nimport MarkerIcon from './models/features/marker/marker-icon';\r\nimport MarkerOptions from './models/features/marker/marker-options';\r\nimport OverlayOptions from './models/features/overlay/overlay-options';\r\nimport PolygonAlterOptions from './models/features/polygons/polygon-alter-options';\r\nimport PolygonOptions from './models/features/polygons/polygon-options';\r\nimport NavigationOptions from './models/features/polyline/navigations-options';\r\nimport PolylineOptions from './models/features/polyline/polyline-options';\r\nimport PopupOptions from './models/features/popup/popup-options';\r\nimport MarkerClustererConfig from './models/features/marker-clusterer/marker-clusterer-config';\r\nimport { MarkerEventType, CircleEventType, PolygonEventType, PolylineEventType, MapEventType } from './models/dto/event-type';\r\nimport { MapType } from './models/dto/map-type';\r\nimport { PolylineType } from './models/dto/polyline-type';\r\n\r\nexport { Map };\r\nexport { MarkerOptions };\r\nexport { MarkerIcon };\r\nexport { EventReturn };\r\nexport { CircleMarkerOptions };\r\nexport { CircleMarkerStyle };\r\nexport { GeoJsonOptions };\r\nexport { MarkerAlterOptions };\r\nexport { PopupOptions };\r\nexport { PolygonOptions };\r\nexport { PolygonAlterOptions };\r\nexport { CircleOptions };\r\nexport { CircleAlterOptions };\r\nexport { PolylineOptions };\r\nexport { NavigationOptions };\r\nexport { IMapFunctions };\r\nexport { OverlayOptions };\r\nexport { MapType };\r\nexport { PolylineType };\r\nexport { MapEventType };\r\nexport { MarkerEventType };\r\nexport { CircleEventType };\r\nexport { PolygonEventType };\r\nexport { PolylineEventType };\r\nexport { MarkerClustererConfig };\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.ts","/**\n * @name MarkerClustererPlus for Google Maps V3\n * @version 2.1.11\n * @author Gary Little\n * @fileoverview\n * The library creates and manages per-zoom-level clusters for large amounts of markers.\n * <p>\n * This is an enhanced V3 implementation of the V2 MarkerClusterer by Xiaoxi Wu. It is\n * based on the V3 MarkerClusterer port by Luke Mahe. MarkerClustererPlus was created\n * by Gary Little.\n * <p>\n * v2.0 release: MarkerClustererPlus v2.0 is backward compatible with MarkerClusterer v1.0. It\n * adds support for the <code>ignoreHidden</code>, <code>title</code>, <code>batchSizeIE</code>,\n * and <code>calculator</code> properties as well as support for four more events. It also allows\n * greater control over the styling of the text that appears on the cluster marker. The\n * documentation has been significantly improved and the overall code has been simplified and\n * polished. Very large numbers of markers can now be managed without causing Javascript timeout\n * errors on Internet Explorer. Note that the name of the <code>clusterclick</code> event has been\n * deprecated. The new name is <code>click</code>, so please change your application code now.\n */\n\n/**\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * @name ClusterIconStyle\n * @class This class represents the object for values in the <code>styles</code> array passed\n * to the {@link MarkerClusterer} constructor. The element in this array that is used to\n * style the cluster icon is determined by calling the <code>calculator</code> function.\n *\n * @property {string} url The URL of the cluster icon image file. Required.\n * @property {number} height The display height (in pixels) of the cluster icon. Required.\n * @property {number} width The display width (in pixels) of the cluster icon. Required.\n * @property {Array} [anchorText] The position (in pixels) from the center of the cluster icon to\n * where the text label is to be centered and drawn. The format is <code>[yoffset, xoffset]</code>\n * where <code>yoffset</code> increases as you go down from center and <code>xoffset</code>\n * increases to the right of center. The default is <code>[0, 0]</code>.\n * @property {Array} [anchorIcon] The anchor position (in pixels) of the cluster icon. This is the\n * spot on the cluster icon that is to be aligned with the cluster position. The format is\n * <code>[yoffset, xoffset]</code> where <code>yoffset</code> increases as you go down and\n * <code>xoffset</code> increases to the right of the top-left corner of the icon. The default\n * anchor position is the center of the cluster icon.\n * @property {string} [textColor=\"black\"] The color of the label text shown on the\n * cluster icon.\n * @property {number} [textSize=11] The size (in pixels) of the label text shown on the\n * cluster icon.\n * @property {string} [textDecoration=\"none\"] The value of the CSS <code>text-decoration</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontWeight=\"bold\"] The value of the CSS <code>font-weight</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontStyle=\"normal\"] The value of the CSS <code>font-style</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [fontFamily=\"Arial,sans-serif\"] The value of the CSS <code>font-family</code>\n * property for the label text shown on the cluster icon.\n * @property {string} [backgroundPosition=\"0 0\"] The position of the cluster icon image\n * within the image defined by <code>url</code>. The format is <code>\"xpos ypos\"</code>\n * (the same format as for the CSS <code>background-position</code> property). You must set\n * this property appropriately when the image defined by <code>url</code> represents a sprite\n * containing multiple images. Note that the position <i>must</i> be specified in px units.\n */\n/**\n * @name ClusterIconInfo\n * @class This class is an object containing general information about a cluster icon. This is\n * the object that a <code>calculator</code> function returns.\n *\n * @property {string} text The text of the label to be shown on the cluster icon.\n * @property {number} index The index plus 1 of the element in the <code>styles</code>\n * array to be used to style the cluster icon.\n * @property {string} title The tooltip to display when the mouse moves over the cluster icon.\n * If this value is <code>undefined</code> or <code>\"\"</code>, <code>title</code> is set to the\n * value of the <code>title</code> property passed to the MarkerClusterer.\n */\n/**\n * A cluster icon.\n *\n * @constructor\n * @extends google.maps.OverlayView\n * @param {Cluster} cluster The cluster with which the icon is to be associated.\n * @param {Array} [styles] An array of {@link ClusterIconStyle} defining the cluster icons\n * to use for various cluster sizes.\n * @private\n */\nfunction ClusterIcon(cluster, styles) {\n cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);\n\n this.cluster_ = cluster;\n this.className_ = cluster.getMarkerClusterer().getClusterClass();\n this.styles_ = styles;\n this.center_ = null;\n this.div_ = null;\n this.sums_ = null;\n this.visible_ = false;\n\n this.setMap(cluster.getMap()); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Adds the icon to the DOM.\n */\nClusterIcon.prototype.onAdd = function () {\n var cClusterIcon = this;\n var cMouseDownInCluster;\n var cDraggingMapByCluster;\n var gmVersion = google.maps.version.split(\".\");\n\n gmVersion = parseInt(gmVersion[0] * 100, 10) + parseInt(gmVersion[1], 10);\n\n this.div_ = document.createElement(\"div\");\n this.div_.className = this.className_;\n if (this.visible_) {\n this.show();\n }\n\n this.getPanes().overlayMouseTarget.appendChild(this.div_);\n\n // Fix for Issue 157\n this.boundsChangedListener_ = google.maps.event.addListener(this.getMap(), \"bounds_changed\", function () {\n cDraggingMapByCluster = cMouseDownInCluster;\n });\n\n google.maps.event.addDomListener(this.div_, \"mousedown\", function () {\n cMouseDownInCluster = true;\n cDraggingMapByCluster = false;\n });\n\n// March 1, 2018: Fix for this 3.32 exp bug, https://issuetracker.google.com/issues/73571522\n// But it doesn't work with earlier releases so do a version check.\n if (gmVersion >= 332) { // Ugly version-dependent code\n google.maps.event.addDomListener(this.div_, \"touchstart\", function (e) {\n e.stopPropagation();\n });\n }\n\n google.maps.event.addDomListener(this.div_, \"click\", function (e) {\n cMouseDownInCluster = false;\n if (!cDraggingMapByCluster) {\n var theBounds;\n var mz;\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(mc, \"click\", cClusterIcon.cluster_);\n google.maps.event.trigger(mc, \"clusterclick\", cClusterIcon.cluster_); // deprecated name\n\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (mc.getZoomOnClick()) {\n // Zoom into the cluster.\n mz = mc.getMaxZoom();\n theBounds = cClusterIcon.cluster_.getBounds();\n mc.getMap().fitBounds(theBounds);\n // There is a fix for Issue 170 here:\n setTimeout(function () {\n mc.getMap().fitBounds(theBounds);\n // Don't zoom beyond the max zoom level\n if (mz !== null && (mc.getMap().getZoom() > mz)) {\n mc.getMap().setZoom(mz + 1);\n }\n }, 100);\n }\n\n // Prevent event propagation to the map:\n e.cancelBubble = true;\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n }\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseover\", function () {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseover\", cClusterIcon.cluster_);\n });\n\n google.maps.event.addDomListener(this.div_, \"mouseout\", function () {\n var mc = cClusterIcon.cluster_.getMarkerClusterer();\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(mc, \"mouseout\", cClusterIcon.cluster_);\n });\n};\n\n\n/**\n * Removes the icon from the DOM.\n */\nClusterIcon.prototype.onRemove = function () {\n if (this.div_ && this.div_.parentNode) {\n this.hide();\n google.maps.event.removeListener(this.boundsChangedListener_);\n google.maps.event.clearInstanceListeners(this.div_);\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n};\n\n\n/**\n * Draws the icon.\n */\nClusterIcon.prototype.draw = function () {\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.top = pos.y + \"px\";\n this.div_.style.left = pos.x + \"px\";\n this.div_.style.zIndex = google.maps.Marker.MAX_ZINDEX + 1; // Put above all unclustered markers\n }\n};\n\n\n/**\n * Hides the icon.\n */\nClusterIcon.prototype.hide = function () {\n if (this.div_) {\n this.div_.style.display = \"none\";\n }\n this.visible_ = false;\n};\n\n\n/**\n * Positions and shows the icon.\n */\nClusterIcon.prototype.show = function () {\n if (this.div_) {\n var img = \"\";\n // NOTE: values must be specified in px units\n var bp = this.backgroundPosition_.split(\" \");\n var spriteH = parseInt(bp[0].replace(/^\\s+|\\s+$/g, \"\"), 10);\n var spriteV = parseInt(bp[1].replace(/^\\s+|\\s+$/g, \"\"), 10);\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos);\n img = \"<img src='\" + this.url_ + \"' style='position: absolute; top: \" + spriteV + \"px; left: \" + spriteH + \"px; \";\n if (this.cluster_.getMarkerClusterer().enableRetinaIcons_) {\n img += \"width: \" + this.width_ + \"px; height: \" + this.height_ + \"px;\";\n } else {\n img += \"clip: rect(\" + (-1 * spriteV) + \"px, \" + ((-1 * spriteH) + this.width_) + \"px, \" +\n ((-1 * spriteV) + this.height_) + \"px, \" + (-1 * spriteH) + \"px);\";\n }\n img += \"'>\";\n this.div_.innerHTML = img + \"<div style='\" +\n \"position: absolute;\" +\n \"top: \" + this.anchorText_[0] + \"px;\" +\n \"left: \" + this.anchorText_[1] + \"px;\" +\n \"color: \" + this.textColor_ + \";\" +\n \"font-size: \" + this.textSize_ + \"px;\" +\n \"font-family: \" + this.fontFamily_ + \";\" +\n \"font-weight: \" + this.fontWeight_ + \";\" +\n \"font-style: \" + this.fontStyle_ + \";\" +\n \"text-decoration: \" + this.textDecoration_ + \";\" +\n \"text-align: center;\" +\n \"width: \" + this.width_ + \"px;\" +\n \"line-height:\" + this.height_ + \"px;\" +\n \"'>\" + this.sums_.text + \"</div>\";\n if (typeof this.sums_.title === \"undefined\" || this.sums_.title === \"\") {\n this.div_.title = this.cluster_.getMarkerClusterer().getTitle();\n } else {\n this.div_.title = this.sums_.title;\n }\n this.div_.style.display = \"\";\n }\n this.visible_ = true;\n};\n\n\n/**\n * Sets the icon styles to the appropriate element in the styles array.\n *\n * @param {ClusterIconInfo} sums The icon label text and styles index.\n */\nClusterIcon.prototype.useStyle = function (sums) {\n this.sums_ = sums;\n var index = Math.max(0, sums.index - 1);\n index = Math.min(this.styles_.length - 1, index);\n var style = this.styles_[index];\n this.url_ = style.url;\n this.height_ = style.height;\n this.width_ = style.width;\n this.anchorText_ = style.anchorText || [0, 0];\n this.anchorIcon_ = style.anchorIcon || [parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)];\n this.textColor_ = style.textColor || \"black\";\n this.textSize_ = style.textSize || 11;\n this.textDecoration_ = style.textDecoration || \"none\";\n this.fontWeight_ = style.fontWeight || \"bold\";\n this.fontStyle_ = style.fontStyle || \"normal\";\n this.fontFamily_ = style.fontFamily || \"Arial,sans-serif\";\n this.backgroundPosition_ = style.backgroundPosition || \"0 0\";\n};\n\n\n/**\n * Sets the position at which to center the icon.\n *\n * @param {google.maps.LatLng} center The latlng to set as the center.\n */\nClusterIcon.prototype.setCenter = function (center) {\n this.center_ = center;\n};\n\n\n/**\n * Creates the cssText style parameter based on the position of the icon.\n *\n * @param {google.maps.Point} pos The position of the icon.\n * @return {string} The CSS style text.\n */\nClusterIcon.prototype.createCss = function (pos) {\n var style = [];\n style.push(\"cursor: pointer;\");\n style.push(\"position: absolute; top: \" + pos.y + \"px; left: \" + pos.x + \"px;\");\n style.push(\"width: \" + this.width_ + \"px; height: \" + this.height_ + \"px;\");\n style.push(\"-webkit-user-select: none;\");\n style.push(\"-khtml-user-select: none;\");\n style.push(\"-moz-user-select: none;\");\n style.push(\"-o-user-select: none;\");\n style.push(\"user-select: none;\");\n return style.join(\"\");\n};\n\n\n/**\n * Returns the position at which to place the DIV depending on the latlng.\n *\n * @param {google.maps.LatLng} latlng The position in latlng.\n * @return {google.maps.Point} The position in pixels.\n */\nClusterIcon.prototype.getPosFromLatLng_ = function (latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n pos.x -= this.anchorIcon_[1];\n pos.y -= this.anchorIcon_[0];\n pos.x = parseInt(pos.x, 10);\n pos.y = parseInt(pos.y, 10);\n return pos;\n};\n\n\n/**\n * Creates a single cluster that manages a group of proximate markers.\n * Used internally, do not call this constructor directly.\n * @constructor\n * @param {MarkerClusterer} mc The <code>MarkerClusterer</code> object with which this\n * cluster is associated.\n */\nfunction Cluster(mc) {\n this.markerClusterer_ = mc;\n this.map_ = mc.getMap();\n this.gridSize_ = mc.getGridSize();\n this.minClusterSize_ = mc.getMinimumClusterSize();\n this.averageCenter_ = mc.getAverageCenter();\n this.markers_ = [];\n this.center_ = null;\n this.bounds_ = null;\n this.clusterIcon_ = new ClusterIcon(this, mc.getStyles());\n}\n\n\n/**\n * Returns the number of markers managed by the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {number} The number of markers in the cluster.\n */\nCluster.prototype.getSize = function () {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the array of markers managed by the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {Array} The array of markers in the cluster.\n */\nCluster.prototype.getMarkers = function () {\n return this.markers_;\n};\n\n\n/**\n * Returns the center of the cluster. You can call this from\n * a <code>click</code>, <code>mouseover</code>, or <code>mouseout</code> event handler\n * for the <code>MarkerClusterer</code> object.\n *\n * @return {google.maps.LatLng} The center of the cluster.\n */\nCluster.prototype.getCenter = function () {\n return this.center_;\n};\n\n\n/**\n * Returns the map with which the cluster is associated.\n *\n * @return {google.maps.Map} The map.\n * @ignore\n */\nCluster.prototype.getMap = function () {\n return this.map_;\n};\n\n\n/**\n * Returns the <code>MarkerClusterer</code> object with which the cluster is associated.\n *\n * @return {MarkerClusterer} The associated marker clusterer.\n * @ignore\n */\nCluster.prototype.getMarkerClusterer = function () {\n return this.markerClusterer_;\n};\n\n\n/**\n * Returns the bounds of the cluster.\n *\n * @return {google.maps.LatLngBounds} the cluster bounds.\n * @ignore\n */\nCluster.prototype.getBounds = function () {\n var i;\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n var markers = this.getMarkers();\n for (i = 0; i < markers.length; i++) {\n bounds.extend(markers[i].getPosition());\n }\n return bounds;\n};\n\n\n/**\n * Removes the cluster from the map.\n *\n * @ignore\n */\nCluster.prototype.remove = function () {\n this.clusterIcon_.setMap(null);\n this.markers_ = [];\n delete this.markers_;\n};\n\n\n/**\n * Adds a marker to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to be added.\n * @return {boolean} True if the marker was added.\n * @ignore\n */\nCluster.prototype.addMarker = function (marker) {\n var i;\n var mCount;\n var mz;\n\n if (this.isMarkerAlreadyAdded_(marker)) {\n return false;\n }\n\n if (!this.center_) {\n this.center_ = marker.getPosition();\n this.calculateBounds_();\n } else {\n if (this.averageCenter_) {\n var l = this.markers_.length + 1;\n var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\n var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\n this.center_ = new google.maps.LatLng(lat, lng);\n this.calculateBounds_();\n }\n }\n\n marker.isAdded = true;\n this.markers_.push(marker);\n\n mCount = this.markers_.length;\n mz = this.markerClusterer_.getMaxZoom();\n if (mz !== null && this.map_.getZoom() > mz) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount < this.minClusterSize_) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map_) {\n marker.setMap(this.map_);\n }\n } else if (mCount === this.minClusterSize_) {\n // Hide the markers that were showing.\n for (i = 0; i < mCount; i++) {\n this.markers_[i].setMap(null);\n }\n } else {\n marker.setMap(null);\n }\n\n this.updateIcon_();\n return true;\n};\n\n\n/**\n * Determines if a marker lies within the cluster's bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker lies in the bounds.\n * @ignore\n */\nCluster.prototype.isMarkerInClusterBounds = function (marker) {\n return this.bounds_.contains(marker.getPosition());\n};\n\n\n/**\n * Calculates the extended bounds of the cluster with the grid.\n */\nCluster.prototype.calculateBounds_ = function () {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\n};\n\n\n/**\n * Updates the cluster icon.\n */\nCluster.prototype.updateIcon_ = function () {\n var mCount = this.markers_.length;\n var mz = this.markerClusterer_.getMaxZoom();\n\n if (mz !== null && this.map_.getZoom() > mz) {\n this.clusterIcon_.hide();\n return;\n }\n\n if (mCount < this.minClusterSize_) {\n // Min cluster size not yet reached.\n this.clusterIcon_.hide();\n return;\n }\n\n var numStyles = this.markerClusterer_.getStyles().length;\n var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\n this.clusterIcon_.setCenter(this.center_);\n this.clusterIcon_.useStyle(sums);\n this.clusterIcon_.show();\n};\n\n\n/**\n * Determines if a marker has already been added to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker has already been added.\n */\nCluster.prototype.isMarkerAlreadyAdded_ = function (marker) {\n var i;\n if (this.markers_.indexOf) {\n return this.markers_.indexOf(marker) !== -1;\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n return true;\n }\n }\n }\n return false;\n};\n\n\n/**\n * @name MarkerClustererOptions\n * @class This class represents the optional parameter passed to\n * the {@link MarkerClusterer} constructor.\n * @property {number} [gridSize=60] The grid size of a cluster in pixels. The grid is a square.\n * @property {number} [maxZoom=null] The maximum zoom level at which clustering is enabled or\n * <code>null</code> if clustering is to be enabled at all zoom levels.\n * @property {boolean} [zoomOnClick=true] Whether to zoom the map when a cluster marker is\n * clicked. You may want to set this to <code>false</code> if you have installed a handler\n * for the <code>click</code> event and it deals with zooming on its own.\n * @property {boolean} [averageCenter=false] Whether the position of a cluster marker should be\n * the average position of all markers in the cluster. If set to <code>false</code>, the\n * cluster marker is positioned at the location of the first marker added to the cluster.\n * @property {number} [minimumClusterSize=2] The minimum number of markers needed in a cluster\n * before the markers are hidden and a cluster marker appears.\n * @property {boolean} [ignoreHidden=false] Whether to ignore hidden markers in clusters. You\n * may want to set this to <code>true</code> to ensure that hidden markers are not included\n * in the marker count that appears on a cluster marker (this count is the value of the\n * <code>text</code> property of the result returned by the default <code>calculator</code>).\n * If set to <code>true</code> and you change the visibility of a marker being clustered, be\n * sure to also call <code>MarkerClusterer.repaint()</code>.\n * @property {string} [title=\"\"] The tooltip to display when the mouse moves over a cluster\n * marker. (Alternatively, you can use a custom <code>calculator</code> function to specify a\n * different tooltip for each cluster marker.)\n * @property {function} [calculator=MarkerClusterer.CALCULATOR] The function used to determine\n * the text to be displayed on a cluster marker and the index indicating which style to use\n * for the cluster marker. The input parameters for the function are (1) the array of markers\n * represented by a cluster marker and (2) the number of cluster icon styles. It returns a\n * {@link ClusterIconInfo} object. The default <code>calculator</code> returns a\n * <code>text</code> property which is the number of markers in the cluster and an\n * <code>index</code> property which is one higher than the lowest integer such that\n * <code>10^i</code> exceeds the number of markers in the cluster, or the size of the styles\n * array, whichever is less. The <code>styles</code> array element used has an index of\n * <code>index</code> minus 1. For example, the default <code>calculator</code> returns a\n * <code>text</code> value of <code>\"125\"</code> and an <code>index</code> of <code>3</code>\n * for a cluster icon representing 125 markers so the element used in the <code>styles</code>\n * array is <code>2</code>. A <code>calculator</code> may also return a <code>title</code>\n * property that contains the text of the tooltip to be used for the cluster marker. If\n * <code>title</code> is not defined, the tooltip is set to the value of the <code>title</code>\n * property for the MarkerClusterer.\n * @property {string} [clusterClass=\"cluster\"] The name of the CSS class defining general styles\n * for the cluster markers. Use this class to define CSS styles that are not set up by the code\n * that processes the <code>styles</code> array.\n * @property {Array} [styles] An array of {@link ClusterIconStyle} elements defining the styles\n * of the cluster markers to be used. The element to be used to style a given cluster marker\n * is determined by the function defined by the <code>calculator</code> property.\n * The default is an array of {@link ClusterIconStyle} elements whose properties are derived\n * from the values for <code>imagePath</code>, <code>imageExtension</code>, and\n * <code>imageSizes</code>.\n * @property {boolean} [enableRetinaIcons=false] Whether to allow the use of cluster icons that\n * have sizes that are some multiple (typically double) of their actual display size. Icons such\n * as these look better when viewed on high-resolution monitors such as Apple's Retina displays.\n * Note: if this property is <code>true</code>, sprites cannot be used as cluster icons.\n * @property {number} [batchSize=MarkerClusterer.BATCH_SIZE] Set this property to the\n * number of markers to be processed in a single batch when using a browser other than\n * Internet Explorer (for Internet Explorer, use the batchSizeIE property instead).\n * @property {number} [batchSizeIE=MarkerClusterer.BATCH_SIZE_IE] When Internet Explorer is\n * being used, markers are processed in several batches with a small delay inserted between\n * each batch in an attempt to avoid Javascript timeout errors. Set this property to the\n * number of markers to be processed in a single batch; select as high a number as you can\n * without causing a timeout error in the browser. This number might need to be as low as 100\n * if 15,000 markers are being managed, for example.\n * @property {string} [imagePath=MarkerClusterer.IMAGE_PATH]\n * The full URL of the root name of the group of image files to use for cluster icons.\n * The complete file name is of the form <code>imagePath</code>n.<code>imageExtension</code>\n * where n is the image file number (1, 2, etc.).\n * @property {string} [imageExtension=MarkerClusterer.IMAGE_EXTENSION]\n * The extension name for the cluster icon image files (e.g., <code>\"png\"</code> or\n * <code>\"jpg\"</code>).\n * @property {Array} [imageSizes=MarkerClusterer.IMAGE_SIZES]\n * An array of numbers containing the widths of the group of\n * <code>imagePath</code>n.<code>imageExtension</code> image files.\n * (The images are assumed to be square.)\n */\n/**\n * Creates a MarkerClusterer object with the options specified in {@link MarkerClustererOptions}.\n * @constructor\n * @extends google.maps.OverlayView\n * @param {google.maps.Map} map The Google map to attach to.\n * @param {Array.<google.maps.Marker>} [opt_markers] The markers to be added to the cluster.\n * @param {MarkerClustererOptions} [opt_options] The optional parameters.\n */\nfunction MarkerClusterer(map, opt_markers, opt_options) {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n this.extend(MarkerClusterer, google.maps.OverlayView);\n\n opt_markers = opt_markers || [];\n opt_options = opt_options || {};\n\n this.markers_ = [];\n this.clusters_ = [];\n this.listeners_ = [];\n this.activeMap_ = null;\n this.ready_ = false;\n\n this.gridSize_ = opt_options.gridSize || 60;\n this.minClusterSize_ = opt_options.minimumClusterSize || 2;\n this.maxZoom_ = opt_options.maxZoom || null;\n this.styles_ = opt_options.styles || [];\n this.title_ = opt_options.title || \"\";\n this.zoomOnClick_ = true;\n if (opt_options.zoomOnClick !== undefined) {\n this.zoomOnClick_ = opt_options.zoomOnClick;\n }\n this.averageCenter_ = false;\n if (opt_options.averageCenter !== undefined) {\n this.averageCenter_ = opt_options.averageCenter;\n }\n this.ignoreHidden_ = false;\n if (opt_options.ignoreHidden !== undefined) {\n this.ignoreHidden_ = opt_options.ignoreHidden;\n }\n this.enableRetinaIcons_ = false;\n if (opt_options.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons_ = opt_options.enableRetinaIcons;\n }\n this.imagePath_ = opt_options.imagePath || MarkerClusterer.IMAGE_PATH;\n this.imageExtension_ = opt_options.imageExtension || MarkerClusterer.IMAGE_EXTENSION;\n this.imageSizes_ = opt_options.imageSizes || MarkerClusterer.IMAGE_SIZES;\n this.calculator_ = opt_options.calculator || MarkerClusterer.CALCULATOR;\n this.batchSize_ = opt_options.batchSize || MarkerClusterer.BATCH_SIZE;\n this.batchSizeIE_ = opt_options.batchSizeIE || MarkerClusterer.BATCH_SIZE_IE;\n this.clusterClass_ = opt_options.clusterClass || \"cluster\";\n\n if (navigator.userAgent.toLowerCase().indexOf(\"msie\") !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize_ = this.batchSizeIE_;\n }\n\n this.setupStyles_();\n\n this.addMarkers(opt_markers, true);\n this.setMap(map); // Note: this causes onAdd to be called\n}\n\n\n/**\n * Implementation of the onAdd interface method.\n * @ignore\n */\nMarkerClusterer.prototype.onAdd = function () {\n var cMarkerClusterer = this;\n\n this.activeMap_ = this.getMap();\n this.ready_ = true;\n\n this.repaint();\n\n this.prevZoom_ = this.getMap().getZoom();\n\n // Add the map event listeners\n this.listeners_ = [\n google.maps.event.addListener(this.getMap(), \"zoom_changed\", function () {\n // Fix for bug #407\n // Determines map type and prevents illegal zoom levels\n var zoom = this.getMap().getZoom();\n var minZoom = this.getMap().minZoom || 0;\n var maxZoom = Math.min(this.getMap().maxZoom || 100,\n this.getMap().mapTypes[this.getMap().getMapTypeId()].maxZoom);\n zoom = Math.min(Math.max(zoom, minZoom), maxZoom);\n\n if (this.prevZoom_ != zoom) {\n this.prevZoom_ = zoom;\n this.resetViewport_(false);\n }\n }.bind(this)),\n google.maps.event.addListener(this.getMap(), \"idle\", function () {\n cMarkerClusterer.redraw_();\n })\n ];\n};\n\n\n/**\n * Implementation of the onRemove interface method.\n * Removes map event listeners and all cluster icons from the DOM.\n * All managed markers are also put back on the map.\n * @ignore\n */\nMarkerClusterer.prototype.onRemove = function () {\n var i;\n\n // Put all the managed markers back on the map:\n for (i = 0; i < this.markers_.length; i++) {\n if (this.markers_[i].getMap() !== this.activeMap_) {\n this.markers_[i].setMap(this.activeMap_);\n }\n }\n\n // Remove all clusters:\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Remove map event listeners:\n for (i = 0; i < this.listeners_.length; i++) {\n google.maps.event.removeListener(this.listeners_[i]);\n }\n this.listeners_ = [];\n\n this.activeMap_ = null;\n this.ready_ = false;\n};\n\n\n/**\n * Implementation of the draw interface method.\n * @ignore\n */\nMarkerClusterer.prototype.draw = function () {};\n\n\n/**\n * Sets up the styles object.\n */\nMarkerClusterer.prototype.setupStyles_ = function () {\n var i, size;\n if (this.styles_.length > 0) {\n return;\n }\n\n for (i = 0; i < this.imageSizes_.length; i++) {\n size = this.imageSizes_[i];\n this.styles_.push({\n url: this.imagePath_ + (i + 1) + \".\" + this.imageExtension_,\n height: size,\n width: size\n });\n }\n};\n\n\n/**\n * Fits the map to the bounds of the markers managed by the clusterer.\n */\nMarkerClusterer.prototype.fitMapToMarkers = function () {\n var i;\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (i = 0; i < markers.length; i++) {\n // March 3, 2018: Bug fix -- honor the ignoreHidden property\n if (markers[i].getVisible() || !this.getIgnoreHidden()) {\n bounds.extend(markers[i].getPosition());\n }\n }\n\n this.getMap().fitBounds(bounds);\n};\n\n\n/**\n * Returns the value of the <code>gridSize</code> property.\n *\n * @return {number} The grid size.\n */\nMarkerClusterer.prototype.getGridSize = function () {\n return this.gridSize_;\n};\n\n\n/**\n * Sets the value of the <code>gridSize</code> property.\n *\n * @param {number} gridSize The grid size.\n */\nMarkerClusterer.prototype.setGridSize = function (gridSize) {\n this.gridSize_ = gridSize;\n};\n\n\n/**\n * Returns the value of the <code>minimumClusterSize</code> property.\n *\n * @return {number} The minimum cluster size.\n */\nMarkerClusterer.prototype.getMinimumClusterSize = function () {\n return this.minClusterSize_;\n};\n\n/**\n * Sets the value of the <code>minimumClusterSize</code> property.\n *\n * @param {number} minimumClusterSize The minimum cluster size.\n */\nMarkerClusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) {\n this.minClusterSize_ = minimumClusterSize;\n};\n\n\n/**\n * Returns the value of the <code>maxZoom</code> property.\n *\n * @return {number} The maximum zoom level.\n */\nMarkerClusterer.prototype.getMaxZoom = function () {\n return this.maxZoom_;\n};\n\n\n/**\n * Sets the value of the <code>maxZoom</code> property.\n *\n * @param {number} maxZoom The maximum zoom level.\n */\nMarkerClusterer.prototype.setMaxZoom = function (maxZoom) {\n this.maxZoom_ = maxZoom;\n};\n\n\n/**\n * Returns the value of the <code>styles</code> property.\n *\n * @return {Array} The array of styles defining the cluster markers to be used.\n */\nMarkerClusterer.prototype.getStyles = function () {\n return this.styles_;\n};\n\n\n/**\n * Sets the value of the <code>styles</code> property.\n *\n * @param {Array.<ClusterIconStyle>} styles The array of styles to use.\n */\nMarkerClusterer.prototype.setStyles = function (styles) {\n this.styles_ = styles;\n};\n\n\n/**\n * Returns the value of the <code>title</code> property.\n *\n * @return {string} The content of the title text.\n */\nMarkerClusterer.prototype.getTitle = function () {\n return this.title_;\n};\n\n\n/**\n * Sets the value of the <code>title</code> property.\n *\n * @param {string} title The value of the title property.\n */\nMarkerClusterer.prototype.setTitle = function (title) {\n this.title_ = title;\n};\n\n\n/**\n * Returns the value of the <code>zoomOnClick</code> property.\n *\n * @return {boolean} True if zoomOnClick property is set.\n */\nMarkerClusterer.prototype.getZoomOnClick = function () {\n return this.zoomOnClick_;\n};\n\n\n/**\n * Sets the value of the <code>zoomOnClick</code> property.\n *\n * @param {boolean} zoomOnClick The value of the zoomOnClick property.\n */\nMarkerClusterer.prototype.setZoomOnClick = function (zoomOnClick) {\n this.zoomOnClick_ = zoomOnClick;\n};\n\n\n/**\n * Returns the value of the <code>averageCenter</code> property.\n *\n * @return {boolean} True if averageCenter property is set.\n */\nMarkerClusterer.prototype.getAverageCenter = function () {\n return this.averageCenter_;\n};\n\n\n/**\n * Sets the value of the <code>averageCenter</code> property.\n *\n * @param {boolean} averageCenter The value of the averageCenter property.\n */\nMarkerClusterer.prototype.setAverageCenter = function (averageCenter) {\n this.averageCenter_ = averageCenter;\n};\n\n\n/**\n * Returns the value of the <code>ignoreHidden</code> property.\n *\n * @return {boolean} True if ignoreHidden property is set.\n */\nMarkerClusterer.prototype.getIgnoreHidden = function () {\n return this.ignoreHidden_;\n};\n\n\n/**\n * Sets the value of the <code>ignoreHidden</code> property.\n *\n * @param {boolean} ignoreHidden The value of the ignoreHidden property.\n */\nMarkerClusterer.prototype.setIgnoreHidden = function (ignoreHidden) {\n this.ignoreHidden_ = ignoreHidden;\n};\n\n\n/**\n * Returns the value of the <code>enableRetinaIcons</code> property.\n *\n * @return {boolean} True if enableRetinaIcons property is set.\n */\nMarkerClusterer.prototype.getEnableRetinaIcons = function () {\n return this.enableRetinaIcons_;\n};\n\n\n/**\n * Sets the value of the <code>enableRetinaIcons</code> property.\n *\n * @param {boolean} enableRetinaIcons The value of the enableRetinaIcons property.\n */\nMarkerClusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) {\n this.enableRetinaIcons_ = enableRetinaIcons;\n};\n\n\n/**\n * Returns the value of the <code>imageExtension</code> property.\n *\n * @return {string} The value of the imageExtension property.\n */\nMarkerClusterer.prototype.getImageExtension = function () {\n return this.imageExtension_;\n};\n\n\n/**\n * Sets the value of the <code>imageExtension</code> property.\n *\n * @param {string} imageExtension The value of the imageExtension property.\n */\nMarkerClusterer.prototype.setImageExtension = function (imageExtension) {\n this.imageExtension_ = imageExtension;\n};\n\n\n/**\n * Returns the value of the <code>imagePath</code> property.\n *\n * @return {string} The value of the imagePath property.\n */\nMarkerClusterer.prototype.getImagePath = function () {\n return this.imagePath_;\n};\n\n\n/**\n * Sets the value of the <code>imagePath</code> property.\n *\n * @param {string} imagePath The value of the imagePath property.\n */\nMarkerClusterer.prototype.setImagePath = function (imagePath) {\n this.imagePath_ = imagePath;\n};\n\n\n/**\n * Returns the value of the <code>imageSizes</code> property.\n *\n * @return {Array} The value of the imageSizes property.\n */\nMarkerClusterer.prototype.getImageSizes = function () {\n return this.imageSizes_;\n};\n\n\n/**\n * Sets the value of the <code>imageSizes</code> property.\n *\n * @param {Array} imageSizes The value of the imageSizes property.\n */\nMarkerClusterer.prototype.setImageSizes = function (imageSizes) {\n this.imageSizes_ = imageSizes;\n};\n\n\n/**\n * Returns the value of the <code>calculator</code> property.\n *\n * @return {function} the value of the calculator property.\n */\nMarkerClusterer.prototype.getCalculator = function () {\n return this.calculator_;\n};\n\n\n/**\n * Sets the value of the <code>calculator</code> property.\n *\n * @param {function(Array.<google.maps.Marker>, number)} calculator The value\n * of the calculator property.\n */\nMarkerClusterer.prototype.setCalculator = function (calculator) {\n this.calculator_ = calculator;\n};\n\n\n/**\n * Returns the value of the <code>batchSizeIE</code> property.\n *\n * @return {number} the value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.getBatchSizeIE = function () {\n return this.batchSizeIE_;\n};\n\n\n/**\n * Sets the value of the <code>batchSizeIE</code> property.\n *\n * @param {number} batchSizeIE The value of the batchSizeIE property.\n */\nMarkerClusterer.prototype.setBatchSizeIE = function (batchSizeIE) {\n this.batchSizeIE_ = batchSizeIE;\n};\n\n\n/**\n * Returns the value of the <code>clusterClass</code> property.\n *\n * @return {string} the value of the clusterClass property.\n */\nMarkerClusterer.prototype.getClusterClass = function () {\n return this.clusterClass_;\n};\n\n\n/**\n * Sets the value of the <code>clusterClass</code> property.\n *\n * @param {string} clusterClass The value of the clusterClass property.\n */\nMarkerClusterer.prototype.setClusterClass = function (clusterClass) {\n this.clusterClass_ = clusterClass;\n};\n\n\n/**\n * Returns the array of markers managed by the clusterer.\n *\n * @return {Array} The array of markers managed by the clusterer.\n */\nMarkerClusterer.prototype.getMarkers = function () {\n return this.markers_;\n};\n\n\n/**\n * Returns the number of markers managed by the clusterer.\n *\n * @return {number} The number of markers.\n */\nMarkerClusterer.prototype.getTotalMarkers = function () {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the current array of clusters formed by the clusterer.\n *\n * @return {Array} The array of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getClusters = function () {\n return this.clusters_;\n};\n\n\n/**\n * Returns the number of clusters formed by the clusterer.\n *\n * @return {number} The number of clusters formed by the clusterer.\n */\nMarkerClusterer.prototype.getTotalClusters = function () {\n return this.clusters_.length;\n};\n\n\n/**\n * Adds a marker to the clusterer. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarker = function (marker, opt_nodraw) {\n this.pushMarkerTo_(marker);\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Adds an array of markers to the clusterer. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>.\n *\n * @param {Array.<google.maps.Marker>} markers The markers to add.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n */\nMarkerClusterer.prototype.addMarkers = function (markers, opt_nodraw) {\n var key;\n for (key in markers) {\n if (markers.hasOwnProperty(key)) {\n this.pushMarkerTo_(markers[key]);\n }\n }\n if (!opt_nodraw) {\n this.redraw_();\n }\n};\n\n\n/**\n * Pushes a marker to the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.pushMarkerTo_ = function (marker) {\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n var cMarkerClusterer = this;\n google.maps.event.addListener(marker, \"dragend\", function () {\n if (cMarkerClusterer.ready_) {\n this.isAdded = false;\n cMarkerClusterer.repaint();\n }\n });\n }\n marker.isAdded = false;\n this.markers_.push(marker);\n};\n\n\n/**\n * Removes a marker from the cluster. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if the\n * marker was removed from the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to remove.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n * @return {boolean} True if the marker was removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarker = function (marker, opt_nodraw) {\n var removed = this.removeMarker_(marker);\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes an array of markers from the cluster. The clusters are redrawn unless\n * <code>opt_nodraw</code> is set to <code>true</code>. Returns <code>true</code> if markers\n * were removed from the clusterer.\n *\n * @param {Array.<google.maps.Marker>} markers The markers to remove.\n * @param {boolean} [opt_nodraw] Set to <code>true</code> to prevent redrawing.\n * @return {boolean} True if markers were removed from the clusterer.\n */\nMarkerClusterer.prototype.removeMarkers = function (markers, opt_nodraw) {\n var i, r;\n var removed = false;\n\n for (i = 0; i < markers.length; i++) {\n r = this.removeMarker_(markers[i]);\n removed = removed || r;\n }\n\n if (!opt_nodraw && removed) {\n this.repaint();\n }\n\n return removed;\n};\n\n\n/**\n * Removes a marker and returns true if removed, false if not.\n *\n * @param {google.maps.Marker} marker The marker to remove\n * @return {boolean} Whether the marker was removed or not\n */\nMarkerClusterer.prototype.removeMarker_ = function (marker) {\n var i;\n var index = -1;\n if (this.markers_.indexOf) {\n index = this.markers_.indexOf(marker);\n } else {\n for (i = 0; i < this.markers_.length; i++) {\n if (marker === this.markers_[i]) {\n index = i;\n break;\n }\n }\n }\n\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n\n marker.setMap(null);\n this.markers_.splice(index, 1); // Remove the marker from the list of managed markers\n return true;\n};\n\n\n/**\n * Removes all clusters and markers from the map and also removes all markers\n * managed by the clusterer.\n */\nMarkerClusterer.prototype.clearMarkers = function () {\n this.resetViewport_(true);\n this.markers_ = [];\n};\n\n\n/**\n * Recalculates and redraws all the marker clusters from scratch.\n * Call this after changing any properties.\n */\nMarkerClusterer.prototype.repaint = function () {\n var oldClusters = this.clusters_.slice();\n this.clusters_ = [];\n this.resetViewport_(false);\n this.redraw_();\n\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function () {\n var i;\n for (i = 0; i < oldClusters.length; i++) {\n oldClusters[i].remove();\n }\n }, 0);\n};\n\n\n/**\n * Returns the current bounds extended by the grid size.\n *\n * @param {google.maps.LatLngBounds} bounds The bounds to extend.\n * @return {google.maps.LatLngBounds} The extended bounds.\n * @ignore\n */\nMarkerClusterer.prototype.getExtendedBounds = function (bounds) {\n var projection = this.getProjection();\n\n // Turn the bounds into latlng.\n var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),\n bounds.getNorthEast().lng());\n var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),\n bounds.getSouthWest().lng());\n\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(tr);\n trPix.x += this.gridSize_;\n trPix.y -= this.gridSize_;\n\n var blPix = projection.fromLatLngToDivPixel(bl);\n blPix.x -= this.gridSize_;\n blPix.y += this.gridSize_;\n\n // Convert the pixel points back to LatLng\n var ne = projection.fromDivPixelToLatLng(trPix);\n var sw = projection.fromDivPixelToLatLng(blPix);\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(ne);\n bounds.extend(sw);\n\n return bounds;\n};\n\n\n/**\n * Redraws all the clusters.\n */\nMarkerClusterer.prototype.redraw_ = function () {\n this.createClusters_(0);\n};\n\n\n/**\n * Removes all clusters from the map. The markers are also removed from the map\n * if <code>opt_hide</code> is set to <code>true</code>.\n *\n * @param {boolean} [opt_hide] Set to <code>true</code> to also remove the markers\n * from the map.\n */\nMarkerClusterer.prototype.resetViewport_ = function (opt_hide) {\n var i, marker;\n // Remove all the clusters\n for (i = 0; i < this.clusters_.length; i++) {\n this.clusters_[i].remove();\n }\n this.clusters_ = [];\n\n // Reset the markers to not be added and to be removed from the map.\n for (i = 0; i < this.markers_.length; i++) {\n marker = this.markers_[i];\n marker.isAdded = false;\n if (opt_hide) {\n marker.setMap(null);\n }\n }\n};\n\n\n/**\n * Calculates the distance between two latlng locations in km.\n *\n * @param {google.maps.LatLng} p1 The first lat lng point.\n * @param {google.maps.LatLng} p2 The second lat lng point.\n * @return {number} The distance between the two points in km.\n * @see http://www.movable-type.co.uk/scripts/latlong.html\n*/\nMarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) {\n var R = 6371; // Radius of the Earth in km\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *\n Math.sin(dLon / 2) * Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c;\n return d;\n};\n\n\n/**\n * Determines if a marker is contained in a bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @param {google.maps.LatLngBounds} bounds The bounds to check against.\n * @return {boolean} True if the marker is in the bounds.\n */\nMarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) {\n return bounds.contains(marker.getPosition());\n};\n\n\n/**\n * Adds a marker to a cluster, or creates a new cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n */\nMarkerClusterer.prototype.addToClosestCluster_ = function (marker) {\n var i, d, cluster, center;\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n for (i = 0; i < this.clusters_.length; i++) {\n cluster = this.clusters_[i];\n center = cluster.getCenter();\n if (center) {\n d = this.distanceBetweenPoints_(center, marker.getPosition());\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n cluster = new Cluster(this);\n cluster.addMarker(marker);\n this.clusters_.push(cluster);\n }\n};\n\n\n/**\n * Creates the clusters. This is done in batches to avoid timeout errors\n * in some browsers when there is a huge number of markers.\n *\n * @param {number} iFirst The index of the first marker in the batch of\n * markers to be added to clusters.\n */\nMarkerClusterer.prototype.createClusters_ = function (iFirst) {\n var i, marker;\n var mapBounds;\n var cMarkerClusterer = this;\n if (!this.ready_) {\n return;\n }\n\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the <code>MarkerClusterer</code> begins\n * clustering markers.\n * @name MarkerClusterer#clusteringbegin\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringbegin\", this);\n\n if (typeof this.timerRefStatic !== \"undefined\") {\n clearTimeout(this.timerRefStatic);\n delete this.timerRefStatic;\n }\n }\n\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n if (this.getMap().getZoom() > 3) {\n mapBounds = new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),\n this.getMap().getBounds().getNorthEast());\n } else {\n mapBounds = new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n }\n var bounds = this.getExtendedBounds(mapBounds);\n\n var iLast = Math.min(iFirst + this.batchSize_, this.markers_.length);\n\n for (i = iFirst; i < iLast; i++) {\n marker = this.markers_[i];\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\n if (!this.ignoreHidden_ || (this.ignoreHidden_ && marker.getVisible())) {\n this.addToClosestCluster_(marker);\n }\n }\n }\n\n if (iLast < this.markers_.length) {\n this.timerRefStatic = setTimeout(function () {\n cMarkerClusterer.createClusters_(iLast);\n }, 0);\n } else {\n delete this.timerRefStatic;\n\n /**\n * This event is fired when the <code>MarkerClusterer</code> stops\n * clustering markers.\n * @name MarkerClusterer#clusteringend\n * @param {MarkerClusterer} mc The MarkerClusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, \"clusteringend\", this);\n }\n};\n\n\n/**\n * Extends an object's prototype by another's.\n *\n * @param {Object} obj1 The object to be extended.\n * @param {Object} obj2 The object to extend with.\n * @return {Object} The new extended object.\n * @ignore\n */\nMarkerClusterer.prototype.extend = function (obj1, obj2) {\n return (function (object) {\n var property;\n for (property in object.prototype) {\n this.prototype[property] = object.prototype[property];\n }\n return this;\n }).apply(obj1, [obj2]);\n};\n\n\n/**\n * The default function for determining the label text and style\n * for a cluster icon.\n *\n * @param {Array.<google.maps.Marker>} markers The array of markers represented by the cluster.\n * @param {number} numStyles The number of marker styles available.\n * @return {ClusterIconInfo} The information resource for the cluster.\n * @constant\n * @ignore\n */\nMarkerClusterer.CALCULATOR = function (markers, numStyles) {\n var index = 0;\n var title = \"\";\n var count = markers.length.toString();\n\n var dv = count;\n while (dv !== 0) {\n dv = parseInt(dv / 10, 10);\n index++;\n }\n\n index = Math.min(index, numStyles);\n return {\n text: count,\n index: index,\n title: title\n };\n};\n\n\n/**\n * The number of markers to process in one batch.\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE = 2000;\n\n\n/**\n * The number of markers to process in one batch (IE only).\n *\n * @type {number}\n * @constant\n */\nMarkerClusterer.BATCH_SIZE_IE = 500;\n\n\n/**\n * The default root name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_PATH = \"https://cdn.rawgit.com/googlemaps/js-marker-clusterer/gh-pages/images/m\";\n\n\n/**\n * The default extension name for the marker cluster images.\n *\n * @type {string}\n * @constant\n */\nMarkerClusterer.IMAGE_EXTENSION = \"png\";\n\n\n/**\n * The default array of sizes for the marker cluster images.\n *\n * @type {Array.<number>}\n * @constant\n */\nMarkerClusterer.IMAGE_SIZES = [53, 56, 66, 78, 90];\n\nif (typeof module == 'object') {\n module.exports = MarkerClusterer;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@google/markerclustererplus/src/markerclusterer.js\n// module id = 8\n// module chunks = 0 1","import GoogleMaps from './models/apis/googleMaps';\r\nimport Leaflet from './models/apis/leaflet';\r\nimport IMapFunctions from './models/apis/mapFunctions';\r\nimport { MarkerEventType, CircleEventType, PolygonEventType, PolylineEventType, MapEventType } from './models/dto/event-type';\r\nimport { MapType } from './models/dto/map-type';\r\nimport CircleAlterOptions from './models/features/circle/circle-alter-options';\r\nimport CircleOptions from './models/features/circle/circle-options';\r\nimport GeoJsonOptions from './models/features/geojson/geojson-options';\r\nimport MarkerClustererConfig from './models/features/marker-clusterer/marker-clusterer-config';\r\nimport CircleMarkerOptions from './models/features/marker/circle-marker-options';\r\nimport MarkerAlterOptions from './models/features/marker/marker-alter-options';\r\nimport MarkerOptions from './models/features/marker/marker-options';\r\nimport OverlayOptions from './models/features/overlay/overlay-options';\r\nimport PolygonAlterOptions from './models/features/polygons/polygon-alter-options';\r\nimport PolygonOptions from './models/features/polygons/polygon-options';\r\nimport PolylineOptions from './models/features/polyline/polyline-options';\r\nimport PopupOptions from './models/features/popup/popup-options';\r\n\r\nexport default class Map {\r\n private markersList = {};\r\n private polygonsList = {};\r\n private circlesList = {};\r\n private polylinesList = {};\r\n private infoWindowList = {};\r\n private overlayList = {};\r\n private map: IMapFunctions;\r\n private markerClusterer = {};\r\n\r\n constructor() { /**/ }\r\n\r\n /**\r\n * Use this to initialize map\r\n * @param {InlogMaps.MapType} mapType\r\n * @param {any} options\r\n * @param {string} elementId default: 'inlog-map' [nullable]\r\n * @returns {Promisse<any>}\r\n */\r\n public initialize(mapType: MapType, options: any, elementId: string = 'inlog-map'): Promise<any> {\r\n this.map = mapType === MapType.Google ? new GoogleMaps() : new Leaflet();\r\n return this.map.initialize(mapType, options, elementId);\r\n }\r\n\r\n /* GEOJson */\r\n /**\r\n * Use this function to add GEOJSON to the currentMap\r\n * @param {object} data Geojson\r\n * @param {InlogMaps.GeoJsonOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n public loadGEOJson(data: object, options: GeoJsonOptions, eventClick?: any): void {\r\n this.map.loadGEOJson(data, options, eventClick);\r\n }\r\n\r\n /* Markers */\r\n /**\r\n * Use this function to draw markers in the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n public drawMarker(type: string, options: MarkerOptions, eventClick?: any): void {\r\n const marker = this.map.drawMarker(options, eventClick);\r\n\r\n if (!this.markersList[type]) {\r\n this.markersList[type] = [];\r\n }\r\n marker.type = 'simple';\r\n this.markersList[type].push(marker);\r\n\r\n if (options.addClusterer) {\r\n if (!this.markerClusterer[type]) {\r\n this.addMarkerClusterer(type, new MarkerClustererConfig(true, 1, 10));\r\n }\r\n\r\n this.map.addMarkerOnClusterer(marker, this.markerClusterer[type]);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to draw circle markers in the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.CircleMarkerOptions} options\r\n * @param {any} eventClick is a function callback on click [nullable]\r\n */\r\n public drawCircleMarker(type: string, options: CircleMarkerOptions, eventClick?: any): void {\r\n const marker = this.map.drawCircleMarker(options, eventClick);\r\n\r\n if (!this.markersList[type]) {\r\n this.markersList[type] = [];\r\n }\r\n marker.type = 'circle';\r\n this.markersList[type].push(marker);\r\n }\r\n\r\n /**\r\n * Use this function to show/hide markers from a specific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toogle markers with the condition [nullable]\r\n */\r\n public toggleMarkers(show: boolean, type: string, condition?: any): void {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n if (markers && markers.length) {\r\n this.map.toggleMarkers(markers, show, this.markerClusterer[type]);\r\n }\r\n }\r\n\r\n /**\r\n * Remove markers from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove markers with the condition [nullable]\r\n */\r\n public removeMarkers(type: string, condition?: any): void {\r\n if (this.markersList[type] && condition) {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n // Hide markers with the condition\r\n this.map.toggleMarkers(markers, false, this.markerClusterer[type]);\r\n\r\n // Keep markers that doesn't have the condition\r\n this.markersList[type] = this.markersList[type].filter((marker: any) => !condition(marker.object));\r\n } else {\r\n if (this.markersList[type]) {\r\n this.map.toggleMarkers(this.markersList[type], false, this.markerClusterer[type]);\r\n }\r\n this.markersList[type] = [];\r\n }\r\n\r\n if (this.markersList[type].length === 0) {\r\n delete this.markersList[type];\r\n }\r\n }\r\n\r\n /**\r\n * Remove all markers from the map and from the internal list\r\n */\r\n public removeAllMarkers(): void {\r\n for (const type in this.markersList) {\r\n if (this.markersList.hasOwnProperty(type)) {\r\n this.removeMarkers(type);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to alter marker style\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerAlterOptions} options\r\n * @param {any} condition alter markers with the condition [nullable]\r\n */\r\n public alterMarkerOptions(type: string, options: MarkerAlterOptions, condition?: any): void {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n if (markers && markers.length) {\r\n this.map.alterMarkerOptions(markers, options);\r\n }\r\n }\r\n\r\n /**\r\n * Use this functions to alterar marker position\r\n * @param {string } type\r\n * @param {number[]} position\r\n * @param {boolean} addTransition [nullable]\r\n * @param {any} condition [nullable]\r\n */\r\n public alterMarkerPosition(type: string, position: number[], addTransition?: boolean, condition?: any): void {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n if (markers && markers.length) {\r\n this.map.alterMarkerPosition(markers, position, addTransition);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to fit bounds in the markers with the especified type\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @param {boolean} onlyMarkersOnMap default true\r\n */\r\n public fitBoundsMarkers(type: string, condition?: any, onlyMarkersOnMap: boolean = true): void {\r\n let markers = this.getMarkers(type, condition);\r\n\r\n if (onlyMarkersOnMap) {\r\n markers = markers.filter((x: any) => this.map.isMarkerOnMap(x));\r\n }\r\n\r\n if (markers && markers.length) {\r\n this.map.fitBoundsPositions(markers);\r\n }\r\n }\r\n\r\n /**\r\n * Use this functions to set the center of the map on marker\r\n * @param {string} type\r\n * @param {any} condition center on marker with the condition [nullable]\r\n */\r\n public setCenterMarker(type: string, condition?: any): void {\r\n if (this.markersList[type] && condition) {\r\n const marker = this.markersList[type].find((marker: any) => condition(marker.object));\r\n\r\n // Center on the marker with the condition\r\n this.map.setCenterMarker(marker);\r\n } else {\r\n if (this.markersList[type] && this.markersList[type].length) {\r\n this.map.setCenterMarker(this.markersList[type][0]);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * This functions returns if marker exists\r\n * @param type\r\n * @param condition [nullable]\r\n * @returns {boolean}\r\n */\r\n public markerExists(type: string, condition?: any): boolean {\r\n const markers = this.getMarkers(type, condition);\r\n return markers && markers.length > 0;\r\n }\r\n\r\n /**\r\n * Use this function to count markers by type\r\n * @param {string} type\r\n * @param {boolean} onlyOnMap exclude hidden markers, default true\r\n * @param {any} condition\r\n * @returns {number}\r\n */\r\n public countMarkers(type: string, onlyOnMap: boolean = true, condition?: any): number {\r\n if (this.markerClusterer[type]) {\r\n return this.map.countMarkersOnCluster(this.markerClusterer[type]);\r\n }\r\n\r\n let markers = this.getMarkers(type, condition);\r\n if (onlyOnMap) {\r\n markers = markers.filter((x: any) => this.map.isMarkerOnMap(x));\r\n }\r\n\r\n return markers.length;\r\n }\r\n\r\n /**\r\n * This function add new events on marker\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n public addMarkerEvent(type: string, event: MarkerEventType, eventFunction: any, condition?: any): void {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n this.map.addMarkerEvent(markers, event, eventFunction);\r\n }\r\n\r\n /**\r\n * This function remove events of marker\r\n * @param {string} type\r\n * @param {InlogMaps.MarkerEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n public removeMarkerEvent(type: string, event: MarkerEventType, condition?: any): void {\r\n const markers = this.getMarkers(type, condition);\r\n\r\n this.map.removeMarkerEvent(markers, event);\r\n }\r\n\r\n /* Marker Clusterer */\r\n /**\r\n * Use this function to add MarkerClusterer on the map\r\n * @param {string} type same type of markers\r\n * @param {InlogMaps.MarkerClusterConfig} config\r\n */\r\n public addMarkerClusterer(type: string, config: MarkerClustererConfig): void {\r\n this.markerClusterer[type] = this.map.addMarkerClusterer(config);\r\n }\r\n\r\n /**\r\n * Use this function to alter clusterer options\r\n * @param type same type of markers\r\n * @param {InlogMaps.MarkerClusterConfig} config\r\n */\r\n public alterMarkerClustererConfig(type: string, config: MarkerClustererConfig): void {\r\n if (this.markerClusterer[type]) {\r\n this.map.alterMarkerClustererConfig(this.markerClusterer[type], config);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to redraw marker clusterer\r\n * @param type same type of markers\r\n */\r\n public refreshClusterer(type: string): void {\r\n if (this.markerClusterer[type]) {\r\n this.map.refreshClusterer(this.markerClusterer[type]);\r\n }\r\n }\r\n\r\n /**\r\n * Use this to clear markers on clusterer\r\n * @param type same type of markers\r\n */\r\n public clearMarkersClusterer(type: string): void {\r\n if (this.markerClusterer[type]) {\r\n this.map.clearMarkersClusterer(this.markerClusterer[type]);\r\n }\r\n }\r\n\r\n /* Polygons */\r\n /**\r\n * Use this function to draw polygons\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n public drawPolygon(type: string, options: PolygonOptions, eventClick?: any): void {\r\n const polygon = this.map.drawPolygon(options, eventClick);\r\n\r\n if (!this.polygonsList[type]) {\r\n this.polygonsList[type] = [];\r\n }\r\n this.polygonsList[type].push(polygon);\r\n }\r\n\r\n /**\r\n * Use this function to show/hide polygon from a especific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle polygon with the condition [nullable]\r\n */\r\n public togglePolygons(show: boolean, type: string, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition);\r\n\r\n if (polygons && polygons.length) {\r\n this.map.togglePolygons(polygons, show);\r\n }\r\n }\r\n\r\n /**\r\n * Remove polygons from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove polygons with the condition [nullable]\r\n */\r\n public removePolygons(type: string, condition?: any): void {\r\n if (this.polygonsList[type] && condition) {\r\n const polygons = this.getPolygons(type, condition);\r\n\r\n // Hide markers with the condition\r\n this.map.togglePolygons(polygons, false);\r\n\r\n // Keep markers that doesn't have the condition\r\n this.polygonsList[type] = this.polygonsList[type].filter((polygon: any) => !condition(polygon.object));\r\n } else {\r\n if (this.polygonsList[type]) {\r\n this.map.togglePolygons(this.polygonsList[type], false);\r\n }\r\n this.polygonsList[type] = [];\r\n }\r\n\r\n if (this.polygonsList[type].length === 0) {\r\n delete this.polygonsList[type];\r\n }\r\n }\r\n\r\n /**\r\n * Remove all polygons from the map and from the internal list\r\n */\r\n public removeAllPolygons(): void {\r\n for (const type in this.polygonsList) {\r\n if (this.polygonsList.hasOwnProperty(type)) {\r\n this.removePolygons(type);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to alter polygons options/style\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonAlterOptions} options\r\n * @param {any} condition alter polygon with the condition [nullable]\r\n */\r\n public alterPolygonOptions(type: string, options: PolygonAlterOptions, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition);\r\n\r\n if (polygons && polygons.length) {\r\n this.map.alterPolygonOptions(polygons, options);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to fit bounds of a polygon\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n public fitBoundsPolygons(type: string, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition)\r\n .filter((polygon: any) => this.map.isPolygonOnMap(polygon));\r\n\r\n if (polygons && polygons.length) {\r\n this.map.fitBoundsPolygons(polygons);\r\n }\r\n }\r\n\r\n /**\r\n * Set center on polygon bounds\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n public setCenterPolygons(type: string, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition)\r\n .filter((polygon: any) => this.map.isPolygonOnMap(polygon));\r\n\r\n if (polygons && polygons.length) {\r\n this.map.setCenterPolygons(polygons);\r\n }\r\n }\r\n\r\n /**\r\n * This functions returns if polygon exists\r\n * @param type\r\n * @param condition [nullable]\r\n * @returns {boolean}\r\n */\r\n public polygonExists(type: string, condition?: any): boolean {\r\n const polygons = this.getPolygons(type, condition);\r\n return polygons && polygons.length > 0;\r\n }\r\n\r\n /**\r\n * Use this function to get the path of some polygon\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {number[]}\r\n */\r\n public getPolygonPath(type: string, condition?: any): number[][] {\r\n const polygon = this.getPolygons(type, condition);\r\n\r\n if (polygon && polygon.length) {\r\n return this.map.getPolygonPath(polygon[0]);\r\n }\r\n }\r\n\r\n /**\r\n * This function add new events on polygon\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n public addPolygonEvent(type: string, event: PolygonEventType, eventFunction: any, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition);\r\n\r\n this.map.addPolygonEvent(polygons, event, eventFunction);\r\n }\r\n\r\n /**\r\n * This function remove events of polygon\r\n * @param {string} type\r\n * @param {InlogMaps.PolygonEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n public removePolygonEvent(type: string, event: PolygonEventType, condition?: any): void {\r\n const polygons = this.getPolygons(type, condition);\r\n\r\n this.map.removePolygonEvent(polygons, event);\r\n }\r\n\r\n /* Circles */\r\n /**\r\n * Use this function to draw circles on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.CircleOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n public drawCircle(type: string, options: CircleOptions, eventClick?: any): void {\r\n const circle = this.map.drawCircle(options, eventClick);\r\n\r\n if (!this.circlesList[type]) {\r\n this.circlesList[type] = [];\r\n }\r\n this.circlesList[type].push(circle);\r\n }\r\n\r\n /**\r\n * Use this function to show/hide circles from a especific type\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle circles with the condition [nullable]\r\n */\r\n public toggleCircles(show: boolean, type: string, condition?: any): void {\r\n const circles = this.getCircles(type, condition);\r\n\r\n if (circles && circles.length) {\r\n this.map.toggleCircles(circles, show);\r\n }\r\n }\r\n\r\n /**\r\n * Remove circles from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove circles with the condition [nullable]\r\n */\r\n public removeCircles(type: string, condition?: any): void {\r\n if (this.circlesList[type] && condition) {\r\n const circles = this.getCircles(type, condition);\r\n\r\n // Hide circles with the condition\r\n this.map.toggleCircles(circles, false);\r\n\r\n // Keep circles that doesn't have the condition\r\n this.circlesList[type] = this.circlesList[type].filter((circle: any) => !condition(circle.object));\r\n } else {\r\n if (this.circlesList[type]) {\r\n this.map.toggleCircles(this.circlesList[type], false);\r\n }\r\n this.circlesList[type] = [];\r\n }\r\n\r\n if (this.circlesList[type].length === 0) {\r\n delete this.circlesList[type];\r\n }\r\n }\r\n\r\n /**\r\n * Remove all circles from the map and from the internal list\r\n */\r\n public removeAllCircles(): void {\r\n for (const type in this.circlesList) {\r\n if (this.circlesList.hasOwnProperty(type)) {\r\n this.removeCircles(type);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to alter circle options\r\n * @param {string} type\r\n * @param {InlogMaps.CircleAlterOptions} options\r\n * @param {any} condition alter circle with the condition [nullable]\r\n */\r\n public alterCircleOptions(type: string, options: CircleAlterOptions, condition?: any): void {\r\n const circles = this.getCircles(type, condition);\r\n\r\n if (circles && circles.length) {\r\n this.map.alterCircleOptions(circles, options);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to fit bounds of a polygon\r\n * @param {string} type\r\n * @param {any} condition fit polygon bounds with the condition [nullable]\r\n */\r\n public fitBoundsCircles(type: string, condition?: any): void {\r\n const circles = this.getCircles(type, condition)\r\n .filter((circle: any) => this.map.isCircleOnMap(circle));\r\n\r\n if (circles && circles.length) {\r\n this.map.fitBoundsCircles(circles);\r\n }\r\n }\r\n\r\n /**\r\n * This functions returns if circle exists\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {boolean}\r\n */\r\n public circleExists(type: string, condition?: any): boolean {\r\n const circles = this.getCircles(type, condition);\r\n return circles && circles.length > 0;\r\n }\r\n\r\n /**\r\n * This function return circle center\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {number[]}\r\n */\r\n public getCircleCenter(type: string, condition?: any): number[] {\r\n const circles = this.getCircles(type, condition);\r\n\r\n if (circles && circles.length) {\r\n return this.map.getCircleCenter(circles[0]);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * This function return circle center\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {number}\r\n */\r\n public getCircleRadius(type: string, condition?: any): number {\r\n const circles = this.getCircles(type, condition);\r\n\r\n if (circles && circles.length) {\r\n return this.map.getCircleRadius(circles[0]);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * This function add new events on circle\r\n * @param {string} type\r\n * @param {InlogMaps.CircleEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n public addCircleEvent(type: string, event: CircleEventType, eventFunction: any, condition?: any): void {\r\n const circles = this.getCircles(type, condition);\r\n\r\n this.map.addCircleEvent(circles, event, eventFunction);\r\n }\r\n\r\n /**\r\n * This function remove events of circle\r\n * @param {string} type\r\n * @param {InlogMaps.CircleEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n public removeCircleEvent(type: string, event: CircleEventType, condition?: any): void {\r\n const circles = this.getCircles(type, condition);\r\n\r\n this.map.removeCircleEvent(circles, event);\r\n }\r\n\r\n /* Polylines */\r\n /**\r\n * Use this function to draw polylines on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n * @param {any} eventClick [nullable]\r\n */\r\n public drawPolyline(type: string, options: PolylineOptions, eventClick?: any): void {\r\n const polyline = this.map.drawPolyline(options, eventClick);\r\n\r\n if (!this.polylinesList[type]) {\r\n this.polylinesList[type] = [];\r\n }\r\n this.polylinesList[type].push(polyline);\r\n }\r\n\r\n /**\r\n * Use this function to draw polylines with navigation on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n */\r\n public drawPolylineWithNavigation(type: string, options: PolylineOptions, eventClick?: any): void {\r\n const polyline = this.map.drawPolylineWithNavigation(options, eventClick);\r\n\r\n if (!this.polylinesList[type]) {\r\n this.polylinesList[type] = [];\r\n }\r\n this.polylinesList[type].push(polyline);\r\n }\r\n\r\n /**\r\n * Use this function to toggle polylines\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition toggle polyline with the condition [nullable]\r\n */\r\n public togglePolylines(show: boolean, type: string, condition?: any): void {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n if (polyline && polyline.length) {\r\n this.map.togglePolylines(polyline, show);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to remove polylines\r\n * @param {string} type\r\n * @param {any} condition remove polyline with the condition [nullable]\r\n */\r\n public removePolylines(type: string, condition?: any): void {\r\n if (this.polylinesList[type] && condition) {\r\n const polylines = this.getPolylines(type, condition);\r\n\r\n // Hide markers with the condition\r\n this.map.togglePolylines(polylines, false);\r\n\r\n // Keep markers that doesn't have the condition\r\n this.polylinesList[type] = this.polylinesList[type].filter((polyline: any) => !condition(polyline.object));\r\n } else {\r\n if (this.polylinesList[type]) {\r\n this.map.togglePolylines(this.polylinesList[type], false);\r\n }\r\n this.polylinesList[type] = [];\r\n }\r\n\r\n if (this.polylinesList[type].length === 0) {\r\n delete this.polylinesList[type];\r\n }\r\n }\r\n\r\n /**\r\n * Remove all polylines from the map and from the internal list\r\n */\r\n public removeAllPolylines(): void {\r\n for (const type in this.polylinesList) {\r\n if (this.polylinesList.hasOwnProperty(type)) {\r\n this.removePolylines(type);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to alter polyline options\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineOptions} options\r\n * @param {any} condition alter polyline with the condition [nullable]\r\n */\r\n public alterPolylineOptions(type: string, options: PolylineOptions, condition?: any): void {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n if (polyline && polyline.length) {\r\n this.map.alterPolylineOptions(polyline, options);\r\n }\r\n }\r\n\r\n /**\r\n * Use this functions to fit polylines bounds\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n public fitBoundsPolylines(type: string, condition?: any): void {\r\n const polylines = this.getPolylines(type, condition)\r\n .filter((polyline: any) => this.map.isPolylineOnMap(polyline));\r\n\r\n if (polylines && polylines.length) {\r\n this.map.fitBoundsPolylines(polylines);\r\n }\r\n }\r\n\r\n /**\r\n * This functions returns if polyline exists\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n * @returns {boolean}\r\n */\r\n public polylineExists(type: string, condition?: any): boolean {\r\n const polylines = this.getPolylines(type, condition);\r\n return polylines && polylines.length > 0;\r\n }\r\n\r\n /**\r\n * Use this function to add more paths to a polyline\r\n * @param {string} type\r\n * @param {number[]} position\r\n * @param {any} condition [nullable]\r\n */\r\n public addPolylinePath(type: string, position: number[], condition?: any): void {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n if (polyline && polyline.length) {\r\n this.map.addPolylinePath(polyline, position);\r\n } else {\r\n const options = new PolylineOptions();\r\n options.addToMap = true;\r\n\r\n this.drawPolyline(type, options, null);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to get the path of some polyline\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {number[]}\r\n */\r\n public getPolylinePath(type: string, condition?: any): number[][] {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n if (polyline && polyline.length) {\r\n return this.map.getPolylinePath(polyline[0]);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to clear polyline selected from the currentMap\r\n */\r\n public removePolylineHighlight(): void {\r\n this.map.removePolylineHighlight();\r\n }\r\n\r\n /**\r\n * Use this function to add listeners on polyline\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} eventFunction\r\n * @param {any} condition [nullable]\r\n */\r\n public addPolylineEvent(type: string, event: PolylineEventType, eventFunction: any, condition?: any): void {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n this.map.addPolylineEvent(polyline, event, eventFunction);\r\n }\r\n\r\n /**\r\n * Use this function to remove listeners of polyline\r\n * @param {string} type\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} condition [nullable]\r\n */\r\n public removePolylineEvent(type: string, event: PolylineEventType, condition?: any): void {\r\n const polyline = this.getPolylines(type, condition);\r\n\r\n this.map.removePolylineEvent(polyline, event);\r\n }\r\n\r\n /**\r\n * Use this function to set position of polyline highlight\r\n * @param {string} type\r\n * @param {number} initialIndex\r\n * @param {any} condition [nullable]\r\n */\r\n public setIndexPolylineHighlight(type: string, initialIndex: number, condition?: any) {\r\n const polylines = this.getPolylines(type, condition);\r\n\r\n if (polylines && polylines.length) {\r\n this.map.setIndexPolylineHighlight(polylines[0], initialIndex);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to get the object of a polyline\r\n * @param {string} type\r\n * @param {any} condition\r\n * @returns {object}\r\n */\r\n public getObjectPolyline(type: string, condition?: any): object {\r\n const polylines = this.getPolylines(type, condition);\r\n\r\n if (polylines && polylines.length) {\r\n return this.map.getObjectPolyline(polylines[0]);\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to get the object of the polyline highligth\r\n * @returns {object}\r\n */\r\n public getObjectPolylineHighlight(): any {\r\n return this.map.getObjectPolylineHighlight();\r\n }\r\n\r\n /**\r\n * Use this function to add events on polyline highligtht / selected polyline\r\n * @param {InlogMaps.PolylineEventType} event\r\n * @param {any} eventFunction\r\n */\r\n public addPolylineHighlightEvent(event: PolylineEventType, eventFunction: any) {\r\n this.map.addPolylineHighlightEvent(event, eventFunction);\r\n }\r\n\r\n /**\r\n * Use this function to get initial and final index of the polyline highlight\r\n * @returns {number[]} returns an array with initial index and final index\r\n */\r\n public getPolylineHighlightIndex(): number[] {\r\n return this.map.getPolylineHighlightIndex();\r\n }\r\n\r\n /* Info Windows */\r\n /**\r\n * Use this function to draw popups on the currentMap\r\n * @param {string} type\r\n * @param {InlogMaps.PopupOptions} options\r\n */\r\n public drawPopup(type: string, options: PopupOptions): void {\r\n let marker: any = null;\r\n if (options.marker) {\r\n const markers = this.getMarkers(options.marker, options.conditionMarker);\r\n marker = markers[0];\r\n }\r\n\r\n let popup: any;\r\n if (this.infoWindowList[type]) {\r\n popup = this.map.alterPopup(this.infoWindowList[type], options, marker);\r\n } else {\r\n popup = this.map.drawPopup(options, marker);\r\n }\r\n\r\n this.infoWindowList[type] = popup;\r\n }\r\n\r\n /**\r\n * Use this function to alter popups\r\n * @param {string} type\r\n * @param {InlogMaps.PopupOptions} options\r\n */\r\n public alterPopup(type: string, options: PopupOptions): void {\r\n const popups = this.infoWindowList[type];\r\n\r\n let markers: any;\r\n if (options.marker) {\r\n markers = this.getMarkers(options.marker, options.conditionMarker);\r\n }\r\n\r\n if (popups) {\r\n this.map.alterPopupContent(popups, options, markers ? markers[0] : null);\r\n }\r\n }\r\n\r\n /**\r\n *\r\n * @param {string} type\r\n * @returns {object}\r\n */\r\n public getObjectOpenPopup(type: string): object {\r\n return this.infoWindowList[type] ? this.infoWindowList[type].object : null;\r\n }\r\n\r\n /**\r\n * Use this function to close popup by type\r\n * @param {string} type\r\n */\r\n public closePopup(type: string): void {\r\n if (this.infoWindowList[type]) {\r\n this.map.closePopup(this.infoWindowList[type])\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to close all popups\r\n * @param {string} type\r\n */\r\n public closeAllPopups(): void {\r\n for (const type in this.infoWindowList) {\r\n if (this.infoWindowList.hasOwnProperty(type)) {\r\n this.closePopup(type);\r\n }\r\n }\r\n }\r\n\r\n /* Map */\r\n /**\r\n * Resize de map based on html size\r\n */\r\n public resizeMap(): void {\r\n this.map.resizeMap();\r\n }\r\n\r\n /**\r\n * Use this function to add event clicks on the currentMap\r\n * @param {InlogMaps.MapEventType} eventType\r\n * @param eventFunction function callback\r\n */\r\n public addEventMap(eventType: MapEventType, eventFunction: any): void {\r\n this.map.addEventMap(eventType, eventFunction);\r\n }\r\n\r\n /**\r\n * Use this function to remove event clicks from the currentMap\r\n * @param {InlogMaps.MapEventType} eventType\r\n */\r\n public removeEventMap(eventType: MapEventType): void {\r\n this.map.removeEventMap(eventType);\r\n }\r\n\r\n /**\r\n * Returns the current zoom level of the map view\r\n * @returns {number}\r\n */\r\n public getZoom(): number {\r\n return this.map.getZoom();\r\n }\r\n\r\n /**\r\n * Set the current zoom level of the map view\r\n * @param {number} zoom\r\n */\r\n public setZoom(zoom: number): void {\r\n this.map.setZoom(zoom);\r\n }\r\n\r\n /**\r\n * Returns the center position of the map\r\n * @returns {number[]}\r\n */\r\n public getCenter(): number[] {\r\n return this.map.getCenter();\r\n }\r\n\r\n /**\r\n * Set the position center of the map\r\n * @param {number[]} position\r\n */\r\n public setCenter(position: number[]): void {\r\n this.map.setCenter(position);\r\n }\r\n\r\n /**\r\n * Returns the coordinates from pixels\r\n * @param {number} offsetx\r\n * @param {number} offsety\r\n * @returns {number[]}\r\n */\r\n public pixelsToLatLng(offsetx: number, offsety: number): number[] {\r\n return this.map.pixelsToLatLng(offsetx, offsety);\r\n }\r\n\r\n /**\r\n * Use this functions to fit bounds on elements with same type and condition\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n public fitBoundsElements(type: string, condition?: any): void {\r\n const markers = this.getMarkers(type, condition)\r\n .filter((marker: any) => this.map.isMarkerOnMap(marker));\r\n\r\n const circles = this.getCircles(type, condition)\r\n .filter((circle: any) => this.map.isCircleOnMap(circle));\r\n\r\n const polygons = this.getPolygons(type, condition)\r\n .filter((polygon: any) => this.map.isPolygonOnMap(polygon));\r\n\r\n const polylines = this.getPolylines(type, condition)\r\n .filter((polyline: any) => this.map.isPolylineOnMap(polyline));\r\n\r\n this.map.fitBoundsElements(markers, circles, polygons, polylines);\r\n }\r\n\r\n /* Overlay */\r\n /**\r\n * Use this function to dray overlays on the current map\r\n * @param {string} type\r\n * @param {InlogMaps.OverlayOptions} options\r\n */\r\n public drawOverlay(type: string, options: OverlayOptions): void {\r\n let overlay = null;\r\n\r\n if (options.polygon) {\r\n const polygons = this.getPolygons(options.polygon, options.conditionPolygon);\r\n\r\n if (polygons && polygons.length) {\r\n overlay = this.map.drawOverlay(options, polygons);\r\n }\r\n } else {\r\n overlay = this.map.drawOverlay(options);\r\n }\r\n\r\n if (overlay != null) {\r\n if (!this.overlayList[type]) {\r\n this.overlayList[type] = [];\r\n }\r\n this.overlayList[type].push(overlay);\r\n }\r\n }\r\n\r\n /**\r\n * Use this function to show or hide overlay\r\n * @param {boolean} show\r\n * @param {string} type\r\n * @param {any} condition [nullable]\r\n */\r\n public toggleOverlay(show: boolean, type: string, condition?: any): void {\r\n const overlays = this.getOverlays(type, condition);\r\n\r\n if (overlays && overlays.length) {\r\n this.map.toggleOverlay(overlays, show);\r\n }\r\n }\r\n\r\n /**\r\n * Remove overlays from the map and from internal list\r\n * @param {string} type\r\n * @param {any} condition remove overlays with the condition [nullable]\r\n */\r\n public removeOverlays(type: string, condition?: any): void {\r\n if (this.overlayList[type] && condition) {\r\n const overlays = this.getOverlays(type, condition);\r\n\r\n // Hide markers with the condition\r\n this.map.toggleOverlay(overlays, false);\r\n\r\n // Keep markers that doesn't have the condition\r\n this.overlayList[type] = this.overlayList[type].filter((overlay: any) => !condition(overlay.object));\r\n } else {\r\n if (this.overlayList[type]) {\r\n this.map.toggleOverlay(this.overlayList[type], false);\r\n }\r\n this.overlayList[type] = [];\r\n }\r\n\r\n if (this.overlayList[type].length === 0) {\r\n delete this.overlayList[type];\r\n }\r\n }\r\n\r\n /**\r\n * Remove all overlays from the map and from the internal list\r\n */\r\n public removeAllOverlays(): void {\r\n for (const type in this.overlayList) {\r\n if (this.overlayList.hasOwnProperty(type)) {\r\n this.removeOverlays(type);\r\n }\r\n }\r\n }\r\n\r\n /* Private Methods */\r\n private getMarkers(type: string, condition: any): any[] {\r\n const markers = this.markersList[type];\r\n\r\n if (markers && markers.length) {\r\n return condition ? markers.filter((marker: any) => condition(marker.object)) : markers;\r\n } else return [];\r\n }\r\n\r\n private getPolygons(type: string, condition: any): any[] {\r\n const polygons = this.polygonsList[type];\r\n\r\n if (polygons && polygons.length) {\r\n return condition ? polygons.filter((polygon: any) => condition(polygon.object)) : polygons;\r\n } else return [];\r\n }\r\n\r\n private getCircles(type: string, condition: any): any[] {\r\n const circles = this.circlesList[type];\r\n\r\n if (circles && circles.length) {\r\n return condition ? circles.filter((circle: any) => condition(circle.object)) : circles;\r\n } else return [];\r\n }\r\n\r\n private getPolylines(type: string, condition: any): any[] {\r\n const polylines = this.polylinesList[type];\r\n\r\n if (polylines && polylines.length) {\r\n return condition ? polylines.filter((polyline: any) => condition(polyline.object)) : polylines;\r\n } else return [];\r\n }\r\n\r\n private getOverlays(type: string, condition: any): any[] {\r\n const overlays = this.overlayList[type];\r\n\r\n if (overlays && overlays.length) {\r\n return condition ? overlays.filter((overlay: any) => condition(overlay.object)) : overlays;\r\n } else return [];\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/map.ts","import { MapsApiLoaderService } from '../../utils/maps-api-loader.service';\r\nimport { CircleEventType, MapEventType, MarkerEventType, PolygonEventType, PolylineEventType } from '../dto/event-type';\r\nimport { MapType } from '../dto/map-type';\r\nimport CircleAlterOptions from '../features/circle/circle-alter-options';\r\nimport CircleOptions from '../features/circle/circle-options';\r\nimport GeoJsonOptions from '../features/geojson/geojson-options';\r\nimport MarkerClustererConfig from '../features/marker-clusterer/marker-clusterer-config';\r\nimport CircleMarkerOptions from '../features/marker/circle-marker-options';\r\nimport MarkerAlterOptions from '../features/marker/marker-alter-options';\r\nimport MarkerOptions from '../features/marker/marker-options';\r\nimport OverlayOptions from '../features/overlay/overlay-options';\r\nimport PolygonAlterOptions from '../features/polygons/polygon-alter-options';\r\nimport PolygonOptions from '../features/polygons/polygon-options';\r\nimport PolylineOptions from '../features/polyline/polyline-options';\r\nimport PopupOptions from '../features/popup/popup-options';\r\nimport GoogleCircles from './google/google-circles';\r\nimport GoogleGeoJson from './google/google-geojson';\r\nimport GoogleMap from './google/google-map';\r\nimport GoogleMarkers from './google/google-markers';\r\nimport GoogleOverlays from './google/google-overlay';\r\nimport GooglePolygons from './google/google-polygons';\r\nimport GooglePolylines from './google/google-polylines';\r\nimport GooglePopups from './google/google-popup';\r\nimport IMapFunctions from './mapFunctions';\r\n\r\nexport default class GoogleMaps implements IMapFunctions {\r\n private googleMarkers: GoogleMarkers;\r\n private googlePolygons: GooglePolygons;\r\n private googleCircles: GoogleCircles;\r\n private googlePolylines: GooglePolylines;\r\n private googlePopups: GooglePopups;\r\n private googleMap: GoogleMap;\r\n private googleOverlays: GoogleOverlays;\r\n private googleGeoJson: GoogleGeoJson;\r\n\r\n private mapsApiLoader: MapsApiLoaderService = new MapsApiLoaderService();\r\n\r\n constructor() { /* */ }\r\n\r\n public async initialize(mapType: MapType, params: any, elementId: string): Promise<any> {\r\n try {\r\n const api = await this.mapsApiLoader.loadApi(mapType, params);\r\n const google = api;\r\n const options: any = {\r\n center: new google.maps.LatLng(-14, -54),\r\n fullscreenControl: false,\r\n keyboardShortcuts: false,\r\n mapTypeControl: true,\r\n minZoom: 4,\r\n rotateControl: false,\r\n scaleControl: false,\r\n streetViewControl: false,\r\n zoom: 4,\r\n zoomControl: true\r\n };\r\n\r\n if (params.gestureHandling) {\r\n options.gestureHandling = 'cooperative';\r\n } else {\r\n options.gestureHandling = 'greedy';\r\n }\r\n\r\n if (params.options) {\r\n for (const key in params.options) {\r\n if (params.options.hasOwnProperty(key)) {\r\n options[key] = params.options[key];\r\n }\r\n }\r\n }\r\n\r\n const imageMapTypes = [];\r\n if (params.mapTiles) {\r\n const ids = [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE];\r\n\r\n params.mapTiles.forEach((tile: any) => {\r\n ids.push(tile.name);\r\n\r\n const mapTypeOptions = {\r\n getTileUrl: (coord: any, zoom: any) =>\r\n `https://tile.openstreetmap.org/${zoom}/${coord.x}/${coord.y}.png`,\r\n isPng: true,\r\n maxZoom: 19,\r\n minZoom: 0,\r\n name: 'OpenStreetMap',\r\n tileSize: new google.maps.Size(256, 256),\r\n };\r\n\r\n for (const key in tile) {\r\n if (tile.hasOwnProperty(key)) {\r\n mapTypeOptions[key] = tile[key];\r\n }\r\n }\r\n\r\n const imageMapType = new google.maps.ImageMapType(mapTypeOptions);\r\n imageMapTypes.push({ id: tile.name, tile: imageMapType });\r\n });\r\n\r\n options.mapTypeControlOptions = {\r\n mapTypeIds: ids,\r\n style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR\r\n };\r\n }\r\n\r\n const map = new google.maps.Map(document.getElementById(elementId), options);\r\n this.googleMarkers = new GoogleMarkers(map, google);\r\n this.googlePolygons = new GooglePolygons(map, google);\r\n this.googleCircles = new GoogleCircles(map, google);\r\n this.googlePopups = new GooglePopups(map, google);\r\n this.googlePolylines = new GooglePolylines(map, google, this.googlePopups);\r\n this.googleMap = new GoogleMap(map, google);\r\n this.googleOverlays = new GoogleOverlays(map, google, this.googlePolygons);\r\n this.googleGeoJson = new GoogleGeoJson(map, google);\r\n\r\n if (imageMapTypes && imageMapTypes.length) {\r\n imageMapTypes.forEach((image: any) => {\r\n map.mapTypes.set(image.id, image.tile);\r\n });\r\n }\r\n\r\n if (params.showTraffic) {\r\n const trafficLayer = new google.maps.TrafficLayer();\r\n trafficLayer.setMap(map);\r\n }\r\n\r\n return this;\r\n } catch (err) {\r\n return err;\r\n }\r\n }\r\n\r\n /* GEOJson */\r\n public loadGEOJson(data: object, options: GeoJsonOptions, eventClick: any) {\r\n this.googleGeoJson.loadGEOJson(data, options, eventClick);\r\n }\r\n\r\n /* Markers */\r\n public drawMarker(options: MarkerOptions, eventClick: any): any {\r\n return this.googleMarkers.drawMarker(options, eventClick);\r\n }\r\n\r\n public drawCircleMarker(options: CircleMarkerOptions, eventClick: any): any {\r\n return this.googleMarkers.drawCircleMarker(options, eventClick);\r\n }\r\n\r\n public toggleMarkers(markers: any[], show: boolean, markerClusterer?: any): void {\r\n this.googleMarkers.toggleMarkers(markers, show, markerClusterer);\r\n }\r\n\r\n public alterMarkerOptions(markers: any[], options: MarkerAlterOptions): void {\r\n this.googleMarkers.alterMarkerOptions(markers, options);\r\n }\r\n\r\n public alterMarkerPosition(markers: any[], position: number[], addTransition: boolean): void {\r\n this.googleMarkers.alterMarkerPosition(markers, position, addTransition);\r\n }\r\n\r\n public fitBoundsPositions(markers: any[]): void {\r\n this.googleMarkers.fitBoundsPositions(markers);\r\n }\r\n\r\n public isMarkerOnMap(marker: any): boolean {\r\n return this.googleMarkers.isMarkerOnMap(marker);\r\n }\r\n\r\n public setCenterMarker(marker: any): void {\r\n this.googleMarkers.setCenterMarker(marker);\r\n }\r\n\r\n public addMarkerEvent(markers: any, eventType: MarkerEventType, eventFunction: any): void {\r\n this.googleMarkers.addMarkerEvent(markers, eventType, eventFunction);\r\n }\r\n\r\n public removeMarkerEvent(markers: any, event: MarkerEventType): void {\r\n this.googleMarkers.removeMarkerEvent(markers, event);\r\n }\r\n\r\n /* Marker Clusterer */\r\n public addMarkerClusterer(config: MarkerClustererConfig): any {\r\n return this.googleMarkers.addMarkerClusterer(config);\r\n }\r\n\r\n public alterMarkerClustererConfig(markerClusterer: any, config: MarkerClustererConfig): void {\r\n this.googleMarkers.alterMarkerClustererConfig(markerClusterer, config);\r\n }\r\n\r\n public refreshClusterer(markerClusterer: any): void {\r\n this.googleMarkers.refreshClusterer(markerClusterer);\r\n }\r\n\r\n public addMarkerOnClusterer(marker: any, markerClusterer: any): void {\r\n this.googleMarkers.addMarkerOnClusterer(marker, markerClusterer);\r\n }\r\n\r\n public removeMarkerFromClusterer(marker: any, markerClusterer: any): void {\r\n this.googleMarkers.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n\r\n public clearMarkersClusterer(markerClusterer: any): void {\r\n this.googleMarkers.clearMarkersClusterer(markerClusterer);\r\n }\r\n\r\n public countMarkersOnCluster(markerClusterer: any): number {\r\n return this.googleMarkers.countMarkersOnCluster(markerClusterer);\r\n }\r\n\r\n /* Polygons */\r\n public drawPolygon(options: PolygonOptions, eventClick: any): any {\r\n return this.googlePolygons.drawPolygon(options, eventClick);\r\n }\r\n\r\n public togglePolygons(polygons: any[], show: boolean): void {\r\n this.googlePolygons.togglePolygons(polygons, show);\r\n }\r\n\r\n public alterPolygonOptions(polygons: any[], options: PolygonAlterOptions): void {\r\n this.googlePolygons.alterPolygonOptions(polygons, options);\r\n }\r\n\r\n public fitBoundsPolygons(polygons: any): void {\r\n this.googlePolygons.fitBoundsPolygons(polygons);\r\n }\r\n\r\n public setCenterPolygons(polygons: any): void {\r\n this.googlePolygons.setCenterPolygons(polygons);\r\n }\r\n\r\n public isPolygonOnMap(polygon: any): boolean {\r\n return this.googlePolygons.isPolygonOnMap(polygon);\r\n }\r\n\r\n public getPolygonPath(polygon: any): number[][] {\r\n return this.googlePolygons.getPolygonPath(polygon);\r\n }\r\n\r\n public addPolygonEvent(polygons: any, eventType: PolygonEventType, eventFunction: any): void {\r\n return this.googlePolygons.addPolygonEvent(polygons, eventType, eventFunction);\r\n }\r\n\r\n public removePolygonEvent(polygons: any, event: PolygonEventType): void {\r\n this.googlePolygons.removePolygonEvent(polygons, event);\r\n }\r\n\r\n /* Circles */\r\n public drawCircle(options: CircleOptions, eventClick: any): any {\r\n return this.googleCircles.drawCircle(options, eventClick);\r\n }\r\n\r\n public toggleCircles(circles: any[], show: boolean): void {\r\n this.googleCircles.toggleCircles(circles, show);\r\n }\r\n\r\n public alterCircleOptions(circles: any[], options: CircleAlterOptions): void {\r\n this.googleCircles.alterCircleOptions(circles, options);\r\n }\r\n\r\n public fitBoundsCircles(circles: any): void {\r\n this.googleCircles.fitBoundsCircles(circles);\r\n }\r\n\r\n public isCircleOnMap(circle: any): boolean {\r\n return this.googleCircles.isCircleOnMap(circle);\r\n }\r\n\r\n public getCircleCenter(circle: any): number[] {\r\n return this.googleCircles.getCircleCenter(circle);\r\n }\r\n\r\n public getCircleRadius(circle: any): number {\r\n return this.googleCircles.getCircleRadius(circle);\r\n }\r\n\r\n public addCircleEvent(circles: any, eventType: CircleEventType, eventFunction: any): void {\r\n this.googleCircles.addCircleEvent(circles, eventType, eventFunction);\r\n }\r\n\r\n public removeCircleEvent(circles: any, event: CircleEventType): void {\r\n this.googleCircles.removeCircleEvent(circles, event);\r\n }\r\n\r\n /* Polylines */\r\n public drawPolyline(options: PolylineOptions, eventClick: any): any {\r\n return this.googlePolylines.drawPolyline(options, eventClick);\r\n }\r\n\r\n public drawPolylineWithNavigation(options: PolylineOptions, eventClick?: any): any {\r\n return this.googlePolylines.drawPolylineWithNavigation(options, eventClick);\r\n }\r\n\r\n public togglePolylines(polylines: any, show: boolean): void {\r\n this.googlePolylines.togglePolylines(polylines, show);\r\n }\r\n\r\n public alterPolylineOptions(polylines: any, options: PolylineOptions): void {\r\n this.googlePolylines.alterPolylineOptions(polylines, options);\r\n }\r\n\r\n public fitBoundsPolylines(polylines: any): void {\r\n this.googlePolylines.fitBoundsPolylines(polylines);\r\n }\r\n\r\n public isPolylineOnMap(polyline: any): boolean {\r\n return this.googlePolylines.isPolylineOnMap(polyline);\r\n }\r\n\r\n public addPolylinePath(polylines: any, position: number[]): void {\r\n this.googlePolylines.addPolylinePath(polylines, position);\r\n }\r\n\r\n public getPolylinePath(polyline: any): number[][] {\r\n return this.googlePolylines.getPolylinePath(polyline);\r\n }\r\n\r\n public removePolylineHighlight(): void {\r\n this.googlePolylines.removePolylineHighlight();\r\n }\r\n\r\n public addPolylineEvent(polylines: any, eventType: PolylineEventType, eventFunction: any): void {\r\n this.googlePolylines.addPolylineEvent(polylines, eventType, eventFunction);\r\n }\r\n\r\n public removePolylineEvent(polylines: any, event: PolylineEventType): void {\r\n this.googlePolylines.removePolylineEvent(polylines, event);\r\n }\r\n\r\n public setIndexPolylineHighlight(polyline: any, index: number): void {\r\n this.googlePolylines.setIndexPolylineHighlight(polyline, index);\r\n }\r\n\r\n public getObjectPolyline(polyline: any): object {\r\n return this.googlePolylines.getObjectPolyline(polyline);\r\n }\r\n\r\n public getObjectPolylineHighlight(): object {\r\n return this.googlePolylines.getObjectPolylineHighlight();\r\n }\r\n\r\n public addPolylineHighlightEvent(eventType: PolylineEventType, eventFunction: any): void {\r\n this.googlePolylines.addPolylineHighlightEvent(eventType, eventFunction);\r\n }\r\n\r\n public getPolylineHighlightIndex(): number[] {\r\n return this.googlePolylines.getPolylineHighlightIndex();\r\n }\r\n\r\n /* Info Windows */\r\n public drawPopup(options: PopupOptions, marker?: any): any {\r\n return this.googlePopups.drawPopup(options, marker);\r\n }\r\n\r\n public alterPopup(popup: any, options: PopupOptions, marker?: any): any {\r\n return this.googlePopups.alterPopup(popup, options, marker);\r\n }\r\n\r\n public alterPopupContent(popup: any, options: PopupOptions, marker?: any): void {\r\n this.googlePopups.alterPopupContent(popup, options, marker);\r\n }\r\n\r\n public closePopup(popup: any): void {\r\n this.googlePopups.closePopup(popup);\r\n }\r\n\r\n /* Map */\r\n public resizeMap(): void {\r\n this.googleMap.resizeMap();\r\n }\r\n\r\n public addEventMap(eventType: MapEventType, eventFunction: any): void {\r\n this.googleMap.addEventMap(eventType, eventFunction);\r\n }\r\n\r\n public removeEventMap(eventType: MapEventType): void {\r\n this.googleMap.removeEventMap(eventType);\r\n }\r\n\r\n public getZoom(): number {\r\n return this.googleMap.getZoom();\r\n }\r\n\r\n public setZoom(zoom: number): void {\r\n this.googleMap.setZoom(zoom);\r\n }\r\n\r\n public getCenter(): number[] {\r\n return this.googleMap.getCenter();\r\n }\r\n\r\n public setCenter(position: number[]): void {\r\n this.googleMap.setCenter(position);\r\n }\r\n\r\n public pixelsToLatLng(offsetx: number, offsety: number): number[] {\r\n return this.googleMap.pixelsToLatLng(offsetx, offsety);\r\n }\r\n\r\n public fitBoundsElements(markers: any, circles: any, polygons: any, polylines: any): void {\r\n this.googleMap.fitBoundsElements(markers, circles, polygons, polylines);\r\n }\r\n\r\n /* Overlay */\r\n public drawOverlay(options: OverlayOptions, polygons: any) {\r\n return this.googleOverlays.drawOverlay(options, polygons);\r\n }\r\n\r\n public toggleOverlay(overlays: any[], show: boolean): void {\r\n this.googleOverlays.toggleOverlay(overlays, show);\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/googleMaps.ts","import { CircleEventType } from '../../dto/event-type';\r\nimport CircleAlterOptions from '../../features/circle/circle-alter-options';\r\nimport CircleOptions from '../../features/circle/circle-options';\r\nimport EventReturn from '../../features/events/event-return';\r\n\r\nexport default class GoogleCircles {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public drawCircle(options: CircleOptions, eventClick: any) {\r\n const self = this;\r\n const latlng = {\r\n lat: options.center[0],\r\n lng: options.center[1]\r\n };\r\n const newOptions = {\r\n center: latlng,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n object: options.object,\r\n radius: options.radius,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity,\r\n strokeWeight: options.weight,\r\n suppressUndo: true\r\n };\r\n\r\n const circle = new this.google.maps.Circle(newOptions);\r\n\r\n if (eventClick) {\r\n this.google.maps.event.addListener(circle, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n circle.setMap(self.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(circle.getBounds());\r\n }\r\n\r\n return circle;\r\n }\r\n\r\n public toggleCircles(circles: any[], show: boolean) {\r\n const self = this;\r\n circles.forEach((circle) => circle.setMap(show ? self.map : null));\r\n }\r\n\r\n public alterCircleOptions(circles: any[], options: CircleAlterOptions) {\r\n circles.forEach((circle) => {\r\n const latlng = options.center && options.center.length > 0 ?\r\n { lat: options.center[0], lng: options.center[1] } : circle.getCenter();\r\n\r\n const newOptions = {\r\n center: latlng,\r\n fillColor: options.fillColor ? options.fillColor : circle.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : circle.fillOpacity,\r\n radius: options.radius ? options.radius : circle.radius,\r\n strokeColor: options.color ? options.color : circle.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : circle.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : circle.strokeWeight,\r\n editable: options.editable !== null && options.editable !== undefined ?\r\n options.editable : circle.editable,\r\n draggable: options.draggable !== null && options.draggable !== undefined ?\r\n options.draggable : circle.draggable\r\n };\r\n\r\n circle.setOptions(newOptions);\r\n });\r\n }\r\n\r\n public fitBoundsCircles(circles: any): void {\r\n this.map.fitBounds(this.getCirclesBounds(circles));\r\n }\r\n\r\n public isCircleOnMap(circle: any): boolean {\r\n return !!circle.map;\r\n }\r\n\r\n public getCircleCenter(circle: any): number[] {\r\n const center = circle.getCenter();\r\n\r\n return [center.lat(), center.lng()];\r\n }\r\n\r\n public getCircleRadius(circle: any): number {\r\n return circle.getRadius();\r\n }\r\n\r\n public addCircleEvent(circles: any, eventType: CircleEventType, eventFunction: any): void {\r\n circles.forEach((circle: any) => {\r\n switch (eventType) {\r\n case CircleEventType.Click:\r\n this.google.maps.event.addListener(circle, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, circle.object);\r\n });\r\n break;\r\n case CircleEventType.CenterChanged:\r\n this.google.maps.event.addListener(circle, 'center_changed', () => {\r\n const param = new EventReturn([circle.getCenter().lat(), circle.getCenter().lng()]);\r\n eventFunction(param, circle.object);\r\n });\r\n case CircleEventType.RadiusChanged:\r\n this.google.maps.event.addListener(circle, 'radius_changed', (event: any) => {\r\n const param = new EventReturn([circle.getCenter().lat(), circle.getCenter().lng()]);\r\n eventFunction(param, circle.object, circle.getRadius());\r\n });\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removeCircleEvent(circles: any, event: CircleEventType): void {\r\n circles.forEach((circle: any) => {\r\n switch (event) {\r\n case CircleEventType.Click:\r\n this.google.maps.event.clearListeners(circle, 'click');\r\n case CircleEventType.CenterChanged:\r\n this.google.maps.event.clearListeners(circle, 'center_changed');\r\n case CircleEventType.RadiusChanged:\r\n this.google.maps.event.clearListeners(circle, 'radius_changed');\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private getCirclesBounds(circles: any) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n\r\n circles.forEach((circulo: any) => bounds.union(circulo.getBounds()));\r\n return bounds;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-circles.ts","import EventReturn from '../../features/events/event-return';\r\nimport GeoJsonOptions from '../../features/geojson/geojson-options';\r\n\r\nexport default class GoogleGeoJson {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public loadGEOJson(data: object, options: GeoJsonOptions, eventClick: any) {\r\n const self = this;\r\n const objects = self.parseGeoJson(data, options);\r\n\r\n objects.forEach((elem) => {\r\n if (eventClick) {\r\n elem.addListener('click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param);\r\n });\r\n }\r\n elem.setMap(self.map);\r\n });\r\n }\r\n\r\n private parseGeoJson(data: any, options: GeoJsonOptions) {\r\n const self = this;\r\n const parsedFeatures = [];\r\n\r\n if (Array.isArray(data.features)) {\r\n for (const feature of data.features) {\r\n parsedFeatures.push(self.parseGeoJsonToObject(feature, options));\r\n }\r\n } else {\r\n parsedFeatures.push(self.parseGeoJsonToObject(data, options));\r\n }\r\n\r\n return parsedFeatures;\r\n }\r\n\r\n private parseGeoJsonToObject(data: any, objectOptions: any) {\r\n const geometry = data.geometry;\r\n\r\n if (data.properties) {\r\n Object.assign(objectOptions, data.properties);\r\n }\r\n\r\n switch (geometry.type) {\r\n case 'Point':\r\n objectOptions.position = {\r\n lat: geometry.coordinates[1],\r\n lng: geometry.coordinates[0]\r\n };\r\n return new this.google.maps.Marker(objectOptions);\r\n case 'Polygon':\r\n objectOptions.paths = [];\r\n geometry.coordinates.forEach((polygon) =>\r\n objectOptions.paths.push(polygon.map((elem) => ({\r\n lat: elem[1],\r\n lng: elem[0]\r\n })))\r\n );\r\n return new this.google.maps.Polygon(objectOptions);\r\n case 'LineString':\r\n objectOptions.path = geometry.coordinates.map((elem) => ({\r\n lat: elem[1],\r\n lng: elem[0]\r\n }));\r\n return new this.google.maps.Polyline(objectOptions);\r\n default:\r\n throw new Error('Forma de objeto desconhecida.');\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-geojson.ts","import { MapEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\n\r\nexport default class GoogleMap {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public resizeMap(): void {\r\n google.maps.event.trigger(this.map, 'resize');\r\n }\r\n\r\n public addEventMap(eventType: MapEventType, eventFunction: any) {\r\n const self = this;\r\n\r\n switch (eventType) {\r\n case MapEventType.Click:\r\n this.google.maps.event.addListener(self.map, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param);\r\n });\r\n break;\r\n case MapEventType.ZoomChanged:\r\n self.map.addListener('zoom_changed', () => {\r\n const param = new EventReturn([self.map.getCenter().lat(), self.map.getCenter().lng()]);\r\n eventFunction(param);\r\n });\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n public removeEventMap(eventType: MapEventType) {\r\n const self = this;\r\n switch (eventType) {\r\n case MapEventType.Click:\r\n this.google.maps.event.clearListeners(self.map, 'click');\r\n break;\r\n case MapEventType.ZoomChanged:\r\n this.google.maps.event.clearListeners(self.map, 'zoom_changed');\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n public getZoom(): number {\r\n return this.map.getZoom();\r\n }\r\n\r\n public setZoom(zoom: number) {\r\n return this.map.setZoom(zoom);\r\n }\r\n\r\n public getCenter(): number[] {\r\n const center = this.map.getCenter();\r\n return [center.lat(), center.lng()];\r\n }\r\n\r\n public setCenter(position: number[]) {\r\n this.map.setCenter(new google.maps.LatLng(position[0], position[1]));\r\n }\r\n\r\n public pixelsToLatLng(offsetx: number, offsety: number) {\r\n const scale = Math.pow(2, this.map.getZoom());\r\n const worldCoordinateCenter = this.map.getProjection().fromLatLngToPoint(this.map.getCenter());\r\n const pixelOffset = new google.maps.Point(offsetx / scale || 0, offsety / scale || 0);\r\n\r\n const worldCoordinateNewCenter = new google.maps.Point(\r\n worldCoordinateCenter.x - pixelOffset.x,\r\n worldCoordinateCenter.y + pixelOffset.y\r\n );\r\n\r\n const latlng = this.map.getProjection().fromPointToLatLng(worldCoordinateNewCenter);\r\n return [latlng.lat(), latlng.lng()];\r\n }\r\n\r\n public fitBoundsElements(markers: any, circles: any, polygons: any, polylines: any) {\r\n const bounds = new google.maps.LatLngBounds();\r\n\r\n if (markers && markers.length) {\r\n markers.forEach((marker: any) => bounds.extend(marker.getPosition()));\r\n\r\n this.map.fitBounds(bounds);\r\n }\r\n\r\n if (circles && circles.length) {\r\n circles.forEach((circle: any) => bounds.union(circle.getBounds()));\r\n\r\n this.map.fitBounds(bounds);\r\n }\r\n\r\n if (polygons && polygons.length) {\r\n polygons.forEach((polygon: any) => polygon.getPaths()\r\n .forEach((path: any) => path.getArray()\r\n .forEach((ponto: any) => bounds.extend(ponto))));\r\n\r\n this.map.fitBounds(bounds);\r\n }\r\n\r\n if (polylines && polylines.length) {\r\n polylines.forEach((polyline: any) => polyline.getPath()\r\n .forEach((path: any) => bounds.extend(new google.maps.LatLng(path.lat(), path.lng()))));\r\n\r\n this.map.fitBounds(bounds);\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-map.ts","import { MarkerEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport MarkerClustererConfig from '../../features/marker-clusterer/marker-clusterer-config';\r\nimport CircleMarkerOptions from '../../features/marker/circle-marker-options';\r\nimport MarkerAlterOptions from '../../features/marker/marker-alter-options';\r\nimport MarkerOptions from '../../features/marker/marker-options';\r\n\r\nconst MarkerClusterer = require('@google/markerclustererplus');\r\n\r\nexport default class GoogleMarkers {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public drawMarker(options: MarkerOptions, eventClick: any) {\r\n const newOptions = {\r\n draggable: options.draggable,\r\n icon: null,\r\n object: options.object,\r\n position: {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n }\r\n };\r\n\r\n if (options.icon) {\r\n newOptions.icon = {\r\n url: options.icon.url\r\n };\r\n\r\n if (options.icon.size) {\r\n newOptions.icon.size = new this.google.maps.Size(options.icon.size[0], options.icon.size[1]);\r\n }\r\n }\r\n const marker = new this.google.maps.Marker(newOptions);\r\n\r\n if (eventClick) {\r\n this.google.maps.event.addListener(marker, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n\r\n eventClick(param, options.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n marker.setMap(this.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n\r\n bounds.extend(marker.getPosition());\r\n this.map.fitBounds(bounds);\r\n }\r\n\r\n return marker;\r\n }\r\n\r\n public drawCircleMarker(options: CircleMarkerOptions, eventClick: any) {\r\n const self = this;\r\n const newOptions = {\r\n icon: {\r\n fillColor: options.style.fillColor,\r\n fillOpacity: options.style.fillOpacity,\r\n path: this.google.maps.SymbolPath.CIRCLE,\r\n scale: options.style.radius,\r\n strokeColor: options.style.color,\r\n strokeWeight: options.style.weight\r\n },\r\n object: options.object,\r\n position: {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n }\r\n };\r\n\r\n const marker = new this.google.maps.Marker(newOptions);\r\n\r\n if (eventClick) {\r\n this.google.maps.event.addListener(marker, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n marker.setMap(self.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n bounds.extend(marker.getPosition());\r\n self.map.fitBounds(bounds);\r\n }\r\n\r\n return marker;\r\n }\r\n\r\n public toggleMarkers(markers: any[], show: boolean, markerClusterer?: any) {\r\n const self = this;\r\n markers.forEach((marker) => {\r\n marker.setMap(show ? self.map : null);\r\n\r\n if (markerClusterer) {\r\n if (show) {\r\n self.addMarkerOnClusterer(marker, markerClusterer);\r\n } else {\r\n self.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n }\r\n });\r\n }\r\n\r\n public alterMarkerOptions(markers: any[], options: MarkerAlterOptions) {\r\n let icon = null;\r\n let position = null;\r\n\r\n if (options.latlng) {\r\n position = {\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n };\r\n }\r\n\r\n if (options.icon) {\r\n icon = options.icon;\r\n\r\n if (options.icon.size) {\r\n icon.size = new this.google.maps.Size(options.icon.size[0], options.icon.size[1]);\r\n }\r\n }\r\n\r\n markers.forEach((marker) => {\r\n if (options.style) {\r\n icon = {\r\n fillColor: options.style.fillColor ? options.style.fillColor : marker.icon.fillColor,\r\n fillOpacity: options.style.fillOpacity ? options.style.fillOpacity : marker.icon.fillOpacity,\r\n path: this.google.maps.SymbolPath.CIRCLE,\r\n scale: options.style.radius ? options.style.radius : marker.icon.scale,\r\n strokeColor: options.style.color ? options.style.color : marker.icon.strokeColor,\r\n strokeWeight: options.style.weight ? options.style.weight : marker.icon.strokeWeight\r\n };\r\n }\r\n\r\n let newOptions = null;\r\n if (position && icon) {\r\n newOptions = { icon, position };\r\n } else if (position) {\r\n newOptions = { position };\r\n } else {\r\n newOptions = { icon };\r\n }\r\n\r\n marker.setOptions(newOptions);\r\n });\r\n }\r\n\r\n public alterMarkerPosition(markers: any[], position: number[], addTransition: boolean) {\r\n const newPosition = {\r\n lat: position[0],\r\n lng: position[1]\r\n };\r\n\r\n markers.forEach((marker) => {\r\n if (addTransition) {\r\n this.moveTransitionMarker(newPosition, marker);\r\n } else {\r\n marker.setPosition(newPosition);\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsPositions(markers: any[]) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n markers.map((marker) => marker.position).forEach((position) => bounds.extend(position));\r\n this.map.fitBounds(bounds);\r\n }\r\n\r\n public isMarkerOnMap(marker: any): boolean {\r\n return !!marker.map;\r\n }\r\n\r\n public setCenterMarker(marker: any) {\r\n this.map.setCenter(marker.getPosition());\r\n }\r\n\r\n public addMarkerEvent(markers: any, eventType: MarkerEventType, eventFunction: any) {\r\n markers.forEach((marker: any) => {\r\n switch (eventType) {\r\n case MarkerEventType.Click:\r\n this.google.maps.event.addListener(marker, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.RightClick:\r\n this.google.maps.event.addListener(marker, 'rightclick', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.AfterDrag:\r\n this.google.maps.event.addListener(marker, 'dragend', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.MouseOver:\r\n this.google.maps.event.addListener(marker, 'mouseover', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.MouseOut:\r\n this.google.maps.event.addListener(marker, 'mouseout', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.BeforeDrag:\r\n this.google.maps.event.addListener(marker, 'dragstart', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removeMarkerEvent(markers: any, event: MarkerEventType): void {\r\n markers.forEach((marker: any) => {\r\n switch (event) {\r\n case MarkerEventType.Click:\r\n this.google.maps.event.clearListeners(marker, 'click');\r\n break;\r\n case MarkerEventType.RightClick:\r\n this.google.maps.event.clearListeners(marker, 'rightclick');\r\n break;\r\n case MarkerEventType.AfterDrag:\r\n this.google.maps.event.clearListeners(marker, 'dragend');\r\n break;\r\n case MarkerEventType.MouseOver:\r\n this.google.maps.event.clearListeners(marker, 'mouseover');\r\n break;\r\n case MarkerEventType.MouseOut:\r\n this.google.maps.event.clearListeners(marker, 'mouseout');\r\n break;\r\n case MarkerEventType.BeforeDrag:\r\n this.google.maps.event.clearListeners(marker, \"dragstart\");\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n /* Marker Clusterer */\r\n public addMarkerClusterer(config: MarkerClustererConfig): any {\r\n return new MarkerClusterer(this.map, [], {\r\n maxZoom: config.clusterMaxZoom,\r\n minimumClusterSize: config.clusterMinSize,\r\n zoomOnClick: config.clusterZoomOnClick\r\n });\r\n }\r\n\r\n public alterMarkerClustererConfig(markerClusterer: any, config: MarkerClustererConfig): void {\r\n markerClusterer.setZoomOnClick(config.clusterZoomOnClick);\r\n markerClusterer.setMinimumClusterSize(config.clusterMinSize);\r\n markerClusterer.setMaxZoom(config.clusterMaxZoom);\r\n }\r\n\r\n public refreshClusterer(markerClusterer: any): void {\r\n markerClusterer.repaint();\r\n }\r\n\r\n public addMarkerOnClusterer(marker: any, markerClusterer: any): void {\r\n if (markerClusterer.getMarkers().indexOf(marker) === -1) {\r\n markerClusterer.addMarker(marker, true);\r\n }\r\n }\r\n\r\n public removeMarkerFromClusterer(marker: any, markerClusterer: any): void {\r\n markerClusterer.removeMarker(marker);\r\n }\r\n\r\n public clearMarkersClusterer(markerClusterer: any): void {\r\n markerClusterer.clearMarkers();\r\n }\r\n\r\n public countMarkersOnCluster(markerClusterer: any): number {\r\n return markerClusterer.getMarkers().length;\r\n }\r\n\r\n private moveTransitionMarker(position: any, marker: any) {\r\n const numDeltas = 5;\r\n const reference = {\r\n deltaLat: (position.lat - marker.getPosition().lat()) / numDeltas,\r\n deltaLng: (position.lng - marker.getPosition().lng()) / numDeltas,\r\n i: 0,\r\n position: [marker.getPosition().lat(), marker.getPosition().lng()],\r\n lastPosition: position\r\n };\r\n\r\n this.moveMarker(marker, reference, numDeltas);\r\n }\r\n\r\n private moveMarker(marker: any, reference: any, numDeltas: number) {\r\n reference.position[0] += reference.deltaLat;\r\n reference.position[1] += reference.deltaLng;\r\n marker.setPosition(new google.maps.LatLng(reference.position[0], reference.position[1]));\r\n if (reference.i < numDeltas) {\r\n reference.i++;\r\n setTimeout(() => this.moveMarker(marker, reference, numDeltas), 20);\r\n } else if (reference.i === numDeltas) {\r\n setTimeout(() => marker.setPosition(reference.lastPosition), 20);\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-markers.ts","import EventReturn from '../../features/events/event-return';\r\nimport OverlayOptions from '../../features/overlay/overlay-options';\r\nimport GooglePolygons from './google-polygons';\r\n\r\nexport default class GoogleOverlays {\r\n private map = null;\r\n private google = null;\r\n private googlePolygons: GooglePolygons;\r\n private OverlayGoogle = null;\r\n\r\n constructor(map: any, google: any, googlePolygons: GooglePolygons) {\r\n this.map = map;\r\n this.google = google;\r\n this.googlePolygons = googlePolygons;\r\n\r\n OverlayGoogle.prototype = new this.google.maps.OverlayView();\r\n\r\n function OverlayGoogle(bounds: any, div: any, draggable: boolean, obj: any, afterDrag: any) {\r\n this.bounds_ = bounds;\r\n this.div_ = div;\r\n this.draggable = draggable;\r\n this.afterDragHandler = afterDrag;\r\n this.object = obj;\r\n this.setMap(map);\r\n }\r\n\r\n OverlayGoogle.prototype.onAdd = function () {\r\n const that = this;\r\n const panes = this.getPanes();\r\n panes.overlayLayer.appendChild(this.div_);\r\n panes.overlayMouseTarget.appendChild(this.div_);\r\n\r\n google.maps.event.addDomListener(this.div_, 'click', function () {\r\n google.maps.event.trigger(this.div_, 'click');\r\n });\r\n\r\n if (this.draggable) {\r\n google.maps.event.addDomListener(this.get('map').getDiv(), 'mouseleave', function () {\r\n google.maps.event.trigger(this.div_, 'mouseup');\r\n });\r\n\r\n google.maps.event.addDomListener(this.div_, 'mousedown', function (e) {\r\n this.style.cursor = 'move';\r\n that.map.set('draggable', false);\r\n that.set('origin', e);\r\n\r\n that.moveHandler = google.maps.event.addDomListener(that.get('map').getDiv(),\r\n 'mousemove', function (e) {\r\n const origin = that.get('origin');\r\n const left = origin.clientX - e.clientX;\r\n const top = origin.clientY - e.clientY;\r\n const pos = that.getProjection().fromLatLngToDivPixel(that.bounds_.getCenter());\r\n const latLng = that.getProjection()\r\n .fromDivPixelToLatLng(new google.maps.Point(pos.x - left, pos.y - top));\r\n\r\n that.set('origin', e);\r\n that.bounds_ = new google.maps.LatLngBounds();\r\n that.bounds_.extend(latLng);\r\n that.draw();\r\n });\r\n });\r\n\r\n google.maps.event.addDomListener(this.div_, 'mouseup', function () {\r\n that.map.set('draggable', true);\r\n this.style.cursor = 'default';\r\n google.maps.event.removeListener(that.moveHandler);\r\n\r\n if (that.afterDragHandler) {\r\n const latLng = that.bounds_.getCenter();\r\n const param = new EventReturn([latLng.lat(), latLng.lng()]);\r\n that.afterDragHandler(param, that.object);\r\n }\r\n });\r\n }\r\n };\r\n\r\n OverlayGoogle.prototype.draw = function () {\r\n const overlayProjection = this.getProjection();\r\n const center = overlayProjection.fromLatLngToDivPixel(this.bounds_.getCenter());\r\n\r\n const div = this.div_;\r\n div.style.left = center.x + 'px';\r\n div.style.top = center.y + 'px';\r\n };\r\n\r\n OverlayGoogle.prototype.onRemove = function () {\r\n this.div_.parentNode.removeChild(this.div_);\r\n };\r\n\r\n this.OverlayGoogle = OverlayGoogle;\r\n }\r\n\r\n public drawOverlay(options: OverlayOptions, polygons: any) {\r\n let bounds = null;\r\n\r\n if (polygons && polygons.length > 0) {\r\n bounds = this.googlePolygons.getPolygonsBounds(polygons);\r\n } else {\r\n bounds = new this.google.maps.LatLngBounds();\r\n bounds.extend(new this.google.maps.LatLng(options.position[0], options.position[1]));\r\n }\r\n\r\n const overlay = new this.OverlayGoogle(bounds, options.divElement,\r\n options.draggable, options.object, options.afterEventDragHandler);\r\n\r\n if (options.addToMap) {\r\n overlay.setMap(this.map);\r\n }\r\n\r\n overlay.object = options.object;\r\n return overlay;\r\n }\r\n\r\n public toggleOverlay(overlays: any[], show: boolean) {\r\n const self = this;\r\n overlays.forEach((overlay) => overlay.setMap(show ? self.map : null));\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-overlay.ts","import { PolygonEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport PolygonAlterOptions from '../../features/polygons/polygon-alter-options';\r\nimport PolygonOptions from '../../features/polygons/polygon-options';\r\n\r\nexport default class GooglePolygons {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public drawPolygon(options: PolygonOptions, eventClick: any) {\r\n const self = this;\r\n let paths = this.getPathRecursiveArray(options.path);\r\n paths = this.getPathPolylineArray(paths);\r\n\r\n const newOptions = {\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n object: options.object,\r\n paths,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity,\r\n strokeWeight: options.weight,\r\n suppressUndo: true,\r\n zIndex: options.zIndex\r\n };\r\n\r\n const polygon = new this.google.maps.Polygon(newOptions);\r\n\r\n if (eventClick) {\r\n this.google.maps.event.addListener(polygon, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, options.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n polygon.setMap(self.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(self.getPolygonBounds(polygon));\r\n }\r\n\r\n return polygon;\r\n }\r\n\r\n public togglePolygons(polygons: any[], show: boolean) {\r\n const self = this;\r\n polygons.forEach((polygon) => polygon.setMap(show ? self.map : null));\r\n }\r\n\r\n public alterPolygonOptions(polygons: any[], options: PolygonAlterOptions) {\r\n let newOptions = {};\r\n\r\n polygons.forEach((polygon) => {\r\n newOptions = {\r\n editable: options.editable !== null && options.editable !== undefined ?\r\n options.editable : polygon.editable,\r\n fillColor: options.fillColor ? options.fillColor : polygon.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : polygon.fillOpacity,\r\n strokeColor: options.color ? options.color : polygon.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : polygon.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : polygon.strokeWeight,\r\n draggable: options.draggable !== null && options.draggable !== undefined ?\r\n options.draggable : polygon.draggable\r\n };\r\n\r\n if (options.path) {\r\n const paths = [];\r\n options.path.forEach((path) => paths.push({ lat: path[0], lng: path[1] }));\r\n polygon.setPath(paths);\r\n }\r\n\r\n polygon.setOptions(newOptions);\r\n\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsPolygons(polygons: any): void {\r\n this.map.fitBounds(this.getPolygonsBounds(polygons));\r\n }\r\n\r\n public setCenterPolygons(polygons: any): void {\r\n this.map.setCenter(this.getPolygonsBounds(polygons).getCenter());\r\n }\r\n\r\n public isPolygonOnMap(polygon: any): boolean {\r\n return !!polygon.map;\r\n }\r\n\r\n public getPolygonPath(polygon: any): number[][] {\r\n return polygon.getPaths().getArray().map((x: any) => x.getArray().map(y => new EventReturn([y.lat(), y.lng()])));\r\n }\r\n\r\n public addPolygonEvent(polygons: any, eventType: PolygonEventType, eventFunction: any): void {\r\n polygons.forEach((polygon: any) => {\r\n switch (eventType) {\r\n case PolygonEventType.SetAt:\r\n this.addPolygonEventMove(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.InsertAt:\r\n this.addPolygonEventInsertAt(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.RemoveAt:\r\n this.addPolygonEventRemoveAt(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.DragPolygon:\r\n this.addPolygonEventDragPolygon(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.Click:\r\n this.addPolygonEventClick(polygon, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removePolygonEvent(polygons: any, event: PolygonEventType): void {\r\n polygons.forEach((polygon: any) => {\r\n switch (event) {\r\n case PolygonEventType.SetAt:\r\n this.google.maps.event.clearListeners(polygon.getPaths(), 'set_at');\r\n break;\r\n case PolygonEventType.InsertAt:\r\n this.google.maps.event.clearListeners(polygon.getPaths(), 'insert_at');\r\n break;\r\n case PolygonEventType.RemoveAt:\r\n this.google.maps.event.clearListeners(polygon.getPaths(), 'remove_at');\r\n break;\r\n case PolygonEventType.DragPolygon:\r\n this.google.maps.event.clearListeners(polygon, 'dragstart');\r\n this.google.maps.event.clearListeners(polygon, 'dragend');\r\n break;\r\n case PolygonEventType.Click:\r\n this.google.maps.event.clearListeners(polygon, 'click');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public getPolygonsBounds(polygons: any) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n\r\n polygons.forEach((polygon: any) => {\r\n const paths = polygon.getPaths().getArray();\r\n paths.forEach((path: any) => path.getArray().forEach((x: any) => bounds.extend(x)));\r\n });\r\n\r\n return bounds;\r\n }\r\n\r\n private getPolygonBounds(polygon: any) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n const paths = polygon.getPaths().getArray();\r\n\r\n paths.forEach((path: any) => path.getArray().forEach((x: any) => bounds.extend(x)));\r\n return bounds;\r\n }\r\n\r\n private addPolygonEventMove(polygon, eventFunction) {\r\n const polygonPathIdx = polygon.getPaths().getLength();\r\n\r\n for (let index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventMoveAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction);\r\n }\r\n }\r\n\r\n private addPolygonEventMoveAllPaths(polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'set_at', (newEvent: any, lastEvent: any) => {\r\n if (polygon.dragging)\r\n return;\r\n\r\n const path = innerPolygon.getAt(newEvent);\r\n const newPosition = new EventReturn([path.lat(), path.lng()]);\r\n const lastPosition = new EventReturn([lastEvent.lat(), lastEvent.lng()]);\r\n\r\n eventFunction(newPosition, lastPosition, polygon.object, newEvent, polygon.getPaths().getArray().map((x: any) => x.getArray().map(y => new EventReturn([y.lat(), y.lng()]))));\r\n });\r\n }\r\n\r\n private addPolygonEventInsertAt(polygon, eventFunction) {\r\n const polygonPathIdx = polygon.getPaths().getLength();\r\n\r\n for (let index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventInsertAtAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction);\r\n }\r\n }\r\n\r\n private addPolygonEventInsertAtAllPaths(polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'insert_at', (event: any) => {\r\n const newPath = innerPolygon.getAt(event);\r\n const newPoint = new EventReturn([newPath.lat(), newPath.lng()]);\r\n\r\n const previousPath = innerPolygon.getAt(event - 1);\r\n const previousPoint = previousPath ? new EventReturn([previousPath.lat(), previousPath.lng()]) : null;\r\n eventFunction(newPoint, previousPoint, polygon.object, event, polygon.getPaths().getArray().map((x: any) => x.getArray().map(y => new EventReturn([y.lat(), y.lng()]))));\r\n });\r\n }\r\n\r\n private addPolygonEventRemoveAt(polygon, eventFunction) {\r\n const polygonPathIdx = polygon.getPaths().getLength();\r\n\r\n for (let index = 0; index < polygonPathIdx; index++) {\r\n this.addPolygonEventRemoveAtAllPaths(polygon, polygon.getPaths().getAt(index), eventFunction)\r\n }\r\n }\r\n\r\n private addPolygonEventRemoveAtAllPaths(polygon, innerPolygon, eventFunction) {\r\n this.google.maps.event.addListener(innerPolygon, 'remove_at', (event: any) => {\r\n const param = new EventReturn([innerPolygon.getAt(event).lat(), innerPolygon.getAt(event).lng()]);\r\n eventFunction(param, polygon.getPaths().getArray().map((x: any) => x.getArray().map(y => new EventReturn([y.lat(), y.lng()]))), polygon.object);\r\n });\r\n }\r\n\r\n private addPolygonEventDragPolygon(polygon, eventFunction) {\r\n this.google.maps.event.addListener(polygon, 'dragstart', (event: any) => {\r\n polygon.dragging = true;\r\n });\r\n\r\n this.google.maps.event.addListener(polygon, 'dragend', (event: any) => {\r\n polygon.dragging = false;\r\n eventFunction(polygon.getPaths().getArray().map((x: any) => x.getArray().map(y => new EventReturn([y.lat(), y.lng()]))), polygon.object);\r\n });\r\n }\r\n\r\n private addPolygonEventClick(polygon, eventFunction) {\r\n this.google.maps.event.addListener(polygon, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventFunction(param, polygon.object);\r\n });\r\n }\r\n\r\n private getPathRecursiveArray(path: any) {\r\n if (Array.isArray(path) && typeof path[0] !== 'number') {\r\n return path.map(x => this.getPathRecursiveArray(x));\r\n }\r\n else return { lat: path[0], lng: path[1] }\r\n }\r\n\r\n private getPathPolylineArray(path: any) {\r\n if (typeof path[0].lat === 'number') {\r\n return path;\r\n }\r\n else if (typeof path[0][0].lat !== 'number') {\r\n path = path[0];\r\n return this.getPathPolylineArray(path);\r\n } else return path;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-polygons.ts","import { PolylineEventType } from '../../dto/event-type';\r\nimport { PolylineType } from '../../dto/polyline-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport NavigationOptions from '../../features/polyline/navigations-options';\r\nimport PolylineOptions from '../../features/polyline/polyline-options';\r\nimport GooglePopups from './google-popup';\r\n\r\nexport default class GooglePolylines {\r\n private map = null;\r\n private google = null;\r\n private googlePopups: GooglePopups;\r\n\r\n private selectedPolyline = null;\r\n private selectedPath = null;\r\n private navigateInfoWindow = null;\r\n private directionForward = false;\r\n private multiSelectionForward = false;\r\n private multiSelection = false;\r\n private navigateByPoint: boolean;\r\n private navigationOptions: NavigationOptions;\r\n\r\n constructor(map: any, google: any, googlePopups: GooglePopups) {\r\n this.map = map;\r\n this.google = google;\r\n this.googlePopups = googlePopups;\r\n }\r\n\r\n public drawPolyline(options: PolylineOptions, eventClick: any) {\r\n const self = this;\r\n const newOptions = {\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n icons: null,\r\n infowindows: options.infowindows,\r\n object: options.object,\r\n path: null,\r\n strokeColor: options.color,\r\n strokeOpacity: options.opacity || 1,\r\n strokeWeight: options.weight,\r\n suppressUndo: true,\r\n zIndex: options.zIndex\r\n };\r\n\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1,\r\n strokeWeight: options.weight\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scaledSize: new google.maps.Size(20, 20),\r\n size: new google.maps.Size(20, 20)\r\n },\r\n offset: '100%',\r\n repeat: '100px'\r\n },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '0%' },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '100%' }];\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n newOptions.path = options.path ? options.path.map((x) => {\r\n return {\r\n lat: x[0],\r\n lng: x[1]\r\n };\r\n }) : [];\r\n\r\n const polyline = new this.google.maps.Polyline(newOptions);\r\n\r\n if (eventClick) {\r\n this.google.maps.event.addListener(polyline, 'click', (event: any) => {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n eventClick(param, polyline.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n polyline.setMap(self.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(self.getPolylineBounds(polyline));\r\n }\r\n\r\n return polyline;\r\n }\r\n\r\n public drawPolylineWithNavigation(options: PolylineOptions, eventClick?: any) {\r\n const polyline = this.drawPolyline(options, null);\r\n\r\n polyline.navigationHandlerClick = eventClick;\r\n this.navigationOptions = options.navigateOptions;\r\n this.navigateByPoint = this.navigationOptions ? this.navigationOptions.navigateByPoint : true;\r\n this.addNavigation(polyline);\r\n\r\n return polyline;\r\n }\r\n\r\n public togglePolylines(polylines: any, show: boolean) {\r\n polylines.forEach((polyline: any) => {\r\n const self = this;\r\n polyline.setMap(show ? self.map : null);\r\n });\r\n }\r\n\r\n public alterPolylineOptions(polylines, options: PolylineOptions) {\r\n polylines.forEach((polyline: any) => {\r\n const newOptions: any = {\r\n draggable: options.draggable ? options.draggable : polyline.draggable,\r\n editable: options.editable ? options.editable : polyline.editable,\r\n infowindows: options.infowindows ? options.infowindows : polyline.infowindows,\r\n object: options.object ? options.object : polyline.object,\r\n strokeColor: options.color ? options.color : polyline.strokeColor,\r\n strokeOpacity: options.opacity ? options.opacity : polyline.strokeOpacity,\r\n strokeWeight: options.weight ? options.weight : polyline.strokeWeight,\r\n zIndex: options.zIndex ? options.zIndex : polyline.zIndex\r\n };\r\n\r\n if (options.path) {\r\n polyline.setPath(options.path.map((x) => new google.maps.LatLng(x[0], x[1])));\r\n }\r\n\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scaledSize: new google.maps.Size(20, 20),\r\n size: new google.maps.Size(20, 20)\r\n },\r\n offset: '90%',\r\n repeat: '20%'\r\n },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '0%' },\r\n { icon: { path: google.maps.SymbolPath.FORWARD_OPEN_ARROW }, offset: '100%' }];\r\n break;\r\n default:\r\n newOptions.icons = null;\r\n break;\r\n }\r\n\r\n polyline.setOptions(newOptions);\r\n });\r\n }\r\n\r\n public fitBoundsPolylines(polylines: any) {\r\n const self = this;\r\n self.map.fitBounds(self.getPolylinesBounds(polylines));\r\n }\r\n\r\n public isPolylineOnMap(polyline: any): boolean {\r\n return !!polyline.map;\r\n }\r\n\r\n public addPolylinePath(polylines: any, position: number[]) {\r\n polylines.forEach((polyline: any) => {\r\n const path = polyline.getPath();\r\n\r\n path.push(new this.google.maps.LatLng(position[0], position[1]));\r\n polyline.setPath(path);\r\n });\r\n }\r\n\r\n public getPolylinePath(polyline: any): number[][] {\r\n return polyline.getPath().getArray().map((x: any) => [x.lat(), x.lng()]);\r\n }\r\n\r\n public removePolylineHighlight() {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n if (this.selectedPath) {\r\n this.selectedPath.setMap(null);\r\n this.selectedPath = null;\r\n }\r\n if (this.navigateInfoWindow) {\r\n this.navigateInfoWindow.close();\r\n }\r\n }\r\n\r\n public addPolylineEvent(polylines: any, eventType: PolylineEventType, eventFunction: any) {\r\n polylines.forEach((polyline: any) => {\r\n switch (eventType) {\r\n case PolylineEventType.SetAt:\r\n this.addPolylineEventMove(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.InsertAt:\r\n this.addPolylineEventInsertAt(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.RemoveAt:\r\n this.addPolylineEventRemoveAt(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.DragPolyline:\r\n this.addPolylineEventDragPolyline(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.MouseOver:\r\n this.addPolylineEventMouseOver(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.MouseOut:\r\n this.addPolylineEventMouseOut(polyline, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removePolylineEvent(polylines: any, event: PolylineEventType) {\r\n polylines.forEach((polyline: any) => this.google.maps.event.clearListeners(polyline, 'click'));\r\n\r\n polylines.forEach((polyline: any) => {\r\n switch (event) {\r\n case PolylineEventType.SetAt:\r\n this.google.maps.event.clearListeners(polyline.getPath(), 'set_at');\r\n break;\r\n case PolylineEventType.InsertAt:\r\n this.google.maps.event.clearListeners(polyline.getPath(), 'insert_at');\r\n break;\r\n case PolylineEventType.RemoveAt:\r\n this.google.maps.event.clearListeners(polyline.getPath(), 'remove_at');\r\n break;\r\n case PolylineEventType.DragPolyline:\r\n this.google.maps.event.clearListeners(polyline, 'dragstart');\r\n this.google.maps.event.clearListeners(polyline, 'dragend');\r\n break;\r\n case PolylineEventType.MouseOver:\r\n this.google.maps.event.clearListeners(polyline, 'mouseover');\r\n break;\r\n case PolylineEventType.MouseOut:\r\n this.google.maps.event.clearListeners(polyline, 'mouseout');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public setIndexPolylineHighlight(polyline: any, index: number) {\r\n this.directionForward = false;\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n this.google.maps.event.addDomListener(document, 'keydown', this.onKeyUp.bind(this));\r\n } else {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.addDomListener(document, 'keyup', this.onKeyUp.bind(this));\r\n }\r\n }\r\n\r\n public getObjectPolyline(polyline: any): object {\r\n return polyline.object;\r\n }\r\n\r\n public getObjectPolylineHighlight() {\r\n if (this.selectedPath) {\r\n return this.selectedPath.object;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n public addPolylineHighlightEvent(eventType: PolylineEventType, eventFunction: any) {\r\n if (this.selectedPath) {\r\n this.addPolylineEvent([this.selectedPath], eventType, eventFunction);\r\n }\r\n }\r\n\r\n public getPolylineHighlightIndex() {\r\n if (this.selectedPath) {\r\n return [this.selectedPath.initialIdx, this.selectedPath.finalIdx];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /* Private methods */\r\n private addNavigation(polyline: any) {\r\n const self = this;\r\n\r\n this.google.maps.event.clearListeners(polyline, 'click');\r\n this.google.maps.event.addListener(polyline, 'click', self.onClickPolyline.bind(self, polyline));\r\n }\r\n\r\n private onClickPolyline(polyline: any, event: any) {\r\n const index = this.checkIdx(polyline, event.latLng);\r\n\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n this.google.maps.event.clearListeners(document, 'keydown');\r\n this.google.maps.event.addDomListener(document, 'keydown', this.onKeyUp.bind(this));\r\n } else {\r\n this.google.maps.event.clearListeners(document, 'keyup');\r\n this.google.maps.event.addDomListener(document, 'keyup', this.onKeyUp.bind(this));\r\n }\r\n\r\n if (polyline.navigationHandlerClick) {\r\n const param = new EventReturn([event.latLng.lat(), event.latLng.lng()]);\r\n polyline.navigationHandlerClick(param, polyline.object);\r\n }\r\n }\r\n\r\n private onKeyUp(event: any) {\r\n const self = this;\r\n\r\n if (self.selectedPath) {\r\n switch (event.which ? event.which : event.keyCode) {\r\n case 38: case 39:\r\n // up arrow or right arrow\r\n self.moveForwards(event.shiftKey);\r\n break;\r\n case 37: case 40:\r\n // left arrow or down arrow\r\n self.moveBackwards(event.shiftKey);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n private moveForwards(multiSelection: boolean) {\r\n const self = this;\r\n const polyline = self.selectedPolyline;\r\n\r\n if ((!self.navigateByPoint || self.directionForward) &&\r\n polyline.finalIdx < polyline.getPath().getArray().length - 1) {\r\n self.navigateForward(multiSelection, polyline);\r\n }\r\n self.directionForward = true;\r\n self.moveSelectedPath(polyline, null);\r\n }\r\n\r\n private navigateForward(multiSelection: boolean, polyline: any) {\r\n const self = this;\r\n if (!multiSelection) {\r\n polyline.finalIdx++;\r\n polyline.initialIdx = self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n } else {\r\n self.multiSelection = true;\r\n if (self.multiSelectionForward) {\r\n polyline.finalIdx++;\r\n }\r\n self.multiSelectionForward = true;\r\n }\r\n }\r\n\r\n private moveBackwards(multiSelection: boolean) {\r\n const self = this;\r\n const polyline = self.selectedPolyline;\r\n\r\n if ((!self.navigateByPoint || !self.directionForward) && polyline.initialIdx > 0) {\r\n self.navigateBackward(multiSelection, polyline);\r\n }\r\n self.directionForward = false;\r\n self.moveSelectedPath(polyline, null);\r\n }\r\n\r\n private navigateBackward(multiSelection: boolean, polyline) {\r\n const self = this;\r\n if (!multiSelection) {\r\n polyline.initialIdx--;\r\n polyline.finalIdx = !self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n } else {\r\n self.multiSelection = true;\r\n if (!self.multiSelectionForward) {\r\n polyline.initialIdx--;\r\n }\r\n self.multiSelectionForward = false;\r\n }\r\n }\r\n\r\n private moveSelectedPath(polyline: any, options: NavigationOptions) {\r\n const pathSelected = polyline.getPath().getArray().slice(polyline.initialIdx, polyline.finalIdx + 1);\r\n\r\n if (this.selectedPath) {\r\n this.selectedPath.setPath(pathSelected);\r\n this.selectedPath.object = polyline.object;\r\n this.updateSelectedPathListeners();\r\n } else {\r\n const newOptions: any = {\r\n editable: options.editable,\r\n keyboardShortcuts: false,\r\n map: this.map,\r\n object: polyline.object,\r\n path: pathSelected,\r\n strokeColor: options && options.color || '#FF0000',\r\n strokeOpacity: options && options.opacity || 1,\r\n strokeWeight: options && options.weight || 10,\r\n zIndex: 9999\r\n };\r\n\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n newOptions.strokeOpacity = 0;\r\n newOptions.icons = [{\r\n icon: {\r\n path: 'M 0,-1 0,1',\r\n scale: 2,\r\n strokeOpacity: 1\r\n },\r\n offset: '0',\r\n repeat: '10px'\r\n }];\r\n break;\r\n case PolylineType.Arrow:\r\n newOptions.icons = [{\r\n icon: {\r\n anchor: new google.maps.Point(0, 2),\r\n fillColor: '#000',\r\n fillOpacity: 0.7,\r\n path: google.maps.SymbolPath.FORWARD_OPEN_ARROW,\r\n scale: 4,\r\n strokeColor: '#000',\r\n strokeWeight: 5,\r\n },\r\n offset: '100%'\r\n }];\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n this.selectedPath = new this.google.maps.Polyline(newOptions);\r\n }\r\n\r\n this.selectedPath.initialIdx = polyline.initialIdx;\r\n this.selectedPath.finalIdx = polyline.finalIdx;\r\n\r\n this.drawPopupNavigation(polyline);\r\n }\r\n\r\n private addPolylineEventMove(polyline: any, eventFunction: any) {\r\n polyline.moveListener = (newEvent: any, lastEvent: any) => {\r\n if (polyline.dragging)\r\n return;\r\n\r\n const path = polyline.getPath().getAt(newEvent);\r\n const newPosition = new EventReturn([path.lat(), path.lng()]);\r\n const lastPosition = new EventReturn([lastEvent.lat(), lastEvent.lng()]);\r\n\r\n eventFunction(newPosition, lastPosition, polyline.object, newEvent, polyline.getPath().getArray().map((x: any) => new EventReturn([x.lat(), x.lng()])));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'set_at', polyline.moveListener);\r\n }\r\n\r\n private addPolylineEventInsertAt(polyline: any, eventFunction: any) {\r\n polyline.insertAtListener = (event: any) => {\r\n const path = polyline.getPath();\r\n const newPath = path.getAt(event);\r\n const newPoint = new EventReturn([newPath.lat(), newPath.lng()]);\r\n\r\n const previousPath = path.getAt(event - 1);\r\n const previousPoint = previousPath ? new EventReturn([previousPath.lat(), previousPath.lng()]) : null;\r\n eventFunction(newPoint, previousPoint, polyline.object, event, polyline.getPath().getArray().map((x: any) => new EventReturn([x.lat(), x.lng()])));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'insert_at', polyline.insertAtListener);\r\n }\r\n\r\n private addPolylineEventRemoveAt(polyline: any, eventFunction: any) {\r\n polyline.removeAtListener = (event: any) => {\r\n const param = new EventReturn([polyline.getPath().getAt(event).lat(), polyline.getPath().getAt(event).lng()]);\r\n eventFunction(param, polyline.object, polyline.getPath().getArray().map((x: any) => new EventReturn([x.lat(), x.lng()])));\r\n };\r\n this.google.maps.event.addListener(polyline.getPath(), 'remove_at', polyline.removeAtListener);\r\n }\r\n\r\n private addPolylineEventMouseOver(polyline: any, eventFunction: any) {\r\n polyline.overPolylineListener = () => {\r\n polyline.dragging = false;\r\n const param = polyline.getPath().getArray().map((x: any) => new EventReturn([x.lat(), x.lng()]));\r\n eventFunction(param, polyline.object);\r\n };\r\n\r\n this.google.maps.event.addListener(polyline, 'mouseover', polyline.overPolylineListener);\r\n }\r\n\r\n private addPolylineEventMouseOut(polyline: any, eventFunction: any) {\r\n polyline.outPolylineListener = () => {\r\n polyline.dragging = false;\r\n const param = polyline.getPath().getArray().map((x: any) => new EventReturn([x.lat(), x.lng()]));\r\n eventFunction(param, polyline.object);\r\n };\r\n\r\n this.google.maps.event.addListener(polyline, 'mouseout', polyline.outPolylineListener);\r\n }\r\n\r\n private addPolylineEventDragPolyline(polyline: any, eventFunction: any) {\r\n polyline.dragPolylineListener = () => {\r\n polyline.dragging = false;\r\n const param = polyline.getPath().getArray().map((x: any) => new EventReturn([x.lat(), x.lng()]));\r\n eventFunction(param, polyline.object);\r\n };\r\n\r\n this.google.maps.event.addListener(polyline, 'dragend', polyline.dragPolylineListener);\r\n this.google.maps.event.addListener(polyline, 'dragstart', () => polyline.dragging = true);\r\n }\r\n\r\n private updateSelectedPathListeners() {\r\n if (this.selectedPath.moveListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'set_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'set_at', this.selectedPath.moveListener);\r\n }\r\n\r\n if (this.selectedPath.insertAtListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'insert_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'insert_at',\r\n this.selectedPath.insertAtListener);\r\n }\r\n\r\n if (this.selectedPath.removeAtListener) {\r\n this.google.maps.event.clearListeners(this.selectedPath.getPath(), 'remove_at');\r\n this.google.maps.event.addListener(this.selectedPath.getPath(), 'remove_at',\r\n this.selectedPath.removeAtListener);\r\n }\r\n }\r\n\r\n private drawPopupNavigation(polyline: any) {\r\n const self = this;\r\n let idx = self.directionForward ? polyline.finalIdx : polyline.initialIdx;\r\n if (!self.navigateByPoint) {\r\n idx = polyline.finalIdx > polyline.initialIdx ? polyline.finalIdx : polyline.initialIdx;\r\n }\r\n\r\n const infowindow = polyline.infowindows ? polyline.infowindows[idx] : null;\r\n\r\n if (infowindow) {\r\n const point = polyline.getPath().getArray()[idx];\r\n\r\n if (self.navigateInfoWindow) {\r\n this.googlePopups.alterPopup(self.navigateInfoWindow, {\r\n content: infowindow,\r\n latlng: [point.lat(), point.lng()]\r\n });\r\n } else {\r\n self.navigateInfoWindow = this.googlePopups.drawPopup({\r\n content: infowindow,\r\n latlng: [point.lat(), point.lng()]\r\n });\r\n }\r\n }\r\n }\r\n\r\n private checkIdx(polyline: any, point: any) {\r\n const self = this;\r\n const path = polyline.getPath();\r\n let distance = 0;\r\n let minDistance = Number.MAX_VALUE;\r\n let returnValue = -1;\r\n\r\n for (let i = 0; i < path.length - 1; i++) {\r\n distance = self.distanceToLine(path.getAt(i), path.getAt(i + 1), point);\r\n\r\n if (distance < minDistance) {\r\n minDistance = distance;\r\n returnValue = i;\r\n }\r\n }\r\n return returnValue;\r\n }\r\n\r\n private distanceToLine(pt1: any, pt2: any, pt: any) {\r\n const self = this;\r\n const deltaX = pt2.lng() - pt1.lng();\r\n const deltaY = pt2.lat() - pt1.lat();\r\n let incIntersect = (pt.lng() - pt1.lng()) * deltaX;\r\n const deltaSum = (deltaX * deltaX) + (deltaY * deltaY);\r\n\r\n incIntersect += (pt.lat() - pt1.lat()) * deltaY;\r\n if (deltaSum > 0) {\r\n incIntersect /= deltaSum;\r\n } else {\r\n incIntersect = -1;\r\n }\r\n\r\n // The intersection occurs outside the line segment, 'before' pt1.\r\n if (incIntersect < 0) {\r\n return self.kmTo(pt, pt1);\r\n } else if (incIntersect > 1) {\r\n return self.kmTo(pt, pt2);\r\n }\r\n\r\n // Intersection point calculation.\r\n const intersect = new this.google.maps\r\n .LatLng(pt1.lat() + incIntersect * deltaY, pt1.lng() + incIntersect * deltaX);\r\n\r\n return self.kmTo(pt, intersect);\r\n }\r\n\r\n private kmTo(pt1: any, pt2: any) {\r\n const e = Math;\r\n const ra = e.PI / 180;\r\n const b = pt1.lat() * ra;\r\n const c = pt2.lat() * ra;\r\n const d = b - c;\r\n const g = pt1.lng() * ra - pt2.lng() * ra;\r\n const f = 2 * e.asin(e.sqrt(e.pow(e.sin(d / 2), 2) + e.cos(b) * e.cos(c) * e.pow(e.sin(g / 2), 2)));\r\n\r\n return f * 6378.137 * 1000;\r\n }\r\n\r\n private getPolylinesBounds(polylines: any) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n\r\n polylines.forEach((polyline: any) => {\r\n const paths = polyline.getPath().getArray();\r\n paths.forEach((path: any) => bounds.extend(path));\r\n });\r\n\r\n return bounds;\r\n }\r\n\r\n private getPolylineBounds(polyline: any) {\r\n const bounds = new this.google.maps.LatLngBounds();\r\n const paths = polyline.getPath().getArray();\r\n\r\n paths.forEach((path) => bounds.extend(path));\r\n return bounds;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-polylines.ts","import PopupOptions from '../../features/popup/popup-options';\r\n\r\nexport default class GooglePopups {\r\n private map = null;\r\n private google = null;\r\n\r\n constructor(map: any, google: any) {\r\n this.map = map;\r\n this.google = google;\r\n }\r\n\r\n public drawPopup(options: PopupOptions, marker?: any) {\r\n const self = this;\r\n const infowindow = new this.google.maps.InfoWindow({\r\n content: options.content\r\n });\r\n\r\n if (options.latlng) {\r\n infowindow.setPosition({\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n });\r\n }\r\n\r\n infowindow.open(self.map, marker || null);\r\n\r\n if (options.object) {\r\n infowindow.object = options.object;\r\n }\r\n return infowindow;\r\n }\r\n\r\n public alterPopup(popup: any, options: PopupOptions, marker?: any) {\r\n const self = this;\r\n self.alterPopupContent(popup, options, marker);\r\n\r\n if (!popup.getMap()) {\r\n popup.open(self.map, marker || null);\r\n }\r\n\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n\r\n return popup;\r\n }\r\n\r\n public alterPopupContent(popup: any, options: PopupOptions, marker?: any) {\r\n if (options.content) {\r\n popup.setContent(options.content);\r\n }\r\n\r\n if (options.latlng) {\r\n popup.setPosition({\r\n lat: options.latlng[0],\r\n lng: options.latlng[1]\r\n });\r\n } else if (marker) {\r\n popup.setPosition(marker.getPosition());\r\n }\r\n\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n }\r\n\r\n public closePopup(popup: any) {\r\n popup.close();\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/google/google-popup.ts","import { OverlayOptions } from '../..';\r\nimport { MapsApiLoaderService } from '../../utils/maps-api-loader.service';\r\nimport { CircleEventType, MapEventType, MarkerEventType, PolygonEventType, PolylineEventType } from '../dto/event-type';\r\nimport { MapType } from '../dto/map-type';\r\nimport CircleAlterOptions from '../features/circle/circle-alter-options';\r\nimport CircleOptions from '../features/circle/circle-options';\r\nimport GeoJsonOptions from '../features/geojson/geojson-options';\r\nimport MarkerClustererConfig from '../features/marker-clusterer/marker-clusterer-config';\r\nimport CircleMarkerOptions from '../features/marker/circle-marker-options';\r\nimport MarkerAlterOptions from '../features/marker/marker-alter-options';\r\nimport MarkerOptions from '../features/marker/marker-options';\r\nimport PolygonAlterOptions from '../features/polygons/polygon-alter-options';\r\nimport PolygonOptions from '../features/polygons/polygon-options';\r\nimport PolylineOptions from '../features/polyline/polyline-options';\r\nimport PopupOptions from '../features/popup/popup-options';\r\nimport LeafletCircles from './leaflet/leaflet-circle';\r\nimport LeafletGeoJson from './leaflet/leaflet-geojson';\r\nimport LeafletMap from './leaflet/leaflet-map';\r\nimport LeafletMarkers from './leaflet/leaflet-markers';\r\nimport LeafletOverlays from './leaflet/leaflet-overlay';\r\nimport LeafletPolygons from './leaflet/leaflet-polygons';\r\nimport LeafletPolylines from './leaflet/leaflet-polylines';\r\nimport LeafletPopups from './leaflet/leaflet-popup';\r\nimport IMapFunctions from './mapFunctions';\r\n\r\nexport default class Leaflet implements IMapFunctions {\r\n private leafletMarkers: LeafletMarkers;\r\n private leafletPolygons: LeafletPolygons;\r\n private leafletCircles: LeafletCircles;\r\n private leafletPolylines: LeafletPolylines;\r\n private leafletPopups: LeafletPopups;\r\n private leafletMap: LeafletMap;\r\n private leafletOverlays: LeafletOverlays;\r\n private leafletGeoJson: LeafletGeoJson;\r\n\r\n private mapsApiLoader: MapsApiLoaderService = new MapsApiLoaderService();\r\n\r\n constructor() { /* */ }\r\n\r\n public async initialize(mapType: MapType, params: any, elementId: string): Promise<any> {\r\n try {\r\n const api = await this.mapsApiLoader.loadApi(mapType, params);\r\n const leaflet = api;\r\n this.loadDependencies(params);\r\n await this.mapTimeout(1000);\r\n\r\n const mapOptions: any = {\r\n center: new leaflet.LatLng(-14, -54),\r\n editable: true,\r\n keyboard: false,\r\n maxZoom: params.wikimedia ? 18 : 19,\r\n minZoom: 4,\r\n zoom: 4,\r\n zoomControl: false\r\n };\r\n\r\n if (params.gestureHandling) {\r\n mapOptions.gestureHandling = true;\r\n }\r\n\r\n await this.mapTimeout(200);\r\n const osm = new leaflet.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', mapOptions);\r\n const wikimedia = new leaflet.tileLayer('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', {\r\n attribution: '<a href=\"https://wikimediafoundation.org/wiki/Maps_Terms_of_Use\">Wikimedia</a>'\r\n });\r\n\r\n const satelliteURL = 'https://server.arcgisonline.com/ArcGIS/rest/services/' +\r\n 'World_Imagery/MapServer/tile/{z}/{y}/{x}';\r\n const satellite = L.tileLayer(satelliteURL, {\r\n attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye,' +\r\n ' Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',\r\n maxZoom: 18\r\n });\r\n mapOptions.layers = [params.wikimedia ? wikimedia : osm];\r\n\r\n const map = new leaflet.Map(elementId, mapOptions);\r\n const baseLayers = {\r\n Map: params.wikimedia ? wikimedia : osm,\r\n Satellite: satellite\r\n };\r\n\r\n if (params.mapTiles && params.mapTiles.length) {\r\n params.mapTiles.forEach((tile: any) => {\r\n const layer = new leaflet.tileLayer(tile.url, tile.options);\r\n baseLayers[tile.name] = layer;\r\n });\r\n }\r\n\r\n leaflet.control.layers(baseLayers, null, { position: 'topleft' }).addTo(map);\r\n leaflet.control.zoom({ position: 'bottomright' }).addTo(map);\r\n\r\n this.leafletMarkers = new LeafletMarkers(map, leaflet);\r\n this.leafletPolygons = new LeafletPolygons(map, leaflet);\r\n this.leafletCircles = new LeafletCircles(map, leaflet);\r\n this.leafletPopups = new LeafletPopups(map, leaflet);\r\n this.leafletPolylines = new LeafletPolylines(map, leaflet, this.leafletPopups);\r\n this.leafletMap = new LeafletMap(map, leaflet);\r\n this.leafletOverlays = new LeafletOverlays(map, leaflet, this.leafletPolygons);\r\n this.leafletGeoJson = new LeafletGeoJson(map, leaflet);\r\n return this;\r\n } catch (err) {\r\n console.error(err);\r\n return err;\r\n }\r\n }\r\n\r\n /* GEOJson */\r\n public loadGEOJson(data: object, options: GeoJsonOptions, eventClick: any): void {\r\n this.leafletGeoJson.loadGEOJson(data, options, eventClick);\r\n }\r\n\r\n /* Markers */\r\n public drawMarker(options: MarkerOptions, eventClick: any): any {\r\n return this.leafletMarkers.drawMarker(options, eventClick);\r\n }\r\n\r\n public drawCircleMarker(options: CircleMarkerOptions, eventClick: any): any {\r\n return this.leafletMarkers.drawCircleMarker(options, eventClick);\r\n }\r\n\r\n public toggleMarkers(markers: any[], show: boolean, markerClusterer?: any): void {\r\n this.leafletMarkers.toggleMarkers(markers, show, markerClusterer);\r\n }\r\n\r\n public alterMarkerOptions(markers: any[], options: MarkerAlterOptions): void {\r\n this.leafletMarkers.alterMarkerOptions(markers, options);\r\n }\r\n\r\n public alterMarkerPosition(markers: any[], position: number[], addTransition: boolean): void {\r\n this.leafletMarkers.alterMarkerPosition(markers, position, addTransition);\r\n }\r\n\r\n public fitBoundsPositions(markers: any[]): void {\r\n this.leafletMarkers.fitBoundsPositions(markers);\r\n }\r\n\r\n public isMarkerOnMap(marker: any): boolean {\r\n return this.leafletMarkers.isMarkerOnMap(marker);\r\n }\r\n\r\n public setCenterMarker(marker: any): void {\r\n this.leafletMarkers.setCenterMarker(marker);\r\n }\r\n\r\n public addMarkerEvent(markers: any, eventType: MarkerEventType, eventFunction: any): void {\r\n this.leafletMarkers.addMarkerEvent(markers, eventType, eventFunction);\r\n }\r\n\r\n public removeMarkerEvent(markers: any, event: MarkerEventType): void {\r\n this.leafletMarkers.removeMarkerEvent(markers, event);\r\n }\r\n\r\n /* Marker Clusterer */\r\n public addMarkerClusterer(config: MarkerClustererConfig): any {\r\n return this.leafletMarkers.addMarkerClusterer(config);\r\n }\r\n\r\n public alterMarkerClustererConfig(markerClusterer: any, config: MarkerClustererConfig): void {\r\n this.leafletMarkers.alterMarkerClustererConfig(markerClusterer, config);\r\n }\r\n\r\n public refreshClusterer(markerClusterer: any): void {\r\n this.leafletMarkers.refreshClusterer(markerClusterer);\r\n }\r\n\r\n public addMarkerOnClusterer(marker: any, markerClusterer: any): void {\r\n this.leafletMarkers.addMarkerOnClusterer(marker, markerClusterer);\r\n }\r\n\r\n public removeMarkerFromClusterer(marker: any, markerClusterer: any): void {\r\n this.leafletMarkers.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n\r\n public clearMarkersClusterer(markerClusterer: any): void {\r\n this.leafletMarkers.clearMarkersClusterer(markerClusterer);\r\n }\r\n\r\n public countMarkersOnCluster(markerClusterer: any): number {\r\n return this.leafletMarkers.countMarkersOnCluster(markerClusterer);\r\n }\r\n\r\n /* Polygons */\r\n public drawPolygon(options: PolygonOptions, eventClick: any): any {\r\n return this.leafletPolygons.drawPolygon(options, eventClick);\r\n }\r\n\r\n public togglePolygons(polygons: any[], show: boolean): void {\r\n this.leafletPolygons.togglePolygons(polygons, show);\r\n }\r\n\r\n public alterPolygonOptions(polygons: any[], options: PolygonAlterOptions): void {\r\n this.leafletPolygons.alterPolygonOptions(polygons, options);\r\n }\r\n\r\n public fitBoundsPolygons(polygons: any): void {\r\n this.leafletPolygons.fitBoundsPolygons(polygons);\r\n }\r\n\r\n public setCenterPolygons(polygons: any): void {\r\n this.leafletPolygons.setCenterPolygons(polygons);\r\n }\r\n\r\n public isPolygonOnMap(polygon: any): boolean {\r\n return this.leafletPolygons.isPolygonOnMap(polygon);\r\n }\r\n\r\n public getPolygonPath(polygon: any): number[][] {\r\n return this.leafletPolygons.getPolygonPath(polygon);\r\n }\r\n\r\n public addPolygonEvent(polygons: any, eventType: PolygonEventType, eventFunction: any): void {\r\n this.leafletPolygons.addPolygonEvent(polygons, eventType, eventFunction);\r\n }\r\n\r\n public removePolygonEvent(polygons: any, event: PolygonEventType): void {\r\n this.leafletPolygons.removePolygonEvent(polygons, event);\r\n }\r\n\r\n /* Circles */\r\n public drawCircle(options: CircleOptions, eventClick: any): any {\r\n return this.leafletCircles.drawCircle(options, eventClick);\r\n }\r\n\r\n public toggleCircles(circles: any[], show: boolean): void {\r\n this.leafletCircles.toggleCircles(circles, show);\r\n }\r\n\r\n public alterCircleOptions(circles: any[], options: CircleAlterOptions): void {\r\n this.leafletCircles.alterCircleOptions(circles, options);\r\n }\r\n\r\n public fitBoundsCircles(circles: any) {\r\n this.leafletCircles.fitBoundsCircles(circles);\r\n }\r\n\r\n public isCircleOnMap(circle: any): boolean {\r\n return this.leafletCircles.isCircleOnMap(circle);\r\n }\r\n\r\n public getCircleCenter(circle: any): number[] {\r\n return this.leafletCircles.getCircleCenter(circle);\r\n }\r\n\r\n public getCircleRadius(circle: any): number {\r\n return this.leafletCircles.getCircleRadius(circle);\r\n }\r\n\r\n public addCircleEvent(circles: any, eventType: CircleEventType, eventFunction: any): void {\r\n this.leafletCircles.addCircleEvent(circles, eventType, eventFunction);\r\n }\r\n\r\n public removeCircleEvent(circles: any, event: CircleEventType): void {\r\n this.leafletCircles.removeCircleEvent(circles, event);\r\n }\r\n\r\n /* Polylines */\r\n public drawPolyline(options: PolylineOptions, eventClick: any): any {\r\n return this.leafletPolylines.drawPolyline(options, eventClick);\r\n }\r\n\r\n public drawPolylineWithNavigation(options: PolylineOptions, eventClick?: any): any {\r\n return this.leafletPolylines.drawPolylineWithNavigation(options, eventClick);\r\n }\r\n\r\n public togglePolylines(polylines: any, show: boolean): void {\r\n this.leafletPolylines.togglePolylines(polylines, show);\r\n }\r\n\r\n public alterPolylineOptions(polylines: any, options: PolylineOptions): void {\r\n this.leafletPolylines.alterPolylineOptions(polylines, options);\r\n }\r\n\r\n public fitBoundsPolylines(polylines: any): void {\r\n this.leafletPolylines.fitBoundsPolylines(polylines);\r\n }\r\n\r\n public isPolylineOnMap(polyline: any): boolean {\r\n return this.leafletPolylines.isPolylineOnMap(polyline);\r\n }\r\n\r\n public addPolylinePath(polylines: any, position: number[]): void {\r\n this.leafletPolylines.addPolylinePath(polylines, position);\r\n }\r\n\r\n public getPolylinePath(polyline: any): number[][] {\r\n return this.leafletPolylines.getPolylinePath(polyline);\r\n }\r\n\r\n public removePolylineHighlight(): void {\r\n this.leafletPolylines.removePolylineHighlight();\r\n }\r\n\r\n public addPolylineEvent(polylines: any, eventType: PolylineEventType, eventFunction: any): void {\r\n this.leafletPolylines.addPolylineEvent(polylines, eventType, eventFunction);\r\n }\r\n\r\n public removePolylineEvent(polylines: any, event: PolylineEventType): void {\r\n this.leafletPolylines.removePolylineEvent(polylines, event);\r\n }\r\n\r\n public setIndexPolylineHighlight(polyline: any, index: number): void {\r\n this.leafletPolylines.setIndexPolylineHighlight(polyline, index);\r\n }\r\n\r\n public getObjectPolyline(polyline: any): object {\r\n return this.leafletPolylines.getObjectPolyline(polyline);\r\n }\r\n public getObjectPolylineHighlight(): object {\r\n return this.leafletPolylines.getObjectPolylineHighlight();\r\n }\r\n\r\n public addPolylineHighlightEvent(eventType: PolylineEventType, eventFunction: any): void {\r\n this.leafletPolylines.addPolylineHighlightEvent(eventType, eventFunction);\r\n }\r\n\r\n public getPolylineHighlightIndex(): number[] {\r\n return this.leafletPolylines.getPolylineHighlightIndex();\r\n }\r\n\r\n /* Popups */\r\n public drawPopup(options: PopupOptions, marker?: any): any {\r\n return this.leafletPopups.drawPopup(options, marker);\r\n }\r\n\r\n public alterPopup(popup: any, options: PopupOptions, marker?: any): any {\r\n return this.leafletPopups.alterPopup(popup, options, marker);\r\n }\r\n\r\n public alterPopupContent(popup: any, options: PopupOptions, marker?: any): any {\r\n this.leafletPopups.alterPopupContent(popup, options, marker);\r\n }\r\n\r\n public closePopup(popup: any): any {\r\n this.leafletPopups.closePopup(popup);\r\n }\r\n\r\n /* Map */\r\n public resizeMap(): void {\r\n this.leafletMap.resizeMap();\r\n }\r\n\r\n public addEventMap(eventType: MapEventType, eventFunction: any): void {\r\n this.leafletMap.addEventMap(eventType, eventFunction);\r\n }\r\n\r\n public removeEventMap(eventType: MapEventType): void {\r\n this.leafletMap.removeEventMap(eventType);\r\n }\r\n\r\n public getZoom(): number {\r\n return this.leafletMap.getZoom();\r\n }\r\n\r\n public setZoom(zoom: number): void {\r\n this.leafletMap.setZoom(zoom);\r\n }\r\n\r\n public getCenter(): number[] {\r\n return this.leafletMap.getCenter();\r\n }\r\n\r\n public setCenter(position: number[]): void {\r\n this.leafletMap.setCenter(position);\r\n }\r\n\r\n public pixelsToLatLng(offsetx: number, offsety: number): number[] {\r\n return this.leafletMap.pixelsToLatLng(offsetx, offsety);\r\n }\r\n\r\n public fitBoundsElements(markers: any, circles: any, polygons: any, polylines: any): void {\r\n this.leafletMap.fitBoundsElements(markers, circles, polygons, polylines);\r\n }\r\n\r\n /* Overlay */\r\n public drawOverlay(options: OverlayOptions, polygons: any): any {\r\n return this.leafletOverlays.drawOverlay(options, polygons);\r\n }\r\n\r\n public toggleOverlay(overlays: any[], show: boolean): void {\r\n this.leafletOverlays.toggleOverlay(overlays, show);\r\n }\r\n\r\n /* Private Methods */\r\n private mapTimeout(ms: number) {\r\n return new Promise((resolve) => setTimeout(resolve, ms));\r\n }\r\n\r\n private loadDependencies(params: any) {\r\n const styles = params.cssDependencies;\r\n if (styles && styles.length > 0) {\r\n styles.forEach((path: any) => {\r\n const link = document.createElement('link');\r\n link.rel = 'stylesheet';\r\n link.href = path;\r\n document.querySelector('head').appendChild(link);\r\n });\r\n }\r\n\r\n const scripts = params.scriptsDependencies;\r\n if (scripts && scripts.length > 0) {\r\n scripts.forEach((path: any) => {\r\n const script = document.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = path;\r\n document.querySelector('head').appendChild(script);\r\n });\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet.ts","import { CircleEventType } from '../../dto/event-type';\r\nimport CircleAlterOptions from '../../features/circle/circle-alter-options';\r\nimport CircleOptions from '../../features/circle/circle-options';\r\nimport EventReturn from '../../features/events/event-return';\r\n\r\nexport default class LeafletCircles {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n public drawCircle(options: CircleOptions, eventClick: any) {\r\n const self = this;\r\n const newOptions = {\r\n color: options.color,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n fillColor: options.fillColor,\r\n fillOpacity: options.fillOpacity,\r\n opacity: options.opacity,\r\n radius: options.radius,\r\n weight: options.weight\r\n };\r\n const circle = new this.leaflet.Circle(options.center, newOptions);\r\n\r\n if (eventClick) {\r\n circle.on('click', (event: any) => {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n circle.addTo(self.map);\r\n\r\n if (options.editable) {\r\n circle.enableEdit();\r\n }\r\n }\r\n\r\n if (options.object) {\r\n circle.object = options.object;\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(circle.getBounds());\r\n }\r\n\r\n return circle;\r\n }\r\n\r\n public toggleCircles(circles: any[], show: boolean) {\r\n const self = this;\r\n circles.forEach((circle) => show ? self.map.addLayer(circle) : self.map.removeLayer(circle));\r\n }\r\n\r\n public alterCircleOptions(circles: any[], options: CircleAlterOptions) {\r\n circles.forEach((circle) => {\r\n const style = {\r\n color: options.color ? options.color : circle.options.color,\r\n draggable: options.draggable ? options.draggable : circle.options.draggable,\r\n editable: options.editable ? options.editable : circle.options.editable,\r\n fillColor: options.fillColor ? options.fillColor : circle.options.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : circle.options.fillOpacity,\r\n opacity: options.opacity ? options.opacity : circle.options.opacity,\r\n weight: options.weight ? options.weight : circle.options.weight\r\n };\r\n\r\n circle.setStyle(style);\r\n\r\n if (options.radius) {\r\n circle.setRadius(options.radius);\r\n }\r\n\r\n if (options.center) {\r\n circle.setLatLng(options.center);\r\n }\r\n\r\n if (options.editable !== null && options.editable !== undefined) {\r\n if (options.editable) {\r\n circle.enableEdit();\r\n } else {\r\n circle.disableEdit();\r\n }\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsCircles(circles: any) {\r\n this.map.fitBounds(this.getBoundsCircles(circles));\r\n }\r\n\r\n public isCircleOnMap(circle: any): boolean {\r\n return this.map.hasLayer(circle);\r\n }\r\n\r\n public getCircleCenter(circle: any): number[] {\r\n const center = circle.getLatLng();\r\n\r\n return [center.lat, center.lng];\r\n }\r\n\r\n public getCircleRadius(circle: any): number {\r\n return circle.getRadius();\r\n }\r\n\r\n public addCircleEvent(circles: any, eventType: CircleEventType, eventFunction: any): void {\r\n circles.forEach((circle: any) => {\r\n switch (eventType) {\r\n case CircleEventType.Click:\r\n circle.on('click', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, circle.object);\r\n });\r\n case CircleEventType.CenterChanged:\r\n circle.on('dragend', (event: any) => {\r\n const param = new EventReturn([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, circle.object);\r\n });\r\n case CircleEventType.RadiusChanged:\r\n circle.on('editable:vertex:dragend', (event: any) => {\r\n const param = new EventReturn([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(param, circle.object, circle.getRadius());\r\n });\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removeCircleEvent(circles: any, event: CircleEventType): void {\r\n circles.forEach((circle: any) => {\r\n switch (event) {\r\n case CircleEventType.Click:\r\n circle.off('click');\r\n case CircleEventType.CenterChanged:\r\n circle.off('dragend');\r\n case CircleEventType.RadiusChanged:\r\n circle.off('editable:vertex:dragend');\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private getBoundsCircles(circles: any) {\r\n const group = new this.leaflet.FeatureGroup(circles);\r\n return group.getBounds();\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-circle.ts","import EventReturn from '../../features/events/event-return';\r\nimport GeoJsonOptions from '../../features/geojson/geojson-options';\r\n\r\nexport default class LeafletGeoJson {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n public loadGEOJson(data: object, options: GeoJsonOptions, eventClick: any) {\r\n const self = this;\r\n const objects = self.parseGeoJson(data, options);\r\n\r\n objects.forEach((elem) => self.map.addLayer(elem));\r\n\r\n if (self.map.options) {\r\n if (self.map.options.editable) {\r\n objects.forEach((obj) => {\r\n if (obj.enableEdit) {\r\n obj.enableEdit();\r\n }\r\n\r\n if (eventClick) {\r\n obj.on('click', (event) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param);\r\n });\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n private parseGeoJson(data: any, options: GeoJsonOptions) {\r\n const self = this;\r\n const parsedFeatures = [];\r\n\r\n if (Array.isArray(data.features)) {\r\n for (const feature of data.features) {\r\n parsedFeatures.push(self.parseGeoJsonToObject(feature, options));\r\n }\r\n } else {\r\n parsedFeatures.push(self.parseGeoJsonToObject(data, options));\r\n }\r\n\r\n return parsedFeatures;\r\n }\r\n\r\n private parseGeoJsonToObject(data: any, objectOptions: any) {\r\n const geometry = data.geometry;\r\n let parsedCoordinates = [];\r\n\r\n if (data.properties) {\r\n Object.assign(objectOptions, data.properties);\r\n }\r\n\r\n switch (geometry.type) {\r\n case 'Point':\r\n parsedCoordinates = geometry.coordinates.reverse();\r\n return new this.leaflet.Marker(parsedCoordinates, objectOptions);\r\n case 'Polygon':\r\n geometry.coordinates\r\n .forEach((polygon) => parsedCoordinates.push(polygon.map((elem) => elem.reverse())));\r\n return new this.leaflet.Polygon(parsedCoordinates, objectOptions);\r\n case 'LineString':\r\n parsedCoordinates = geometry.coordinates.map((elem) => elem.reverse());\r\n return new this.leaflet.Polyline(parsedCoordinates, objectOptions);\r\n default:\r\n throw new Error('Unknown object shape.');\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-geojson.ts","import { MapEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\n\r\nexport default class LeafletMap {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n public resizeMap(): void {\r\n this.map.invalidateSize();\r\n }\r\n\r\n public addEventMap(eventType: MapEventType, eventFunction: any) {\r\n const self = this;\r\n\r\n switch (eventType) {\r\n case MapEventType.Click:\r\n self.map.on('click', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param);\r\n });\r\n break;\r\n case MapEventType.ZoomChanged:\r\n self.map.on('zoomend', (event: any) => {\r\n const param = new EventReturn([event.target.getCenter().lat, event.target.getCenter().lng]);\r\n eventFunction(param);\r\n });\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n public removeEventMap(eventType: MapEventType) {\r\n const self = this;\r\n switch (eventType) {\r\n case MapEventType.Click: self.map.off('click'); break;\r\n case MapEventType.ZoomChanged: self.map.off('zoomend');\r\n default: break;\r\n }\r\n }\r\n\r\n public getZoom(): number {\r\n return this.map.getZoom();\r\n }\r\n\r\n public setZoom(zoom: number) {\r\n this.map.setZoom(zoom);\r\n }\r\n\r\n public getCenter(): number[] {\r\n const center = this.map.getCenter();\r\n return [center.lat, center.lng];\r\n }\r\n\r\n public setCenter(position: number[]) {\r\n this.map.panTo(position);\r\n }\r\n\r\n public pixelsToLatLng(offsetx: number, offsety: number) {\r\n const scale = Math.pow(2, this.map.getZoom());\r\n const worldCoordinateCenter = this.leaflet.CRS.Simple.project(this.map.getCenter())\r\n const pixelOffset = new this.leaflet.Point(offsetx / scale || 0, offsety / scale || 0);\r\n\r\n const worldCoordinateNewCenter = new this.leaflet.Point(\r\n worldCoordinateCenter.x - pixelOffset.x,\r\n worldCoordinateCenter.y + pixelOffset.y\r\n );\r\n\r\n const latlng = this.leaflet.CRS.Simple.unproject(worldCoordinateNewCenter);\r\n return [latlng.lat, latlng.lng];\r\n }\r\n\r\n public fitBoundsElements(markers: any, circles: any, polygons: any, polylines: any): void {\r\n const group = [];\r\n\r\n if (markers && markers.length) {\r\n markers.forEach((marker: any) => group.push(marker));\r\n }\r\n\r\n if (circles && circles.length) {\r\n circles.forEach((circle: any) => group.push(circle));\r\n }\r\n\r\n if (polygons && polygons.length) {\r\n polygons.forEach((polygon: any) => group.push(polygon));\r\n }\r\n\r\n if (polylines && polylines.length) {\r\n polylines.forEach((polyline: any) => group.push(polyline));\r\n }\r\n\r\n if (group && group.length) {\r\n const bounds = this.leaflet.featureGroup(group).getBounds();\r\n this.map.fitBounds(bounds);\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-map.ts","import { MarkerEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport MarkerClustererConfig from '../../features/marker-clusterer/marker-clusterer-config';\r\nimport CircleMarkerOptions from '../../features/marker/circle-marker-options';\r\nimport MarkerAlterOptions from '../../features/marker/marker-alter-options';\r\nimport MarkerOptions from '../../features/marker/marker-options';\r\n\r\nexport default class LeafletMarkers {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n /* Markers */\r\n public drawMarker(options: MarkerOptions, eventClick: any) {\r\n const newOptions: any = {\r\n draggable: options.draggable\r\n };\r\n\r\n if (options.icon) {\r\n newOptions.icon = new this.leaflet.Icon({\r\n iconUrl: options.icon.url\r\n });\r\n\r\n const size = options.icon.size;\r\n if (size) {\r\n newOptions.icon.options.iconSize = size;\r\n newOptions.icon.options.iconAnchor = [size[0] / 2, size[1]];\r\n newOptions.icon.options.popupAnchor = [0, -size[1]];\r\n }\r\n }\r\n\r\n const marker = new this.leaflet.Marker(options.latlng, newOptions);\r\n\r\n if (options.object) {\r\n marker.object = options.object;\r\n }\r\n\r\n if (eventClick) {\r\n marker.on('click', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n\r\n if (options.addToMap && !options.addClusterer) {\r\n marker.addTo(this.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n const group = new this.leaflet.FeatureGroup([marker]);\r\n this.map.fitBounds(group.getBounds());\r\n }\r\n\r\n return marker;\r\n }\r\n\r\n public drawCircleMarker(options: CircleMarkerOptions, eventClick: any) {\r\n const self = this;\r\n const marker = new this.leaflet.circleMarker(options.latlng, options.style);\r\n\r\n if (eventClick) {\r\n marker.on('click', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n marker.addTo(self.map);\r\n }\r\n\r\n if (options.fitBounds) {\r\n const group = new this.leaflet.FeatureGroup([marker]);\r\n self.map.fitBounds(group.getBounds());\r\n }\r\n\r\n marker.object = options.object;\r\n return marker;\r\n }\r\n\r\n public toggleMarkers(markers: any[], show: boolean, markerClusterer?: any) {\r\n const self = this;\r\n markers.forEach((marker) => {\r\n if (markerClusterer) {\r\n if (show) {\r\n self.addMarkerOnClusterer(marker, markerClusterer);\r\n } else {\r\n self.removeMarkerFromClusterer(marker, markerClusterer);\r\n }\r\n } else {\r\n if (show) {\r\n self.map.addLayer(marker);\r\n } else {\r\n self.map.removeLayer(marker);\r\n }\r\n }\r\n });\r\n }\r\n\r\n public alterMarkerOptions(markers: any[], options: MarkerAlterOptions) {\r\n markers.forEach((marker) => {\r\n if (marker.type === 'circle' && options.style) {\r\n const style = {\r\n fillColor: options.style.fillColor ? options.style.fillColor : marker.options.fillColor,\r\n fillOpacity: options.style.fillOpacity ? options.style.fillOpacity : marker.options.fillOpacity,\r\n radius: options.style.radius ? options.style.radius : marker.options.radius,\r\n strokeColor: options.style.color ? options.style.color : marker.options.strokeColor,\r\n strokeWeight: options.style.weight ? options.style.weight : marker.options.strokeWeight\r\n };\r\n\r\n marker.setStyle(style);\r\n }\r\n\r\n if (options.icon) {\r\n const icon = new this.leaflet.icon({ iconUrl: options.icon.url });\r\n const size = options.icon.size;\r\n\r\n if (size) {\r\n icon.options.iconSize = size;\r\n icon.options.iconAnchor = [size[0] / 2, size[1]];\r\n }\r\n\r\n marker.setIcon(icon);\r\n }\r\n\r\n if (options.latlng) {\r\n marker.setLatLng(options.latlng);\r\n }\r\n });\r\n }\r\n\r\n public alterMarkerPosition(markers: any[], position: number[], addTransition: boolean) {\r\n markers.forEach((marker) => {\r\n if (addTransition) {\r\n this.moveTransitionMarker(position, marker);\r\n } else {\r\n marker.setLatLng(position);\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsPositions(markers: any[]) {\r\n const group = new this.leaflet.featureGroup(markers);\r\n this.map.fitBounds(group.getBounds());\r\n }\r\n\r\n public isMarkerOnMap(marker: any): boolean {\r\n return this.map.hasLayer(marker);\r\n }\r\n\r\n public setCenterMarker(marker: any) {\r\n this.map.panTo(marker.getLatLng());\r\n }\r\n\r\n public addMarkerEvent(markers: any, eventType: MarkerEventType, eventFunction: any) {\r\n markers.forEach((marker: any) => {\r\n switch (eventType) {\r\n case MarkerEventType.Click:\r\n marker.on('click', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.RightClick:\r\n marker.on('contextmenu', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.AfterDrag:\r\n marker.on('dragend', (event: any) => {\r\n const param = new EventReturn([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.MouseOver:\r\n marker.on('mouseover', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.MouseOut:\r\n marker.on('mouseout', (event: any) => {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n case MarkerEventType.BeforeDrag:\r\n marker.on('dragstart', (event: any) => {\r\n const param = new EventReturn([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n eventFunction(param, marker.object);\r\n });\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removeMarkerEvent(markers: any, event: MarkerEventType): void {\r\n markers.forEach((marker: any) => {\r\n switch (event) {\r\n case MarkerEventType.Click:\r\n marker.off('click');\r\n break;\r\n case MarkerEventType.RightClick:\r\n marker.off('contextmenu');\r\n break;\r\n case MarkerEventType.AfterDrag:\r\n marker.off('dragend');\r\n break;\r\n case MarkerEventType.MouseOver:\r\n marker.off('mouseover');\r\n break;\r\n case MarkerEventType.MouseOut:\r\n marker.off('mouseout');\r\n break;\r\n case MarkerEventType.BeforeDrag:\r\n marker.off('dragstart');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n /* Marker Clusterer */\r\n public addMarkerClusterer(config: MarkerClustererConfig): any {\r\n const layer = this.leaflet.markerClusterGroup({\r\n maxClusterRadius: 50,\r\n showCoverageOnHover: false,\r\n zoomToBoundsOnClick: config.clusterZoomOnClick\r\n });\r\n\r\n this.map.addLayer(layer);\r\n return layer;\r\n }\r\n\r\n public alterMarkerClustererConfig(markerClusterer: any, config: MarkerClustererConfig): void {\r\n markerClusterer.options.zoomToBoundsOnClick = config.clusterZoomOnClick;\r\n }\r\n\r\n public refreshClusterer(markerClusterer: any): void {\r\n markerClusterer.refreshClusters();\r\n }\r\n\r\n public addMarkerOnClusterer(marker: any, markerClusterer: any): void {\r\n markerClusterer.addLayer(marker);\r\n }\r\n\r\n public removeMarkerFromClusterer(marker: any, markerClusterer: any): void {\r\n markerClusterer.removeLayer(marker);\r\n }\r\n\r\n public clearMarkersClusterer(markerClusterer: any): void {\r\n markerClusterer.clearLayers();\r\n }\r\n\r\n public countMarkersOnCluster(markerClusterer: any): number {\r\n return markerClusterer.getLayers().length;\r\n }\r\n\r\n private moveTransitionMarker(position: any, marker: any) {\r\n const numDeltas = 5;\r\n const reference = {\r\n deltaLat: (position[0] - marker.getLatLng().lat) / numDeltas,\r\n deltaLng: (position[1] - marker.getLatLng().lng) / numDeltas,\r\n i: 0,\r\n position: [marker.getLatLng().lat, marker.getLatLng().lng],\r\n lastPosition: position\r\n };\r\n\r\n this.moveMarker(marker, reference, numDeltas);\r\n }\r\n\r\n private moveMarker(marker: any, reference: any, numDeltas: number) {\r\n reference.position[0] += reference.deltaLat;\r\n reference.position[1] += reference.deltaLng;\r\n marker.setLatLng(reference.position);\r\n if (reference.i < numDeltas) {\r\n reference.i++;\r\n setTimeout(() => this.moveMarker(marker, reference, numDeltas), 20);\r\n } else if (reference.i === numDeltas) {\r\n setTimeout(() => marker.setLatLng(reference.lastPosition), 20);\r\n }\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-markers.ts","import EventReturn from '../../features/events/event-return';\r\nimport OverlayOptions from '../../features/overlay/overlay-options';\r\nimport LeafletPolygons from './leaflet-polygons';\r\n\r\nexport default class LeafletOverlay {\r\n private map = null;\r\n private leaflet = null;\r\n private leafletPolygons: LeafletPolygons;\r\n\r\n constructor(map: any, leaflet: any, leafletPolygons: LeafletPolygons) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n this.leafletPolygons = leafletPolygons;\r\n }\r\n\r\n public drawOverlay(options: OverlayOptions, polygons: any) {\r\n const html: string = options.divElement.outerHTML;\r\n const myIcon = new this.leaflet.DivIcon({ html });\r\n\r\n const position = polygons && polygons.length > 0 ?\r\n this.leafletPolygons.getBoundsPolygons(polygons).getCenter() : options.position;\r\n\r\n const overlay = new this.leaflet.Marker(position, { icon: myIcon, draggable: options.draggable });\r\n\r\n if (options.addToMap) {\r\n overlay.addTo(this.map);\r\n }\r\n\r\n overlay.object = options.object;\r\n\r\n if (options.draggable && options.afterEventDragHandler) {\r\n overlay.on('dragend', (event: any) => {\r\n const param = new EventReturn([event.target.getLatLng().lat, event.target.getLatLng().lng]);\r\n options.afterEventDragHandler(param, options.object);\r\n });\r\n }\r\n\r\n return overlay;\r\n }\r\n\r\n public toggleOverlay(overlays: any[], show: boolean) {\r\n const self = this;\r\n overlays.forEach((overlay) => show ? self.map.addLayer(overlay) : self.map.removeLayer(overlay));\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-overlay.ts","import { PolygonEventType } from '../../dto/event-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport PolygonAlterOptions from '../../features/polygons/polygon-alter-options';\r\nimport PolygonOptions from '../../features/polygons/polygon-options';\r\n\r\nexport default class LeafletPolygons {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n public drawPolygon(options: PolygonOptions, eventClick: any) {\r\n const self = this;\r\n const newOptions = {\r\n color: options.color || '#000',\r\n draggable: options.draggable,\r\n fillColor: options.fillColor || '#fff',\r\n fillOpacity: options.fillOpacity || 1,\r\n opacity: options.opacity || 1,\r\n weight: options.weight || 2\r\n };\r\n const polygon = new this.leaflet.Polygon(options.path, newOptions);\r\n\r\n if (eventClick) {\r\n polygon.on('click', (event: any) => {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n polygon.addTo(self.map);\r\n\r\n if (options.editable) {\r\n polygon.enableEdit();\r\n }\r\n }\r\n\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(polygon.getBounds());\r\n }\r\n\r\n return polygon;\r\n }\r\n\r\n public togglePolygons(polygons: any[], show: boolean) {\r\n const self = this;\r\n polygons.forEach((polygon) => show ? self.map.addLayer(polygon) : self.map.removeLayer(polygon));\r\n }\r\n\r\n public alterPolygonOptions(polygons: any[], options: PolygonAlterOptions) {\r\n polygons.forEach((polygon) => {\r\n const style = {\r\n color: options.color ? options.color : polygon.options.color,\r\n draggable: options.draggable ? options.draggable : polygon.options.draggable,\r\n fillColor: options.fillColor ? options.fillColor : polygon.options.fillColor,\r\n fillOpacity: options.fillOpacity ? options.fillOpacity : polygon.options.fillOpacity,\r\n opacity: options.opacity ? options.opacity : polygon.options.opacity,\r\n weight: options.weight ? options.weight : polygon.options.weight\r\n };\r\n\r\n if (options.path) {\r\n polygon.setLatLngs(options.path);\r\n }\r\n\r\n polygon.setStyle(style);\r\n\r\n if (options.editable !== null && options.editable !== undefined) {\r\n polygon.disableEdit();\r\n\r\n if (options.editable) {\r\n polygon.enableEdit();\r\n }\r\n }\r\n\r\n if (options.object) {\r\n polygon.object = options.object;\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsPolygons(polygons: any): void {\r\n this.map.fitBounds(this.getBoundsPolygons(polygons));\r\n }\r\n\r\n public setCenterPolygons(polygons: any): void {\r\n this.map.panTo(this.getBoundsPolygons(polygons).getCenter());\r\n }\r\n\r\n public isPolygonOnMap(polygon: any): boolean {\r\n return this.map.hasLayer(polygon);\r\n }\r\n\r\n public getPolygonPath(polygon: any): number[][] {\r\n return polygon.getLatLngs()[0].map((x: any) => [x.lat, x.lng]);\r\n }\r\n\r\n public addPolygonEvent(polygons: any, eventType: PolygonEventType, eventFunction: any): void {\r\n const self = this;\r\n polygons.forEach((polygon: any) => {\r\n switch (eventType) {\r\n case PolygonEventType.SetAt:\r\n this.addPolygonEventMove(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.InsertAt:\r\n this.addPolygonEventInsertAt(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.RemoveAt:\r\n this.addPolygonEventRemoveAt(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.DragPolygon:\r\n this.addPolygonEventDragPolygon(polygon, eventFunction);\r\n break;\r\n case PolygonEventType.Click:\r\n this.addPolygonEventClick(polygon, eventFunction, self);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removePolygonEvent(polygons: any, event: PolygonEventType): void {\r\n polygons.forEach((polygon: any) => {\r\n switch (event) {\r\n case PolygonEventType.SetAt:\r\n polygon.off('editable:vertex:dragstart');\r\n break;\r\n case PolygonEventType.InsertAt:\r\n polygon.off('editable:vertex:new');\r\n break;\r\n case PolygonEventType.RemoveAt:\r\n polygon.off('editable:vertex:clicked');\r\n polygon.off('editable:vertex:deleted');\r\n break;\r\n case PolygonEventType.DragPolygon:\r\n polygon.off('dragend');\r\n break;\r\n case PolygonEventType.Click:\r\n polygon.off('click');\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public getBoundsPolygons(polygons) {\r\n const group = new this.leaflet.FeatureGroup(polygons);\r\n return group.getBounds();\r\n }\r\n\r\n private addPolygonEventMove(polygon: any, eventFunction: any) {\r\n polygon.on('editable:vertex:dragstart', (eventStart: any) => {\r\n const lastPosition = new EventReturn([eventStart.vertex.latlng.lat, eventStart.vertex.latlng.lng]);\r\n\r\n polygon.on('editable:vertex:dragend', (eventEnd: any) => {\r\n const newPosition = new EventReturn([eventEnd.vertex.latlng.lat, eventEnd.vertex.latlng.lng]);\r\n const path = polygon.getLatLngs().map((x: any) => {\r\n if (Array.isArray(x[0])) {\r\n return x.map((y: any) => y.map(z => new EventReturn([z.lat, z.lng])));\r\n } else {\r\n return [x.map((y: any) => new EventReturn([y.lat, y.lng]))];\r\n }\r\n });\r\n\r\n eventFunction(newPosition, lastPosition, eventEnd.target.object, eventEnd.vertex.getIndex(), path[0]);\r\n polygon.off('editable:vertex:dragend');\r\n });\r\n });\r\n }\r\n\r\n private addPolygonEventInsertAt(polygon: any, eventFunction: any) {\r\n polygon.on('editable:vertex:new', (eventNew: any) => {\r\n const latlngs = eventNew.vertex.latlngs;\r\n const previous = latlngs[latlngs.findIndex((x: any) => x === eventNew.vertex.latlng) - 1];\r\n\r\n if (previous) {\r\n const previousPoint = new EventReturn([previous.lat, previous.lng]);\r\n\r\n polygon.on('editable:vertex:dragend', (event: any) => {\r\n const newPoint = new EventReturn([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n const path = polygon.getLatLngs().map((x: any) => {\r\n if (Array.isArray(x[0])) {\r\n return x.map((y: any) => y.map(z => new EventReturn([z.lat, z.lng])));\r\n } else {\r\n return [x.map((y: any) => new EventReturn([y.lat, y.lng]))];\r\n }\r\n });\r\n\r\n eventFunction(newPoint, previousPoint, event.target.object, event.vertex.getIndex(), path[0]);\r\n polygon.off('editable:vertex:dragend');\r\n });\r\n }\r\n });\r\n }\r\n\r\n private addPolygonEventRemoveAt(polygon: any, eventFunction: any) {\r\n polygon.on('editable:vertex:deleted', (event: any) => {\r\n const param = new EventReturn([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n\r\n const path = polygon.getLatLngs().map((x: any) => {\r\n if (Array.isArray(x[0])) {\r\n return x.map((y: any) => y.map(z => new EventReturn([z.lat, z.lng])));\r\n } else {\r\n return [x.map((y: any) => new EventReturn([y.lat, y.lng]))];\r\n }\r\n });\r\n\r\n eventFunction(param, path[0], event.target.object);\r\n });\r\n }\r\n\r\n private addPolygonEventDragPolygon(polygon: any, eventFunction: any) {\r\n polygon.on('dragend', (event: any) => {\r\n const path = polygon.getLatLngs().map((x: any) => {\r\n if (Array.isArray(x[0])) {\r\n return x.map((y: any) => y.map(z => new EventReturn([z.lat, z.lng])));\r\n } else {\r\n return [x.map((y: any) => new EventReturn([y.lat, y.lng]))];\r\n }\r\n });\r\n\r\n eventFunction(path[0], event.target.object);\r\n });\r\n }\r\n\r\n private addPolygonEventClick(polygon: any, eventFunction: any, self: any) {\r\n polygon.on('click', (event: any) => {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventFunction(param, event.target.object);\r\n });\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-polygons.ts","import { Polyline } from 'leaflet';\r\nimport { PolylineEventType } from '../../dto/event-type';\r\nimport { PolylineType } from '../../dto/polyline-type';\r\nimport EventReturn from '../../features/events/event-return';\r\nimport NavigationOptions from '../../features/polyline/navigations-options';\r\nimport PolylineOptions from '../../features/polyline/polyline-options';\r\nimport LeafletPopup from './leaflet-popup';\r\n\r\nexport default class LeafletPolylines {\r\n private map = null;\r\n private leaflet = null;\r\n private leafletPopup: LeafletPopup;\r\n\r\n private selectedPolyline = null;\r\n private selectedPath = null;\r\n private navigateInfoWindow = null;\r\n private directionForward = false;\r\n private multiSelectionForward = false;\r\n private multiSelection = false;\r\n private navigateByPoint: boolean;\r\n private navigationOptions: NavigationOptions;\r\n\r\n constructor(map: any, leaflet: any, leafletPopup: LeafletPopup) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n this.leafletPopup = leafletPopup;\r\n }\r\n\r\n public drawPolyline(options: PolylineOptions, eventClick: any) {\r\n const self = this;\r\n const newOptions = {\r\n color: options.color || '#000000',\r\n dashArray: null,\r\n draggable: options.draggable,\r\n editable: options.editable,\r\n infowindows: options.infowindows,\r\n opacity: options.opacity || 1,\r\n weight: options.weight || 3,\r\n zIndex: options.zIndex\r\n };\r\n\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n newOptions.opacity = .7;\r\n newOptions.dashArray = '20,15';\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n const polyline = new this.leaflet.Polyline(options.path || [], newOptions);\r\n polyline.on('editable:vertex:rawclick', (e) => e.cancel());\r\n\r\n if (eventClick) {\r\n polyline.on('click', (event: any) => {\r\n self.leaflet.DomEvent.stopPropagation(event);\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n\r\n polyline.on('editable:vertex:rawclick', (event) => {\r\n event.cancel()\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n eventClick(param, event.target.object);\r\n });\r\n\r\n }\r\n\r\n if (options.style && options.style === PolylineType.Arrow) {\r\n const pathOptions = { fillOpacity: 1, weight: 0, color: polyline.options.color };\r\n\r\n polyline.decorator = self.leaflet.polylineDecorator(polyline, {\r\n patterns: [{\r\n offset: '20%',\r\n repeat: '90px',\r\n symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions })\r\n },\r\n { offset: '0%', symbol: self.leaflet.Symbol.arrowHead({ pathOptions, pixelSize: 20 }) },\r\n { offset: '100%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions }) }]\r\n });\r\n }\r\n\r\n if (options.addToMap) {\r\n polyline.addTo(self.map);\r\n if (polyline.decorator) { polyline.decorator.addTo(self.map); }\r\n if (options.editable) { polyline.enableEdit(); }\r\n }\r\n\r\n if (options.object) {\r\n polyline.object = options.object;\r\n }\r\n\r\n if (options.fitBounds) {\r\n self.map.fitBounds(polyline.getBounds());\r\n }\r\n\r\n return polyline;\r\n }\r\n\r\n public drawPolylineWithNavigation(options: PolylineOptions, eventClick?: any) {\r\n const polyline = this.drawPolyline(options, null);\r\n\r\n polyline.navigationHandlerClick = eventClick;\r\n this.navigationOptions = options.navigateOptions;\r\n this.navigateByPoint = this.navigationOptions ? this.navigationOptions.navigateByPoint : true;\r\n this.addNavigation(polyline);\r\n return polyline;\r\n }\r\n\r\n public togglePolylines(polylines: any, show: boolean) {\r\n const self = this;\r\n polylines.forEach((polyline: any) => {\r\n if (show) {\r\n self.map.addLayer(polyline);\r\n if (polyline.options.editable) {\r\n polyline.enableEdit();\r\n }\r\n if (polyline.decorator) { self.map.addLayer(polyline.decorator); }\r\n } else {\r\n self.map.removeLayer(polyline);\r\n if (polyline.options.editable) {\r\n polyline.disableEdit();\r\n }\r\n if (polyline.decorator) { self.map.removeLayer(polyline.decorator); }\r\n }\r\n });\r\n }\r\n\r\n public alterPolylineOptions(polylines: any, options: PolylineOptions) {\r\n const self = this;\r\n\r\n polylines.forEach((polyline: any) => {\r\n const style: any = {\r\n color: options.color ? options.color : polyline.options.color,\r\n draggable: options.draggable ? options.draggable : polyline.options.draggable,\r\n opacity: options.opacity ? options.opacity : polyline.options.opacity,\r\n weight: options.weight ? options.weight : polyline.options.weight,\r\n zIndex: options.zIndex ? options.zIndex : polyline.options.zIndex\r\n };\r\n\r\n if (options.path) {\r\n polyline.setLatLngs(options.path);\r\n }\r\n\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n style.dashArray = '20,15';\r\n break;\r\n case PolylineType.Arrow:\r\n const pathOptions = { fillOpacity: 1, weight: 0, color: style.color };\r\n\r\n if (polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n }\r\n\r\n polyline.decorator = self.leaflet.polylineDecorator(polyline, {\r\n patterns: [{\r\n offset: '20%',\r\n repeat: '90px',\r\n symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions })\r\n },\r\n { offset: '0%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions }) },\r\n { offset: '100%', symbol: self.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions }) }]\r\n });\r\n\r\n if (self.map.hasLayer(polyline)) {\r\n polyline.decorator.addTo(self.map);\r\n }\r\n break;\r\n default:\r\n if (polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n polyline.decorator = null;\r\n }\r\n break;\r\n }\r\n\r\n polyline.setStyle(style);\r\n\r\n if (options.object) {\r\n polyline.object = options.object;\r\n }\r\n\r\n if (options.editable) {\r\n polyline.disableEdit();\r\n polyline.enableEdit();\r\n }\r\n });\r\n }\r\n\r\n public fitBoundsPolylines(polylines: any) {\r\n const self = this;\r\n self.map.fitBounds(self.getBoundsPolylines(polylines));\r\n }\r\n\r\n public isPolylineOnMap(polyline: any): boolean {\r\n return this.map.hasLayer(polyline);\r\n }\r\n\r\n public addPolylinePath(polylines: any, position: number[]) {\r\n polylines.forEach((polyline: any) => {\r\n const path = polyline.getLatLngs();\r\n\r\n path.push(new this.leaflet.LatLng(position[0], position[1]));\r\n polyline.setLatLngs(path);\r\n\r\n if (polyline.editEnabled && polyline.editEnabled()) {\r\n polyline.disableEdit();\r\n polyline.enableEdit();\r\n }\r\n });\r\n }\r\n\r\n public getPolylinePath(polyline: any): number[][] {\r\n return polyline.getLatLngs().map((x: any) => [x.lat, x.lng]);\r\n }\r\n\r\n public removePolylineHighlight() {\r\n const self = this;\r\n\r\n if (self.selectedPath) {\r\n if (this.selectedPath.decorator) {\r\n this.map.removeLayer(this.selectedPath.decorator);\r\n }\r\n\r\n this.map.removeLayer(self.selectedPath);\r\n self.selectedPath = null;\r\n }\r\n\r\n if (self.navigateInfoWindow) {\r\n self.navigateInfoWindow.remove();\r\n }\r\n\r\n document.onkeyup = null;\r\n document.onkeydown = null;\r\n }\r\n\r\n public addPolylineEvent(polylines: any, eventType: PolylineEventType, eventFunction: any) {\r\n polylines.forEach((polyline: any) => {\r\n switch (eventType) {\r\n case PolylineEventType.SetAt:\r\n this.addPolylineEventMove(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.InsertAt:\r\n this.addPolylineEventInsertAt(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.RemoveAt:\r\n this.addPolylineEventRemoveAt(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.MouseOver:\r\n this.addPolylineEventMouseOver(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.MouseOut:\r\n this.addPolylineEventMouseOut(polyline, eventFunction);\r\n break;\r\n case PolylineEventType.DragPolyline:\r\n this.addPolylineEventDragPolyline(polyline, eventFunction);\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public removePolylineEvent(polylines: any, event: PolylineEventType) {\r\n polylines.forEach((polyline: any) => {\r\n switch (event) {\r\n case PolylineEventType.SetAt:\r\n polyline.off('editable:vertex:dragstart');\r\n break;\r\n case PolylineEventType.InsertAt:\r\n polyline.off('editable:vertex:new');\r\n break;\r\n case PolylineEventType.RemoveAt:\r\n polyline.off('editable:vertex:deleted');\r\n break;\r\n case PolylineEventType.DragPolyline:\r\n polyline.off('dragend');\r\n break;\r\n case PolylineEventType.MouseOver:\r\n polyline.off('mouseover');\r\n break;\r\n case PolylineEventType.MouseOut:\r\n polyline.off('mouseout');\r\n break;\r\n default:\r\n break;\r\n }\r\n });\r\n }\r\n\r\n public setIndexPolylineHighlight(polyline: any, index: number) {\r\n this.directionForward = false;\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n document.onkeydown = this.onKeyUp.bind(this);\r\n } else {\r\n document.onkeyup = this.onKeyUp.bind(this);\r\n }\r\n\r\n }\r\n\r\n public getObjectPolyline(polyline: any): object {\r\n return polyline.object;\r\n }\r\n\r\n public getObjectPolylineHighlight(): object {\r\n if (this.selectedPath) {\r\n return this.selectedPath.object;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n public addPolylineHighlightEvent(eventType: PolylineEventType, eventFunction: any) {\r\n if (this.selectedPolyline) {\r\n this.addPolylineEvent([this.selectedPath], eventType, eventFunction);\r\n }\r\n }\r\n\r\n public getPolylineHighlightIndex() {\r\n if (this.selectedPath) {\r\n return [this.selectedPath.initialIdx, this.selectedPath.finalIdx];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /* Private methods */\r\n private addNavigation(polyline: any) {\r\n polyline.clearAllEventListeners();\r\n polyline.on('click', this.onClickPolyline.bind(this, polyline));\r\n }\r\n\r\n private onClickPolyline(polyline: any, event: any) {\r\n const index = this.checkIdx(polyline, event.latlng);\r\n\r\n polyline.initialIdx = index;\r\n polyline.finalIdx = index + 1;\r\n\r\n this.moveSelectedPath(polyline, this.navigationOptions);\r\n this.selectedPolyline = polyline;\r\n\r\n if (this.navigationOptions.navegateOnKeyPress) {\r\n document.onkeydown = this.onKeyUp.bind(this);\r\n } else {\r\n document.onkeyup = this.onKeyUp.bind(this);\r\n }\r\n\r\n if (polyline.navigationHandlerClick) {\r\n const param = new EventReturn([event.latlng.lat, event.latlng.lng]);\r\n polyline.navigationHandlerClick(param, event.target.object);\r\n }\r\n }\r\n\r\n private onKeyUp(event: any) {\r\n const self = this;\r\n\r\n if (self.selectedPath) {\r\n if (event.ctrlKey) {\r\n console.warn('Deprecated: CTRL is not needed in navigation anymore');\r\n }\r\n\r\n switch (event.which ? event.which : event.keyCode) {\r\n case 38: case 39:\r\n // up arrow or right arrow\r\n self.moveFowards(event.shiftKey);\r\n break;\r\n case 37: case 40:\r\n // left arrow or down arrow\r\n self.moveBackwards(event.shiftKey);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n private moveFowards(multiselection: boolean) {\r\n const polyline = this.selectedPolyline;\r\n\r\n if ((!this.navigateByPoint || this.directionForward) && polyline.finalIdx < polyline.getLatLngs().length - 1) {\r\n this.navigateFoward(multiselection, polyline);\r\n }\r\n this.directionForward = true;\r\n this.moveSelectedPath(polyline, null);\r\n }\r\n\r\n private navigateFoward(multiSelection: boolean, polyline: any) {\r\n if (!multiSelection) {\r\n polyline.finalIdx++;\r\n polyline.initialIdx = this.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n this.multiSelection = false;\r\n } else {\r\n this.multiSelection = true;\r\n if (this.multiSelectionForward) {\r\n polyline.finalIdx++;\r\n }\r\n this.multiSelectionForward = true;\r\n }\r\n }\r\n\r\n private moveBackwards(multiSelection: boolean) {\r\n const polyline = this.selectedPolyline;\r\n\r\n if ((!this.navigateByPoint || !this.directionForward) && polyline.initialIdx > 0) {\r\n this.navigateBackward(multiSelection, polyline);\r\n }\r\n this.directionForward = false;\r\n this.moveSelectedPath(polyline, null);\r\n }\r\n\r\n private navigateBackward(multiSelection: boolean, polyline: any) {\r\n const self = this;\r\n if (!multiSelection) {\r\n polyline.initialIdx--;\r\n polyline.finalIdx = !self.multiSelection ? polyline.finalIdx - 1 : polyline.initialIdx + 1;\r\n self.multiSelection = false;\r\n } else {\r\n self.multiSelection = true;\r\n if (!self.multiSelectionForward) {\r\n polyline.initialIdx--;\r\n }\r\n self.multiSelectionForward = false;\r\n }\r\n }\r\n\r\n private moveSelectedPath(polyline: any, options: NavigationOptions) {\r\n const self = this;\r\n const pathSelected = polyline.getLatLngs().map((x: any) => [x.lat, x.lng])\r\n .slice(polyline.initialIdx, polyline.finalIdx + 1);\r\n\r\n if (self.selectedPath) {\r\n self.selectedPath.setLatLngs(pathSelected);\r\n this.selectedPath.object = polyline.object;\r\n } else {\r\n this.addNewSelectedPath(pathSelected, options, polyline.object);\r\n this.selectedPath.addTo(this.map);\r\n }\r\n\r\n if (this.selectedPath.decorator) {\r\n this.map.removeLayer(this.selectedPath.decorator);\r\n this.setArrowSelectedPath();\r\n }\r\n\r\n if ((options && options.editable) ||\r\n (this.selectedPath.editEnabled && this.selectedPath.editEnabled())) {\r\n this.selectedPath.disableEdit();\r\n this.selectedPath.enableEdit();\r\n }\r\n\r\n this.selectedPath.initialIdx = polyline.initialIdx;\r\n this.selectedPath.finalIdx = polyline.finalIdx;\r\n\r\n let idx = self.directionForward ? polyline.finalIdx : polyline.initialIdx;\r\n if (!this.navigateByPoint) {\r\n idx = polyline.finalIdx > polyline.initialIdx ? polyline.finalIdx : polyline.initialIdx;\r\n }\r\n\r\n const infowindow = polyline.options.infowindows ? polyline.options.infowindows[idx] : null;\r\n if (infowindow) {\r\n const point = polyline.getLatLngs()[idx];\r\n\r\n if (self.navigateInfoWindow) {\r\n self.leafletPopup.alterPopup(self.navigateInfoWindow, {\r\n content: infowindow,\r\n latlng: [point.lat, point.lng]\r\n });\r\n } else {\r\n self.navigateInfoWindow = self.leafletPopup.drawPopup({\r\n content: infowindow,\r\n latlng: [point.lat, point.lng]\r\n });\r\n }\r\n }\r\n }\r\n\r\n private setArrowSelectedPath() {\r\n const pathOptions = { fillOpacity: 1, weight: 0, color: this.selectedPath.options.color };\r\n this.selectedPath.decorator = this.leaflet.polylineDecorator(this.selectedPath, {\r\n patterns: [{ offset: '100%', symbol: this.leaflet.Symbol.arrowHead({ pixelSize: 20, pathOptions }) }]\r\n });\r\n\r\n this.selectedPath.decorator.addTo(this.map);\r\n }\r\n\r\n private addNewSelectedPath(pathSelected, options, object) {\r\n const newOptions: any = {\r\n color: options && options.color || '#FF0000',\r\n draggable: false,\r\n editable: options.editable,\r\n opacity: options && options.opacity || 1,\r\n weight: options && options.weight || 10,\r\n zIndex: 9999\r\n };\r\n\r\n if (options.style !== null) {\r\n switch (options.style) {\r\n case PolylineType.Dotted:\r\n console.warn('PolylineType.Dotted is deprecated, instead use PolylineType.Dashed.');\r\n case PolylineType.Dashed:\r\n newOptions.opacity = .7;\r\n newOptions.dashArray = '20,15';\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n this.selectedPath = new this.leaflet.Polyline(pathSelected, newOptions);\r\n this.selectedPath.on('editable:vertex:rawclick', (e: any) => e.cancel());\r\n\r\n if (options.style && options.style === PolylineType.Arrow) {\r\n this.setArrowSelectedPath();\r\n }\r\n\r\n this.selectedPath.object = object;\r\n this.selectedPath.highlight = true;\r\n }\r\n\r\n private checkIdx(polyline: any, point: any) {\r\n const self = this;\r\n const path = polyline.getLatLngs();\r\n let distance = 0;\r\n let minDistance = Number.MAX_VALUE;\r\n let returnValue = -1;\r\n\r\n for (let i = 0; i < path.length - 1; i++) {\r\n distance = self.distanceToLine(path[i], path[i + 1], point);\r\n\r\n if (distance < minDistance) {\r\n minDistance = distance;\r\n returnValue = i;\r\n }\r\n }\r\n return returnValue;\r\n }\r\n\r\n private distanceToLine(pt1: any, pt2: any, pt: any) {\r\n const self = this;\r\n const deltaX = pt2.lng - pt1.lng;\r\n const deltaY = pt2.lat - pt1.lat;\r\n let incIntersect = (pt.lng - pt1.lng) * deltaX;\r\n const deltaSum = (deltaX * deltaX) + (deltaY * deltaY);\r\n\r\n incIntersect += (pt.lat - pt1.lat) * deltaY;\r\n if (deltaSum > 0) {\r\n incIntersect /= deltaSum;\r\n } else {\r\n incIntersect = -1;\r\n }\r\n\r\n // The intersection occurs outside the line segment, 'before' pt1.\r\n if (incIntersect < 0) {\r\n return self.kmTo(pt, pt1);\r\n } else if (incIntersect > 1) {\r\n return self.kmTo(pt, pt2);\r\n }\r\n\r\n // Intersection point calculation.\r\n const intersect = new this.leaflet.LatLng(pt1.lat + incIntersect * deltaY, pt1.lng + incIntersect * deltaX);\r\n\r\n return self.kmTo(pt, intersect);\r\n }\r\n\r\n private kmTo(pt1: any, pt2: any) {\r\n const e = Math;\r\n const ra = e.PI / 180;\r\n const b = pt1.lat * ra;\r\n const c = pt2.lat * ra;\r\n const d = b - c;\r\n const g = pt1.lng * ra - pt2.lng * ra;\r\n const f = 2 * e.asin(e.sqrt(e.pow(e.sin(d / 2), 2) + e.cos(b) * e.cos(c) * e.pow(e.sin(g / 2), 2)));\r\n\r\n return f * 6378.137 * 1000;\r\n }\r\n\r\n private getBoundsPolylines(polylines: any) {\r\n const group = new this.leaflet.FeatureGroup(polylines);\r\n return group.getBounds();\r\n }\r\n\r\n private addPolylineEventMove(polyline: any, eventFunction: any) {\r\n const self = this;\r\n polyline.on('editable:vertex:dragstart', (eventStart: any) => {\r\n const lastPosition = new EventReturn([eventStart.vertex.latlng.lat, eventStart.vertex.latlng.lng]);\r\n\r\n polyline.on('editable:vertex:dragend', (eventEnd: any) => {\r\n if (polyline.highlight && polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n self.setArrowSelectedPath();\r\n }\r\n\r\n const newPosition = new EventReturn([eventEnd.vertex.latlng.lat, eventEnd.vertex.latlng.lng]);\r\n eventFunction(newPosition, lastPosition, eventEnd.target.object, eventEnd.vertex.getIndex(), polyline.getLatLngs().map((x: any) => new EventReturn([x.lat, x.lng])));\r\n polyline.off('editable:vertex:dragend');\r\n });\r\n });\r\n }\r\n\r\n private addPolylineEventInsertAt(polyline: any, eventFunction: any) {\r\n const self = this;\r\n polyline.on('editable:vertex:new', (eventNew: any) => {\r\n const latlngs = eventNew.vertex.latlngs;\r\n const previous = latlngs[latlngs.findIndex((x: any) => x === eventNew.vertex.latlng) - 1];\r\n const previousPoint = new EventReturn([previous.lat, previous.lng]);\r\n\r\n polyline.on('editable:vertex:dragend', (event: any) => {\r\n if (polyline.highlight && polyline.decorator) {\r\n self.map.removeLayer(polyline.decorator);\r\n self.setArrowSelectedPath();\r\n }\r\n\r\n const newPoint = new EventReturn([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(newPoint, previousPoint, event.target.object, event.vertex.getIndex(), polyline.getLatLngs().map((x: any) => new EventReturn([x.lat, x.lng])));\r\n polyline.off('editable:vertex:dragend');\r\n });\r\n });\r\n }\r\n\r\n private addPolylineEventRemoveAt(polyline: any, eventFunction: any) {\r\n polyline.on('editable:vertex:deleted', (event: any) => {\r\n const param = new EventReturn([event.vertex.latlng.lat, event.vertex.latlng.lng]);\r\n eventFunction(param, event.target.object, polyline.getLatLngs().map((x: any) => new EventReturn([x.lat, x.lng])));\r\n });\r\n }\r\n\r\n private addPolylineEventMouseOver(polyline: any, eventFunction: any) {\r\n polyline.on('mouseover', (event: any) => {\r\n const param = event.target.getLatLngs().map((x: any) => new EventReturn([x.lat, x.lng]));\r\n eventFunction(param, event.target.object);\r\n });\r\n }\r\n\r\n private addPolylineEventMouseOut(polyline: any, eventFunction: any) {\r\n polyline.on('mouseout', (event: any) => {\r\n const param = event.target.getLatLngs().map((x: any) => new EventReturn([x.lat, x.lng]));\r\n eventFunction(param, event.target.object);\r\n });\r\n }\r\n\r\n private addPolylineEventDragPolyline(polyline: any, eventFunction: any) {\r\n polyline.on('dragend', (event: any) => {\r\n const param = event.target.getLatLngs().map((x: any) => new EventReturn([x.lat, x.lng]));\r\n eventFunction(param, event.target.object);\r\n });\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-polylines.ts","import PopupOptions from '../../features/popup/popup-options';\r\n\r\nexport default class LeafletPopup {\r\n private map = null;\r\n private leaflet = null;\r\n\r\n constructor(map: any, leaflet: any) {\r\n this.map = map;\r\n this.leaflet = leaflet;\r\n }\r\n\r\n public drawPopup(options: PopupOptions, marker?: any) {\r\n const self = this;\r\n let popup = null;\r\n\r\n if (!marker) {\r\n popup = new this.leaflet.Popup();\r\n popup.setLatLng(options.latlng);\r\n popup.setContent(options.content);\r\n popup.openOn(self.map);\r\n\r\n } else {\r\n popup = self.drawPopupOnMarker(marker, options);\r\n }\r\n\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n return popup;\r\n }\r\n\r\n public alterPopup(popup: any, options: PopupOptions, marker?: any) {\r\n const self = this;\r\n\r\n if (marker && !marker.getPopup()) {\r\n popup = self.drawPopup(options, marker);\r\n } else {\r\n self.alterPopupContent(popup, options, marker);\r\n\r\n if (!popup.isOpen()) {\r\n if (!marker) {\r\n popup.openOn(self.map);\r\n } else if (options.notCalledByMap) {\r\n marker.openPopup();\r\n }\r\n }\r\n }\r\n\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n\r\n return popup;\r\n }\r\n\r\n public alterPopupContent(popup: any, options: PopupOptions, marker?: any) {\r\n if (marker) {\r\n popup = marker._popup;\r\n }\r\n\r\n if (popup) {\r\n if (options.content) {\r\n popup.setContent(options.content);\r\n }\r\n\r\n if (options.latlng) {\r\n popup.setLatLng(options.latlng);\r\n }\r\n }\r\n\r\n if (options.object) {\r\n popup.object = options.object;\r\n }\r\n }\r\n\r\n public closePopup(popup: any) {\r\n popup.remove();\r\n }\r\n\r\n private drawPopupOnMarker(marker: any, options: PopupOptions) {\r\n marker.bindPopup(options.content);\r\n const popup = marker.getPopup();\r\n\r\n marker.openPopup();\r\n return popup;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/apis/leaflet/leaflet-popup.ts","export default class CircleAlterOptions {\r\n public center: number[];\r\n public radius: number;\r\n public weight: number;\r\n public fillOpacity?: number;\r\n public fillColor?: string;\r\n public color?: string;\r\n public opacity?: number;\r\n public editable?: boolean;\r\n public draggable?: boolean;\r\n\r\n constructor(center: number[], radius: number, weight: number, fillOpacity?: number,\r\n fillColor?: string, color?: string, opacity?: number) {\r\n\r\n this.center = center;\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.fillOpacity = fillOpacity;\r\n this.fillColor = fillColor;\r\n this.color = color;\r\n this.opacity = opacity;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/circle/circle-alter-options.ts","export default class CircleOptions {\r\n public center: number[];\r\n public radius: number;\r\n public weight: number;\r\n public addToMap?: boolean;\r\n public fillOpacity?: number;\r\n public fillColor?: string;\r\n public color?: string;\r\n public opacity?: number;\r\n public draggable?: boolean;\r\n public editable?: boolean;\r\n public fitBounds?: boolean;\r\n public object?: object;\r\n\r\n constructor(center: number[], radius: number, weight: number, addToMap?: boolean, fillOpacity?: number,\r\n fillColor?: string, color?: string, opacity?: number, draggable?: boolean, editable?: boolean,\r\n fitBounds?: boolean, object?: object) {\r\n\r\n this.center = center;\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.addToMap = addToMap;\r\n this.fillOpacity = fillOpacity;\r\n this.fillColor = fillColor;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/circle/circle-options.ts","\r\nexport default class GeoJsonOptions {\r\n public draggable?: boolean;\r\n public editable?: boolean;\r\n\r\n constructor(draggable?: boolean, editable?: boolean) {\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/geojson/geojson-options.ts","import CircleMarkerStyle from './circle-marker-style';\r\n\r\nexport default class CircleMarkerOptions {\r\n public latlng: number[];\r\n public addToMap?: boolean;\r\n public style: CircleMarkerStyle;\r\n public fitBounds?: boolean;\r\n public object?: object;\r\n\r\n constructor(latlng: number[], style: CircleMarkerStyle, addToMap?: boolean, fitBounds?: boolean, object?: object) {\r\n this.latlng = latlng;\r\n this.addToMap = addToMap;\r\n this.style = style;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker/circle-marker-options.ts","export default class CircleMarkerStyle {\r\n public radius: number;\r\n public weight?: number;\r\n public color?: string;\r\n public fillColor?: string;\r\n public fillOpacity?: number;\r\n\r\n constructor(radius: number, weight?: number, color?: string, fillColor?: string, fillOpacity?: number) {\r\n this.radius = radius;\r\n this.weight = weight;\r\n this.color = color;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker/circle-marker-style.ts","import CircleMarkerStyle from './circle-marker-style';\r\nimport MarkerIcon from './marker-icon';\r\n\r\nexport default class MarkerAlterOptions {\r\n public latlng?: number[];\r\n public icon?: MarkerIcon;\r\n public style?: CircleMarkerStyle;\r\n\r\n constructor(latlng?: number[], icon?: MarkerIcon, style?: CircleMarkerStyle) {\r\n this.latlng = latlng;\r\n this.icon = icon;\r\n this.style = style;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker/marker-alter-options.ts","export default class MarkerIcon {\r\n public url: string;\r\n public size?: number[];\r\n\r\n constructor(url: string, size?: number[]) {\r\n this.url = url;\r\n this.size = size;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker/marker-icon.ts","import MarkerIcon from './marker-icon';\r\n\r\nexport default class MarkerOptions {\r\n public latlng: number[];\r\n public addToMap?: boolean;\r\n public draggable?: boolean;\r\n public icon?: MarkerIcon;\r\n public fitBounds?: boolean;\r\n public object?: object;\r\n public addClusterer?: boolean;\r\n\r\n constructor(latlng: number[], addToMap: boolean = false, draggable: boolean = false, icon?: MarkerIcon,\r\n fitBounds: boolean = false, object?: object, addClusterer = false) {\r\n\r\n this.latlng = latlng;\r\n this.addToMap = addToMap;\r\n this.draggable = draggable;\r\n this.icon = icon;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n this.addClusterer = addClusterer;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/marker/marker-options.ts","export default class OverlayOptions {\r\n public position: number[];\r\n public divElement: HTMLDivElement;\r\n public addToMap: boolean;\r\n public object: any;\r\n public polygon: string;\r\n public conditionPolygon: any;\r\n public draggable: boolean;\r\n public afterEventDragHandler: any;\r\n\r\n constructor(divElement: HTMLDivElement, addToMap: boolean, position?: number[], object?: any,\r\n polygon?: string, conditionPolygon?: any, draggable: boolean = false) {\r\n this.position = position;\r\n this.divElement = divElement;\r\n this.addToMap = addToMap;\r\n this.object = object;\r\n this.polygon = polygon;\r\n this.conditionPolygon = conditionPolygon;\r\n this.draggable = draggable;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/overlay/overlay-options.ts","export default class PolygonAlterOptions {\r\n public weight: number;\r\n public color?: string;\r\n public opacity?: number;\r\n public fillColor?: string;\r\n public fillOpacity?: number;\r\n public addToMap: boolean;\r\n public object: any;\r\n public path: number[][];\r\n public editable?: boolean;\r\n public draggable?: boolean;\r\n\r\n constructor(addToMap: boolean, color?: string, opacity?: number, fillColor?: string, fillOpacity?: number,\r\n weight?: number) {\r\n this.addToMap = addToMap;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n this.weight = weight;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/polygons/polygon-alter-options.ts","export default class PolygonOptions {\r\n public path: number[][];\r\n public weight: number;\r\n public addToMap?: boolean;\r\n public color?: string;\r\n public opacity?: number;\r\n public fillColor?: string;\r\n public fillOpacity?: number;\r\n public draggable?: boolean;\r\n public editable?: boolean;\r\n public fitBounds?: boolean;\r\n public object?: object;\r\n public zIndex: number;\r\n\r\n constructor(path: number[][], weight: number, addToMap?: boolean, color?: string, opacity?: number,\r\n fillColor?: string, fillOpacity?: number, draggable?: boolean, editable?: boolean, fitBounds?: boolean,\r\n object?: object) {\r\n\r\n this.path = path;\r\n this.weight = weight;\r\n this.addToMap = addToMap;\r\n this.color = color;\r\n this.opacity = opacity;\r\n this.fillColor = fillColor;\r\n this.fillOpacity = fillOpacity;\r\n this.draggable = draggable;\r\n this.editable = editable;\r\n this.fitBounds = fitBounds;\r\n this.object = object;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/polygons/polygon-options.ts","import { PolylineType } from '../../dto/polyline-type';\r\n\r\nexport default class NavigationOptions {\r\n public color?: string;\r\n public weight?: number;\r\n public opacity?: number;\r\n public navigateByPoint: boolean; // Set to false when you want to navigate by stretch, and not by points\r\n public style: PolylineType;\r\n public editable: boolean;\r\n public navegateOnKeyPress: boolean;\r\n\r\n constructor(color?: string, weight?: number, navigateByPoint: boolean = true, opacity = 1) {\r\n this.color = color;\r\n this.weight = weight;\r\n this.opacity = opacity;\r\n this.navigateByPoint = navigateByPoint;\r\n this.navegateOnKeyPress = false\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/polyline/navigations-options.ts","export default class PopupOptions {\r\n public latlng: number[];\r\n public content: string;\r\n public marker?: string;\r\n public conditionMarker?: any;\r\n public notCalledByMap?: boolean; /* Property to set if open is called from map event or not, only used on leaflet */\r\n public object?: object;\r\n\r\n constructor(latlng: number[], content: string, marker?: string, conditionMarker?: any,\r\n notCalledByMap?: boolean, object?: object) {\r\n this.latlng = latlng;\r\n this.content = content;\r\n this.marker = marker;\r\n this.conditionMarker = conditionMarker;\r\n this.notCalledByMap = notCalledByMap;\r\n this.object = object;\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/models/features/popup/popup-options.ts","/**\r\n * urlBuilder\r\n *\r\n * @param {object} params\r\n * @param {string} params.base the base url\r\n * @param {array} params.libraries an array of the libraries to be requested\r\n * @param {string} params.callback the callback function\r\n *\r\n * @return {string}\r\n */\r\nexport const urlBuilder = (params) => {\r\n let builtUrl = params.base;\r\n\r\n builtUrl += '?';\r\n\r\n if (params.apiKey) {\r\n builtUrl += 'key=' + params.apiKey + '&';\r\n }\r\n if (params.integrity) {\r\n builtUrl += 'integrity=' + params.integrity + '&';\r\n }\r\n\r\n if (params.client) {\r\n builtUrl += 'client=' + params.client + '&';\r\n }\r\n\r\n if (params.crossorigin) {\r\n builtUrl += 'crossorigin=' + params.crossorigin + '&';\r\n }\r\n\r\n if (params.libraries && params.libraries.length > 0) {\r\n builtUrl += 'libraries=';\r\n\r\n params.libraries.forEach(function (library, index) {\r\n builtUrl += library;\r\n\r\n if (index !== params.libraries.length - 1) {\r\n builtUrl += ',';\r\n }\r\n });\r\n\r\n builtUrl += '&';\r\n }\r\n\r\n if (params.language) {\r\n builtUrl += 'language=' + params.language + '&';\r\n }\r\n\r\n if (params.callback) {\r\n builtUrl += 'callback=' + params.callback + '&';\r\n }\r\n\r\n return builtUrl;\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/url-builder.ts"],"sourceRoot":""}
|