!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("async"),require("@angular/core"),require("rxjs"),require("@angular/common"),require("bingmaps")):"function"==typeof define&&define.amd?define("angular-maps",["exports","async","@angular/core","rxjs","@angular/common","bingmaps"],e):e(t["angular-maps"]={},null,t.ng.core,t.rxjs,t.ng.common)}(this,function(t,i,r,a,e){"use strict";var n=function(){},u={None:0,FontMarker:1,CanvasMarker:2,DynamicCircleMarker:3,RotatedImageMarker:4,RoundedImageMarker:5,ScaledImageMarker:6,Custom:7};u[u.None]="None",u[u.FontMarker]="FontMarker",u[u.CanvasMarker]="CanvasMarker",u[u.DynamicCircleMarker]="DynamicCircleMarker",u[u.RotatedImageMarker]="RotatedImageMarker",u[u.RoundedImageMarker]="RoundedImageMarker",u[u.ScaledImageMarker]="ScaledImageMarker",u[u.Custom]="Custom";var l=function(){function l(){}return l.CreateMarker=function(t){switch(t.markerType){case u.CanvasMarker:return l.CreateCanvasMarker(t);case u.DynamicCircleMarker:return l.CreateDynamicCircleMarker(t);case u.FontMarker:return l.CreateFontBasedMarker(t);case u.RotatedImageMarker:return l.CreateRotatedImageMarker(t);case u.RoundedImageMarker:return l.CreateRoundedImageMarker(t);case u.ScaledImageMarker:return l.CreateScaledImageMarker(t);case u.Custom:throw Error("Custom Marker Creators are not currently supported.")}throw Error("Unsupported marker type: "+t.markerType)},l.GetImageForMarker=function(t){if(null==t||""===t)return null;var e=null;return null!=(e=l.ImageElementCache.get(t))||"undefined"!=typeof document&&null!=document&&((e=document.createElement("img")).src=t,l.ImageElementCache.set(t,e)),e},l.CreateCanvasMarker=function(t){if(null==document)throw Error("Document context (window.document) is required for canvas markers.");if(null==t||null==t.size||null==t.points)throw Error("IMarkerIconInfo.size, and IMarkerIConInfo.points are required for canvas markers.");if(null!=t.id&&l.MarkerCache.has(t.id)){var e=l.MarkerCache.get(t.id);return t.size=e.markerSize,e.markerIconString}var n=document.createElement("canvas"),i=n.getContext("2d");n.width=t.size.width,n.height=t.size.height,t.rotation&&(i.translate(.5*n.width,.5*n.height),i.rotate(t.rotation*Math.PI/180),i.translate(.5*-n.width,.5*-n.height)),i.fillStyle=t.color||"red",i.beginPath(),t.drawingOffset&&i.moveTo(t.drawingOffset.x,t.drawingOffset.y),t.points.forEach(function(t){i.lineTo(t.x,t.y)}),i.closePath(),i.fill(),i.stroke();var o=n.toDataURL();return null!=t.id&&l.MarkerCache.set(t.id,{markerIconString:o,markerSize:t.size}),o},l.CreateDynamicCircleMarker=function(t){if(null==document)throw Error("Document context (window.document) is required for dynamic circle markers.");if(null==t||null==t.size)throw Error("IMarkerIconInfo.size is required for dynamic circle markers.");if(null!=t.id&&l.MarkerCache.has(t.id)){var e=l.MarkerCache.get(t.id);return t.size=e.markerSize,e.markerIconString}var n=t.strokeWidth||0,i=['<svg xmlns="http://www.w3.org/2000/svg" width="',t.size.width.toString(),'" height="',t.size.width.toString(),'"><circle cx="',(t.size.width/2).toString(),'" cy="',(t.size.width/2).toString(),'" r="',(t.size.width/2-n).toString(),'" stroke="',t.color||"red",'" stroke-width="',n.toString(),'" fill="',t.color||"red",'"/></svg>'].join("");return null!=t.id&&l.MarkerCache.set(t.id,{markerIconString:i,markerSize:t.size}),i},l.CreateFontBasedMarker=function(t){if(null==document)throw Error("Document context (window.document) is required for font based markers");if(null==t||null==t.fontName||null==t.fontSize)throw Error("IMarkerIconInfo.fontName, IMarkerIconInfo.fontSize and IMarkerIConInfo.text are required for font based markers.");if(null!=t.id&&l.MarkerCache.has(t.id)){var e=l.MarkerCache.get(t.id);return t.size=e.markerSize,e.markerIconString}var n=document.createElement("canvas"),i=n.getContext("2d"),o=t.fontSize+"px "+t.fontName;i.font=o;var r=i.measureText(t.text);n.width=r.width,n.height=t.fontSize,t.rotation&&(i.translate(.5*n.width,.5*n.height),i.rotate(t.rotation*Math.PI/180),i.translate(.5*-n.width,.5*-n.height)),i.font=o,i.textBaseline="top",i.fillStyle=t.color||"red",i.fillText(t.text,0,0),t.size={width:n.width,height:n.height};var a=n.toDataURL();return null!=t.id&&l.MarkerCache.set(t.id,{markerIconString:a,markerSize:t.size}),a},l.CreateRotatedImageMarker=function(r){if(null==document)throw Error("Document context (window.document) is required for rotated image markers");if(null==r||null==r.rotation||null==r.url)throw Error("IMarkerIconInfo.rotation, IMarkerIconInfo.url are required for rotated image markers.");if(null!=r.id&&l.MarkerCache.has(r.id)){var t=l.MarkerCache.get(r.id);return r.size=t.markerSize,t.markerIconString}var a=new Image;return new Promise(function(o,t){a.crossOrigin="anonymous",a.src=r.url,r.size&&(a.width=r.size.width,a.height=r.size.height),a.onload=function(){var t=document.createElement("canvas"),e=t.getContext("2d"),n=r.rotation*Math.PI/180;t.width=Math.ceil(Math.abs(a.width*Math.cos(n))+Math.abs(a.height*Math.sin(n))),t.height=Math.ceil(Math.abs(a.width*Math.sin(n))+Math.abs(a.height*Math.cos(n))),e.translate(t.width/2,t.height/2),e.rotate(n),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),r.size={width:t.width,height:t.height};var i=t.toDataURL();null!=r.id&&l.MarkerCache.set(r.id,{markerIconString:i,markerSize:r.size}),o({icon:i,iconInfo:r})}})},l.CreateRoundedImageMarker=function(s){if(null==document)throw Error("Document context (window.document) is required for rounded image markers");if(null==s||null==s.size||null==s.url)throw Error("IMarkerIconInfo.size, IMarkerIconInfo.url are required for rounded image markers.");if(null!=s.id&&l.MarkerCache.has(s.id)){var t=l.MarkerCache.get(s.id);return s.size=t.markerSize,t.markerIconString}return new Promise(function(i,t){var o=s.size.width/2,r=new Image,a=s.drawingOffset||{x:0,y:0};r.crossOrigin="anonymous",r.src=s.url,r.onload=function(){var t=document.createElement("canvas"),e=t.getContext("2d");t.width=s.size.width,t.height=s.size.width,e.beginPath(),e.arc(o,o,o,0,2*Math.PI,!1),e.fill(),e.clip(),e.drawImage(r,a.x,a.y,s.size.width,s.size.width),s.size={width:t.width,height:t.height};var n=t.toDataURL();null!=s.id&&l.MarkerCache.set(s.id,{markerIconString:n,markerSize:s.size}),i({icon:n,iconInfo:s})}})},l.CreateScaledImageMarker=function(r){if(null==document)throw Error("Document context (window.document) is required for scaled image markers");if(null==r||null==r.scale||null==r.url)throw Error("IMarkerIconInfo.scale, IMarkerIconInfo.url are required for scaled image markers.");if(null!=r.id&&l.MarkerCache.has(r.id)){var t=l.MarkerCache.get(r.id);return r.size=t.markerSize,t.markerIconString}return new Promise(function(i,t){var o=new Image;o.crossOrigin="anonymous",o.src=r.url,o.onload=function(){var t=document.createElement("canvas"),e=t.getContext("2d");t.width=o.width*r.scale,t.height=o.height*r.scale,e.drawImage(o,0,0,t.width,t.height),r.size={width:t.width,height:t.height};var n=t.toDataURL();null!=r.id&&l.MarkerCache.set(r.id,{markerIconString:n,markerSize:r.size}),i({icon:n,iconInfo:r})}})},l.ImageElementCache=new Map,l.MarkerCache=new Map,l}(),s={aerial:0,canvasDark:1,canvasLight:2,grayscale:3,hybrid:4,mercator:5,ordnanceSurvey:6,road:7,streetside:8};s[s.aerial]="aerial",s[s.canvasDark]="canvasDark",s[s.canvasLight]="canvasLight",s[s.grayscale]="grayscale",s[s.hybrid]="hybrid",s[s.mercator]="mercator",s[s.ordnanceSurvey]="ordnanceSurvey",s[s.road]="road",s[s.streetside]="streetside";var o=function(){},c=function(){function t(){}return Object.defineProperty(t.prototype,"Center",{get:function(){return null==this._center&&(this._center=this.GetBoundingCenter()),this._center},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Centroid",{get:function(){return null==this._centroid&&(this._centroid=this.GetPolygonCentroid()),this._centroid},enumerable:!0,configurable:!0}),t.prototype.GetBoundingCenter=function(){var t={latitude:0,longitude:0},e=90,n=-90,i=180,o=-180,r=this.GetPaths();return r?(r.forEach(function(t){return t.forEach(function(t){t.latitude<e&&(e=t.latitude),t.latitude>n&&(n=t.latitude),t.longitude<i&&(i=t.longitude),t.longitude>o&&(o=t.longitude)})}),t.latitude=e+(n-e)/2,t.longitude=i+(o-i)/2):t=null,t},t.prototype.GetPolygonCentroid=function(){var t={latitude:0,longitude:0},e=this.GetPaths(),n=e[0][0];if(null!=n){for(var i=0,o=0,r=0,a=void 0,s=void 0,l=void 0,u=0;u<e.length;u++)for(var c=0,p=e[u].length-1;c<e[u].length;p=c++)a=e[u][c],s=e[u][p],i+=l=(a.latitude-n.latitude)*(s.longitude-n.longitude)-(s.latitude-n.latitude)*(a.longitude-n.longitude),o+=(a.latitude+s.latitude-2*n.latitude)*l,r+=(a.longitude+s.longitude-2*n.longitude)*l;0!==i?(l=3*i,t.latitude=o/l+n.latitude,t.longitude=r/l+n.longitude):(t.latitude=n.latitude,t.longitude=n.longitude)}else t=null;return t},t}(),p=function(){function e(){}return Object.defineProperty(e.prototype,"Center",{get:function(){return null==this._center&&(this._center=this.GetBoundingCenter()),this._center},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"Centroid",{get:function(){return null==this._centroid&&(this._centroid=this.GetPolylineCentroid()),this._centroid},enumerable:!0,configurable:!0}),e.GetPolylineCentroid=function(t){var e={latitude:0,longitude:0},n=t[0];if(null!=n){for(var i=0,o=0,r=0,a=void 0,s=void 0,l=void 0,u=0,c=t.length-1;u<t.length;c=u++)a=t[u],s=t[c],i+=l=(a.latitude-n.latitude)*(s.longitude-n.longitude)-(s.latitude-n.latitude)*(a.longitude-n.longitude),o+=(a.latitude+s.latitude-2*n.latitude)*l,r+=(a.longitude+s.longitude-2*n.longitude)*l;0!==i?(l=3*i,e.latitude=o/l+n.latitude,e.longitude=r/l+n.longitude):(e.latitude=n.latitude,e.longitude=n.longitude)}else e=null;return e},e.prototype.GetBoundingCenter=function(){var t={latitude:0,longitude:0},e=90,n=-90,i=180,o=-180,r=this.GetPath();return r?(r.forEach(function(t){t.latitude<e&&(e=t.latitude),t.latitude>n&&(n=t.latitude),t.longitude<i&&(i=t.longitude),t.longitude>o&&(o=t.longitude)}),t.latitude=e+(n-e)/2,t.longitude=i+(o-i)/2):t=null,t},e.prototype.GetPolylineCentroid=function(){var t=this.GetPath();return e.GetPolylineCentroid(t)},e}(),h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function f(t,e){function n(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function d(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(o)throw o.error}}return a}function y(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t}var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(l),g={None:0,MeanValue:1,FirstPin:2};g[g.None]="None",g[g.MeanValue]="MeanValue",g[g.FirstPin]="FirstPin";var v={None:0,ZoomIntoCluster:1,Spider:2};v[v.None]="None",v[v.ZoomIntoCluster]="ZoomIntoCluster",v[v.Spider]="Spider";var _=0,b=function(){function t(t){var n=this;this._canvasReady=new Promise(function(t,e){n._readyResolver=t}),this._drawCallback=t,_++}return Object.defineProperty(t.prototype,"CanvasReady",{get:function(){return this._canvasReady},enumerable:!0,configurable:!0}),t.prototype.Delete=function(){this.SetMap(null)},t.prototype.OnAdd=function(){this._canvas=document.createElement("canvas"),this._canvas.style.position="absolute",this._canvas.style.left="0px",this._canvas.style.top="0px",this._canvas.id="xMapOverlay"+_,this.SetCanvasElement(this._canvas)},t.prototype.OnRemove=function(){this.SetCanvasElement(null),this.RemoveEventHandlers(),this._canvas=null},t.prototype.Redraw=function(t){null!=this._canvas&&(t&&this.Resize(),this._drawCallback&&this._drawCallback(this._canvas))},t.prototype.UpdatePosition=function(t,e,n,i){this._canvas.style.left=t+"px",this._canvas.style.top=e+"px",this._canvas.style.width=n+"px",this._canvas.style.height=i+"px"},t}(),M=function(){function t(t,e){this._layer=t,this._maps=e,this._pendingEntities=new Array}return Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._layer},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){Microsoft.Maps.Events.addHandler(this._layer,t,function(t){e(t)})},t.prototype.AddEntity=function(t){t&&t.NativePrimitve&&(this.GetVisible()?this._layer.add(t.NativePrimitve):this._pendingEntities.push(t))},t.prototype.AddEntities=function(t){var n=this;null!=t&&Array.isArray(t)&&0!==t.length&&i.eachSeries(y(t),function(t,e){n.GetVisible()?n._layer.add(t.NativePrimitve):n._pendingEntities.push(t),i.nextTick(function(){return e()})})},t.prototype.Delete=function(){this._maps.DeleteLayer(this)},t.prototype.GetOptions=function(){return{id:Number(this._layer.getId())}},t.prototype.GetVisible=function(){return this._layer.getVisible()},t.prototype.RemoveEntity=function(t){t.NativePrimitve&&this._layer.remove(t.NativePrimitve)},t.prototype.SetEntities=function(t){this._layer.setPrimitives([]),this.AddEntities(t)},t.prototype.SetOptions=function(t){this._layer.metadata.id=t.id.toString()},t.prototype.SetVisible=function(t){this._layer.setVisible(t),t&&0<this._pendingEntities.length&&this.AddEntities(this._pendingEntities.splice(0))},t}(),k=function(){function o(){}return o.TranslateAction=function(t){return{eventHandler:t.eventHandler,label:t.label}},o.TranslateActions=function(t){var e=new Array;return t.forEach(function(t){return e.push(o.TranslateAction(t))}),e},o.TranslateBounds=function(t){return Microsoft.Maps.LocationRect.fromEdges(t.maxLatitude,t.minLongitude,t.minLatitude,t.maxLongitude)},o.TranslateClusterOptions=function(e){var n={};return Object.keys(e).filter(function(t){return-1!==o._clusterOptionsAttributes.indexOf(t)}).forEach(function(t){"layerOffset"===t&&(n.layerOffset=o.TranslatePoint(e.layerOffset)),"placementMode"===t?e.placementMode===g.FirstPin?n.placementMode=Microsoft.Maps.ClusterPlacementType.FirstLocation:n.placementMode=Microsoft.Maps.ClusterPlacementType.MeanAverage:n[t]=e[t]}),n},o.TranslateInfoBoxOptions=function(e){var n={};return Object.keys(e).filter(function(t){return-1!==o._infoWindowOptionsAttributes.indexOf(t)}).forEach(function(t){"pixelOffset"===t?n.offset=o.TranslatePoint(e.pixelOffset):"position"===t?n.location=o.TranslateLocation(e.position):"actions"===t?n.actions=o.TranslateActions(e.actions):n[t]=e[t]}),n},o.TranslateLoadOptions=function(e){var n={};return Object.keys(e).filter(function(t){return-1!==o._mapOptionsAttributes.indexOf(t)||-1!==o._viewOptionsAttributes.indexOf(t)}).forEach(function(t){"center"===t?n.center=o.TranslateLocation(e.center):"mapTypeId"===t?e.mapTypeId===s.hybrid?(n.mapTypeId=Microsoft.Maps.MapTypeId.aerial,n.labelOverlay=Microsoft.Maps.LabelOverlay.visible):e.mapTypeId===s.aerial?(n.mapTypeId=Microsoft.Maps.MapTypeId.aerial,n.labelOverlay=Microsoft.Maps.LabelOverlay.hidden):n.mapTypeId=Microsoft.Maps.MapTypeId[s[e.mapTypeId]]:"bounds"===t?n.bounds=o.TranslateBounds(e.bounds):n[t]=e[t]}),n},o.TranslateLocation=function(t){return new Microsoft.Maps.Location(t.latitude,t.longitude)},o.TranslateMarkerOptions=function(e){var n={};return Object.keys(e).filter(function(t){return-1!==o._markerOptionsAttributes.indexOf(t)}).forEach(function(t){"anchor"===t?n.anchor=o.TranslatePoint(e.anchor):n[t]=e[t]}),n},o.TranslateOptions=function(e){var n={};return Object.keys(e).filter(function(t){return-1!==o._mapOptionsAttributes.indexOf(t)}).forEach(function(t){"center"===t?n.center=o.TranslateLocation(e.center):"mapTypeId"===t?n.mapTypeId=Microsoft.Maps.MapTypeId[s[e.mapTypeId]]:n[t]=e[t]}),n},o.TranslatePaths=function(t){var e=new Array;if(null!=t&&Array.isArray(t)&&0!==t.length)if(Array.isArray(t[0]))for(var n=t,i=0;i<n.length;i++){for(var o=new Array,r=0;r<n[i].length;r++)o.push(new Microsoft.Maps.Location(n[i][r].latitude,n[i][r].longitude));e.push(o)}else{var a=new Array;for(n=t,i=0;i<n.length;i++)a.push(new Microsoft.Maps.Location(n[i].latitude,n[i].longitude));e.push(a)}else e.push(new Array);return e},o.TranslatePoint=function(t){return new Microsoft.Maps.Point(t.x,t.y)},o.TranslatePolygonOptions=function(e){var n={},i=function(t,e){var n=/rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*\d+[\.\d+]*)*\)/g.exec(t);if(n&&3<n.length)return e=1<e?e/100:e,"rgba("+[n[1],n[2],n[3],e].join(",")+")";if("#"===t[0]){var i=t.substr(1);return"rgba("+[parseInt(i.substr(0,2),16),parseInt(i.substr(2,2),16),parseInt(i.substr(4,2),16),e].join(",")+")"}return t};return Object.keys(e).filter(function(t){return-1!==o._polygonOptionsAttributes.indexOf(t)}).forEach(function(t){"strokeWeight"===t?n.strokeThickness=e.strokeWeight:"strokeColor"===t?e.strokeOpacity?n.strokeColor=i(e.strokeColor,e.strokeOpacity):n.strokeColor=e.strokeColor:"strokeOpacity"===t||("fillColor"===t?e.fillOpacity?n.fillColor=i(e.fillColor,e.fillOpacity):n.fillColor=e.fillColor:"fillOpacity"===t||(n[t]=e[t]))}),n},o.TranslatePolylineOptions=function(e){var n={};return Object.keys(e).filter(function(t){return-1!==o._polylineOptionsAttributes.indexOf(t)}).forEach(function(t){"strokeWeight"===t?n.strokeThickness=e.strokeWeight:"strokeColor"===t?e.strokeOpacity?n.strokeColor=function(t,e){var n=/rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*\d+[\.\d+]*)*\)/g.exec(t);if(n&&3<n.length)return e=1<e?e/100:e,"rgba("+[n[1],n[2],n[3],e].join(",")+")";if("#"===t[0]){var i=t.substr(1);return"rgba("+[parseInt(i.substr(0,2),16),parseInt(i.substr(2,2),16),parseInt(i.substr(4,2),16),e].join(",")+")"}return t}(e.strokeColor,e.strokeOpacity):n.strokeColor=e.strokeColor:"strokeOpacity"===t||(n[t]=e[t])}),n},o.TranslateViewOptions=function(e){var n={};return Object.keys(e).filter(function(t){return-1!==o._viewOptionsAttributes.indexOf(t)}).forEach(function(t){"center"===t?n.center=o.TranslateLocation(e.center):"bounds"===t?n.bounds=o.TranslateBounds(e.bounds):"centerOffset"===t?n.centerOffset=o.TranslatePoint(e.centerOffset):"mapTypeId"===t?n.mapTypeId=Microsoft.Maps.MapTypeId[s[e.mapTypeId]]:n[t]=e[t]}),n},o._mapOptionsAttributes=["backgroundColor","credentials","customizeOverlays","customMapStyle","disableBirdseye","disableKeyboardInput","disableMouseInput","disablePanning","disableTouchInput","disableUserInput","disableZooming","disableStreetside","enableClickableLogo","enableSearchLogo","fixedMapPosition","height","inertiaIntensity","navigationBarMode","showBreadcrumb","showCopyright","showDashboard","showMapTypeSelector","showScalebar","theme","tileBuffer","useInertia","width","center","zoom","mapTypeId","liteMode"],o._viewOptionsAttributes=["animate","bounds","center","centerOffset","heading","labelOverlay","mapTypeId","padding","zoom"],o._infoWindowOptionsAttributes=["actions","description","htmlContent","id","position","pixelOffset","showCloseButton","showPointer","pushpin","title","titleClickHandler","typeName","visible","width","height"],o._markerOptionsAttributes=["anchor","draggable","height","htmlContent","icon","infobox","state","title","textOffset","typeName","visible","width","zIndex"],o._polygonOptionsAttributes=["cursor","fillColor","fillOpacity","strokeColor","strokeOpacity","strokeWeight","visible"],o._polylineOptionsAttributes=["cursor","strokeColor","strokeOpacity","strokeWeight","visible"],o._clusterOptionsAttributes=["callback","clusteredPinCallback","clusteringEnabled","gridSize","layerOffset","placementMode","visible","zIndex"],o}(),C=function(){function t(t,e,n){this._pushpin=t,this._map=e,this._layer=n,this._metadata=new Map,this._isFirst=!1,this._isLast=!0}return Object.defineProperty(t.prototype,"IsFirst",{get:function(){return this._isFirst},set:function(t){this._isFirst=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"IsLast",{get:function(){return this._isLast},set:function(t){this._isLast=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Location",{get:function(){var t=this._pushpin.getLocation();return{latitude:t.latitude,longitude:t.longitude}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Metadata",{get:function(){return this._metadata},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._pushpin},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){Microsoft.Maps.Events.addHandler(this._pushpin,t,function(t){e(t)})},t.prototype.DeleteMarker=function(){(this._map||this._layer)&&(this._layer?this._layer.remove(this.NativePrimitve):this._map.entities.remove(this.NativePrimitve))},t.prototype.GetLabel=function(){return this._pushpin.getText()},t.prototype.GetVisible=function(){return this._pushpin.getVisible()},t.prototype.SetAnchor=function(t){var e={};e.anchor=new Microsoft.Maps.Point(t.x,t.y),this._pushpin.setOptions(e)},t.prototype.SetDraggable=function(t){var e={};e.draggable=t,this._pushpin.setOptions(e)},t.prototype.SetIcon=function(t){var e={};e.icon=t,this._pushpin.setOptions(e)},t.prototype.SetLabel=function(t){var e={};e.text=t,this._pushpin.setOptions(e)},t.prototype.SetPosition=function(t){var e=k.TranslateLocation(t);this._pushpin.setLocation(e)},t.prototype.SetTitle=function(t){var e={};e.title=t,this._pushpin.setOptions(e)},t.prototype.SetOptions=function(t){var e=k.TranslateMarkerOptions(t);this._pushpin.setOptions(e)},t.prototype.SetVisible=function(t){var e={};e.visible=t,this._pushpin.setOptions(e)},t}(),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(C),O=function(){function t(t,e){this._layer=t,this._maps=e,this._isClustering=!0,this._markers=new Array,this._markerLookup=new Map,this._pendingMarkers=new Array,this._spiderMarkers=new Array,this._spiderMarkerLookup=new Map,this._useSpiderCluster=!1,this._mapclicks=0,this._events=new Array,this._currentZoom=0,this._spiderOptions={circleSpiralSwitchover:9,collapseClusterOnMapChange:!1,collapseClusterOnNthClick:1,invokeClickOnHover:!0,minCircleLength:60,minSpiralAngleSeperation:25,spiralDistanceFactor:5,stickStyle:{strokeColor:"black",strokeThickness:2},stickHoverStyle:{strokeColor:"red"},markerSelected:null,markerUnSelected:null},this._currentCluster=null}return Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._layer},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){Microsoft.Maps.Events.addHandler(this._layer,t,function(t){e(t)})},t.prototype.AddEntity=function(t){var e=t instanceof l;if((e=t instanceof C||e)&&t.IsFirst&&this.StopClustering(),t.NativePrimitve&&t.Location){if(this._isClustering){var n=this._layer.getPushpins();n.push(t.NativePrimitve),this._layer.setPushpins(n),this._markers.push(t)}else this._pendingMarkers.push(t);this._markerLookup.set(t.NativePrimitve,t)}e&&t.IsLast&&this.StartClustering()},t.prototype.AddEntities=function(t){var e,n,i=this;if(null!=t&&Array.isArray(t)&&0!==t.length){var o=t.map(function(t){return i._markerLookup.set(t.NativePrimitve,t),t.NativePrimitve});if(this._isClustering){var r=this._layer.getPushpins();r.push.apply(r,y(o)),this._layer.setPushpins(r),(e=this._markers).push.apply(e,y(t))}else(n=this._pendingMarkers).push.apply(n,y(t))}},t.prototype.InitializeSpiderClusterSupport=function(t){var e=this;if(!this._useSpiderCluster){var n=this._maps.MapInstance;this._useSpiderCluster=!0,this._spiderLayer=new Microsoft.Maps.Layer,this._currentZoom=n.getZoom(),this.SetSpiderOptions(t),n.layers.insert(this._spiderLayer),this._events.push(Microsoft.Maps.Events.addHandler(n,"click",function(t){return e.OnMapClick(t)})),this._events.push(Microsoft.Maps.Events.addHandler(n,"viewchangestart",function(t){return e.OnMapViewChangeStart(t)})),this._events.push(Microsoft.Maps.Events.addHandler(n,"viewchangeend",function(t){return e.OnMapViewChangeEnd(t)})),this._events.push(Microsoft.Maps.Events.addHandler(this._layer,"click",function(t){return e.OnLayerClick(t)})),this._events.push(Microsoft.Maps.Events.addHandler(this._spiderLayer,"click",function(t){return e.OnLayerClick(t)})),this._events.push(Microsoft.Maps.Events.addHandler(this._spiderLayer,"mouseover",function(t){return e.OnSpiderMouseOver(t)})),this._events.push(Microsoft.Maps.Events.addHandler(this._spiderLayer,"mouseout",function(t){return e.OnSpiderMouseOut(t)}))}},t.prototype.Delete=function(){var e=this;this._useSpiderCluster&&(this._spiderLayer.clear(),this._maps.MapPromise.then(function(t){t.layers.remove(e._spiderLayer),e._spiderLayer=null}),this._events.forEach(function(t){return Microsoft.Maps.Events.removeHandler(t)}),this._events.splice(0),this._useSpiderCluster=!1),this._markers.splice(0),this._spiderMarkers.splice(0),this._pendingMarkers.splice(0),this._markerLookup.clear(),this._maps.DeleteLayer(this)},t.prototype.GetMarkerFromBingMarker=function(t){return this._markerLookup.get(t)},t.prototype.GetOptions=function(){var t=this._layer.getOptions();return{id:0,gridSize:t.gridSize,layerOffset:t.layerOffset,clusteringEnabled:t.clusteringEnabled,callback:t.callback,clusteredPinCallback:t.clusteredPinCallback,visible:t.visible,zIndex:t.zIndex}},t.prototype.GetVisible=function(){return this._layer.getOptions().visible},t.prototype.GetSpiderMarkerFromBingMarker=function(t){return this._spiderMarkerLookup.get(t)},t.prototype.RemoveEntity=function(t){if(t.NativePrimitve&&t.Location){var e=this._markers.indexOf(t),n=this._pendingMarkers.indexOf(t);if(-1<e&&this._markers.splice(e,1),-1<n&&this._pendingMarkers.splice(n,1),this._isClustering){var i=this._layer.getPushpins(),o=i.indexOf(t.NativePrimitve);-1<o&&(i.splice(o,1),this._layer.setPushpins(i))}this._markerLookup["delete"](t.NativePrimitve)}},t.prototype.SetEntities=function(t){var e=this,n=new Array;this._markers.splice(0),this._markerLookup.clear(),t.forEach(function(t){t.NativePrimitve&&t.Location&&(e._markers.push(t),e._markerLookup.set(t.NativePrimitve,t),n.push(t.NativePrimitve))}),this._layer.setPushpins(n)},t.prototype.SetOptions=function(t){var e=k.TranslateClusterOptions(t);this._layer.setOptions(e),t.spiderClusterOptions&&this.SetSpiderOptions(t.spiderClusterOptions)},t.prototype.SetVisible=function(t){var e=this._layer.getOptions();e.visible=t,this._layer.setOptions(e)},t.prototype.StartClustering=function(){if(!this._isClustering){var e=new Array;this._markers.forEach(function(t){t.NativePrimitve&&t.Location&&e.push(t.NativePrimitve)}),this._pendingMarkers.forEach(function(t){t.NativePrimitve&&t.Location&&e.push(t.NativePrimitve)}),this._layer.setPushpins(e),this._markers=this._markers.concat(this._pendingMarkers.splice(0)),this._isClustering=!0}},t.prototype.StopClustering=function(){this._isClustering&&(this._isClustering=!1)},t.prototype.GetBasicPushpinOptions=function(t){return{anchor:t.getAnchor(),color:t.getColor(),cursor:t.getCursor(),icon:t.getIcon(),roundClickableArea:t.getRoundClickableArea(),subTitle:t.getSubTitle(),text:t.getText(),textOffset:t.getTextOffset(),title:t.getTitle()}},t.prototype.HideSpiderCluster=function(){this._mapclicks=0,this._currentCluster&&(this._spiderLayer.clear(),this._spiderMarkers.splice(0),this._spiderMarkerLookup.clear(),this._currentCluster=null,this._mapclicks=-1,this._spiderOptions.markerUnSelected&&this._spiderOptions.markerUnSelected())},t.prototype.OnLayerClick=function(t){if(t.primitive instanceof Microsoft.Maps.ClusterPushpin){var e=t.primitive!==this._currentCluster;this.HideSpiderCluster(),e&&this.ShowSpiderCluster(t.primitive)}else{var n=t.primitive;if(n.metadata&&n.metadata.isClusterMarker){var i=this.GetSpiderMarkerFromBingMarker(n).ParentMarker,o=i.NativePrimitve;this._spiderOptions.markerSelected&&this._spiderOptions.markerSelected(i,new C(this._currentCluster,null,null)),Microsoft.Maps.Events.hasHandler(o,"click")&&Microsoft.Maps.Events.invoke(o,"click",t),this._mapclicks=0}else this._spiderOptions.markerSelected&&this._spiderOptions.markerSelected(this.GetMarkerFromBingMarker(n),null),Microsoft.Maps.Events.hasHandler(n,"click")&&Microsoft.Maps.Events.invoke(n,"click",t)}},t.prototype.OnMapClick=function(t){-1!==this._mapclicks&&++this._mapclicks>=this._spiderOptions.collapseClusterOnNthClick&&this.HideSpiderCluster()},t.prototype.OnMapViewChangeEnd=function(t){var e=t.target.getZoom(),n=e!==this._currentZoom;this._currentZoom=e,n&&this.HideSpiderCluster()},t.prototype.OnMapViewChangeStart=function(t){this._spiderOptions.collapseClusterOnMapChange&&this.HideSpiderCluster()},t.prototype.OnSpiderMouseOut=function(t){var e=t.primitive;e instanceof Microsoft.Maps.Pushpin&&e.metadata&&e.metadata.isClusterMarker&&this.GetSpiderMarkerFromBingMarker(e).Stick.setOptions(this._spiderOptions.stickStyle)},t.prototype.OnSpiderMouseOver=function(t){var e=t.primitive;if(e instanceof Microsoft.Maps.Pushpin&&e.metadata&&e.metadata.isClusterMarker){var n=this.GetSpiderMarkerFromBingMarker(e);if(n.Stick.setOptions(this._spiderOptions.stickHoverStyle),this._spiderOptions.invokeClickOnHover){var i=n.ParentMarker.NativePrimitve;Microsoft.Maps.Events.hasHandler(i,"click")&&Microsoft.Maps.Events.invoke(i,"click",t)}}},t.prototype.SetSpiderOptions=function(t){t&&("number"==typeof t.circleSpiralSwitchover&&(this._spiderOptions.circleSpiralSwitchover=t.circleSpiralSwitchover),"boolean"==typeof t.collapseClusterOnMapChange&&(this._spiderOptions.collapseClusterOnMapChange=t.collapseClusterOnMapChange),"number"==typeof t.collapseClusterOnNthClick&&(this._spiderOptions.collapseClusterOnNthClick=t.collapseClusterOnNthClick),"boolean"==typeof t.invokeClickOnHover&&(this._spiderOptions.invokeClickOnHover=t.invokeClickOnHover),"number"==typeof t.minSpiralAngleSeperation&&(this._spiderOptions.minSpiralAngleSeperation=t.minSpiralAngleSeperation),"number"==typeof t.spiralDistanceFactor&&(this._spiderOptions.spiralDistanceFactor=t.spiralDistanceFactor),"number"==typeof t.minCircleLength&&(this._spiderOptions.minCircleLength=t.minCircleLength),t.stickHoverStyle&&(this._spiderOptions.stickHoverStyle=t.stickHoverStyle),t.stickStyle&&(this._spiderOptions.stickStyle=t.stickStyle),t.markerSelected&&(this._spiderOptions.markerSelected=t.markerSelected),t.markerUnSelected&&(this._spiderOptions.markerUnSelected=t.markerUnSelected),"boolean"==typeof t.visible&&(this._spiderOptions.visible=t.visible),this.SetOptions(t))},t.prototype.ShowSpiderCluster=function(t){if(this.HideSpiderCluster(),(this._currentCluster=t)&&t.containedPushpins){var e=this._maps.MapInstance,n=t.containedPushpins,i=t.getLocation(),o=e.tryLocationToPixel(i,Microsoft.Maps.PixelReference.control),r=void 0,a=0,s=n.length>this._spiderOptions.circleSpiralSwitchover,l=void 0,u=void 0,c=void 0;s?(l=this._spiderOptions.minCircleLength/Math.PI,c=2*Math.PI*this._spiderOptions.spiralDistanceFactor):(u=2*Math.PI/n.length,(l=this._spiderOptions.spiralDistanceFactor/u/Math.PI/2*n.length)<this._spiderOptions.minCircleLength&&(l=this._spiderOptions.minCircleLength));for(var p=0,h=n.length;p<h;p++){s?l+=c/(a+=this._spiderOptions.minSpiralAngleSeperation/l+5e-4*p):a=u*p;var f=new Microsoft.Maps.Point(o.x+l*Math.cos(a),o.y+l*Math.sin(a)),d=e.tryPixelToLocation(f,Microsoft.Maps.PixelReference.control);r=new Microsoft.Maps.Polyline([i,d],this._spiderOptions.stickStyle),this._spiderLayer.add(r);var y=new Microsoft.Maps.Pushpin(d);y.metadata=n[p].metadata||{},y.metadata.isClusterMarker=!0,y.setOptions(this.GetBasicPushpinOptions(n[p])),this._spiderLayer.add(y);var m=new S(y,null,this._spiderLayer);m.Stick=r,m.ParentMarker=this.GetMarkerFromBingMarker(n[p]),this._spiderMarkers.push(m),this._spiderMarkerLookup.set(y,m)}this._mapclicks=0}},t}(),P=function(){function t(t){this._infoBox=t,this._isOpen=!1}return Object.defineProperty(t.prototype,"IsOpen",{get:function(){return!(!this._infoBox||!0!==this._infoBox.getOptions().visible)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._infoBox},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){var n=this;Microsoft.Maps.Events.addHandler(this._infoBox,t,function(t){"infoboxChanged"===t.eventName?!0===n._infoBox.getOptions().visible?n._isOpen=!0:!1===n._infoBox.getOptions().visible&&!0===n._isOpen&&(n._isOpen=!1,e(t)):e(t)})},t.prototype.Close=function(){var t={visible:!1};this._infoBox.setOptions(t)},t.prototype.GetPosition=function(){return{latitude:this._infoBox.getLocation().latitude,longitude:this._infoBox.getLocation().longitude}},t.prototype.Open=function(){var t={visible:!0};this._infoBox.setOptions(t)},t.prototype.SetOptions=function(t){var e=k.TranslateInfoBoxOptions(t);this._infoBox.setOptions(e)},t.prototype.SetPosition=function(t){var e=k.TranslateLocation(t);this._infoBox.setLocation(e)},t}(),w=function(){function t(t){this.Set("fontFamily","sans-serif"),this.Set("fontSize",12),this.Set("fontColor","#ffffff"),this.Set("strokeWeight",4),this.Set("strokeColor","#000000"),this.Set("align","center"),this.SetValues(t)}return t.prototype.Delete=function(){this.SetMap(null)},t.prototype.Changed=function(t){var e=!1,n=!1;Array.isArray(t)||(t=[t]),t.forEach(function(t){switch(t){case"fontFamily":case"fontSize":case"fontColor":case"strokeWeight":case"strokeColor":case"align":case"text":e=!0;break;case"maxZoom":case"minZoom":case"offset":case"hidden":case"position":n=!0}}),e&&this.DrawCanvas(),n&&this.Draw()},t.prototype.GetVisible=function(){var t=this.Get("minZoom"),e=this.Get("maxZoom");if(this.Get("hidden"))return"hidden";if(t===undefined&&e===undefined)return"";if(!this.GetMap())return"";var n=this.GetMap().getZoom();return n<t||e<n?"hidden":""},t.prototype.DrawCanvas=function(){if(this._canvas){var t=this._canvas.style;t.zIndex=this.Get("zIndex");var e=this._canvas.getContext("2d");e.clearRect(0,0,this._canvas.width,this._canvas.height),e.strokeStyle=this.Get("strokeColor"),e.font=this.Get("fontSize")+"px "+this.Get("fontFamily");var n=this.Get("backgroundColor"),i=Number(this.Get("strokeWeight")),o=this.Get("text"),r=e.measureText(o).width;o&&i&&0<i&&(e.lineWidth=i,e.strokeText(o,4,4)),n&&""!==n&&(e.fillStyle=n,e.fillRect(0,0,r+8,2*parseInt(e.font,10)-2)),e.fillStyle=this.Get("fontColor"),e.fillText(o,4,4),t.marginLeft=this.GetMarginLeft(r)+"px",t.marginTop="-0.4em",t.pointerEvents="none"}},t.prototype.GetMarginLeft=function(t){switch(this.Get("align")){case"left":return 0;case"right":return-t}return t/-2},t.prototype.OnRemove=function(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)},t}(),L=function(){function t(t){this._obj=t,this._proto=t.prototype}return t.prototype.Extend=function(t){for(var e in this.Set("prototype",t,this._obj),this._proto)null!=this._proto[e]&&this.Set(e,this._proto[e],this._obj.prototype[e]);return this},t.prototype.Set=function(t,e,n){if(void 0===e)return this;void 0===n&&(n=this._proto),Object.defineProperty(n,t,e)},t.prototype.Map=function(t,e){return this.Set(t,this._proto[e],this._obj.prototype),this},t}(),I=0,E=function(n){function t(t){var e=this;return t.fontSize=t.fontSize||12,t.fontColor=t.fontColor||"#ffffff",t.strokeWeight=t.strokeWeight||2,t.strokeColor=t.strokeColor||"#000000",(e=n.call(this,t)||this)._options.beneathLabels=!1,e}return f(t,n),Object.defineProperty(t.prototype,"DefaultLabelStyle",{get:function(){return{fontSize:12,fontFamily:"sans-serif",fontColor:"#ffffff",strokeWeight:2,strokeColor:"#000000"}},enumerable:!0,configurable:!0}),t.prototype.Get=function(t){return this[t]},t.prototype.GetMap=function(){return this.getMap()},t.prototype.Set=function(t,e){"position"===t&&!e.hasOwnProperty("altitude")&&e.hasOwnProperty("latitude")&&e.hasOwnProperty("longitude")&&(e=new Microsoft.Maps.Location(e.latitude,e.longitude)),this.Get(t)!==e&&(this[t]=e,this.Changed(t))},t.prototype.SetMap=function(t){var e=this.GetMap();t!==e&&(e&&e.layers.remove(this),null!=t&&t.layers.insert(this))},t.prototype.SetValues=function(t){var e=new Array;for(var n in t)""!==n&&("position"===n&&!t[n].hasOwnProperty("altitude")&&t[n].hasOwnProperty("latitude")&&t[n].hasOwnProperty("longitude")&&(t[n]=new Microsoft.Maps.Location(t[n].latitude,t[n].longitude)),this.Get(n)!==t[n]&&(this[n]=t[n],e.push(n)));0<e.length&&this.Changed(e)},t.prototype.Draw=function(){var t=this.GetVisible(),e=this.GetMap();if(this._canvas&&e){var n=this._canvas.style;if(""===t){var i=this.Get("offset"),o=this.Get("position");if(o){i||(i=new Microsoft.Maps.Point(0,0));var r=e.tryLocationToPixel(o,Microsoft.Maps.PixelReference.control);n.top=r.y+i.y+"px",n.left=r.x+i.x+"px",n.visibility=t}}else n.visibility=t}},t.prototype.OnAdd=function(){this._canvas=document.createElement("canvas"),this._canvas.id="xMapLabel"+I++,this._canvas.style.position="absolute";var t=this._canvas.getContext("2d");t.lineJoin="round",t.textBaseline="top",this.setHtmlElement(this._canvas)},t.prototype.OnLoad=function(){var t=this;Microsoft.Maps.Events.addHandler(this.GetMap(),"viewchange",function(){t.Changed("position")}),this.DrawCanvas(),this.Draw()},t}(w);var T=function(o){function t(t,e,n){var i=o.call(this)||this;return i._polygon=t,i._mapService=e,i._layer=n,i._map=null,i._isEditable=!1,i._title="",i._maxZoom=-1,i._minZoom=-1,i._showLabel=!1,i._showTooltip=!1,i._label=null,i._tooltip=null,i._hasToolTipReceiver=!1,i._tooltipVisible=!1,i._metadata=new Map,i._map=i._mapService.MapInstance,i._originalPath=i.GetPaths(),i}return f(t,o),Object.defineProperty(t.prototype,"LabelMaxZoom",{get:function(){return this._maxZoom},set:function(t){this._maxZoom=t,this.ManageLabel()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"LabelMinZoom",{get:function(){return this._minZoom},set:function(t){this._minZoom=t,this.ManageLabel()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Metadata",{get:function(){return this._metadata},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._polygon},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ShowLabel",{get:function(){return this._showLabel},set:function(t){this._showLabel=t,this.ManageLabel()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ShowTooltip",{get:function(){return this._showTooltip},set:function(t){this._showTooltip=t,this.ManageTooltip()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Title",{get:function(){return this._title},set:function(t){this._title=t,this.ManageLabel(),this.ManageTooltip()},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){var n,i=this;(-1!==["click","dblclick","drag","dragend","dragstart","mousedown","mouseout","mouseover","mouseup"].indexOf(t)&&Microsoft.Maps.Events.addHandler(this._polygon,t,function(t){e(t)}),"mousemove"===t)&&(Microsoft.Maps.Events.addHandler(this._polygon,"mouseover",function(t){n=Microsoft.Maps.Events.addHandler(i._map,"mousemove",function(t){return e(t)})}),Microsoft.Maps.Events.addHandler(this._polygon,"mouseout",function(t){n&&Microsoft.Maps.Events.removeHandler(n)}));"pathchanged"===t&&(this._editingCompleteEmitter=e)},t.prototype.Delete=function(){this._layer?this._layer.remove(this.NativePrimitve):this._map.entities.remove(this.NativePrimitve),this._label&&this._label.Delete(),this._tooltip&&this._tooltip.Delete()},t.prototype.GetDraggable=function(){return!1},t.prototype.GetEditable=function(){return this._isEditable},t.prototype.GetPath=function(){var t=this._polygon.getLocations(),e=new Array;return t.forEach(function(t){return e.push({latitude:t.latitude,longitude:t.longitude})}),e},t.prototype.GetPaths=function(){var t=this._polygon.getRings(),n=new Array;return t.forEach(function(t){var e=new Array;t.forEach(function(t){return e.push({latitude:t.latitude,longitude:t.longitude})}),n.push(e)}),n},t.prototype.GetVisible=function(){return this._polygon.getVisible()},t.prototype.SetDraggable=function(t){throw new Error("The bing maps implementation currently does not support draggable polygons.")},t.prototype.SetEditable=function(t){var i=this,e=this._isEditable!==t;this._isEditable=t,e&&(this._isEditable?(this._originalPath=this.GetPaths(),this._mapService.GetDrawingTools().then(function(t){t.edit(i._polygon)})):this._mapService.GetDrawingTools().then(function(t){t.finish(function(t){if(t===i._polygon&&i._editingCompleteEmitter){var e=i.GetPaths(),n=i._originalPath;i.SetPaths(e),i._editingCompleteEmitter({Click:null,Polygon:i,OriginalPath:n,NewPath:e})}})}))},t.prototype.SetOptions=function(t){var e=k.TranslatePolygonOptions(t);this._polygon.setOptions(e),null!=t.visible&&this._showLabel&&this._label&&this._label.Set("hidden",!t.visible),"undefined"!=typeof t.editable&&this.SetEditable(t.editable)},t.prototype.SetPath=function(t){var e=new Array;t.forEach(function(t){return e.push(new Microsoft.Maps.Location(t.latitude,t.longitude))}),this._originalPath=[t],this._polygon.setLocations(e),this._label&&(this._centroid=null,this.ManageLabel())},t.prototype.SetPaths=function(t){if(null!=t&&Array.isArray(t)){if(0===t.length)return this._polygon.setRings(new Array),void(this._label&&(this._label.Delete(),this._label=null));if(Array.isArray(t[0])){var n=new Array;t.forEach(function(t){var e=new Array;t.forEach(function(t){return e.push(new Microsoft.Maps.Location(t.latitude,t.longitude))}),n.push(e)}),this._originalPath=t,this._polygon.setRings(n),this._label&&(this._centroid=null,this.ManageLabel())}else this.SetPath(t)}},t.prototype.SetVisible=function(t){this._polygon.setOptions({visible:t}),this._showLabel&&this._label&&this._label.Set("hidden",!t)},t.prototype.ManageLabel=function(){if(null!=this.GetPath&&0!==this.GetPath().length)if(this._showLabel&&null!=this._title&&""!==this._title){var t={text:this._title,position:k.TranslateLocation(this.Centroid)};if(null==t.position)return;-1!==this._minZoom&&(t.minZoom=this._minZoom),-1!==this._maxZoom&&(t.maxZoom=this._maxZoom),null==this._label?(this._label=new E(t),this._label.SetMap(this._map)):this._label.SetValues(t),this._label.Set("hidden",!this.GetVisible())}else this._label&&(this._label.SetMap(null),this._label=null)},t.prototype.ManageTooltip=function(){var e=this;if(this._showTooltip&&null!=this._title&&""!==this._title){var t={text:this._title,align:"left",offset:new Microsoft.Maps.Point(0,25),backgroundColor:"bisque",hidden:!0,fontSize:12,fontColor:"#000000",strokeWeight:0};null==this._tooltip?(this._tooltip=new E(t),this._tooltip.SetMap(this._map)):this._tooltip.SetValues(t),this._hasToolTipReceiver||(this._mouseOverListener=Microsoft.Maps.Events.addHandler(this._polygon,"mouseover",function(t){e._tooltip.Set("position",t.location),e._tooltipVisible||(e._tooltip.Set("hidden",!1),e._tooltipVisible=!0),e._mouseMoveListener=Microsoft.Maps.Events.addHandler(e._map,"mousemove",function(t){e._tooltipVisible&&t.location&&t.primitive===e._polygon&&e._tooltip.Set("position",t.location)})}),this._mouseOutListener=Microsoft.Maps.Events.addHandler(this._polygon,"mouseout",function(t){e._tooltipVisible&&(e._tooltip.Set("hidden",!0),e._tooltipVisible=!1),e._mouseMoveListener&&Microsoft.Maps.Events.removeHandler(e._mouseMoveListener)}),this._hasToolTipReceiver=!0)}this._showTooltip&&""!==this._title&&null!=this._title||(this._hasToolTipReceiver&&(this._mouseOutListener&&Microsoft.Maps.Events.removeHandler(this._mouseOutListener),this._mouseOverListener&&Microsoft.Maps.Events.removeHandler(this._mouseOverListener),this._mouseMoveListener&&Microsoft.Maps.Events.removeHandler(this._mouseMoveListener),this._hasToolTipReceiver=!1),this._tooltip&&(this._tooltip.SetMap(null),this._tooltip=null))},t}(c),x=function(o){function t(t,e,n){var i=o.call(this)||this;return i._polyline=t,i._map=e,i._layer=n,i._isEditable=!0,i._title="",i._showTooltip=!1,i._tooltip=null,i._hasToolTipReceiver=!1,i._tooltipVisible=!1,i._metadata=new Map,i}return f(t,o),Object.defineProperty(t.prototype,"Metadata",{get:function(){return this._metadata},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._polyline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ShowTooltip",{get:function(){return this._showTooltip},set:function(t){this._showTooltip=t,this.ManageTooltip()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Title",{get:function(){return this._title},set:function(t){this._title=t,this.ManageTooltip()},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){var n,i=this;(-1!==["click","dblclick","drag","dragend","dragstart","mousedown","mouseout","mouseover","mouseup"].indexOf(t)&&Microsoft.Maps.Events.addHandler(this._polyline,t,function(t){e(t)}),"mousemove"===t)&&(Microsoft.Maps.Events.addHandler(this._polyline,"mouseover",function(t){n=Microsoft.Maps.Events.addHandler(i._map,"mousemove",function(t){return e(t)})}),Microsoft.Maps.Events.addHandler(this._polyline,"mouseout",function(t){n&&Microsoft.Maps.Events.removeHandler(n)}))},t.prototype.Delete=function(){this._layer?this._layer.remove(this.NativePrimitve):this._map.entities.remove(this.NativePrimitve),this._tooltip&&this._tooltip.Delete()},t.prototype.GetDraggable=function(){return!1},t.prototype.GetEditable=function(){return this._isEditable},t.prototype.GetPath=function(){var t=this._polyline.getLocations(),e=new Array;return t.forEach(function(t){return e.push({latitude:t.latitude,longitude:t.longitude})}),e},t.prototype.GetVisible=function(){return this._polyline.getVisible()},t.prototype.SetDraggable=function(t){throw new Error("The bing maps implementation currently does not support draggable polylines.")},t.prototype.SetEditable=function(t){this._isEditable=t},t.prototype.SetOptions=function(t){var e=k.TranslatePolylineOptions(t);this._polyline.setOptions(e),t.path&&this.SetPath(t.path)},t.prototype.SetPath=function(t){var e=new Array;t.forEach(function(t){return e.push(new Microsoft.Maps.Location(t.latitude,t.longitude))}),this._polyline.setLocations(e)},t.prototype.SetVisible=function(t){this._polyline.setOptions({visible:t})},t.prototype.ManageTooltip=function(){var e=this;if(this._showTooltip&&null!=this._title&&""!==this._title){var t={text:this._title,align:"left",offset:new Microsoft.Maps.Point(0,25),backgroundColor:"bisque",hidden:!0,fontSize:12,fontColor:"#000000",strokeWeight:0};null==this._tooltip?(this._tooltip=new E(t),this._tooltip.SetMap(this._map)):this._tooltip.SetValues(t),this._hasToolTipReceiver||(this._mouseOverListener=Microsoft.Maps.Events.addHandler(this._polyline,"mouseover",function(t){e._tooltip.Set("position",t.location),e._tooltipVisible||(e._tooltip.Set("hidden",!1),e._tooltipVisible=!0)}),this._mouseMoveListener=Microsoft.Maps.Events.addHandler(this._map,"mousemove",function(t){e._tooltipVisible&&t.location&&t.primitive===e._polyline&&e._tooltip.Set("position",t.location)}),this._mouseOutListener=Microsoft.Maps.Events.addHandler(this._polyline,"mouseout",function(t){e._tooltipVisible&&(e._tooltip.Set("hidden",!0),e._tooltipVisible=!1)}),this._hasToolTipReceiver=!0)}this._showTooltip&&""!==this._title&&null!=this._title||(this._hasToolTipReceiver&&(this._mouseOutListener&&Microsoft.Maps.Events.removeHandler(this._mouseOutListener),this._mouseOverListener&&Microsoft.Maps.Events.removeHandler(this._mouseOverListener),this._mouseMoveListener&&Microsoft.Maps.Events.removeHandler(this._mouseMoveListener),this._hasToolTipReceiver=!1),this._tooltip&&(this._tooltip.SetMap(null),this._tooltip=null))},t}(p),A={click:"click",dblclick:"dblclick",rightclick:"rightclick",resize:"resize",boundschanged:"viewchangeend",centerchanged:"viewchangeend",zoomchanged:"viewchangeend",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",infowindowclose:"infoboxChanged"},z=function(e){function t(t){return e.call(this,t)||this}return f(t,e),t.prototype.GetCoordinatesFromClick=function(t){return{latitude:t.location.latitude,longitude:t.location.longitude}},t.prototype.GetMap=function(){return this.getMap()},t.prototype.GetToolTipOverlay=function(){var t={align:"left",offset:new Microsoft.Maps.Point(0,25),backgroundColor:"bisque",hidden:!0,fontSize:12,fontColor:"#000000",strokeWeight:0},e=new E(t);return e.SetMap(this.GetMap()),e},t.prototype.OnLoad=function(){var p=this,h=this.getMap();this._zoomStart=h.getZoom(),this._centerStart=h.getCenter(),this.Redraw(!0),this._viewChangeEvent=Microsoft.Maps.Events.addHandler(h,"viewchange",function(t){if(h.getMapTypeId()===Microsoft.Maps.MapTypeId.streetside)p._canvas.style.display="none";else{var e=h.getZoom(),n=h.getCenter(),i=Math.pow(2,e-p._zoomStart),o=h.getWidth()*i,r=h.getHeight()*i,a=h.tryLocationToPixel([k.TranslateLocation(p._centerStart),n],Microsoft.Maps.PixelReference.control),s=a[1].x-a[0].x,l=a[1].y-a[0].y,u=-(o-h.getWidth())/2-s,c=-(r-h.getHeight())/2-l;p.UpdatePosition(u,c,o,r)}}),this._viewChangeEndEvent=Microsoft.Maps.Events.addHandler(h,"viewchangeend",function(t){p.UpdateCanvas()}),this._mapResizeEvent=Microsoft.Maps.Events.addHandler(h,"mapresize",function(t){p.UpdateCanvas()}),this._readyResolver(!0)},t.prototype.SetMap=function(t){var e=this.GetMap();t!==e&&(e&&e.layers.remove(this),null!=t&&t.layers.insert(this))},t.prototype.SetCanvasElement=function(t){this.setHtmlElement(t)},t.prototype.RemoveEventHandlers=function(){Microsoft.Maps.Events.removeHandler(this._viewChangeEvent),Microsoft.Maps.Events.removeHandler(this._viewChangeEndEvent),Microsoft.Maps.Events.removeHandler(this._mapResizeEvent)},t.prototype.Resize=function(){var t=this.getMap();this._canvas.width=t.getWidth(),this._canvas.height=t.getHeight()},t.prototype.UpdateCanvas=function(){var t=this.getMap();t.getMapTypeId()!==Microsoft.Maps.MapTypeId.streetside&&(this._canvas.style.display="",this.UpdatePosition(0,0,t.getWidth(),t.getHeight()),this.Redraw(!0),this._zoomStart=t.getZoom(),this._centerStart=t.getCenter())},t}(b);var D={hybrid:0,roadmap:1,satellite:2,terrain:3};D[D.hybrid]="hybrid",D[D.roadmap]="roadmap",D[D.satellite]="satellite",D[D.terrain]="terrain";var G=function(){function a(){}return a.TranslateBounds=function(t){return{east:t.maxLongitude,north:t.maxLatitude,south:t.minLatitude,west:t.minLongitude}},a.TranslateInfoWindowOptions=function(e){var n={};return Object.keys(e).filter(function(t){return-1!==a._infoWindowOptionsAttributes.indexOf(t)}).forEach(function(t){"htmlContent"===t?n.content=e[t]:n[t]=e[t]}),null!=n.content&&""!==n.content||(""!==e.title&&""!==e.description?n.content=e.title+": "+e.description:""!==e.description?n.content=e.description:n.content=e.title),n},a.TranslateLocation=function(t){return{lat:t.latitude,lng:t.longitude}},a.TranslateLatLng=function(t){return{latitude:t.lat,longitude:t.lng}},a.TranslateLocationObject=function(t){return new google.maps.LatLng(t.latitude,t.longitude)},a.TranslateLatLngObject=function(t){return{latitude:t.lat(),longitude:t.lng()}},a.TranslateLocationObjectArray=function(t){for(var e=new Array,n=0;n<t.length;n++)e.push(a.TranslateLocationObject(t[n]));return e},a.TranslateMapTypeId=function(t){switch(t){case s.road:return D[D.roadmap];case s.grayscale:return D[D.terrain];case s.hybrid:return D[D.hybrid];case s.ordnanceSurvey:return D[D.terrain];default:return D[D.satellite]}},a.TranslateMarkerOptions=function(n){var i={};return Object.keys(n).filter(function(t){return-1!==a._markerOptionsAttributes.indexOf(t)}).forEach(function(t){if("position"===t){var e=a.TranslateLocationObject(n[t]);i.position=e}else i[t]=n[t]}),i},a.TranslateOptions=function(e){var n={};return Object.keys(e).filter(function(t){return-1!==a._mapOptionsAttributes.indexOf(t)}).forEach(function(t){"center"===t?n.center=a.TranslateLocation(e.center):"mapTypeId"===t?n.mapTypeId=a.TranslateMapTypeId(e.mapTypeId):"disableZooming"===t?(n.gestureHandling="none",n.zoomControl=!1):"showMapTypeSelector"===t?n.mapTypeControl=!1:"customMapStyleGoogle"===t?n.styles=e.customMapStyleGoogle:n[t]=e[t]}),n},a.TranslatePaths=function(t){var e=new Array;if(null!=t&&Array.isArray(t)&&0!==t.length)if(Array.isArray(t[0]))for(var n=t,i=0;i<n.length;i++)e.push(a.TranslateLocationObjectArray(n[i]));else e.push(a.TranslateLocationObjectArray(t));else e.push(new Array);return e},a.TranslatePolygonOptions=function(o){var r={};return Object.keys(o).filter(function(t){return-1!==a._polygonOptionsAttributes.indexOf(t)}).forEach(function(t){if("paths"===t){if(!Array.isArray(o.paths))return;if(0===o.paths.length)r.paths=new Array;else if(Array.isArray(o.paths[0])){r.paths=new Array;for(var e=o.paths,n=0;n<e.length;n++){r.paths[n]=new Array;for(var i=0;i<e[n].length;i++)r.paths[n][i]={lat:e[n][i].latitude,lng:e[n][i].longitude}}}else{r.paths=new Array;for(e=o.paths,n=0;n<e.length;n++)r.paths[n]={lat:e[n].latitude,lng:e[n].longitude}}}else r[t]=o[t]}),r},a.TranslatePolylineOptions=function(e){var n={};return Object.keys(e).filter(function(t){return-1!==a._polylineOptionsAttributes.indexOf(t)}).forEach(function(t){n[t]=e[t]}),n},a._mapOptionsAttributes=["backgroundColor","center","clickableIcons","customMapStyleGoogle","disableDefaultUI","disableDoubleClickZoom","draggable","draggableCursor","draggingCursor","disableZooming","fullscreenControl","fullscreenControlOptions","gestureHandling","heading","keyboardShortcuts","mapTypeControl","mapTypeControlOptions","mapTypeId","maxZoom","minZoom","noClear","panControl","panControlOptions","rotateControl","rotateControlOptions","scaleControl","scaleControlOptions","scrollwheel","showMapTypeSelector","streetView","streetViewControl","streetViewControlOptions","styles","tilt","zoom","zoomControl","zoomControlOptions"],a._infoWindowOptionsAttributes=["actions","description","htmlContent","id","position","pixelOffset","showCloseButton","showPointer","pushpin","title","titleClickHandler","typeName","visible","width","height"],a._markerOptionsAttributes=["anchor","position","title","text","label","draggable","icon","width","height","iconInfo","metadata","visible"],a._clusterOptionsAttributes=["callback","clusteredPinCallback","clusteringEnabled","gridSize","layerOffset","placementMode","visible","zIndex"],a._polygonOptionsAttributes=["clickable","draggable","editable","fillColor","fillOpacity","geodesic","paths","strokeColor","strokeOpacity","strokeWeight","visible","zIndex"],a._polylineOptionsAttributes=["clickable","draggable","editable","geodesic","strokeColor","strokeOpacity","strokeWeight","visible","zIndex"],a}(),j=function(){function t(t,e){this._infoWindow=t,this._mapService=e}return Object.defineProperty(t.prototype,"IsOpen",{get:function(){return!0===this._isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._infoWindow},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(e,n){var i=this;this._infoWindow.addListener(e,function(t){"closeclick"===e&&(i._isOpen=!1),n(t)})},t.prototype.Close=function(){this._isOpen=!1,this._infoWindow.close()},t.prototype.GetPosition=function(){return G.TranslateLatLngObject(this._infoWindow.getPosition())},t.prototype.Open=function(e){var n=this;this._mapService.MapPromise.then(function(t){n._isOpen=!0,n._infoWindow.open(t,e)})},t.prototype.SetOptions=function(t){var e=G.TranslateInfoWindowOptions(t);this._infoWindow.setOptions(e)},t.prototype.SetPosition=function(t){var e=G.TranslateLocation(t);this._infoWindow.setPosition(e)},t}(),N=function(){function t(t){this._marker=t,this._metadata=new Map,this._isFirst=!1,this._isLast=!0}return Object.defineProperty(t.prototype,"IsFirst",{get:function(){return this._isFirst},set:function(t){this._isFirst=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"IsLast",{get:function(){return this._isLast},set:function(t){this._isLast=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Metadata",{get:function(){return this._metadata},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._marker},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Location",{get:function(){var t=this._marker.getPosition();return{latitude:t.lat(),longitude:t.lng()}},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){this._marker.addListener(t,e)},t.prototype.DeleteMarker=function(){this._marker.setMap(null)},t.prototype.GetLabel=function(){return this._marker.getLabel().text},t.prototype.GetVisible=function(){return this._marker.getVisible()},t.prototype.SetAnchor=function(t){},t.prototype.SetDraggable=function(t){this._marker.setDraggable(t)},t.prototype.SetIcon=function(t){this._marker.setIcon(t)},t.prototype.SetLabel=function(t){this._marker.setLabel(t)},t.prototype.SetPosition=function(t){var e=G.TranslateLocationObject(t);this._marker.setPosition(e)},t.prototype.SetTitle=function(t){this._marker.setTitle(t)},t.prototype.SetOptions=function(t){var e=G.TranslateMarkerOptions(t);this._marker.setOptions(e)},t.prototype.SetVisible=function(t){this._marker.setVisible(t)},t}(),Z=function(e){function t(t){return t.fontSize=t.fontSize||12,t.fontColor=t.fontColor||"#ffffff",t.strokeWeight=t.strokeWeight||3,t.strokeColor=t.strokeColor||"#000000",e.call(this,t)||this}return f(t,e),Object.defineProperty(t.prototype,"DefaultLabelStyle",{get:function(){return{fontSize:12,fontFamily:"sans-serif",fontColor:"#ffffff",strokeWeight:3,strokeColor:"#000000"}},enumerable:!0,configurable:!0}),t.prototype.Get=function(t){return this.get(t)},t.prototype.GetMap=function(){return this.getMap()},t.prototype.Set=function(t,e){"position"===t&&e.hasOwnProperty("latitude")&&e.hasOwnProperty("longitude")&&(e=new google.maps.LatLng(e.latitude,e.longitude)),this.Get(t)!==e&&this.set(t,e)},t.prototype.SetMap=function(t){this.setMap(t)},t.prototype.SetValues=function(t){for(var e in t)""!==e&&("position"===e&&t[e].hasOwnProperty("latitude")&&t[e].hasOwnProperty("longitude")&&(t[e]=new google.maps.LatLng(t[e].latitude,t[e].longitude)),this.Get(e)===t[e]&&delete t[e]);this.setValues(t)},t.prototype.Draw=function(){var t=this.getProjection(),e=this.GetVisible();if(t&&this._canvas){var n=this._canvas.style;if(""===e){var i=this.Get("offset"),o=this.Get("position");if(o){o instanceof google.maps.LatLng||(o=new google.maps.LatLng(o.lat,o.lng)),i||(i=new google.maps.Point(0,0));var r=t.fromLatLngToDivPixel(o);n.top=r.y+i.y+"px",n.left=r.x+i.x+"px",n.visibility=e}}else n.visibility=e}},t.prototype.OnAdd=function(){this._canvas=document.createElement("canvas"),this._canvas.style.position="absolute";var t=this._canvas.getContext("2d");t.lineJoin="round",t.textBaseline="top",this.DrawCanvas();var e=this.getPanes();e&&e.overlayLayer.appendChild(this._canvas)},t}(w);var V=function(n){function t(t){var e=n.call(this)||this;return e._polygon=t,e._title="",e._showLabel=!1,e._showTooltip=!1,e._maxZoom=-1,e._minZoom=-1,e._label=null,e._tooltip=null,e._tooltipVisible=!1,e._hasToolTipReceiver=!1,e._mouseOverListener=null,e._mouseOutListener=null,e._mouseMoveListener=null,e._metadata=new Map,e._editingCompleteEmitter=null,e._originalPath=e.GetPaths(),e}return f(t,n),Object.defineProperty(t.prototype,"LabelMaxZoom",{get:function(){return this._maxZoom},set:function(t){this._maxZoom=t,this.ManageLabel()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"LabelMinZoom",{get:function(){return this._minZoom},set:function(t){this._minZoom=t,this.ManageLabel()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Metadata",{get:function(){return this._metadata},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._polygon},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ShowLabel",{get:function(){return this._showLabel},set:function(t){this._showLabel=t,this.ManageLabel()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ShowTooltip",{get:function(){return this._showTooltip},set:function(t){this._showTooltip=t,this.ManageTooltip()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Title",{get:function(){return this._title},set:function(t){this._title=t,this.ManageLabel(),this.ManageTooltip()},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){-1!==["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"].indexOf(t)&&this._polygon.addListener(t,e),"pathchanged"===t&&(this._editingCompleteEmitter=e)},t.prototype.Delete=function(){this._polygon.setMap(null),this._label&&this._label.Delete(),this._tooltip&&this._tooltip.Delete()},t.prototype.GetDraggable=function(){return this._polygon.getDraggable()},t.prototype.GetEditable=function(){return this._polygon.getEditable()},t.prototype.GetPath=function(){var t=this._polygon.getPath(),e=new Array;return t.forEach(function(t){return e.push({latitude:t.lat(),longitude:t.lng()})}),e},t.prototype.GetPaths=function(){var t=this._polygon.getPaths(),n=new Array;return t.forEach(function(t){var e=new Array;t.forEach(function(t){return e.push({latitude:t.lat(),longitude:t.lng()})}),n.push(e)}),n},t.prototype.GetVisible=function(){return this._polygon.getVisible()},t.prototype.SetDraggable=function(t){this._polygon.setDraggable(t)},t.prototype.SetEditable=function(t){var e=this._polygon.getEditable();this._polygon.setEditable(t),e&&!t&&this._editingCompleteEmitter&&(this._editingCompleteEmitter({Click:null,Polygon:this,OriginalPath:this._originalPath,NewPath:this.GetPaths()}),this._originalPath=this.GetPaths())},t.prototype.SetOptions=function(t){var e=G.TranslatePolygonOptions(t);"undefined"!=typeof e.editable&&(this.SetEditable(e.editable),delete e.editable),this._polygon.setOptions(e),null!=t.visible&&this._showLabel&&this._label&&this._label.Set("hidden",!t.visible)},t.prototype.SetPath=function(t){var e=new Array;t.forEach(function(t){return e.push(new google.maps.LatLng(t.latitude,t.longitude))}),this._polygon.setPath(e),this._originalPath=[t],this._label&&(this._centroid=null,this.ManageLabel())},t.prototype.SetPaths=function(t){if(null!=t&&Array.isArray(t)){if(0===t.length)return this._polygon.setPaths(new Array),void(this._label&&(this._label.Delete(),this._label=null));if(Array.isArray(t[0])){var n=new Array;t.forEach(function(t){var e=new Array;t.forEach(function(t){return e.push(new google.maps.LatLng(t.latitude,t.longitude))}),n.push(e)}),this._polygon.setPaths(n),this._originalPath=t,this._label&&(this._centroid=null,this.ManageLabel())}else this.SetPath(t)}},t.prototype.SetVisible=function(t){this._polygon.setVisible(t),this._showLabel&&this._label&&this._label.Set("hidden",!t)},t.prototype.ManageLabel=function(){if(null!=this.GetPath&&0!==this.GetPath().length)if(this._showLabel&&null!=this._title&&""!==this._title){var t={text:this._title,position:G.TranslateLocationObject(this.Centroid)};if(null==t.position)return;-1!==this._minZoom&&(t.minZoom=this._minZoom),-1!==this._maxZoom&&(t.maxZoom=this._maxZoom),null==this._label?(t.map=this.NativePrimitve.getMap(),t.zIndex=this.NativePrimitve.zIndex?this.NativePrimitve.zIndex+1:100,this._label=new Z(t)):this._label.SetValues(t),this._label.Set("hidden",!this.GetVisible())}else this._label&&(this._label.SetMap(null),this._label=null)},t.prototype.ManageTooltip=function(){var e=this;if(this._showTooltip&&null!=this._title&&""!==this._title){var t={text:this._title,align:"left",offset:new google.maps.Point(0,25),backgroundColor:"bisque",hidden:!0,fontSize:12,fontColor:"#000000",strokeWeight:0};null==this._tooltip?(t.map=this.NativePrimitve.getMap(),t.zIndex=1e5,this._tooltip=new Z(t)):this._tooltip.SetValues(t),this._hasToolTipReceiver||(this._mouseOverListener=this.NativePrimitve.addListener("mouseover",function(t){e._tooltip.Set("position",t.latLng),e._tooltipVisible||(e._tooltip.Set("hidden",!1),e._tooltipVisible=!0)}),this._mouseMoveListener=this.NativePrimitve.addListener("mousemove",function(t){e._tooltipVisible&&e._tooltip.Set("position",t.latLng)}),this._mouseOutListener=this.NativePrimitve.addListener("mouseout",function(t){e._tooltipVisible&&(e._tooltip.Set("hidden",!0),e._tooltipVisible=!1)}),this._hasToolTipReceiver=!0)}this._showTooltip&&""!==this._title&&null!=this._title||(this._hasToolTipReceiver&&(this._mouseOutListener&&google.maps.event.removeListener(this._mouseOutListener),this._mouseOverListener&&google.maps.event.removeListener(this._mouseOverListener),this._mouseMoveListener&&google.maps.event.removeListener(this._mouseMoveListener),this._hasToolTipReceiver=!1),this._tooltip&&(this._tooltip.SetMap(null),this._tooltip=null))},t}(c),R=function(n){function t(t){var e=n.call(this)||this;return e._polyline=t,e._title="",e._showTooltip=!1,e._tooltip=null,e._tooltipVisible=!1,e._hasToolTipReceiver=!1,e._mouseOverListener=null,e._mouseOutListener=null,e._mouseMoveListener=null,e._metadata=new Map,e}return f(t,n),Object.defineProperty(t.prototype,"Metadata",{get:function(){return this._metadata},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._polyline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ShowTooltip",{get:function(){return this._showTooltip},set:function(t){this._showTooltip=t,this.ManageTooltip()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Title",{get:function(){return this._title},set:function(t){this._title=t,this.ManageTooltip()},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){-1!==["click","dblclick","drag","dragend","dragstart","mousedown","mousemove","mouseout","mouseover","mouseup","rightclick"].indexOf(t)&&this._polyline.addListener(t,e)},t.prototype.Delete=function(){this._polyline.setMap(null),this._tooltip&&this._tooltip.Delete()},t.prototype.GetDraggable=function(){return this._polyline.getDraggable()},t.prototype.GetEditable=function(){return this._polyline.getEditable()},t.prototype.GetPath=function(){var t=this._polyline.getPath(),e=new Array;return t.forEach(function(t){return e.push({latitude:t.lat(),longitude:t.lng()})}),e},t.prototype.GetVisible=function(){return this._polyline.getVisible()},t.prototype.SetDraggable=function(t){this._polyline.setDraggable(t)},t.prototype.SetEditable=function(t){this._polyline.setEditable(t)},t.prototype.SetOptions=function(t){var e=G.TranslatePolylineOptions(t);this._polyline.setOptions(e),t.path&&this.SetPath(t.path)},t.prototype.SetPath=function(t){var e=new Array;t.forEach(function(t){return e.push(new google.maps.LatLng(t.latitude,t.longitude))}),this._polyline.setPath(e)},t.prototype.SetVisible=function(t){this._polyline.setVisible(t)},t.prototype.ManageTooltip=function(){var e=this;if(this._showTooltip&&null!=this._title&&""!==this._title){var t={text:this._title,align:"left",offset:new google.maps.Point(0,25),backgroundColor:"bisque",hidden:!0,fontSize:12,fontColor:"#000000",strokeWeight:0};null==this._tooltip?(t.map=this.NativePrimitve.getMap(),t.zIndex=1e5,this._tooltip=new Z(t)):this._tooltip.SetValues(t),this._hasToolTipReceiver||(this._mouseOverListener=this.NativePrimitve.addListener("mouseover",function(t){e._tooltip.Set("position",t.latLng),e._tooltipVisible||(e._tooltip.Set("hidden",!1),e._tooltipVisible=!0)}),this._mouseMoveListener=this.NativePrimitve.addListener("mousemove",function(t){e._tooltipVisible&&e._tooltip.Set("position",t.latLng)}),this._mouseOutListener=this.NativePrimitve.addListener("mouseout",function(t){e._tooltipVisible&&(e._tooltip.Set("hidden",!0),e._tooltipVisible=!1)}),this._hasToolTipReceiver=!0)}this._showTooltip&&""!==this._title&&null!=this._title||(this._hasToolTipReceiver&&(this._mouseOutListener&&google.maps.event.removeListener(this._mouseOutListener),this._mouseOverListener&&google.maps.event.removeListener(this._mouseOverListener),this._mouseMoveListener&&google.maps.event.removeListener(this._mouseMoveListener),this._hasToolTipReceiver=!1),this._tooltip&&(this._tooltip.SetMap(null),this._tooltip=null))},t}(p),B={click:"click",dblclick:"dblclick",rightclick:"rightclick",resize:"resize",boundschanged:"bounds_changed",centerchanged:"center_changed",zoomchanged:"zoom_changed",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",infowindowclose:"closeclick"},H=function(e){function t(t){return e.call(this,t)||this}return f(t,e),t.prototype.GetCoordinatesFromClick=function(t){return t&&t.latLng&&t.latLng.lat&&t.latLng.lng?{latitude:t.latLng.lat(),longitude:t.latLng.lng()}:null},t.prototype.GetMap=function(){return this.getMap()},t.prototype.GetToolTipOverlay=function(){var t={align:"left",offset:new google.maps.Point(0,25),backgroundColor:"bisque",hidden:!0,fontSize:12,fontColor:"#000000",strokeWeight:0,zIndex:1e5},e=new Z(t);return e.SetMap(this.GetMap()),e},t.prototype.OnAdd=function(){e.prototype.OnAdd.call(this),this.OnLoad(),this._canvas.style.zIndex="100",this._readyResolver(!0)},t.prototype.OnDraw=function(){var t=this.GetMap(),e=t.getZoom(),n=t.getCenter(),i=Math.pow(2,e-this._zoomStart),o=t.getDiv(),r=o.offsetWidth*i,a=o.offsetHeight*i,s=this.getProjection().fromLatLngToDivPixel(n);this.UpdatePosition(s.x-r/2,s.y-a/2,r,a)},t.prototype.OnLoad=function(){var e=this,t=this.getMap();this._zoomStart=t.getZoom();var n=t.getCenter();this._centerStart={latitude:n.lat(),longitude:n.lng()},this._viewChangeEndEvent=google.maps.event.addListener(t,"idle",function(t){e.UpdateCanvas()}),this._mapResizeEvent=google.maps.event.addListener(t,"resize",function(t){e.UpdateCanvas()})},t.prototype.SetMap=function(t){this.setMap(t)},t.prototype.SetCanvasElement=function(t){var e=this.getPanes();e&&(null!=t?e.overlayLayer.appendChild(t):e.overlayLayer.removeChild(this._canvas))},t.prototype.RemoveEventHandlers=function(){this._viewChangeEndEvent&&google.maps.event.removeListener(this._viewChangeEndEvent),this._mapResizeEvent&&google.maps.event.removeListener(this._mapResizeEvent)},t.prototype.Resize=function(){var t=this.getMap().getDiv();this._canvas.width=t.offsetWidth,this._canvas.height=t.offsetHeight},t.prototype.UpdateCanvas=function(){var t=this.getMap();this._canvas.style.display="";var e=t.getDiv(),n=e.offsetWidth,i=e.offsetHeight,o=this.getProjection().fromLatLngToDivPixel(t.getCenter());this.UpdatePosition(o.x-n/2,o.y-i/2,n,i),this.Redraw(!0),this._zoomStart=t.getZoom();var r=t.getCenter();this._centerStart={latitude:r.lat(),longitude:r.lng()}},t}(b);var F=function(){function t(){}return t.decorators=[{type:r.Injectable}],t}(),W=function(){function t(){}return t.GetRandonLocations=function(t,e){var n=[],i=function(t){var e=Math.random()*(t.maxLatitude-t.minLatitude)+t.minLatitude,n=0;return o?180<(n=Math.random()*(t.minLongitude+360-t.maxLongitude)+t.maxLongitude)&&(n-=360):n=Math.random()*(t.maxLongitude-t.minLongitude)+t.minLongitude,{latitude:e,longitude:n}},o=!1;if(null==e&&(e={maxLatitude:360,minLatitude:0,maxLongitude:170,minLongitude:0}),(e.center.longitude<e.minLongitude||e.center.longitude>e.maxLongitude)&&(o=!0),!t||t<=0)return[i(e)];for(var r=0;r<t;r++)n.push(i(e));return n},t.decorators=[{type:r.Injectable}],t}(),U=function(){function t(){}return t.decorators=[{type:r.Injectable}],t}(),q=function(){function t(){}return t.decorators=[{type:r.Injectable}],t}(),Y=function(){function t(){}return t.decorators=[{type:r.Injectable}],t}(),K=function(){function t(){}return t.decorators=[{type:r.Injectable}],t}(),X=function(){function t(){}return t.decorators=[{type:r.Injectable}],t}(),J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.decorators=[{type:r.Injectable}],e}(Y),Q=function(){function t(){this.ActionClicked=new r.EventEmitter}return t.decorators=[{type:r.Directive,args:[{selector:"x-info-box-action"}]}],t.propDecorators={Label:[{type:r.Input}],ActionClicked:[{type:r.Output}]},t}(),$=0,tt=function(){function t(t){this._infoBoxService=t,this._infoBoxAddedToManager=!1,this._id=($++).toString(),this.Modal=!0,this.Visible=!1,this.CloseInfoBoxesOnOpen=!0,this.InfoBoxClose=new r.EventEmitter}return Object.defineProperty(t.prototype,"HtmlContent",{get:function(){return this._content.nativeElement&&this._content.nativeElement.innerText&&""!==this._content.nativeElement.innerText.trim()?this._content.nativeElement.outerHTML:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.prototype.Close=function(){var t=this;return this._infoBoxService.Close(this).then(function(){t.InfoBoxClose.emit(t._id)})},t.prototype.ngAfterViewInit=function(){this._infoBoxService.AddInfoWindow(this),this._infoBoxAddedToManager=!0,this.HandleEvents()},t.prototype.ngOnChanges=function(t){this._infoBoxAddedToManager&&((t.latitude||t.longitude)&&"number"==typeof this.Latitude&&"number"==typeof this.Longitude&&this._infoBoxService.SetPosition(this,{latitude:t.latitude.currentValue,longitude:t.longitude.currentValue}),this.SetInfoWindowOptions(t))},t.prototype.ngOnDestroy=function(){this._infoBoxService.DeleteInfoWindow(this)},t.prototype.Open=function(t){return this._infoBoxService.Open(this,t)},t.prototype.ToString=function(){return"InfoBoxComponent-"+this._id},t.prototype.HandleEvents=function(){var e=this;this._infoBoxService.CreateEventObservable("infowindowclose",this).subscribe(function(t){e.InfoBoxClose.emit(e._id)})},t.prototype.SetInfoWindowOptions=function(t){var e={};t.title&&(e.title=this.Title),t.description&&(e.description=this.Description),t.disableAutoPan&&(e.disableAutoPan=this.DisableAutoPan),t.visible&&(e.visible=this.Visible),(t.xOffset||t.yOffset)&&(null==e.pixelOffset&&(e.pixelOffset={x:0,y:0}),e.pixelOffset.x=this.xOffset,e.pixelOffset.y=this.yOffset),this._infoBoxService.SetOptions(this,e)},t.decorators=[{type:r.Component,args:[{selector:"x-info-box",template:"\n        <div #infoBoxContent class='info-box-content'>\n            <ng-content></ng-content>\n        </div>",styles:["\n        x-map .MicrosoftMap .Infobox .infobox-title { padding: 10px 10px 5px 10px }\n        x-map .MicrosoftMap .Infobox .infobox-info { padding: 3px 10px 10px 10px }\n        x-map .MicrosoftMap .Infobox .infobox-actions { height: auto }\n    "],encapsulation:r.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:q}]},t.propDecorators={_content:[{type:r.ViewChild,args:["infoBoxContent"]}],InfoWindowActions:[{type:r.ContentChildren,args:[Q]}],Latitude:[{type:r.Input}],Longitude:[{type:r.Input}],Title:[{type:r.Input}],Description:[{type:r.Input}],DisableAutoPan:[{type:r.Input}],MaxWidth:[{type:r.Input}],Modal:[{type:r.Input}],HostMarker:[{type:r.Input}],Visible:[{type:r.Input}],xOffset:[{type:r.Input}],yOffset:[{type:r.Input}],CloseInfoBoxesOnOpen:[{type:r.Input}],InfoBoxClose:[{type:r.Output}]},t}(),et=0,nt=function(){function t(t,e){this._markerService=t,this._containerRef=e,this._clickTimeout=null,this._events=[],this._inClusterLayer=!1,this._inCustomLayer=!1,this._markerAddedToManger=!1,this.DblClick=new r.EventEmitter,this.Drag=new r.EventEmitter,this.DragEnd=new r.EventEmitter,this.Draggable=!1,this.DragStart=new r.EventEmitter,this.DynamicMarkerCreated=new r.EventEmitter,this.IsFirstInSet=!1,this.IsLastInSet=!0,this.MarkerClick=new r.EventEmitter,this.Metadata=new Map,this.MouseDown=new r.EventEmitter,this.MouseMove=new r.EventEmitter,this.MouseOut=new r.EventEmitter,this.MouseOver=new r.EventEmitter,this.MouseUp=new r.EventEmitter,this.RightClick=new r.EventEmitter,this._id=(et++).toString()}return Object.defineProperty(t.prototype,"AddedToManager",{get:function(){return this._markerAddedToManger},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"InClusterLayer",{get:function(){return this._inClusterLayer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"InCustomLayer",{get:function(){return this._inCustomLayer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"LayerId",{get:function(){return this._layerId},enumerable:!0,configurable:!0}),t.prototype.LocationToPixel=function(t){return this._markerService.LocationToPoint(t||this)},t.prototype.ngAfterContentInit=function(){if(null!=this._infoBox&&(this._infoBox.HostMarker=this),this._containerRef.element.nativeElement.parentElement){var t=this._containerRef.element.nativeElement.parentElement.tagName;"x-cluster-layer"===t.toLowerCase()?this._inClusterLayer=!0:"x-map-layer"===t.toLowerCase()&&(this._inCustomLayer=!0),this._layerId=Number(this._containerRef.element.nativeElement.parentElement.attributes.layerId)}this._markerAddedToManger||(this._markerService.AddMarker(this),this._markerAddedToManger=!0,this.AddEventListeners())},t.prototype.ngOnChanges=function(t){"number"==typeof this.Latitude&&"number"==typeof this.Longitude&&this._markerAddedToManger&&((t.Latitude||t.Longitude)&&this._markerService.UpdateMarkerPosition(this),t.Title&&this._markerService.UpdateTitle(this),t.Label&&this._markerService.UpdateLabel(this),t.Draggable&&this._markerService.UpdateDraggable(this),(t.IconUrl||t.IconInfo)&&this._markerService.UpdateIcon(this),t.Anchor&&this._markerService.UpdateAnchor(this),t.Visible&&this._markerService.UpdateVisible(this))},t.prototype.ngOnDestroy=function(){this._markerService.DeleteMarker(this),this._events.forEach(function(t){return t.unsubscribe()})},t.prototype.toString=function(){return"MapMarker-"+this._id.toString()},t.prototype.AddEventListeners=function(){var n=this,i=function(t){return{Marker:n,Click:t,Location:n._markerService.GetCoordinatesFromClick(t),Pixels:n._markerService.GetPixelsFromClick(t)}};this._events.push(this._markerService.CreateEventObservable("click",this).subscribe(function(e){n._clickTimeout=a.timer(300).subscribe(function(t){null!=n._infoBox&&n._infoBox.Open(n._markerService.GetCoordinatesFromClick(e)),n.MarkerClick.emit(i(e))})})),this._events.push(this._markerService.CreateEventObservable("dblclick",this).subscribe(function(t){n._clickTimeout&&(n._clickTimeout.unsubscribe(),n._clickTimeout=null),n.DblClick.emit(i(t))})),[{name:"drag",handler:function(t){return n.Drag.emit(i(t))}},{name:"dragend",handler:function(t){return n.DragEnd.emit(i(t))}},{name:"dragstart",handler:function(t){return n.DragStart.emit(i(t))}},{name:"mousedown",handler:function(t){return n.MouseDown.emit(i(t))}},{name:"mousemove",handler:function(t){return n.MouseMove.emit(i(t))}},{name:"mouseout",handler:function(t){return n.MouseOut.emit(i(t))}},{name:"mouseover",handler:function(t){return n.MouseOver.emit(i(t))}},{name:"mouseup",handler:function(t){return n.MouseUp.emit(i(t))}},{name:"rightclick",handler:function(t){return n.RightClick.emit(i(t))}}].forEach(function(t){var e=n._markerService.CreateEventObservable(t.name,n).subscribe(t.handler);n._events.push(e)})},t.decorators=[{type:r.Directive,args:[{selector:"x-map-marker"}]}],t.ctorParameters=function(){return[{type:U},{type:r.ViewContainerRef}]},t.propDecorators={_infoBox:[{type:r.ContentChild,args:[tt]}],Anchor:[{type:r.Input}],DblClick:[{type:r.Output}],Drag:[{type:r.Output}],DragEnd:[{type:r.Output}],Draggable:[{type:r.Input}],DragStart:[{type:r.Output}],DynamicMarkerCreated:[{type:r.Output}],Height:[{type:r.Input}],IconInfo:[{type:r.Input}],IconUrl:[{type:r.Input}],IsFirstInSet:[{type:r.Input}],IsLastInSet:[{type:r.Input}],Label:[{type:r.Input}],Latitude:[{type:r.Input}],Longitude:[{type:r.Input}],MarkerClick:[{type:r.Output}],Metadata:[{type:r.Input}],MouseDown:[{type:r.Output}],MouseMove:[{type:r.Output}],MouseOut:[{type:r.Output}],MouseOver:[{type:r.Output}],MouseUp:[{type:r.Output}],RightClick:[{type:r.Output}],Title:[{type:r.Input}],Visible:[{type:r.Input}],Width:[{type:r.Input}]},t}(),it=function(){function t(t,e){this._mapService=t,this._zone=e,this._longitude=0,this._latitude=0,this._zoom=0,this._options={},this._box=null,this._containerClass=!0,this.BoundsChange=new r.EventEmitter,this.CenterChange=new r.EventEmitter,this.MapClick=new r.EventEmitter,this.MapDblClick=new r.EventEmitter,this.MapRightClick=new r.EventEmitter,this.MapMouseOver=new r.EventEmitter,this.MapMouseOut=new r.EventEmitter,this.MapMouseMove=new r.EventEmitter,this.MapPromise=new r.EventEmitter,this.ZoomChange=new r.EventEmitter,this.MapService=new r.EventEmitter}return Object.defineProperty(t.prototype,"Box",{get:function(){return this._box},set:function(t){this._box=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Latitude",{get:function(){return this._longitude},set:function(t){this._latitude=this.ConvertToDecimal(t),this.UpdateCenter()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Longitude",{get:function(){return this._longitude},set:function(t){this._longitude=this.ConvertToDecimal(t),this.UpdateCenter()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Options",{get:function(){return this._options},set:function(t){this._options=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Zoom",{get:function(){return this._zoom},set:function(t){this._zoom=this.ConvertToDecimal(t,8),"number"==typeof this._zoom&&this._mapService.SetZoom(this._zoom)},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this.InitMapInstance(this._container.nativeElement),this.MapPromise.emit(this._mapService.MapPromise),this.MapService.emit(this._mapService)},t.prototype.ngOnChanges=function(t){this._mapPromise&&(t.Box&&null!=this._box&&this._mapService.SetViewOptions({bounds:this._box}),t.Options&&this._mapService.SetMapOptions(this._options))},t.prototype.ngOnDestroy=function(){this._mapService.DisposeMap()},t.prototype.TriggerResize=function(){var e=this;return new Promise(function(t){setTimeout(function(){return e._mapService.TriggerMapEvent("resize").then(function(){return t()})})})},t.prototype.ConvertToDecimal=function(t,e){return void 0===e&&(e=null),"string"==typeof t?parseFloat(t):"number"==typeof t?t:e},t.prototype.HandleMapClickEvents=function(){var e=this;this._mapService.SubscribeToMapEvent("click").subscribe(function(t){e._clickTimeout=setTimeout(function(){e.MapClick.emit(t)},300)}),this._mapService.SubscribeToMapEvent("dblclick").subscribe(function(t){e._clickTimeout&&clearTimeout(e._clickTimeout),e.MapDblClick.emit(t)}),this._mapService.SubscribeToMapEvent("rightclick").subscribe(function(t){e.MapRightClick.emit(t)}),this._mapService.SubscribeToMapEvent("mouseover").subscribe(function(t){e.MapMouseOver.emit(t)}),this._mapService.SubscribeToMapEvent("mouseout").subscribe(function(t){e.MapMouseOut.emit(t)}),this._mapService.SubscribeToMapEvent("mousemove").subscribe(function(t){e.MapMouseMove.emit(t)})},t.prototype.HandleMapBoundsChange=function(){var e=this;this._mapService.SubscribeToMapEvent("boundschanged").subscribe(function(){e._mapService.GetBounds().then(function(t){e.BoundsChange.emit(t)})})},t.prototype.HandleMapCenterChange=function(){var e=this;this._mapService.SubscribeToMapEvent("centerchanged").subscribe(function(){e._mapService.GetCenter().then(function(t){e._latitude===t.latitude&&e._longitude===t.longitude||(e._latitude=t.latitude,e._longitude=t.longitude,e.CenterChange.emit({latitude:e._latitude,longitude:e._longitude}))})})},t.prototype.HandleMapZoomChange=function(){var e=this;this._mapService.SubscribeToMapEvent("zoomchanged").subscribe(function(){e._mapService.GetZoom().then(function(t){e._zoom!==t&&(e._zoom=t,e.ZoomChange.emit(t))})})},t.prototype.InitMapInstance=function(t){var e=this;this._zone.runOutsideAngular(function(){null==e._options.center&&(e._options.center={latitude:e._latitude,longitude:e._longitude}),null==e._options.zoom&&(e._options.zoom=e._zoom),null==e._options.mapTypeId&&(e._options.mapTypeId=s.hybrid),null!=e._box&&(e._options.bounds=e._box),e._mapPromise=e._mapService.CreateMap(t,e._options),e.HandleMapCenterChange(),e.HandleMapBoundsChange(),e.HandleMapZoomChange(),e.HandleMapClickEvents()})},t.prototype.UpdateCenter=function(){"number"==typeof this._latitude&&"number"==typeof this._longitude&&this._mapService.SetCenter({latitude:this._latitude,longitude:this._longitude})},t.decorators=[{type:r.Component,args:[{selector:"x-map",providers:[{provide:W,deps:[F],useFactory:st},{provide:U,deps:[F,W,Y,J],useFactory:lt},{provide:q,deps:[F,W,U],useFactory:rt},{provide:Y,deps:[F,W],useFactory:at},{provide:J,deps:[F,W],useFactory:ot},{provide:K,deps:[F,W,Y],useFactory:ut},{provide:X,deps:[F,W,Y],useFactory:ct}],template:"\n        <div #container class='map-container-inner'></div>\n        <div class='map-content'>\n            <ng-content></ng-content>\n        </div>\n    ",styles:["\n        .map-container-inner { width: inherit; height: inherit; }\n        .map-container-inner div { background-repeat: no-repeat; }\n        .map-content { display:none; }\n    "],encapsulation:r.ViewEncapsulation.None,changeDetection:r.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:W},{type:r.NgZone}]},t.propDecorators={_containerClass:[{type:r.HostBinding,args:["class.map-container"]}],_container:[{type:r.ViewChild,args:["container"]}],_markers:[{type:r.ContentChildren,args:[nt]}],Box:[{type:r.Input}],Latitude:[{type:r.Input}],Longitude:[{type:r.Input}],Options:[{type:r.Input}],Zoom:[{type:r.Input}],BoundsChange:[{type:r.Output}],CenterChange:[{type:r.Output}],MapClick:[{type:r.Output}],MapDblClick:[{type:r.Output}],MapRightClick:[{type:r.Output}],MapMouseOver:[{type:r.Output}],MapMouseOut:[{type:r.Output}],MapMouseMove:[{type:r.Output}],MapPromise:[{type:r.Output}],ZoomChange:[{type:r.Output}],MapService:[{type:r.Output}]},t}();function ot(t,e){return t.CreateClusterService(e)}function rt(t,e,n){return t.CreateInfoBoxService(e,n)}function at(t,e){return t.CreateLayerService(e)}function st(t){return t.Create()}function lt(t,e,n,i){return t.CreateMarkerService(e,n,i)}function ut(t,e,n){return t.CreatePolygonService(e,n)}function ct(t,e,n){return t.CreatePolylineService(e,n)}var pt=0,ht=function(){function t(t,e){this._layerService=t,this._containerRef=e,this._visible=!0,this._addedToManager=!1,this._id=pt++}return Object.defineProperty(t.prototype,"Visible",{get:function(){return this._visible},set:function(t){this._visible=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this._containerRef.element.nativeElement.attributes.layerId=this._id.toString(),this._layerService.AddLayer(this),this._addedToManager=!0},t.prototype.ngOnChanges=function(t){this._addedToManager&&t.Visible&&this._layerService.GetNativeLayer(this).then(function(t){t.SetVisible(!t.GetVisible())})},t.prototype.ngOnDestroy=function(){this._layerService.DeleteLayer(this)},t.decorators=[{type:r.Directive,args:[{selector:"x-map-layer"}]}],t.ctorParameters=function(){return[{type:Y},{type:r.ViewContainerRef}]},t.propDecorators={_markers:[{type:r.ContentChildren,args:[nt]}],Visible:[{type:r.Input}]},t}(),ft=function(i){function o(t,e){var n=i.call(this,t,e)||this;return n._clusteringEnabled=!0,n._clusterPlacementMode=g.MeanValue,n._clusterClickAction=v.ZoomIntoCluster,n._useDynamicSizeMarker=!1,n._dynamicMarkerBaseSize=18,n._dynamicMarkerRanges=new Map([[10,"rgba(20, 180, 20, 0.5)"],[100,"rgba(255, 210, 40, 0.5)"],[Number.MAX_SAFE_INTEGER,"rgba(255, 40, 40, 0.5)"]]),n._zoomOnClick=!0,n}return f(o,i),Object.defineProperty(o.prototype,"ClusterClickAction",{get:function(){return this._clusterClickAction},set:function(t){this._clusterClickAction=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"ClusteringEnabled",{get:function(){return this._clusteringEnabled},set:function(t){this._clusteringEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"ClusterPlacementMode",{get:function(){return this._clusterPlacementMode},set:function(t){this._clusterPlacementMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"CustomMarkerCallback",{get:function(){return this._iconCreationCallback},set:function(t){if(this._useDynamicSizeMarker)throw new Error("You cannot set a custom marker callback when UseDynamicSizeMarkers is set to true.\n                    Set UseDynamicSizeMakers to false.");this._iconCreationCallback=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"DynamicMarkerBaseSize",{get:function(){return this._dynamicMarkerBaseSize},set:function(t){this._dynamicMarkerBaseSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"DynamicMarkerRanges",{get:function(){return this._dynamicMarkerRanges},set:function(t){this._dynamicMarkerRanges=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"GridSize",{get:function(){return this._gridSize},set:function(t){this._gridSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"IconInfo",{get:function(){return this._iconInfo},set:function(t){this._iconInfo=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"LayerOffset",{get:function(){return this._layerOffset},set:function(t){this._layerOffset=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"MinimumClusterSize",{get:function(){return this._minimumClusterSize},set:function(t){this._minimumClusterSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"SpiderClusterOptions",{get:function(){return this._spiderClusterOptions},set:function(t){this._spiderClusterOptions=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"Styles",{get:function(){return this._styles},set:function(t){this._styles=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"UseDynamicSizeMarkers",{get:function(){return this._useDynamicSizeMarker},set:function(t){var n=this;(this._useDynamicSizeMarker=t)&&(this._iconCreationCallback=function(t,e){return o.CreateDynamicSizeMarker(t.length,e,n._dynamicMarkerBaseSize,n._dynamicMarkerRanges)})},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"ZIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"ZoomOnClick",{get:function(){return this._zoomOnClick},set:function(t){this._zoomOnClick=t},enumerable:!0,configurable:!0}),o.CreateDynamicSizeMarker=function(t,e,n,i){var o,r=n,a=.35*r,s=t,l=Math.log(s)/Math.log(10)*5+r,u=2*l;i.forEach(function(t,e){s<=e&&!o&&(o=t)}),o||(o="rgba(20, 180, 20, 0.5)");var c=["<svg xmlns='http://www.w3.org/2000/svg' width='"+u+"' height='"+u+"'>","<circle cx='"+l+"' cy='"+l+"' r='"+l+"' fill='"+o+"'/>","<circle cx='"+l+"' cy='"+l+"' r='"+(l-a)+"' fill='"+o+"'/>","</svg>"];return e.size={width:u,height:u},e.markerOffsetRatio={x:.5,y:.5},e.textOffset={x:0,y:l-8},c.join("")},o.prototype.ngOnChanges=function(t){if(this._addedToManager){if(t.ClusterClickAction)throw new Error("You cannot change the ClusterClickAction after the layer has been added to the layerservice.");var e={id:this._id};t.ClusteringEnabled&&(e.clusteringEnabled=this._clusteringEnabled),t.GridSize&&(e.gridSize=this._gridSize),t.LayerOffset&&(e.layerOffset=this._layerOffset),t.SpiderClusterOptions&&(e.spiderClusterOptions=this._spiderClusterOptions),t.ZIndex&&(e.zIndex=this._zIndex),t.Visible&&(e.visible=this._visible),this._layerService.GetNativeLayer(this).then(function(t){t.SetOptions(e)})}},o.decorators=[{type:r.Directive,args:[{selector:"x-cluster-layer"}]}],o.ctorParameters=function(){return[{type:J},{type:r.ViewContainerRef}]},o.propDecorators={ClusterClickAction:[{type:r.Input}],ClusteringEnabled:[{type:r.Input}],ClusterPlacementMode:[{type:r.Input}],CustomMarkerCallback:[{type:r.Input}],DynamicMarkerBaseSize:[{type:r.Input}],DynamicMarkerRanges:[{type:r.Input}],GridSize:[{type:r.Input}],IconInfo:[{type:r.Input}],LayerOffset:[{type:r.Input}],MinimumClusterSize:[{type:r.Input}],SpiderClusterOptions:[{type:r.Input}],Styles:[{type:r.Input}],UseDynamicSizeMarkers:[{type:r.Input}],ZIndex:[{type:r.Input}],ZoomOnClick:[{type:r.Input}]},o}(ht),dt=0,yt=function(){function t(t,e){this._polygonService=t,this._containerRef=e,this._inCustomLayer=!1,this._addedToService=!1,this._events=[],this.Clickable=!0,this.Draggable=!1,this.Editable=!1,this.Geodesic=!1,this.Metadata=new Map,this.Paths=[],this.ShowTooltip=!0,this.Click=new r.EventEmitter,this.DblClick=new r.EventEmitter,this.Drag=new r.EventEmitter,this.DragEnd=new r.EventEmitter,this.DragStart=new r.EventEmitter,this.MouseDown=new r.EventEmitter,this.MouseMove=new r.EventEmitter,this.MouseOut=new r.EventEmitter,this.MouseOver=new r.EventEmitter,this.MouseUp=new r.EventEmitter,this.RightClick=new r.EventEmitter,this.PathChanged=new r.EventEmitter,this._id=dt++}return Object.defineProperty(t.prototype,"AddedToService",{get:function(){return this._addedToService},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"IdAsString",{get:function(){return this._id.toString()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"InCustomLayer",{get:function(){return this._inCustomLayer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"LayerId",{get:function(){return this._layerId},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){this._containerRef.element.nativeElement.parentElement&&("x-map-layer"===this._containerRef.element.nativeElement.parentElement.tagName.toLowerCase()&&(this._inCustomLayer=!0,this._layerId=Number(this._containerRef.element.nativeElement.parentElement.attributes.layerId)));this._addedToService||(this._polygonService.AddPolygon(this),this._addedToService=!0,this.AddEventListeners())},t.prototype.ngOnChanges=function(t){if(this._addedToService){var e=this.GeneratePolygonChangeSet(t);null!=e&&this._polygonService.SetOptions(this,e),t.Paths&&!t.Paths.isFirstChange()&&this._polygonService.UpdatePolygon(this)}},t.prototype.ngOnDestroy=function(){this._polygonService.DeletePolygon(this),this._events.forEach(function(t){return t.unsubscribe()})},t.prototype.AddEventListeners=function(){var n=this,e=function(t){return{Polygon:n,Click:t}};this._events.push(this._polygonService.CreateEventObservable("click",this).subscribe(function(t){null!=n._infoBox&&n._infoBox.Open(n._polygonService.GetCoordinatesFromClick(t)),n.Click.emit(e(t))})),[{name:"dblclick",handler:function(t){return n.DblClick.emit(e(t))}},{name:"drag",handler:function(t){return n.Drag.emit(e(t))}},{name:"dragend",handler:function(t){return n.DragEnd.emit(e(t))}},{name:"dragstart",handler:function(t){return n.DragStart.emit(e(t))}},{name:"mousedown",handler:function(t){return n.MouseDown.emit(e(t))}},{name:"mousemove",handler:function(t){return n.MouseMove.emit(e(t))}},{name:"mouseout",handler:function(t){return n.MouseOut.emit(e(t))}},{name:"mouseover",handler:function(t){return n.MouseOver.emit(e(t))}},{name:"mouseup",handler:function(t){return n.MouseUp.emit(e(t))}},{name:"rightclick",handler:function(t){return n.RightClick.emit(e(t))}},{name:"pathchanged",handler:function(t){return n.PathChanged.emit(t)}}].forEach(function(t){var e=n._polygonService.CreateEventObservable(t.name,n).subscribe(t.handler);n._events.push(e)})},t.prototype.GeneratePolygonChangeSet=function(t){var e={id:this._id},n=!1;return t.Clickable&&(e.clickable=this.Clickable,n=!0),t.Draggable&&(e.draggable=this.Draggable,n=!0),t.Editable&&(e.editable=this.Editable,n=!0),(t.FillColor||t.FillOpacity)&&(e.fillColor=this.FillColor,e.fillOpacity=this.FillOpacity,n=!0),t.Geodesic&&(e.geodesic=this.Geodesic,n=!0),t.LabelMaxZoom&&(e.labelMaxZoom=this.LabelMaxZoom,n=!0),t.LabelMinZoom&&(e.labelMinZoom=this.LabelMinZoom,n=!0),t.ShowTooltip&&(e.showTooltip=this.ShowTooltip,n=!0),t.ShowLabel&&(e.showLabel=this.ShowLabel,n=!0),(t.StrokeColor||t.StrokeOpacity)&&(e.strokeColor=this.StrokeColor,e.strokeOpacity=this.StrokeOpacity,n=!0),t.StrokeWeight&&(e.strokeWeight=this.StrokeWeight,n=!0),t.Title&&(e.title=this.Title,n=!0),t.Visible&&(e.visible=this.Visible,n=!0),t.zIndex&&(e.zIndex=this.zIndex,n=!0),n?e:null},t.decorators=[{type:r.Directive,args:[{selector:"x-map-polygon"}]}],t.ctorParameters=function(){return[{type:K},{type:r.ViewContainerRef}]},t.propDecorators={_infoBox:[{type:r.ContentChild,args:[tt]}],Clickable:[{type:r.Input}],Draggable:[{type:r.Input}],Editable:[{type:r.Input}],FillColor:[{type:r.Input}],FillOpacity:[{type:r.Input}],Geodesic:[{type:r.Input}],LabelMaxZoom:[{type:r.Input}],LabelMinZoom:[{type:r.Input}],Metadata:[{type:r.Input}],Paths:[{type:r.Input}],ShowLabel:[{type:r.Input}],ShowTooltip:[{type:r.Input}],StrokeColor:[{type:r.Input}],StrokeOpacity:[{type:r.Input}],StrokeWeight:[{type:r.Input}],Title:[{type:r.Input}],Visible:[{type:r.Input}],zIndex:[{type:r.Input}],Click:[{type:r.Output}],DblClick:[{type:r.Output}],Drag:[{type:r.Output}],DragEnd:[{type:r.Output}],DragStart:[{type:r.Output}],MouseDown:[{type:r.Output}],MouseMove:[{type:r.Output}],MouseOut:[{type:r.Output}],MouseOver:[{type:r.Output}],MouseUp:[{type:r.Output}],RightClick:[{type:r.Output}],PathChanged:[{type:r.Output}]},t}(),mt=0,gt=function(){function t(t,e){this._polylineService=t,this._containerRef=e,this._inCustomLayer=!1,this._addedToService=!1,this._events=[],this.Clickable=!0,this.Draggable=!1,this.Editable=!1,this.Geodesic=!1,this.Metadata=new Map,this.Path=[],this.ShowTooltip=!0,this.Click=new r.EventEmitter,this.DblClick=new r.EventEmitter,this.Drag=new r.EventEmitter,this.DragEnd=new r.EventEmitter,this.DragStart=new r.EventEmitter,this.MouseDown=new r.EventEmitter,this.MouseMove=new r.EventEmitter,this.MouseOut=new r.EventEmitter,this.MouseOver=new r.EventEmitter,this.MouseUp=new r.EventEmitter,this.RightClick=new r.EventEmitter,this._id=mt++}return Object.defineProperty(t.prototype,"AddedToService",{get:function(){return this._addedToService},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"IdAsString",{get:function(){return this._id.toString()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"InCustomLayer",{get:function(){return this._inCustomLayer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"LayerId",{get:function(){return this._layerId},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){this._containerRef.element.nativeElement.parentElement&&("x-map-layer"===this._containerRef.element.nativeElement.parentElement.tagName.toLowerCase()&&(this._inCustomLayer=!0,this._layerId=Number(this._containerRef.element.nativeElement.parentElement.attributes.layerId)));this._addedToService||(this._polylineService.AddPolyline(this),this._addedToService=!0,this.AddEventListeners())},t.prototype.ngOnChanges=function(t){if(this._addedToService){var e=this.GeneratePolylineChangeSet(t);null!=e&&this._polylineService.SetOptions(this,e),t.Path&&!t.Path.isFirstChange()&&this._polylineService.UpdatePolyline(this)}},t.prototype.ngOnDestroy=function(){this._polylineService.DeletePolyline(this),this._events.forEach(function(t){return t.unsubscribe()})},t.prototype.AddEventListeners=function(){var n=this,e=function(t){return{Polyline:n,Click:t}};this._polylineService.CreateEventObservable("click",this).subscribe(function(t){null!=n._infoBox&&n._infoBox.Open(n._polylineService.GetCoordinatesFromClick(t)),n.Click.emit(e(t))}),[{name:"dblclick",handler:function(t){return n.DblClick.emit(e(t))}},{name:"drag",handler:function(t){return n.Drag.emit(e(t))}},{name:"dragend",handler:function(t){return n.DragEnd.emit(e(t))}},{name:"dragstart",handler:function(t){return n.DragStart.emit(e(t))}},{name:"mousedown",handler:function(t){return n.MouseDown.emit(e(t))}},{name:"mousemove",handler:function(t){return n.MouseMove.emit(e(t))}},{name:"mouseout",handler:function(t){return n.MouseOut.emit(e(t))}},{name:"mouseover",handler:function(t){return n.MouseOver.emit(e(t))}},{name:"mouseup",handler:function(t){return n.MouseUp.emit(e(t))}},{name:"rightclick",handler:function(t){return n.RightClick.emit(e(t))}}].forEach(function(t){var e=n._polylineService.CreateEventObservable(t.name,n).subscribe(t.handler);n._events.push(e)})},t.prototype.GeneratePolylineChangeSet=function(t){var e={id:this._id},n=!1;return t.Clickable&&(e.clickable=this.Clickable,n=!0),t.Draggable&&(e.draggable=this.Draggable,n=!0),t.Editable&&(e.editable=this.Editable,n=!0),t.Geodesic&&(e.geodesic=this.Geodesic,n=!0),t.ShowTooltip&&(e.showTooltip=this.ShowTooltip,n=!0),t.StrokeColor&&(e.strokeColor=this.StrokeColor,n=!0),t.StrokeOpacity&&(e.strokeOpacity=this.StrokeOpacity,n=!0),t.StrokeWeight&&(e.strokeWeight=this.StrokeWeight,n=!0),t.Title&&(e.title=this.Title,n=!0),t.Visible&&(e.visible=this.Visible,n=!0),t.zIndex&&(e.zIndex=this.zIndex,n=!0),n?e:null},t.decorators=[{type:r.Directive,args:[{selector:"x-map-polyline"}]}],t.ctorParameters=function(){return[{type:X},{type:r.ViewContainerRef}]},t.propDecorators={_infoBox:[{type:r.ContentChild,args:[tt]}],Clickable:[{type:r.Input}],Draggable:[{type:r.Input}],Editable:[{type:r.Input}],Geodesic:[{type:r.Input}],Metadata:[{type:r.Input}],Path:[{type:r.Input}],ShowTooltip:[{type:r.Input}],StrokeColor:[{type:r.Input}],StrokeOpacity:[{type:r.Input}],StrokeWeight:[{type:r.Input}],Title:[{type:r.Input}],Visible:[{type:r.Input}],zIndex:[{type:r.Input}],Click:[{type:r.Output}],DblClick:[{type:r.Output}],Drag:[{type:r.Output}],DragEnd:[{type:r.Output}],DragStart:[{type:r.Output}],MouseDown:[{type:r.Output}],MouseMove:[{type:r.Output}],MouseOut:[{type:r.Output}],MouseOver:[{type:r.Output}],MouseUp:[{type:r.Output}],RightClick:[{type:r.Output}]},t}(),vt=1e6,_t=function(){function t(t,e,n,i,o){this._markerService=t,this._layerService=e,this._clusterService=n,this._mapService=i,this._zone=o,this._useDynamicSizeMarker=!1,this._dynamicMarkerBaseSize=18,this._dynamicMarkerRanges=new Map([[10,"rgba(20, 180, 20, 0.5)"],[100,"rgba(255, 210, 40, 0.5)"],[Number.MAX_SAFE_INTEGER,"rgba(255, 40, 40, 0.5)"]]),this._streaming=!1,this._markers=new Array,this._markersLast=new Array,this.ClusterClickAction=v.ZoomIntoCluster,this.ClusterPlacementMode=g.MeanValue,this.EnableClustering=!1,this.GridSize=150,this.LayerOffset=null,this.ZIndex=0,this.ZoomOnClick=!0,this.DynamicMarkerCreated=new r.EventEmitter,this.MarkerClick=new r.EventEmitter,this.DragEnd=new r.EventEmitter,this._id=vt++}return Object.defineProperty(t.prototype,"CustomMarkerCallback",{get:function(){return this._iconCreationCallback},set:function(t){if(this._useDynamicSizeMarker)throw new Error("You cannot set a custom marker callback when UseDynamicSizeMarkers is set to true.\n                    Set UseDynamicSizeMakers to false.");this._iconCreationCallback=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"DynamicMarkerBaseSize",{get:function(){return this._dynamicMarkerBaseSize},set:function(t){this._dynamicMarkerBaseSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"DynamicMarkerRanges",{get:function(){return this._dynamicMarkerRanges},set:function(t){this._dynamicMarkerRanges=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"MarkerOptions",{get:function(){return this._markers},set:function(t){var e,n;this._streaming?((e=this._markersLast).push.apply(e,y(t.slice(0))),(n=this._markers).push.apply(n,y(t))):this._markers=t.slice(0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Styles",{get:function(){return this._styles},set:function(t){this._styles=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"TreatNewMarkerOptionsAsStream",{get:function(){return this._streaming},set:function(t){this._streaming=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"UseDynamicSizeMarkers",{get:function(){return this._useDynamicSizeMarker},set:function(t){var n=this;(this._useDynamicSizeMarker=t)&&(this._iconCreationCallback=function(t,e){return ft.CreateDynamicSizeMarker(t.length,e,n._dynamicMarkerBaseSize,n._dynamicMarkerRanges)})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.prototype.LocationToPixel=function(t){return this._markerService.LocationToPoint(t)},t.prototype.ngAfterContentInit=function(){var e=this;this._id;this._zone.runOutsideAngular(function(){var t={Id:e._id,Visible:e.Visible};e.EnableClustering?(t.LayerOffset=e.LayerOffset,t.ZIndex=e.ZIndex,t.ClusteringEnabled=e.EnableClustering,t.ClusterPlacementMode=e.ClusterPlacementMode,t.GridSize=e.GridSize,t.ClusterClickAction=e.ClusterClickAction,t.IconInfo=e.ClusterIconInfo,t.CustomMarkerCallback=e.CustomMarkerCallback,t.UseDynamicSizeMarkers=e.UseDynamicSizeMarkers,e._clusterService.AddLayer(t),e._layerPromise=e._clusterService.GetNativeLayer(t),e._service=e._clusterService):(e._layerService.AddLayer(t),e._layerPromise=e._layerService.GetNativeLayer(t),e._service=e._layerService),e._layerPromise.then(function(t){t.SetVisible(e.Visible),e.MarkerOptions&&e._zone.runOutsideAngular(function(){return e.UpdateMarkers()})})})},t.prototype.ngOnDestroy=function(){this._layerPromise.then(function(t){t.Delete()})},t.prototype.ngOnChanges=function(t){var e=this,n=!1,i={id:this._id};if(t.MarkerOptions&&this._zone.runOutsideAngular(function(){e.UpdateMarkers()}),t.Visible&&!t.Visible.firstChange&&this._zone.runOutsideAngular(function(){e._layerPromise.then(function(t){return t.SetVisible(e.Visible)})}),t.EnableClustering&&!t.EnableClustering.firstChange){if(!("StopClustering"in this._service))throw new Error("You cannot change EnableClustering after the layer has been created.");i.clusteringEnabled=this.EnableClustering,n=!0}if(t.ClusterPlacementMode&&!t.ClusterPlacementMode.firstChange&&"StopClustering"in this._service&&(i.placementMode=this.ClusterPlacementMode,n=!0),t.GridSize&&!t.GridSize.firstChange&&"StopClustering"in this._service&&(i.gridSize=this.GridSize,n=!0),t.ClusterClickAction&&!t.ClusterClickAction.firstChange&&"StopClustering"in this._service&&(i.zoomOnClick=this.ClusterClickAction===v.ZoomIntoCluster,n=!0),t.ZIndex&&!t.ZIndex.firstChange||t.LayerOffset&&!t.LayerOffset.firstChange||t.IconInfo&&!t.IconInfo.firstChange)throw new Error("You cannot change ZIndex or LayerOffset after the layer has been created.");n&&this._zone.runOutsideAngular(function(){e._id;e._layerPromise.then(function(t){return t.SetOptions(i)})})},t.prototype.toString=function(){return"MapMarkerLayer-"+this._id.toString()},t.prototype.AddEventListeners=function(e){var n=this;e.AddListener("click",function(t){return n.MarkerClick.emit({Marker:e,Click:t,Location:n._markerService.GetCoordinatesFromClick(t),Pixels:n._markerService.GetPixelsFromClick(t)})}),e.AddListener("dragend",function(t){return n.DragEnd.emit({Marker:e,Click:t,Location:n._markerService.GetCoordinatesFromClick(t),Pixels:n._markerService.GetPixelsFromClick(t)})})},t.prototype.UpdateMarkers=function(){var n=this;null!=this._layerPromise&&this._layerPromise.then(function(e){var t=n._streaming?n._markersLast.splice(0):n._markers;n._service.CreateMarkers(t,n.IconInfo).then(function(t){t.forEach(function(t){n.AddEventListeners(t)}),n._streaming?e.AddEntities(t):e.SetEntities(t)})})},t.decorators=[{type:r.Directive,args:[{selector:"x-map-marker-layer"}]}],t.ctorParameters=function(){return[{type:U},{type:Y},{type:J},{type:W},{type:r.NgZone}]},t.propDecorators={ClusterClickAction:[{type:r.Input}],ClusterIconInfo:[{type:r.Input}],ClusterPlacementMode:[{type:r.Input}],CustomMarkerCallback:[{type:r.Input}],DynamicMarkerBaseSize:[{type:r.Input}],DynamicMarkerRanges:[{type:r.Input}],EnableClustering:[{type:r.Input}],GridSize:[{type:r.Input}],IconInfo:[{type:r.Input}],LayerOffset:[{type:r.Input}],MarkerOptions:[{type:r.Input}],Styles:[{type:r.Input}],TreatNewMarkerOptionsAsStream:[{type:r.Input}],UseDynamicSizeMarkers:[{type:r.Input}],Visible:[{type:r.Input}],ZIndex:[{type:r.Input}],ZoomOnClick:[{type:r.Input}],DynamicMarkerCreated:[{type:r.Output}],MarkerClick:[{type:r.Output}],DragEnd:[{type:r.Output}]},t}(),bt=1e6,Mt=function(){function t(t,e,n){this._layerService=t,this._mapService=e,this._zone=n,this._labels=new Array,this._tooltipSubscriptions=new Array,this._tooltipVisible=!1,this._defaultOptions={fontSize:11,fontFamily:"sans-serif",strokeWeight:2,strokeColor:"#000000",fontColor:"#ffffff"},this._streaming=!1,this._polygons=new Array,this._polygonsLast=new Array,this.LabelMaxZoom=Number.MAX_SAFE_INTEGER,this.LabelMinZoom=-1,this.LayerOffset=null,this.ShowLabels=!1,this.ShowTooltips=!0,this.ZIndex=0,this.PolygonClick=new r.EventEmitter,this.PolygonDblClick=new r.EventEmitter,this.PolygonMouseMove=new r.EventEmitter,this.PolygonMouseOut=new r.EventEmitter,this.PolygonMouseOver=new r.EventEmitter,this._id=bt++}return Object.defineProperty(t.prototype,"PolygonOptions",{get:function(){return this._polygons},set:function(t){var e,n;this._streaming?((e=this._polygonsLast).push.apply(e,y(t.slice(0))),(n=this._polygons).push.apply(n,y(t))):this._polygons=t.slice(0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"TreatNewPolygonOptionsAsStream",{get:function(){return this._streaming},set:function(t){this._streaming=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){var e=this;this._id;this._zone.runOutsideAngular(function(){var t={Id:e._id,Visible:e.Visible,LayerOffset:e.LayerOffset,ZIndex:e.ZIndex};e._layerService.AddLayer(t),e._layerPromise=e._layerService.GetNativeLayer(t),Promise.all([e._layerPromise,e._mapService.CreateCanvasOverlay(function(t){return e.DrawLabels(t)})]).then(function(t){t[0].SetVisible(e.Visible),e._canvas=t[1],e._canvas._canvasReady.then(function(t){e._tooltip=e._canvas.GetToolTipOverlay(),e.ManageTooltip(e.ShowTooltips)}),e.PolygonOptions&&e._zone.runOutsideAngular(function(){return e.UpdatePolygons()})}),e._service=e._layerService})},t.prototype.ngOnDestroy=function(){this._tooltipSubscriptions.forEach(function(t){return t.unsubscribe()}),this._layerPromise.then(function(t){t.Delete()}),this._canvas&&this._canvas.Delete()},t.prototype.ngOnChanges=function(t){var e=this;if(t.PolygonOptions&&this._zone.runOutsideAngular(function(){e.UpdatePolygons()}),t.Visible&&!t.Visible.firstChange&&this._layerPromise.then(function(t){return t.SetVisible(e.Visible)}),t.ZIndex&&!t.ZIndex.firstChange||t.LayerOffset&&!t.LayerOffset.firstChange)throw new Error("You cannot change ZIndex or LayerOffset after the layer has been created.");(t.ShowLabels&&!t.ShowLabels.firstChange||t.LabelMinZoom&&!t.LabelMinZoom.firstChange||t.LabelMaxZoom&&!t.LabelMaxZoom.firstChange)&&this._canvas&&this._canvas.Redraw(!0),t.ShowTooltips&&this._tooltip&&this.ManageTooltip(t.ShowTooltips.currentValue)},t.prototype.toString=function(){return"MapPolygonLayer-"+this._id.toString()},t.prototype.AddEventListeners=function(e){var n=this;[{name:"click",handler:function(t){return n.PolygonClick.emit({Polygon:e,Click:t})}},{name:"dblclick",handler:function(t){return n.PolygonDblClick.emit({Polygon:e,Click:t})}},{name:"mousemove",handler:function(t){return n.PolygonMouseMove.emit({Polygon:e,Click:t})}},{name:"mouseout",handler:function(t){return n.PolygonMouseOut.emit({Polygon:e,Click:t})}},{name:"mouseover",handler:function(t){return n.PolygonMouseOver.emit({Polygon:e,Click:t})}}].forEach(function(t){return e.AddListener(t.name,t.handler)})},t.prototype.DrawLabels=function(e){var a=this;this.ShowLabels&&this._mapService.GetZoom().then(function(t){if(a.LabelMinZoom<=t&&a.LabelMaxZoom>=t){var o=e.getContext("2d"),r=a._labels.map(function(t){return t.title});a._mapService.LocationsToPoints(a._labels.map(function(t){return t.loc})).then(function(t){for(var e=a._mapService.MapSize,n=0,i=t.length;n<i;n++)0<=t[n].x&&0<=t[n].y&&t[n].x<=e.width&&t[n].y<=e.height&&a.DrawText(o,t[n],r[n])})}})},t.prototype.DrawText=function(t,e,n){var i=this.LabelOptions;null==i&&this._tooltip&&(i=this._tooltip.DefaultLabelStyle),null==i&&(i=this._defaultOptions),t.strokeStyle=i.strokeColor,t.font=i.fontSize+"px "+i.fontFamily,t.textAlign="center";var o=i.strokeWeight;n&&o&&0<o&&(t.lineWidth=o,t.strokeText(n,e.x,e.y)),t.fillStyle=i.fontColor,t.fillText(n,e.x,e.y)},t.prototype.ManageTooltip=function(t){var n=this;t&&this._canvas?(this._tooltip.Set("hidden",!0),this._tooltipVisible=!1,this._tooltipSubscriptions.push(this.PolygonMouseMove.asObservable().subscribe(function(t){if(n._tooltipVisible){var e=n._canvas.GetCoordinatesFromClick(t.Click);n._tooltip.Set("position",e)}})),this._tooltipSubscriptions.push(this.PolygonMouseOver.asObservable().subscribe(function(t){if(t.Polygon.Title&&0<t.Polygon.Title.length){var e=n._canvas.GetCoordinatesFromClick(t.Click);n._tooltip.Set("text",t.Polygon.Title),n._tooltip.Set("position",e),n._tooltipVisible||(n._tooltip.Set("hidden",!1),n._tooltipVisible=!0)}})),this._tooltipSubscriptions.push(this.PolygonMouseOut.asObservable().subscribe(function(t){n._tooltipVisible&&(n._tooltip.Set("hidden",!0),n._tooltipVisible=!1)}))):(this._tooltipSubscriptions.forEach(function(t){return t.unsubscribe()}),this._tooltipSubscriptions.splice(0),this._tooltip.Set("hidden",!0),this._tooltipVisible=!1)},t.prototype.UpdatePolygons=function(){var n=this;null!=this._layerPromise&&this._layerPromise.then(function(e){var t=n._streaming?n._polygonsLast.splice(0):n._polygons;n._streaming||n._labels.splice(0),n._service.CreatePolygons(e.GetOptions().id,t).then(function(t){t.forEach(function(t){null!=t.Title&&0<t.Title.length&&n._labels.push({loc:t.Centroid,title:t.Title}),n.AddEventListeners(t)}),n._streaming?e.AddEntities(t):e.SetEntities(t),n._canvas&&n._canvas.Redraw(!n._streaming)})})},t.decorators=[{type:r.Directive,args:[{selector:"x-map-polygon-layer"}]}],t.ctorParameters=function(){return[{type:Y},{type:W},{type:r.NgZone}]},t.propDecorators={LabelMaxZoom:[{type:r.Input}],LabelMinZoom:[{type:r.Input}],LabelOptions:[{type:r.Input}],LayerOffset:[{type:r.Input}],PolygonOptions:[{type:r.Input}],ShowLabels:[{type:r.Input}],ShowTooltips:[{type:r.Input}],TreatNewPolygonOptionsAsStream:[{type:r.Input}],Visible:[{type:r.Input}],ZIndex:[{type:r.Input}],PolygonClick:[{type:r.Output}],PolygonDblClick:[{type:r.Output}],PolygonMouseMove:[{type:r.Output}],PolygonMouseOut:[{type:r.Output}],PolygonMouseOver:[{type:r.Output}]},t}(),kt=1e6,Ct=function(){function t(t,e,n){this._layerService=t,this._mapService=e,this._zone=n,this._labels=new Array,this._tooltipSubscriptions=new Array,this._tooltipVisible=!1,this._defaultOptions={fontSize:11,fontFamily:"sans-serif",strokeWeight:2,strokeColor:"#000000",fontColor:"#ffffff"},this._streaming=!1,this._polylines=new Array,this._polylinesLast=new Array,this.LabelMaxZoom=Number.MAX_SAFE_INTEGER,this.LabelMinZoom=-1,this.LayerOffset=null,this.ShowLabels=!1,this.ShowTooltips=!0,this.ZIndex=0,this.PolylineClick=new r.EventEmitter,this.PolylineDblClick=new r.EventEmitter,this.PolylineMouseMove=new r.EventEmitter,this.PolylineMouseOut=new r.EventEmitter,this.PolylineMouseOver=new r.EventEmitter,this._id=kt++}return Object.defineProperty(t.prototype,"PolylineOptions",{get:function(){return this._polylines},set:function(t){var e,n;this._streaming?((e=this._polylinesLast).push.apply(e,y(t.slice(0))),(n=this._polylines).push.apply(n,y(t))):this._polylines=t.slice(0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"TreatNewPolylineOptionsAsStream",{get:function(){return this._streaming},set:function(t){this._streaming=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){return this._id},enumerable:!0,configurable:!0}),t.prototype.ngAfterContentInit=function(){var e=this;this._id;this._zone.runOutsideAngular(function(){var t={Id:e._id,Visible:e.Visible,LayerOffset:e.LayerOffset,ZIndex:e.ZIndex};e._layerService.AddLayer(t),e._layerPromise=e._layerService.GetNativeLayer(t),Promise.all([e._layerPromise,e._mapService.CreateCanvasOverlay(function(t){return e.DrawLabels(t)})]).then(function(t){t[0].SetVisible(e.Visible),e._canvas=t[1],e._canvas._canvasReady.then(function(t){e._tooltip=e._canvas.GetToolTipOverlay(),e.ManageTooltip(e.ShowTooltips)}),e.PolylineOptions&&e._zone.runOutsideAngular(function(){return e.UpdatePolylines()})}),e._service=e._layerService})},t.prototype.ngOnDestroy=function(){this._tooltipSubscriptions.forEach(function(t){return t.unsubscribe()}),this._layerPromise.then(function(t){t.Delete()}),this._canvas&&this._canvas.Delete()},t.prototype.ngOnChanges=function(t){var e=this;if(t.PolylineOptions&&this._zone.runOutsideAngular(function(){e.UpdatePolylines()}),t.Visible&&!t.Visible.firstChange&&this._layerPromise.then(function(t){return t.SetVisible(e.Visible)}),t.ZIndex&&!t.ZIndex.firstChange||t.LayerOffset&&!t.LayerOffset.firstChange)throw new Error("You cannot change ZIndex or LayerOffset after the layer has been created.");(t.ShowLabels&&!t.ShowLabels.firstChange||t.LabelMinZoom&&!t.LabelMinZoom.firstChange||t.LabelMaxZoom&&!t.LabelMaxZoom.firstChange)&&this._canvas&&this._canvas.Redraw(!0),t.ShowTooltips&&this._tooltip&&this.ManageTooltip(t.ShowTooltips.currentValue)},t.prototype.toString=function(){return"MapPolylineLayer-"+this._id.toString()},t.prototype.AddEventListeners=function(e){var n=this;[{name:"click",handler:function(t){return n.PolylineClick.emit({Polyline:e,Click:t})}},{name:"dblclick",handler:function(t){return n.PolylineDblClick.emit({Polyline:e,Click:t})}},{name:"mousemove",handler:function(t){return n.PolylineMouseMove.emit({Polyline:e,Click:t})}},{name:"mouseout",handler:function(t){return n.PolylineMouseOut.emit({Polyline:e,Click:t})}},{name:"mouseover",handler:function(t){return n.PolylineMouseOver.emit({Polyline:e,Click:t})}}].forEach(function(t){return e.AddListener(t.name,t.handler)})},t.prototype.DrawLabels=function(e){var a=this;this.ShowLabels&&this._mapService.GetZoom().then(function(t){if(a.LabelMinZoom<=t&&a.LabelMaxZoom>=t){var o=e.getContext("2d"),r=a._labels.map(function(t){return t.title});a._mapService.LocationsToPoints(a._labels.map(function(t){return t.loc})).then(function(t){for(var e=a._mapService.MapSize,n=0,i=t.length;n<i;n++)0<=t[n].x&&0<=t[n].y&&t[n].x<=e.width&&t[n].y<=e.height&&a.DrawText(o,t[n],r[n])})}})},t.prototype.DrawText=function(t,e,n){var i=this.LabelOptions;null==i&&this._tooltip&&(i=this._tooltip.DefaultLabelStyle),null==i&&(i=this._defaultOptions),t.strokeStyle=i.strokeColor,t.font=i.fontSize+"px "+i.fontFamily,t.textAlign="center";var o=i.strokeWeight;n&&o&&0<o&&(t.lineWidth=o,t.strokeText(n,e.x,e.y)),t.fillStyle=i.fontColor,t.fillText(n,e.x,e.y)},t.prototype.ManageTooltip=function(t){var n=this;t&&this._canvas?(this._tooltip.Set("hidden",!0),this._tooltipVisible=!1,this._tooltipSubscriptions.push(this.PolylineMouseMove.asObservable().subscribe(function(t){if(n._tooltipVisible){var e=n._canvas.GetCoordinatesFromClick(t.Click);n._tooltip.Set("position",e)}})),this._tooltipSubscriptions.push(this.PolylineMouseOver.asObservable().subscribe(function(t){if(t.Polyline.Title&&0<t.Polyline.Title.length){var e=n._canvas.GetCoordinatesFromClick(t.Click);n._tooltip.Set("text",t.Polyline.Title),n._tooltip.Set("position",e),n._tooltipVisible||(n._tooltip.Set("hidden",!1),n._tooltipVisible=!0)}})),this._tooltipSubscriptions.push(this.PolylineMouseOut.asObservable().subscribe(function(t){n._tooltipVisible&&(n._tooltip.Set("hidden",!0),n._tooltipVisible=!1)}))):(this._tooltipSubscriptions.forEach(function(t){return t.unsubscribe()}),this._tooltipSubscriptions.splice(0),this._tooltip.Set("hidden",!0),this._tooltipVisible=!1)},t.prototype.UpdatePolylines=function(){var o=this;null!=this._layerPromise&&this._layerPromise.then(function(e){var t=o._streaming?o._polylinesLast.splice(0):o._polylines;o._streaming||o._labels.splice(0),o._service.CreatePolylines(e.GetOptions().id,t).then(function(t){var i=new Array;t.forEach(function(t){if(Array.isArray(t)){var e="",n=new Array;t.forEach(function(t){i.push(t),o.AddEventListeners(t),n.push(t.Centroid),null!=t.Title&&0<t.Title.length&&0===e.length&&(e=t.Title)}),o._labels.push({loc:p.GetPolylineCentroid(n),title:e})}else i.push(t),null!=t.Title&&0<t.Title.length&&o._labels.push({loc:t.Centroid,title:t.Title}),o.AddEventListeners(t)}),o._streaming?e.AddEntities(i):e.SetEntities(i),o._canvas&&o._canvas.Redraw(!o._streaming)})})},t.decorators=[{type:r.Directive,args:[{selector:"x-map-polyline-layer"}]}],t.ctorParameters=function(){return[{type:Y},{type:W},{type:r.NgZone}]},t.propDecorators={LabelMaxZoom:[{type:r.Input}],LabelMinZoom:[{type:r.Input}],LabelOptions:[{type:r.Input}],LayerOffset:[{type:r.Input}],PolylineOptions:[{type:r.Input}],ShowLabels:[{type:r.Input}],ShowTooltips:[{type:r.Input}],TreatNewPolylineOptionsAsStream:[{type:r.Input}],Visible:[{type:r.Input}],ZIndex:[{type:r.Input}],PolylineClick:[{type:r.Output}],PolylineDblClick:[{type:r.Output}],PolylineMouseMove:[{type:r.Output}],PolylineMouseOut:[{type:r.Output}],PolylineMouseOver:[{type:r.Output}]},t}(),St=function(){function t(){}return t.decorators=[{type:r.Injectable}],t}(),Ot=function(){function t(){}return Object.defineProperty(t.prototype,"IsAvailable",{get:function(){return!("undefined"==typeof document)},enumerable:!0,configurable:!0}),t.prototype.GetNativeDocument=function(){return"undefined"==typeof document?null:document},t.decorators=[{type:r.Injectable}],t}(),Pt=function(){function t(){}return Object.defineProperty(t.prototype,"IsAvailable",{get:function(){return!("undefined"==typeof window)},enumerable:!0,configurable:!0}),t.prototype.GetNativeWindow=function(){return"undefined"==typeof window?null:window},t.decorators=[{type:r.Injectable}],t}(),wt={HTTP:0,HTTPS:1,AUTO:2};wt[wt.HTTP]="HTTP",wt[wt.HTTPS]="HTTPS",wt[wt.AUTO]="AUTO";var Lt=function(){function t(){this.apiKey="",this.hostAndPath="www.bing.com/api/maps/mapcontrol",this.protocol=wt.HTTPS,this.branch=""}return t.decorators=[{type:r.Injectable}],t}(),It=new Lt,Et=function(o){function t(t,e,n){var i=o.call(this)||this;return i._config=t,i._windowRef=e,i._documentRef=n,null!==i._config&&i._config!==undefined||(i._config=It),i}return f(t,o),Object.defineProperty(t.prototype,"Config",{get:function(){return this._config},enumerable:!0,configurable:!0}),t.prototype.Load=function(){var n=this;if(this._scriptLoadingPromise)return this._scriptLoadingPromise;var i=this._documentRef.GetNativeDocument().createElement("script");i.type="text/javascript",i.async=!0,i.defer=!0;var o="angular2bingmaps"+(new Date).getMilliseconds();return i.src=this.GetScriptSrc(o),this._scriptLoadingPromise=new Promise(function(t,e){n._windowRef.GetNativeWindow()[o]=function(){t()},i.onerror=function(t){e(t)}}),this._documentRef.GetNativeDocument().head.appendChild(i),this._scriptLoadingPromise},t.prototype.GetScriptSrc=function(t){var e;switch(this._config&&this._config.protocol||It.protocol){case wt.AUTO:e="";break;case wt.HTTP:e="http:";break;case wt.HTTPS:e="https:"}var n=this._config.hostAndPath||It.hostAndPath,i={callback:t};return""!==this._config.branch&&(i.branch=this._config.branch),e+"//"+n+Object.keys(i).map(function(t,e){return(0===e?"?":"&")+(t+"=")+i[t]}).join("")},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:Lt,decorators:[{type:r.Optional}]},{type:Pt},{type:Ot}]},t}(St),Tt=function(){function t(t,e){this._mapService=t,this._zone=e,this._boxes=new Map}return t.prototype.AddInfoWindow=function(t){var e={};"number"==typeof t.Latitude&&"number"==typeof t.Longitude&&(e.position={latitude:t.Latitude,longitude:t.Longitude}),"undefined"!=typeof t.InfoWindowActions&&0<t.InfoWindowActions.length&&(e.actions=[],t.InfoWindowActions.forEach(function(t){e.actions.push({label:t.Label,eventHandler:function(){t.ActionClicked.emit(null)}})})),""!==t.HtmlContent?e.htmlContent=t.HtmlContent:(e.title=t.Title,e.description=t.Description),(t.xOffset||t.yOffset)&&(null==e.pixelOffset&&(e.pixelOffset={x:0,y:0}),t.xOffset&&(e.pixelOffset.x=t.xOffset),t.yOffset&&(e.pixelOffset.y=t.yOffset)),e.visible=t.Visible;var n=this._mapService.CreateInfoWindow(e);this._boxes.set(t,n)},t.prototype.Close=function(t){return this._boxes.get(t).then(function(t){return t.Close()})},t.prototype.CreateEventObservable=function(t,n){var i=this,o=A[t];return a.Observable.create(function(e){i._boxes.get(n).then(function(t){t.AddListener(o,function(t){return i._zone.run(function(){return e.next(t)})})})})},t.prototype.DeleteInfoWindow=function(e){var n=this,t=this._boxes.get(e);return null==t?Promise.resolve():t.then(function(t){return n._zone.run(function(){t.Close(),n._boxes["delete"](e)})})},t.prototype.Open=function(n,i){return(n.CloseInfoBoxesOnOpen||n.Modal)&&this._boxes.forEach(function(t,e){n.Id!==e.Id&&t.then(function(t){t.IsOpen&&(t.Close(),e.Close())})}),this._boxes.get(n).then(function(t){var e={};""!==n.HtmlContent?e.htmlContent=n.HtmlContent:(e.title=n.Title,e.description=n.Description),t.SetOptions(e),n.Latitude&&n.Longitude?t.SetPosition({latitude:n.Latitude,longitude:n.Longitude}):i?t.SetPosition(i):n.HostMarker&&t.SetPosition({latitude:n.HostMarker.Latitude,longitude:n.HostMarker.Longitude}),t.Open()})},t.prototype.SetOptions=function(t,e){return this._boxes.get(t).then(function(t){return t.SetOptions(e)})},t.prototype.SetPosition=function(e){return this._boxes.get(e).then(function(t){return t.SetPosition({latitude:e.Latitude,longitude:e.Longitude})})},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:r.NgZone}]},t}(),xt=function(){function t(t,e,n,i){this._mapService=t,this._layerService=e,this._clusterService=n,this._zone=i,this._markers=new Map}return t.prototype.AddMarker=function(n){var i={position:{latitude:n.Latitude,longitude:n.Longitude},title:n.Title,label:n.Label,draggable:n.Draggable,icon:n.IconUrl,iconInfo:n.IconInfo,isFirst:n.IsFirstInSet,isLast:n.IsLastInSet};n.Width&&(i.width=n.Width),n.Height&&(i.height=n.Height),n.Anchor&&(i.anchor=n.Anchor),n.Metadata&&(i.metadata=n.Metadata);var t=null;t=n.InClusterLayer?this._clusterService.CreateMarker(n.LayerId,i):n.InCustomLayer?this._layerService.CreateMarker(n.LayerId,i):this._mapService.CreateMarker(i),this._markers.set(n,t),n.IconInfo&&t.then(function(t){n.DynamicMarkerCreated.emit(i.iconInfo);var e={x:i.iconInfo.size&&i.iconInfo.markerOffsetRatio?i.iconInfo.size.width*i.iconInfo.markerOffsetRatio.x:0,y:i.iconInfo.size&&i.iconInfo.markerOffsetRatio?i.iconInfo.size.height*i.iconInfo.markerOffsetRatio.y:0};t.SetAnchor(e)})},t.prototype.CreateEventObservable=function(n,t){var i=this,e=new a.Subject;return"mousemove"===n?e.asObservable():"rightclick"===n?e.asObservable():a.Observable.create(function(e){i._markers.get(t).then(function(t){t.AddListener(n,function(t){return i._zone.run(function(){return e.next(t)})})})})},t.prototype.DeleteMarker=function(t){var n=this,e=this._markers.get(t),i=Promise.resolve();return null!=e&&(i=e.then(function(e){return t.InClusterLayer&&n._clusterService.GetNativeLayer(t.LayerId).then(function(t){t.RemoveEntity(e)}),t.InCustomLayer&&n._layerService.GetNativeLayer(t.LayerId).then(function(t){t.RemoveEntity(e)}),n._zone.run(function(){e.DeleteMarker(),n._markers["delete"](t)})})),i},t.prototype.GetCoordinatesFromClick=function(t){if(!t)return null;if(!t.primitive)return null;if(!(t.primitive instanceof Microsoft.Maps.Pushpin))return null;var e=t.primitive.getLocation();return{latitude:e.latitude,longitude:e.longitude}},t.prototype.GetNativeMarker=function(t){return this._markers.get(t)},t.prototype.GetPixelsFromClick=function(t){var e=this.GetCoordinatesFromClick(t);if(null==e)return null;var n=k.TranslateLocation(e),i=this._mapService.MapInstance.tryLocationToPixel(n,Microsoft.Maps.PixelReference.control);return null==i?null:{x:i.x,y:i.y}},t.prototype.LocationToPoint=function(t){var n=this;return null==t?Promise.resolve(null):t instanceof nt?this._markers.get(t).then(function(t){var e=t.Location;return n._mapService.LocationToPoint(e)}):this._mapService.LocationToPoint(t)},t.prototype.UpdateAnchor=function(e){return this._markers.get(e).then(function(t){t.SetAnchor(e.Anchor)})},t.prototype.UpdateDraggable=function(e){return this._markers.get(e).then(function(t){return t.SetDraggable(e.Draggable)})},t.prototype.UpdateIcon=function(i){var n=function(t,e,n){e&&""!==e&&(t.SetIcon(e),i.DynamicMarkerCreated.emit(n))};return this._markers.get(i).then(function(e){if(i.IconInfo){var t=l.CreateMarker(i.IconInfo);return"string"==typeof t?n(e,t,i.IconInfo):t.then(function(t){return n(e,t.icon,t.iconInfo)})}return e.SetIcon(i.IconUrl)})},t.prototype.UpdateLabel=function(e){return this._markers.get(e).then(function(t){t.SetLabel(e.Label)})},t.prototype.UpdateMarkerPosition=function(e){return this._markers.get(e).then(function(t){return t.SetPosition({latitude:e.Latitude,longitude:e.Longitude})})},t.prototype.UpdateTitle=function(e){return this._markers.get(e).then(function(t){return t.SetTitle(e.Title)})},t.prototype.UpdateVisible=function(e){return this._markers.get(e).then(function(t){return t.SetVisible(e.Visible)})},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:Y},{type:J},{type:r.NgZone}]},t}(),At=function(){function t(t,e){var n=this;this._loader=t,this._zone=e,this._modules=new Map,this._map=new Promise(function(t){n._mapResolver=t}),this._config=this._loader.Config}return Object.defineProperty(t.prototype,"LoadedModules",{get:function(){return this._modules},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"MapInstance",{get:function(){return this._mapInstance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"MapPromise",{get:function(){return this._map},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"MapSize",{get:function(){return this.MapInstance?{width:this.MapInstance.getWidth(),height:this.MapInstance.getHeight()}:null},enumerable:!0,configurable:!0}),t.prototype.CreateCanvasOverlay=function(n){return this._map.then(function(t){var e=new z(n);return t.layers.insert(e),e})},t.prototype.CreateClusterLayer=function(r){var a=this;return this._map.then(function(o){return new Promise(function(i){a.LoadModule("Microsoft.Maps.Clustering",function(){var t,e=k.TranslateClusterOptions(r),n=new Microsoft.Maps.ClusterLayer(new Array,e);o.layers.insert(n),(t=new O(n,a)).SetOptions(r),i(t)})})})},t.prototype.CreateInfoWindow=function(i){return this._map.then(function(t){var e;e=null==i.position?t.getCenter():new Microsoft.Maps.Location(i.position.latitude,i.position.longitude);var n=new Microsoft.Maps.Infobox(e,k.TranslateInfoBoxOptions(i));return n.setMap(t),new P(n)})},t.prototype.CreateLayer=function(n){var i=this;return this._map.then(function(t){var e=new Microsoft.Maps.Layer(n.id.toString());return t.layers.insert(e),new M(e,i)})},t.prototype.CreateMap=function(n,i){var o=this;return this._loader.Load().then(function(){new L(E).Extend(new Microsoft.Maps.CustomOverlay).Map("onAdd","OnAdd").Map("onLoad","OnLoad").Map("onRemove","OnRemove"),new L(z).Extend(new Microsoft.Maps.CustomOverlay).Map("onAdd","OnAdd").Map("onLoad","OnLoad").Map("onRemove","OnRemove"),null!=o._mapInstance&&o.DisposeMap();var t=k.TranslateLoadOptions(i);t.credentials||(t.credentials=o._config.apiKey);var e=new Microsoft.Maps.Map(n,t);o._mapInstance=e,o._mapResolver(e)})},t.prototype.CreateMarker=function(a){void 0===a&&(a={});var n=function(t,e){var n=k.TranslateLocation(a.position),i=k.TranslateMarkerOptions(a);t&&""!==t&&(i.icon=t);var o=new Microsoft.Maps.Pushpin(n,i),r=new C(o,e,null);return a.metadata&&a.metadata.forEach(function(t,e){return r.Metadata.set(e,t)}),e.entities.push(o),r};return this._map.then(function(e){if(a.iconInfo&&a.iconInfo.markerType){var t=l.CreateMarker(a.iconInfo);return"string"==typeof t?n(t,e):t.then(function(t){return n(t.icon,e)})}return n(null,e)})},t.prototype.CreatePolygon=function(r){var a=this;return this._map.then(function(t){var e=k.TranslatePaths(r.paths),n=k.TranslatePolygonOptions(r),i=new Microsoft.Maps.Polygon(e,n);t.entities.push(i);var o=new T(i,a,null);return r.metadata&&r.metadata.forEach(function(t,e){return o.Metadata.set(e,t)}),r.title&&""!==r.title&&(o.Title=r.title),null!=r.showLabel&&(o.ShowLabel=r.showLabel),null!=r.showTooltip&&(o.ShowTooltip=r.showTooltip),null!=r.labelMaxZoom&&(o.LabelMaxZoom=r.labelMaxZoom),null!=r.labelMinZoom&&(o.LabelMinZoom=r.labelMinZoom),r.editable&&o.SetEditable(r.editable),o})},t.prototype.CreatePolyline=function(r){var a;return this._map.then(function(e){var i=k.TranslatePolylineOptions(r),t=k.TranslatePaths(r.path);if(r.path&&0<r.path.length&&!Array.isArray(r.path[0])){a=new Microsoft.Maps.Polyline(t[0],i),e.entities.push(a);var n=new x(a,e,null);return r.metadata&&r.metadata.forEach(function(t,e){return n.Metadata.set(e,t)}),r.title&&""!==r.title&&(n.Title=r.title),null!=r.showTooltip&&(n.ShowTooltip=r.showTooltip),n}var o=new Array;return t.forEach(function(t){a=new Microsoft.Maps.Polyline(t,i),e.entities.push(a);var n=new x(a,e,null);r.metadata&&r.metadata.forEach(function(t,e){return n.Metadata.set(e,t)}),r.title&&""!==r.title&&(n.Title=r.title),null!=r.showTooltip&&(n.ShowTooltip=r.showTooltip),o.push(n)}),o})},t.prototype.DeleteLayer=function(e){return this._map.then(function(t){t.layers.remove(e.NativePrimitve)})},t.prototype.DisposeMap=function(){var e=this;null==this._map&&null==this._mapInstance||null!=this._mapInstance&&(this._mapInstance.dispose(),this._mapInstance=null,this._map=new Promise(function(t){e._mapResolver=t}))},t.prototype.GetCenter=function(){return this._map.then(function(t){var e=t.getCenter();return{latitude:e.latitude,longitude:e.longitude}})},t.prototype.GetBounds=function(){return this._map.then(function(t){var e=t.getBounds();return{maxLatitude:e.getNorth(),maxLongitude:e.crossesInternationalDateLine()?e.getWest():e.getEast(),minLatitude:e.getSouth(),minLongitude:e.crossesInternationalDateLine()?e.getEast():e.getWest(),center:{latitude:e.center.latitude,longitude:e.center.longitude},padding:0}})},t.prototype.GetDrawingTools=function(n){var i=this;return void 0===n&&(n=!0),new Promise(function(e,t){i.LoadModuleInstance("Microsoft.Maps.DrawingTools",n).then(function(t){e(t)})})},t.prototype.GetZoom=function(){return this._map.then(function(t){return t.getZoom()})},t.prototype.LoadModule=function(t,e){var n=this;this._modules.has(t)?e():Microsoft.Maps.loadModule(t,function(){n._modules.set(t,null),e()})},t.prototype.LoadModuleInstance=function(i,o){var r=this;void 0===o&&(o=!0);var a=i.substr(i.lastIndexOf(".")+1);if(this._modules.has(i)){var t=null;return o?null!=this._modules.get(i)?t=this._modules.get(i):(t=new Microsoft.Maps[a](this._mapInstance),this._modules.set(i,t)):t=new Microsoft.Maps[a](this._mapInstance),Promise.resolve(t)}return new Promise(function(e,t){try{Microsoft.Maps.loadModule(i,function(){var t=new Microsoft.Maps[a](r._mapInstance);o?r._modules.set(i,t):r._modules.set(i,null),e(t)})}catch(n){t("Could not load module or create instance.")}})},t.prototype.LocationToPoint=function(i){return this._map.then(function(t){var e=k.TranslateLocation(i),n=t.tryLocationToPixel(e,Microsoft.Maps.PixelReference.control);return null!=n?{x:n.x,y:n.y}:null})},t.prototype.LocationsToPoints=function(i){return this._map.then(function(t){var e=i.map(function(t){return k.TranslateLocation(t)}),n=t.tryLocationToPixel(e,Microsoft.Maps.PixelReference.control);return n||new Array})},t.prototype.SetCenter=function(e){return this._map.then(function(t){return t.setView({center:k.TranslateLocation(e)})})},t.prototype.SetMapOptions=function(n){this._map.then(function(t){var e=k.TranslateOptions(n);t.setOptions(e)})},t.prototype.SetViewOptions=function(n){this._map.then(function(t){var e=k.TranslateViewOptions(n);t.setView(e)})},t.prototype.SetZoom=function(e){return this._map.then(function(t){return t.setView({zoom:e})})},t.prototype.SubscribeToMapEvent=function(t){var n=this,i=A[t];return a.Observable.create(function(e){n._map.then(function(t){Microsoft.Maps.Events.addHandler(t,i,function(t){n._zone.run(function(){return e.next(t)})})})})},t.prototype.TriggerMapEvent=function(e){return this._map.then(function(t){return Microsoft.Maps.Events.invoke(t,e,null)})},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:St},{type:r.NgZone}]},t}(),zt=function(){function t(t,e){this._mapService=t,this._zone=e,this._layers=new Map}return t.prototype.CreateMarker=function(t,a){var n=function(t,e){var n=k.TranslateLocation(a.position),i=k.TranslateMarkerOptions(a);t&&""!==t&&(i.icon=t);var o=new Microsoft.Maps.Pushpin(n,i),r=new C(o,null,e.NativePrimitve);return r.IsFirst=a.isFirst,r.IsLast=a.isLast,a.metadata&&a.metadata.forEach(function(t,e){return r.Metadata.set(e,t)}),e.AddEntity(r),r},e=this.GetLayerById(t);if(null==e)throw new Error("Layer with id "+t+" not found in Layer Map");return e.then(function(e){if(a.iconInfo&&a.iconInfo.markerType){var t=l.CreateMarker(a.iconInfo);return"string"==typeof t?n(t,e):t.then(function(t){return n(t.icon,e)})}return n(null,e)})},t.prototype.CreateMarkers=function(i,o){var r=function(s,t){return t.map(function(t){var e,n=k.TranslateMarkerOptions(t);s&&""!==s?e=s:n.icon&&(e=n.icon),n.icon&&delete n.icon;var i=k.TranslateLocation(t.position),o=new Microsoft.Maps.Pushpin(i,n),r=l.GetImageForMarker(e);null!=r&&(o.image=r);var a=new C(o,null,null);return a.IsFirst=t.isFirst,a.IsLast=t.isLast,t.metadata&&t.metadata.forEach(function(t,e){return a.Metadata.set(e,t)}),a})};return new Promise(function(e,t){if(o&&o.markerType){var n=l.CreateMarker(o);if("string"!=typeof n)return n.then(function(t){e(r(t.icon,i))});e(r(n,i))}else e(r(null,i))})},t.prototype.DeleteLayer=function(e){var n=this,t=this._layers.get(e.Id);return null==t?Promise.resolve():t.then(function(t){return n._zone.run(function(){t.Delete(),n._layers["delete"](e.Id)})})},t.prototype.GetNativeLayer=function(t){return"number"==typeof t?this._layers.get(t):this._layers.get(t.Id)},t.prototype.GetLayerById=function(n){var i;return this._layers.forEach(function(t,e){e===n&&(i=t)}),i},t}(),Dt=function(n){function t(t,e){return n.call(this,t,e)||this}return f(t,n),t.prototype.AddLayer=function(e){var t=this._mapService.CreateLayer({id:e.Id});this._layers.set(e.Id,t),t.then(function(t){return t.SetVisible(e.Visible)})},t.prototype.CreatePolygon=function(t,r){var a=this,e=this.GetLayerById(t);if(null==e)throw new Error("Layer with id "+t+" not found in Layer Map");return e.then(function(t){var e=k.TranslatePaths(r.paths),n=k.TranslatePolygonOptions(r),i=new Microsoft.Maps.Polygon(e,n),o=new T(i,a._mapService,t.NativePrimitve);return r.metadata&&r.metadata.forEach(function(t,e){return o.Metadata.set(e,t)}),r.title&&""!==r.title&&(o.Title=r.title),null!=r.showLabel&&(o.ShowLabel=r.showLabel),null!=r.showTooltip&&(o.ShowTooltip=r.showTooltip),null!=r.labelMaxZoom&&(o.LabelMaxZoom=r.labelMaxZoom),null!=r.labelMinZoom&&(o.LabelMinZoom=r.labelMinZoom),t.AddEntity(o),o})},t.prototype.CreatePolygons=function(t,n){var a=this,e=this.GetLayerById(t);if(null==e)throw new Error("Layer with id "+t+" not found in Layer Map");return e.then(function(r){return new Promise(function(t,e){t(n.map(function(t){var e=k.TranslatePaths(t.paths),n=k.TranslatePolygonOptions(t),i=new Microsoft.Maps.Polygon(e,n),o=new T(i,a._mapService,r.NativePrimitve);return t.title&&""!==t.title&&(o.Title=t.title),t.metadata&&t.metadata.forEach(function(t,e){return o.Metadata.set(e,t)}),o}))})})},t.prototype.CreatePolyline=function(t,o){var r,a,s=this,e=this.GetLayerById(t);if(null==e)throw new Error("Layer with id "+t+" not found in Layer Map");return e.then(function(e){var t=k.TranslatePaths(o.path),n=k.TranslatePolylineOptions(o);if(o.path&&0<o.path.length&&!Array.isArray(o.path[0]))return r=new Microsoft.Maps.Polyline(t[0],n),a=new x(r,s._mapService.MapInstance,e.NativePrimitve),e.AddEntity(a),o.metadata&&o.metadata.forEach(function(t,e){return a.Metadata.set(e,t)}),o.title&&""!==o.title&&(a.Title=o.title),null!=o.showTooltip&&(a.ShowTooltip=o.showTooltip),a;var i=new Array;return t.forEach(function(t){r=new Microsoft.Maps.Polyline(t,n),a=new x(r,s._mapService.MapInstance,e.NativePrimitve),e.AddEntity(a),o.metadata&&o.metadata.forEach(function(t,e){return a.Metadata.set(e,t)}),o.title&&""!==o.title&&(a.Title=o.title),null!=o.showTooltip&&(a.ShowTooltip=o.showTooltip),i.push(a)}),i})},t.prototype.CreatePolylines=function(t,n){var s=this,e=this.GetLayerById(t);if(null==e)throw new Error("Layer with id "+t+" not found in Layer Map");return e.then(function(a){return new Promise(function(t,e){t(n.map(function(i){var t=k.TranslatePaths(i.path),o=k.TranslatePolylineOptions(i);if(t&&0<t.length&&!Array.isArray(t[0])){var e=new Microsoft.Maps.Polyline(t[0],o),n=new x(e,s._mapService.MapInstance,a.NativePrimitve);return i.title&&""!==i.title&&(n.Title=i.title),i.metadata&&i.metadata.forEach(function(t,e){return n.Metadata.set(e,t)}),n}var r=new Array;return t.forEach(function(t){var e=new Microsoft.Maps.Polyline(t,o),n=new x(e,s._mapService.MapInstance,a.NativePrimitve);i.metadata&&i.metadata.forEach(function(t,e){return n.Metadata.set(e,t)}),i.title&&""!==i.title&&(n.Title=i.title),r.push(n)}),r}))})})},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:r.NgZone}]},t}(zt),Gt=function(n){function t(t,e){return n.call(this,t,e)||this}return f(t,n),t.prototype.AddLayer=function(n){var e=this,t={id:n.Id,visible:n.Visible,clusteringEnabled:n.ClusteringEnabled,placementMode:n.ClusterPlacementMode};n.GridSize&&(t.gridSize=n.GridSize),n.LayerOffset&&(t.layerOffset=n.LayerOffset),n.ZIndex&&(t.zIndex=n.ZIndex),n.IconInfo&&(t.clusteredPinCallback=function(t){e.CreateClusterPushPin(t,n)}),n.CustomMarkerCallback&&(t.clusteredPinCallback=function(t){e.CreateCustomClusterPushPin(t,n)}),n.SpiderClusterOptions&&(t.spiderClusterOptions=n.SpiderClusterOptions);var i=this._mapService.CreateClusterLayer(t);this._mapService.MapPromise.then(function(e){Microsoft.Maps.Events.addHandler(e,"viewchangeend",function(t){n.ClusteringEnabled&&19===e.getZoom()&&i.then(function(t){t.SetOptions({id:n.Id,clusteringEnabled:!1})}),n.ClusteringEnabled&&e.getZoom()<19&&i.then(function(t){t.GetOptions().clusteringEnabled||t.SetOptions({id:n.Id,clusteringEnabled:!0})})})}),this._layers.set(n.Id,i)},t.prototype.CreatePolygon=function(t,e){throw new Error("Polygons are not supported in clustering layers. You can only use markers.")},t.prototype.CreatePolygons=function(t,e){throw new Error("Polygons are not supported in clustering layers. You can only use markers.")},t.prototype.CreatePolyline=function(t,e){throw new Error("Polylines are not supported in clustering layers. You can only use markers.")},t.prototype.CreatePolylines=function(t,e){throw new Error("Polylines are not supported in clustering layers. You can only use markers.")},t.prototype.StartClustering=function(t){var e=this,n=this._layers.get(t.Id);return null==n?Promise.resolve():n.then(function(t){return e._zone.run(function(){t.StartClustering()})})},t.prototype.StopClustering=function(t){var e=this,n=this._layers.get(t.Id);return null==n?Promise.resolve():n.then(function(t){return e._zone.run(function(){t.StopClustering()})})},t.prototype.CreateClusterPushPin=function(o,r){var a=this;this._layers.get(r.Id).then(function(t){if(r.IconInfo){var n={},e=function(t,e){n.icon=t,n.anchor=new Microsoft.Maps.Point(e.size&&e.markerOffsetRatio?e.size.width*e.markerOffsetRatio.x:0,e.size&&e.markerOffsetRatio?e.size.height*e.markerOffsetRatio.y:0),o.setOptions(n)},i=l.CreateMarker(r.IconInfo);"string"==typeof i?e(i,r.IconInfo):i.then(function(t){e(t.icon,t.iconInfo)})}r.ClusterClickAction===v.ZoomIntoCluster&&Microsoft.Maps.Events.addHandler(o,"click",function(t){return a.ZoomIntoCluster(t)}),r.ClusterClickAction===v.Spider&&(Microsoft.Maps.Events.addHandler(o,"dblclick",function(t){return a.ZoomIntoCluster(t)}),t.InitializeSpiderClusterSupport())})},t.prototype.CreateCustomClusterPushPin=function(o,r){var a=this;this._layers.get(r.Id).then(function(n){var i=new Array;o.containedPushpins.forEach(function(t){var e=n.GetMarkerFromBingMarker(t);e&&i.push(e)});var t={markerType:u.None},e={};e.icon=r.CustomMarkerCallback(i,t),""!==e.icon&&(e.anchor=new Microsoft.Maps.Point(t.size&&t.markerOffsetRatio?t.size.width*t.markerOffsetRatio.x:0,t.size&&t.markerOffsetRatio?t.size.height*t.markerOffsetRatio.y:0),t.textOffset&&(e.textOffset=new Microsoft.Maps.Point(t.textOffset.x,t.textOffset.y)),o.setOptions(e)),r.ClusterClickAction===v.ZoomIntoCluster&&Microsoft.Maps.Events.addHandler(o,"click",function(t){return a.ZoomIntoCluster(t)}),r.ClusterClickAction===v.Spider&&(Microsoft.Maps.Events.addHandler(o,"dblclick",function(t){return a.ZoomIntoCluster(t)}),n.InitializeSpiderClusterSupport())})},t.prototype.ZoomIntoCluster=function(t){var e=t.target;if(e&&e.containedPushpins){var n,i=new Array;e.containedPushpins.forEach(function(t){return i.push(t.getLocation())}),n=Microsoft.Maps.LocationRect.fromLocations(i),this._mapService.MapPromise.then(function(t){t.setView({bounds:n,padding:75})})}},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:r.NgZone}]},t}(zt),jt=function(){function t(t,e,n){this._mapService=t,this._layerService=e,this._zone=n,this._polygons=new Map}return t.prototype.AddPolygon=function(t){var e,n={id:t.Id,clickable:t.Clickable,draggable:t.Draggable,editable:t.Editable,fillColor:t.FillColor,fillOpacity:t.FillOpacity,geodesic:t.Geodesic,labelMaxZoom:t.LabelMaxZoom,labelMinZoom:t.LabelMinZoom,paths:t.Paths,showLabel:t.ShowLabel,showTooltip:t.ShowTooltip,strokeColor:t.StrokeColor,strokeOpacity:t.StrokeOpacity,strokeWeight:t.StrokeWeight,title:t.Title,visible:t.Visible,zIndex:t.zIndex};e=t.InCustomLayer?this._layerService.CreatePolygon(t.LayerId,n):this._mapService.CreatePolygon(n),this._polygons.set(t,e)},t.prototype.CreateEventObservable=function(n,t){var i=this,e=new a.Subject;return"mousemove"===n?e.asObservable():"rightclick"===n?e.asObservable():a.Observable.create(function(e){i._polygons.get(t).then(function(t){t.AddListener(n,function(t){return i._zone.run(function(){return e.next(t)})})})})},t.prototype.DeletePolygon=function(e){var n=this,t=this._polygons.get(e);return null==t?Promise.resolve():t.then(function(t){return n._zone.run(function(){t.Delete(),n._polygons["delete"](e)})})},t.prototype.GetCoordinatesFromClick=function(t){var e=t;return{latitude:e.location.latitude,longitude:e.location.longitude}},t.prototype.GetNativePolygon=function(t){return this._polygons.get(t)},t.prototype.SetOptions=function(t,e){return this._polygons.get(t).then(function(t){t.SetOptions(e)})},t.prototype.UpdatePolygon=function(e){var t=this._polygons.get(e);return null!=t&&null!=e.Paths&&Array.isArray(e.Paths)&&0!==e.Paths.length?t.then(function(t){Array.isArray(e.Paths[0])?t.SetPaths(e.Paths):t.SetPath(e.Paths)}):Promise.resolve()},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:Y},{type:r.NgZone}]},t}(),Nt=function(){function t(t,e,n){this._mapService=t,this._layerService=e,this._zone=n,this._polylines=new Map}return t.prototype.AddPolyline=function(t){var e,n={id:t.Id,clickable:t.Clickable,draggable:t.Draggable,editable:t.Editable,geodesic:t.Geodesic,path:t.Path,showTooltip:t.ShowTooltip,strokeColor:t.StrokeColor,strokeOpacity:t.StrokeOpacity,strokeWeight:t.StrokeWeight,title:t.Title,visible:t.Visible,zIndex:t.zIndex};e=t.InCustomLayer?this._layerService.CreatePolyline(t.LayerId,n):this._mapService.CreatePolyline(n),this._polylines.set(t,e)},t.prototype.CreateEventObservable=function(n,t){var i=this,e=new a.Subject;return"mousemove"===n?e.asObservable():"rightclick"===n?e.asObservable():a.Observable.create(function(e){i._polylines.get(t).then(function(t){(Array.isArray(t)?t:[t]).forEach(function(t){return t.AddListener(n,function(t){return i._zone.run(function(){return e.next(t)})})})})})},t.prototype.DeletePolyline=function(e){var n=this,t=this._polylines.get(e);return null==t?Promise.resolve():t.then(function(t){return n._zone.run(function(){(Array.isArray(t)?t:[t]).forEach(function(t){return t.Delete()}),n._polylines["delete"](e)})})},t.prototype.GetCoordinatesFromClick=function(t){return t&&t.location?{latitude:t.location.latitude,longitude:t.location.longitude}:null},t.prototype.GetNativePolyline=function(t){return this._polylines.get(t)},t.prototype.SetOptions=function(t,e){return this._polylines.get(t).then(function(t){(Array.isArray(t)?t:[t]).forEach(function(t){return t.SetOptions(e)})})},t.prototype.UpdatePolyline=function(i){var t=this,e=this._polylines.get(i);return null==e?Promise.resolve():e.then(function(e){return t._zone.run(function(){var t=Array.isArray(e)?e:[e],n=0<i.Path.length&&Array.isArray(i.Path[0])?i.Path:[i.Path];t.forEach(function(t,e){n.length>e&&t.SetPath(n[e])}),Array.isArray(e)&&e.length>n.length&&e.splice(n.length-1).forEach(function(t){return t.Delete()})})})},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:Y},{type:r.NgZone}]},t}(),Zt=function(){function t(t,e){this._loader=t,this._zone=e}return t.prototype.Create=function(){return new At(this._loader,this._zone)},t.prototype.CreateClusterService=function(t){return new Gt(t,this._zone)},t.prototype.CreateInfoBoxService=function(t){return new Tt(t,this._zone)},t.prototype.CreateLayerService=function(t){return new Dt(t,this._zone)},t.prototype.CreateMarkerService=function(t,e,n){return new xt(t,e,n,this._zone)},t.prototype.CreatePolygonService=function(t,e){return new jt(t,e,this._zone)},t.prototype.CreatePolylineService=function(t,e){return new Nt(t,e,this._zone)},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:St},{type:r.NgZone}]},t}();function Vt(t,e){return new Zt(t,e)}function Rt(){return new Et(new Lt,new Pt,new Ot)}var Bt=function(){function t(t,e){this._mapService=t,this._zone=e}return t.prototype.DeleteLayer=function(e){var n=this,t=this._layers.get(e.Id);return null==t?Promise.resolve():t.then(function(t){return n._zone.run(function(){t.Delete(),n._layers["delete"](e.Id)})})},t.prototype.GetNativeLayer=function(t){return"number"==typeof t?this._layers.get(t):this._layers.get(t.Id)},t.prototype.CreateMarker=function(t,s){var e=this._mapService.MapPromise,n=this._layers.get(t);return Promise.all([e,n]).then(function(t){var e=d(t,2),o=e[0],r=e[1],n=function(t){var n=new google.maps.Marker(t);s.metadata&&s.metadata.forEach(function(t,e){return n.Metadata.set(e,t)}),n.setMap(o);var i=new N(n);return i.IsFirst=s.isFirst,i.IsLast=s.isLast,s.metadata&&s.metadata.forEach(function(t,e){return i.Metadata.set(e,t)}),r.AddEntity(i),i},i=G.TranslateMarkerOptions(s);if(s.iconInfo&&s.iconInfo.markerType){var a=l.CreateMarker(s.iconInfo);return"string"==typeof a?(i.icon=a,n(i)):a.then(function(t){return i.icon=t.icon,n(i)})}return n(i)})},t.prototype.CreateMarkers=function(t,i){var o=function(o){return t.map(function(t){var e=G.TranslateMarkerOptions(t);o&&""!==o&&(e.icon=o);var n=new google.maps.Marker(e),i=new N(n);return i.IsFirst=t.isFirst,i.IsLast=t.isLast,t.metadata&&t.metadata.forEach(function(t,e){return i.Metadata.set(e,t)}),i})};return new Promise(function(e,t){if(i&&i.markerType){var n=l.CreateMarker(i);if("string"!=typeof n)return n.then(function(t){e(o(t.icon))});e(o(n))}else e(o(null))})},t.prototype.GetLayerById=function(n){var i;return this._layers.forEach(function(t,e){e===n&&(i=t)}),i},t}(),Ht=function(i){function o(t,e){var n=i.call(this,t,e)||this;return n._layers=new Map,n._layerStyles=new Map,n}return f(o,i),o.CreateClusterIcons=function(n){return new Promise(function(t,e){var o=new Array;n.forEach(function(n,t){if(n.iconInfo){var e=l.CreateMarker(n.iconInfo);if("string"==typeof e){if(n.url=e,null==n.width&&(n.width=n.iconInfo.size.width,n.height=n.iconInfo.size.height),n.iconInfo.markerOffsetRatio&&n.iconInfo.size&&null==n.anchor){var i=n.iconInfo;n.anchor=[i.size.width*i.markerOffsetRatio.x,i.size.height*i.markerOffsetRatio.y]}delete n.iconInfo}else e.then(function(t){if(n.url=t.icon,null==n.width&&(n.width=t.iconInfo.size.width,n.height=t.iconInfo.size.height),t.iconInfo.markerOffsetRatio&&t.iconInfo.size&&null==n.anchor){var e=t.iconInfo;n.anchor=[e.size.width*e.markerOffsetRatio.x,e.size.height*e.markerOffsetRatio.y]}delete n.iconInfo}),o.push(e)}}),0===o.length?t(n):Promise.all(o).then(function(){t(n)})})},o.prototype.AddLayer=function(a){var s=this,n={id:a.Id,visible:a.Visible,clusteringEnabled:a.ClusteringEnabled,zoomOnClick:a.ClusterClickAction===v.ZoomIntoCluster};a.GridSize&&(n.gridSize=a.GridSize),a.MinimumClusterSize&&(n.minimumClusterSize=a.MinimumClusterSize),a.Styles&&(n.styles=a.Styles),a.UseDynamicSizeMarkers?n.styles=null:n.styles=[{height:30,width:35,textColor:"white",textSize:11,backgroundPosition:"center",iconInfo:{markerType:u.FontMarker,fontName:"FontAwesome",fontSize:30,color:"green",text:""}}];var i=function(t){if(s._layerStyles.has(a.Id))s._layerStyles.get(a.Id).splice(0);else{var e=new Array;e.push({}),s._layerStyles.set(a.Id,e),t.setStyles(e)}},t=this._mapService.CreateClusterLayer(n);this._layers.set(a.Id,t),t.then(function(t){var e=t.NativePrimitve;n.styles?o.CreateClusterIcons(n.styles).then(function(t){e.setStyles(t)}):(i(e),s._mapService.MapPromise.then(function(t){t.addListener("zoom_changed",function(){i(e)})}),e.setCalculator(function(t,e){return n=t,i=s._layerStyles.get(a.Id),o={markerType:u.None},r=a.CustomMarkerCallback(n,o),i[0]={url:'"data:image/svg+xml;utf8,'+r+'"',height:o.size.height,width:o.size.width,textColor:"white",textSize:11,backgroundPosition:"center"},{text:n.length.toString(),index:1};var n,i,o,r}))})},o.prototype.CreateMarker=function(t,n){var i=this,e=this.GetLayerById(t);if(null==e)throw new Error("Layer with id "+t+" not found in Layer Map");return e.then(function(e){return i._mapService.CreateMarker(n).then(function(t){return t.IsFirst=n.isFirst,t.IsLast=n.isLast,e.AddEntity(t),t})})},o.prototype.StartClustering=function(t){return Promise.resolve()},o.prototype.StopClustering=function(t){return Promise.resolve()},o.prototype.CreatePolygon=function(t,e){throw new Error("Polygons are not supported in clustering layers. You can only use markers.")},o.prototype.CreatePolygons=function(t,e){throw new Error("Polygons are not supported in clustering layers. You can only use markers.")},o.prototype.CreatePolyline=function(t,e){throw new Error("Polylines are not supported in clustering layers. You can only use markers.")},o.prototype.CreatePolylines=function(t,e){throw new Error("Polylines are not supported in clustering layers. You can only use markers.")},o.decorators=[{type:r.Injectable}],o.ctorParameters=function(){return[{type:W},{type:r.NgZone}]},o}(Bt),Ft=function(o){function t(t,e,n){var i=o.call(this)||this;return i._mapService=t,i._markerService=e,i._zone=n,i._boxes=new Map,i}return f(t,o),t.prototype.AddInfoWindow=function(t){var e={};""!==t.HtmlContent?e.htmlContent=t.HtmlContent:(e.title=t.Title,e.description=t.Description),(t.xOffset||t.yOffset)&&(null==e.pixelOffset&&(e.pixelOffset={x:0,y:0}),t.xOffset&&(e.pixelOffset.x=t.xOffset),t.yOffset&&(e.pixelOffset.y=t.yOffset)),e.disableAutoPan=t.DisableAutoPan,e.visible=t.Visible,"number"==typeof t.Latitude&&"number"==typeof t.Longitude&&(e.position={latitude:t.Latitude,longitude:t.Longitude});var n=this._mapService.CreateInfoWindow(e);this._boxes.set(t,n)},t.prototype.Close=function(t){return this._boxes.get(t).then(function(t){t.Close()})},t.prototype.CreateEventObservable=function(t,n){var i=this,o=B[t];return a.Observable.create(function(e){i._boxes.get(n).then(function(t){t.AddListener(o,function(t){return i._zone.run(function(){return e.next(t)})})})})},t.prototype.DeleteInfoWindow=function(t){return Promise.resolve()},t.prototype.Open=function(i,e){var o=this;return(i.CloseInfoBoxesOnOpen||i.Modal)&&this._boxes.forEach(function(t,e){i.Id!==e.Id&&t.then(function(t){t.IsOpen&&(t.Close(),e.Close())})}),this._boxes.get(i).then(function(n){var t={};return""!==i.HtmlContent?t.htmlContent=i.HtmlContent:(t.title=i.Title,t.description=i.Description),n.SetOptions(t),null!=i.HostMarker?o._markerService.GetNativeMarker(i.HostMarker).then(function(e){return o._mapService.MapPromise.then(function(t){return n.Open(e.NativePrimitve)})}):o._mapService.MapPromise.then(function(t){e&&n.SetPosition(e),n.Open()})})},t.prototype.SetOptions=function(t,e){return this._boxes.get(t).then(function(t){t.SetOptions(e)})},t.prototype.SetPosition=function(t,e){return this._boxes.get(t).then(function(t){t.SetPosition(e)}),Promise.resolve()},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:U},{type:r.NgZone}]},t}(q),Wt=function(){function t(t,e,n){this._layer=t,this._maps=e,this._id=n,this._entities=new Array,this._visible=!0}return Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._layer},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){throw new Error("Events are not supported on Google Layers. You can still add events to individual markers.")},t.prototype.AddEntity=function(t){t.NativePrimitve&&(this._entities.push(t),t.NativePrimitve.setVisible(this._visible),t.NativePrimitve.setMap(this.NativePrimitve))},t.prototype.AddEntities=function(t){var e,n=this;null!=t&&Array.isArray(t)&&0!==t.length&&((e=this._entities).push.apply(e,y(t)),i.eachSeries(y(t),function(t,e){t.NativePrimitve.setVisible(n._visible),t.NativePrimitve.setMap(n.NativePrimitve),i.nextTick(function(){return e()})}))},t.prototype.Delete=function(){i.eachSeries(this._entities.splice(0),function(t,e){t.NativePrimitve.setMap(null),i.nextTick(function(){return e()})})},t.prototype.GetOptions=function(){return{id:this._id}},t.prototype.GetVisible=function(){return this._visible},t.prototype.RemoveEntity=function(t){if(t.NativePrimitve){var e=this._entities.indexOf(t);-1<e&&this._entities.splice(e,1),t.NativePrimitve.setMap(null)}},t.prototype.SetEntities=function(t){this.Delete(),this.AddEntities(t)},t.prototype.SetOptions=function(t){this._id=t.id},t.prototype.SetVisible=function(n){i.eachSeries(y(this._entities),function(t,e){t.NativePrimitve.setVisible(n),i.nextTick(function(){return e()})}),this._visible=n},t}(),Ut=function(i){function t(t,e){var n=i.call(this,t,e)||this;return n._layers=new Map,n}return f(t,i),t.prototype.AddLayer=function(i){var o=this,t=new Promise(function(n,t){o._mapService.MapPromise.then(function(t){var e=new Wt(t,o._mapService,i.Id);e.SetVisible(i.Visible),n(e)})});this._layers.set(i.Id,t)},t.prototype.CreatePolygon=function(t,e){var n=this._mapService.CreatePolygon(e),i=this._layers.get(t);return Promise.all([n,i]).then(function(t){return t[1].AddEntity(t[0])}),n},t.prototype.CreatePolygons=function(t,n){var e=this.GetLayerById(t);if(null==e)throw new Error("Layer with id "+t+" not found in Layer Map");return e.then(function(t){return new Promise(function(t,e){t(n.map(function(t){var e=G.TranslatePolygonOptions(t),n=new google.maps.Polygon(e),i=new V(n);return t.title&&""!==t.title&&(i.Title=t.title),t.metadata&&t.metadata.forEach(function(t,e){return i.Metadata.set(e,t)}),i}))})})},t.prototype.CreatePolyline=function(t,e){var n=this._mapService.CreatePolyline(e),i=this._layers.get(t);return Promise.all([n,i]).then(function(t){var e,n,i=Array.isArray(t[0])?t[0]:[t[0]];try{for(var o=function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}(i),r=o.next();!r.done;r=o.next()){var a=r.value;t[1].AddEntity(a)}}catch(s){e={error:s}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(e)throw e.error}}}),n},t.prototype.CreatePolylines=function(t,n){var e=this.GetLayerById(t);if(null==e)throw new Error("Layer with id "+t+" not found in Layer Map");return e.then(function(t){return new Promise(function(t,e){t(n.map(function(i){var o=G.TranslatePolylineOptions(i);if(i.path&&0<i.path.length&&!Array.isArray(i.path[0])){o.path=G.TranslatePaths(i.path)[0];var t=new google.maps.Polyline(o),n=new R(t);return i.title&&""!==i.title&&(n.Title=i.title),i.metadata&&i.metadata.forEach(function(t,e){return n.Metadata.set(e,t)}),n}var e=G.TranslatePaths(i.path),r=new Array;return e.forEach(function(t){o.path=t;var e=new google.maps.Polyline(o),n=new R(e);i.metadata&&i.metadata.forEach(function(t,e){return n.Metadata.set(e,t)}),i.title&&""!==i.title&&(n.Title=i.title),r.push(n)}),r}))})})},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:r.NgZone}]},t}(Bt),qt={HTTP:0,HTTPS:1,AUTO:2};qt[qt.HTTP]="HTTP",qt[qt.HTTPS]="HTTPS",qt[qt.AUTO]="AUTO";var Yt=function(){function t(){}return t.decorators=[{type:r.Injectable}],t}(),Kt=new Yt,Xt=function(o){function t(t,e,n){var i=o.call(this)||this;return i._config=t,i._windowRef=e,i._documentRef=n,null!==i._config&&i._config!==undefined||(i._config=Kt),i}return f(t,o),Object.defineProperty(t.prototype,"Config",{get:function(){return this._config},enumerable:!0,configurable:!0}),t.prototype.Load=function(){var i=this;if(this._scriptLoadingPromise)return this._scriptLoadingPromise;var t=this._documentRef.GetNativeDocument().createElement("script");t.type="text/javascript",t.async=!0,t.defer=!0;return t.src=this.GetMapsScriptSrc("Create"),this._scriptLoadingPromise=new Promise(function(e,n){i._windowRef.GetNativeWindow().Create=function(){if(i._config.enableClustering){var t=i._documentRef.GetNativeDocument().createElement("script");t.type="text/javascript",t.src=i.GetClusterScriptSrc(),t.onload=t.onreadystatechange=function(){e()},i._documentRef.GetNativeDocument().head.appendChild(t)}else e()},t.onerror=function(t){n(t)}}),this._documentRef.GetNativeDocument().head.appendChild(t),this._scriptLoadingPromise},t.prototype.GetMapsScriptSrc=function(t){var e=this._config.hostAndPath||"maps.googleapis.com/maps/api/js",n={v:this._config.apiVersion,callback:t,key:this._config.apiKey,client:this._config.clientId,channel:this._config.channel,libraries:this._config.libraries,region:this._config.region,language:this._config.language};return this.GetScriptSrc(e,n)},t.prototype.GetClusterScriptSrc=function(){var t=this._config.clusterHostAndPath||"developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js";return this.GetScriptSrc(t,{})},t.prototype.GetScriptSrc=function(t,n){var e;switch(this._config&&this._config.protocol||qt.HTTPS){case qt.AUTO:e="";break;case qt.HTTP:e="http:";break;case qt.HTTPS:e="https:"}return e+"//"+t+"?"+Object.keys(n).filter(function(t){return null!=n[t]}).filter(function(t){return!Array.isArray(n[t])||Array.isArray(n[t])&&0<n[t].length}).map(function(t){var e=n[t];return Array.isArray(e)?{key:t,value:e.join(",")}:{key:t,value:n[t]}}).map(function(t){return t.key+"="+t.value}).join("&")},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:Yt,decorators:[{type:r.Optional}]},{type:Pt},{type:Ot}]},t}(St),Jt=function(){function t(t,e,n,i){this._mapService=t,this._layerService=e,this._clusterService=n,this._zone=i,this._markers=new Map}return t.prototype.AddMarker=function(n){var i={anchor:n.Anchor,position:{latitude:n.Latitude,longitude:n.Longitude},title:n.Title,label:n.Label,draggable:n.Draggable,icon:n.IconUrl,iconInfo:n.IconInfo,width:n.Width,height:n.Height,isFirst:n.IsFirstInSet,isLast:n.IsLastInSet},t=null;t=n.InClusterLayer?this._clusterService.CreateMarker(n.LayerId,i):n.InCustomLayer?this._layerService.CreateMarker(n.LayerId,i):this._mapService.CreateMarker(i),this._markers.set(n,t),n.IconInfo&&t.then(function(t){n.DynamicMarkerCreated.emit(i.iconInfo);var e={x:i.iconInfo.size&&i.iconInfo.markerOffsetRatio?i.iconInfo.size.width*i.iconInfo.markerOffsetRatio.x:0,y:i.iconInfo.size&&i.iconInfo.markerOffsetRatio?i.iconInfo.size.height*i.iconInfo.markerOffsetRatio.y:0};t.SetAnchor(e)})},t.prototype.CreateEventObservable=function(n,t){var i=this;return a.Observable.create(function(e){i._markers.get(t).then(function(t){t.AddListener(n,function(t){return i._zone.run(function(){return e.next(t)})})})})},t.prototype.DeleteMarker=function(t){var n=this,e=this._markers.get(t);return null==e?Promise.resolve():e.then(function(e){return t.InClusterLayer&&n._clusterService.GetNativeLayer(t.LayerId).then(function(t){t.RemoveEntity(e)}),t.InCustomLayer&&n._layerService.GetNativeLayer(t.LayerId).then(function(t){t.RemoveEntity(e)}),n._zone.run(function(){e.DeleteMarker(),n._markers["delete"](t)})})},t.prototype.GetCoordinatesFromClick=function(t){return t&&t.latLng&&t.latLng.lat&&t.latLng.lng?{latitude:t.latLng.lat(),longitude:t.latLng.lng()}:null},t.prototype.GetNativeMarker=function(t){return this._markers.get(t)},t.prototype.GetPixelsFromClick=function(t){if(!(t&&t.latLng&&t.latLng.lat&&t.latLng.lng))return null;if(null==this._mapService.MapInstance)return null;var e=!1,n=this._mapService.MapInstance,i=n.getProjection(),o=Math.pow(2,n.getZoom()),r=n.getBounds();(r.getCenter().lng()<r.getSouthWest().lng()||r.getCenter().lng()>r.getNorthEast().lng())&&(e=!0);var a=i.fromLatLngToPoint(r.getNorthEast()).y,s=i.fromLatLngToPoint(r.getSouthWest()).x,l=i.fromLatLngToPoint(t.latLng);return{x:Math.floor((l.x-s+(e&&l.x<s?256:0))*o),y:Math.floor((l.y-a)*o)}},t.prototype.LocationToPoint=function(t){var n=this;return null==t?Promise.resolve(null):t instanceof nt?this._markers.get(t).then(function(t){var e=t.Location;return n._mapService.LocationToPoint(e)}):this._mapService.LocationToPoint(t)},t.prototype.UpdateAnchor=function(e){return this._markers.get(e).then(function(t){t.SetAnchor(e.Anchor)})},t.prototype.UpdateDraggable=function(e){return this._markers.get(e).then(function(t){return t.SetDraggable(e.Draggable)})},t.prototype.UpdateIcon=function(i){return this._markers.get(i).then(function(t){if(i.IconInfo){var e={position:{latitude:i.Latitude,longitude:i.Longitude},iconInfo:i.IconInfo},n=G.TranslateMarkerOptions(e);t.SetIcon(n.icon),i.DynamicMarkerCreated.emit(e.iconInfo)}else t.SetIcon(i.IconUrl)})},t.prototype.UpdateLabel=function(e){return this._markers.get(e).then(function(t){t.SetLabel(e.Label)})},t.prototype.UpdateMarkerPosition=function(e){return this._markers.get(e).then(function(t){return t.SetPosition({latitude:e.Latitude,longitude:e.Longitude})})},t.prototype.UpdateTitle=function(e){return this._markers.get(e).then(function(t){return t.SetTitle(e.Title)})},t.prototype.UpdateVisible=function(e){return this._markers.get(e).then(function(t){return t.SetVisible(e.Visible)})},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:Y},{type:J},{type:r.NgZone}]},t}(),Qt=function(){function t(t){this._layer=t,this._isClustering=!0,this._markerLookup=new Map,this._markers=new Array,this._pendingMarkers=new Array,this._mapclicks=0,this._currentZoom=0,this._visible=!0}return Object.defineProperty(t.prototype,"NativePrimitve",{get:function(){return this._layer},enumerable:!0,configurable:!0}),t.prototype.AddListener=function(t,e){throw new Error("Events are not supported on Google Cluster Layers. You can still add events to individual markers.")},t.prototype.AddEntity=function(t){var e=t instanceof l;(e=t instanceof N||e)&&(t.NativePrimitve.setMap(null),t.IsFirst&&this.StopClustering()),t.NativePrimitve&&t.Location&&(this._isClustering&&this._visible?(this._layer.addMarker(t.NativePrimitve),this._markers.push(t)):this._pendingMarkers.push(t),this._markerLookup.set(t.NativePrimitve,t)),e&&t.IsLast&&this.StartClustering()},t.prototype.AddEntities=function(t){var e,n,i=this;if(null!=t&&Array.isArray(t)&&0!==t.length){var o=t.map(function(t){return i._markerLookup.set(t.NativePrimitve,t),t.NativePrimitve.setMap(null),t.NativePrimitve});this._isClustering&&this._visible?(this._layer.addMarkers(o),(e=this._markers).push.apply(e,y(t))):(n=this._pendingMarkers).push.apply(n,y(t))}},t.prototype.Delete=function(){this._layer.getMarkers().forEach(function(t){t.setMap(null)}),this._layer.clearMarkers(),this._markers.splice(0),this._pendingMarkers.splice(0)},t.prototype.GetMarkerFromGoogleMarker=function(t){return this._markerLookup.get(t)},t.prototype.GetOptions=function(){return{id:0,gridSize:this._layer.getGridSize(),clusteringEnabled:0===this._layer.getGridSize(),maxZoom:this._layer.getMaxZoom(),minimumClusterSize:this._layer.getMinClusterSize(),placementMode:this._layer.isAverageCenter()?g.MeanValue:g.FirstPin,visible:this._visible,zoomOnClick:this._layer.isZoomOnClick(),styles:this._layer.getStyles()}},t.prototype.GetVisible=function(){return this._visible},t.prototype.RemoveEntity=function(t){if(t.NativePrimitve&&t.Location){var e=this._markers.indexOf(t),n=this._pendingMarkers.indexOf(t);-1<e&&this._markers.splice(e,1),-1<n&&this._pendingMarkers.splice(n,1),this._isClustering&&this._layer.removeMarker(t.NativePrimitve),this._markerLookup["delete"](t.NativePrimitve)}},t.prototype.SetEntities=function(t){var e=this;this._layer.getMarkers().forEach(function(t){t.setMap(null)}),this._layer.clearMarkers(),this._markers.splice(0),this._pendingMarkers.splice(0),this._markerLookup.clear();var n=new Array;t.forEach(function(t){t.NativePrimitve&&t.Location&&(t.NativePrimitve.setMap(null),e._markerLookup.set(t.NativePrimitve,t),e._visible?(e._markers.push(t),n.push(t.NativePrimitve)):e._pendingMarkers.push(t))}),this._layer.addMarkers(n)},t.prototype.SetOptions=function(t){if(null!=t.placementMode)throw new Error("GoogleMarkerClusterer: PlacementMode option cannot be set after initial creation.");if(null!=t.zoomOnClick)throw new Error("GoogleMarkerClusterer: ZoomOnClick option cannot be set after initial creation.");t.callback,null!=t.clusteringEnabled&&(this._layer.setMinClusterSize(t.clusteringEnabled?1:1e7),this._layer.resetViewport(),this._layer.redraw()),null==t.gridSize||null!=t.clusteringEnabled&&!t.clusteringEnabled||(this._layer.setGridSize(t.gridSize),this._layer.resetViewport(),this._layer.redraw()),null!=t.maxZoom&&this._layer.setMaxZoom(t.maxZoom),null!=t.minimumClusterSize&&this._layer.setMinClusterSize(t.minimumClusterSize),null!=t.styles&&this._layer.setStyles(t.styles),null!=t.visible&&this.SetVisible(t.visible)},t.prototype.SetVisible=function(t){t&&this._layer.getMap();if(t){var e=new Array;0<this._pendingMarkers.length?(this._pendingMarkers.forEach(function(t){t.NativePrimitve&&t.Location&&e.push(t.NativePrimitve)}),this._layer.addMarkers(e),this._markers=this._markers.concat(this._pendingMarkers.splice(0))):this._layer.redraw()}else this._layer.resetViewport(!0);this._visible=t},t.prototype.StartClustering=function(){var t=this;if(!this._isClustering){if(this._visible){var e=new Array;this._markers.forEach(function(t){t.NativePrimitve&&t.Location&&e.push(t.NativePrimitve)}),this._pendingMarkers.forEach(function(t){t.NativePrimitve&&t.Location&&e.push(t.NativePrimitve)}),this._layer.addMarkers(e),this._markers=this._markers.concat(this._pendingMarkers.splice(0))}this._visible||a.timer(0).subscribe(function(){t._layer.resetViewport(!0)}),this._isClustering=!0}},t.prototype.StopClustering=function(){this._isClustering&&(this._isClustering=!1)},t}(),$t=function(){function t(t,e){var n=this;this._loader=t,this._zone=e,this._map=new Promise(function(t){n._mapResolver=t}),this._config=this._loader.Config}return Object.defineProperty(t.prototype,"MapInstance",{get:function(){return this._mapInstance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"MapPromise",{get:function(){return this._map},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"MapSize",{get:function(){if(this.MapInstance){var t=this.MapInstance.getDiv();return{width:t.offsetWidth,height:t.offsetHeight}}return null},enumerable:!0,configurable:!0}),t.prototype.CreateCanvasOverlay=function(n){return this._map.then(function(t){var e=new H(n);return e.SetMap(t),e})},t.prototype.CreateClusterLayer=function(r){return this._map.then(function(t){var e=!1,n=new MarkerClusterer(t,[],r),i=new Qt(n),o={id:r.id};return r.visible||(e=!(o.visible=!1)),r.clusteringEnabled||(e=!(o.clusteringEnabled=!1)),e&&i.SetOptions(o),i})},t.prototype.CreateInfoWindow=function(i){var o=this;return this._map.then(function(t){var e=G.TranslateInfoWindowOptions(i),n=new google.maps.InfoWindow(e);return new j(n,o)})},t.prototype.CreateLayer=function(e){var n=this;return this._map.then(function(t){return new Wt(t,n,e.id)})},t.prototype.CreateMap=function(n,i){var o=this;return this._loader.Load().then(function(){new L(Z).Extend(new google.maps.OverlayView).Map("changed","Changed").Map("onAdd","OnAdd").Map("draw","Draw").Map("onRemove","OnRemove"),new L(H).Extend(new google.maps.OverlayView).Map("onAdd","OnAdd").Map("draw","OnDraw").Map("onRemove","OnRemove"),null==!i.mapTypeId&&(i.mapTypeId=s.hybrid),null!=o._mapInstance&&o.DisposeMap();var t=G.TranslateOptions(i),e=new google.maps.Map(n,t);i.bounds&&e.fitBounds(G.TranslateBounds(i.bounds)),o._mapInstance=e,o._mapResolver(e)})},t.prototype.CreateMarker=function(o){void 0===o&&(o={});var i=function(t,e){var n=new google.maps.Marker(t),i=new N(n);return i.IsFirst=o.isFirst,i.IsLast=o.isLast,o.metadata&&o.metadata.forEach(function(t,e){return i.Metadata.set(e,t)}),n.setMap(e),i};return this._map.then(function(e){var n=G.TranslateMarkerOptions(o);if(o.iconInfo&&o.iconInfo.markerType){var t=l.CreateMarker(o.iconInfo);return"string"==typeof t?(n.icon=t,i(n,e)):t.then(function(t){return n.icon=t.icon,i(n,e)})}return i(n,e)})},t.prototype.CreatePolygon=function(o){return this._map.then(function(t){var e=G.TranslatePolygonOptions(o),n=new google.maps.Polygon(e);n.setMap(t);var i=new V(n);return o.metadata&&o.metadata.forEach(function(t,e){return i.Metadata.set(e,t)}),o.title&&""!==o.title&&(i.Title=o.title),null!=o.showLabel&&(i.ShowLabel=o.showLabel),null!=o.showTooltip&&(i.ShowTooltip=o.showTooltip),null!=o.labelMaxZoom&&(i.LabelMaxZoom=o.labelMaxZoom),null!=o.labelMinZoom&&(i.LabelMinZoom=o.labelMinZoom),i})},t.prototype.CreatePolyline=function(r){var a;return this._map.then(function(e){var i=G.TranslatePolylineOptions(r);if(r.path&&0<r.path.length&&!Array.isArray(r.path[0])){i.path=G.TranslatePaths(r.path)[0],(a=new google.maps.Polyline(i)).setMap(e);var n=new R(a);return r.metadata&&r.metadata.forEach(function(t,e){return n.Metadata.set(e,t)}),r.title&&""!==r.title&&(n.Title=r.title),null!=r.showTooltip&&(n.ShowTooltip=r.showTooltip),n}var t=G.TranslatePaths(r.path),o=new Array;return t.forEach(function(t){i.path=t,(a=new google.maps.Polyline(i)).setMap(e);var n=new R(a);r.metadata&&r.metadata.forEach(function(t,e){return n.Metadata.set(e,t)}),r.title&&""!==r.title&&(n.Title=r.title),null!=r.showTooltip&&(n.ShowTooltip=r.showTooltip),o.push(n)}),o})},t.prototype.DeleteLayer=function(t){return Promise.resolve()},t.prototype.DisposeMap=function(){var e=this;null==this._map&&null==this._mapInstance||null!=this._mapInstance&&(this._mapInstance=null,this._map=new Promise(function(t){e._mapResolver=t}))},t.prototype.GetCenter=function(){return this._map.then(function(t){var e=t.getCenter();return{latitude:e.lat(),longitude:e.lng()}})},t.prototype.GetBounds=function(){return this._map.then(function(t){var e=t.getBounds();return{maxLatitude:e.getNorthEast().lat(),maxLongitude:Math.max(e.getNorthEast().lng(),e.getSouthWest().lng()),minLatitude:e.getSouthWest().lat(),minLongitude:Math.min(e.getNorthEast().lng(),e.getSouthWest().lng()),center:{latitude:e.getCenter().lat(),longitude:e.getCenter().lng()},padding:0}})},t.prototype.GetZoom=function(){return this._map.then(function(t){return t.getZoom()})},t.prototype.LocationToPoint=function(u){return this._map.then(function(t){var e=!1,n=G.TranslateLocationObject(u),i=t.getProjection(),o=Math.pow(2,t.getZoom()),r=t.getBounds();(r.getCenter().lng()<r.getSouthWest().lng()||r.getCenter().lng()>r.getNorthEast().lng())&&(e=!0);var a=i.fromLatLngToPoint(r.getNorthEast()).y,s=i.fromLatLngToPoint(r.getSouthWest()).x,l=i.fromLatLngToPoint(n);return{x:Math.floor((l.x-s+(e&&l.x<s?256:0))*o),y:Math.floor((l.y-a)*o)}})},t.prototype.LocationsToPoints=function(n){return this._map.then(function(t){var i=!1,o=t.getProjection(),r=Math.pow(2,t.getZoom()),e=t.getBounds();(e.getCenter().lng()<e.getSouthWest().lng()||e.getCenter().lng()>e.getNorthEast().lng())&&(i=!0);var a=o.fromLatLngToPoint(e.getSouthWest()).x,s=o.fromLatLngToPoint(e.getNorthEast()).y;return n.map(function(t){var e=G.TranslateLocationObject(t),n=o.fromLatLngToPoint(e);return{x:Math.floor((n.x-a+(i&&n.x<a?256:0))*r),y:Math.floor((n.y-s)*r)}})})},t.prototype.SetCenter=function(n){return this._map.then(function(t){var e=G.TranslateLocationObject(n);t.setCenter(e)})},t.prototype.SetMapOptions=function(n){this._map.then(function(t){var e=G.TranslateOptions(n);t.setOptions(e)})},t.prototype.SetViewOptions=function(n){this._map.then(function(t){n.bounds&&t.fitBounds(G.TranslateBounds(n.bounds));var e=G.TranslateOptions(n);t.setOptions(e)})},t.prototype.SetZoom=function(e){return this._map.then(function(t){return t.setZoom(e)})},t.prototype.SubscribeToMapEvent=function(t){var n=this,i=B[t];return a.Observable.create(function(e){n._map.then(function(t){t.addListener(i,function(t){n._zone.run(function(){return e.next(t)})})})})},t.prototype.TriggerMapEvent=function(e){return this._map.then(function(t){return google.maps.event.trigger(t,e,null)})},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:St},{type:r.NgZone}]},t}(),te=function(){function t(t,e,n){this._mapService=t,this._layerService=e,this._zone=n,this._polygons=new Map}return t.prototype.AddPolygon=function(t){var e={id:t.Id,clickable:t.Clickable,draggable:t.Draggable,editable:t.Editable,fillColor:t.FillColor,fillOpacity:t.FillOpacity,geodesic:t.Geodesic,labelMaxZoom:t.LabelMaxZoom,labelMinZoom:t.LabelMinZoom,paths:t.Paths,showLabel:t.ShowLabel,showTooltip:t.ShowTooltip,strokeColor:t.StrokeColor,strokeOpacity:t.StrokeOpacity,strokeWeight:t.StrokeWeight,title:t.Title,visible:t.Visible,zIndex:t.zIndex},n=this._mapService.CreatePolygon(e);this._polygons.set(t,n)},t.prototype.CreateEventObservable=function(n,t){var i=this;return a.Observable.create(function(e){i._polygons.get(t).then(function(t){t.AddListener(n,function(t){return i._zone.run(function(){return e.next(t)})})})})},t.prototype.DeletePolygon=function(e){var n=this,t=this._polygons.get(e);return null==t?Promise.resolve():t.then(function(t){return n._zone.run(function(){t.Delete(),n._polygons["delete"](e)})})},t.prototype.GetCoordinatesFromClick=function(t){return{latitude:t.latLng.lat(),longitude:t.latLng.lng()}},t.prototype.GetNativePolygon=function(t){return this._polygons.get(t)},t.prototype.SetOptions=function(t,e){return this._polygons.get(t).then(function(t){t.SetOptions(e)})},t.prototype.UpdatePolygon=function(e){var t=this._polygons.get(e);return null!=t&&null!=e.Paths&&Array.isArray(e.Paths)&&0!==e.Paths.length?t.then(function(t){Array.isArray(e.Paths[0])?t.SetPaths(e.Paths):t.SetPath(e.Paths)}):Promise.resolve()},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:Y},{type:r.NgZone}]},t}(),ee=function(){function t(t,e,n){this._mapService=t,this._layerService=e,this._zone=n,this._polylines=new Map}return t.prototype.AddPolyline=function(t){var e={id:t.Id,clickable:t.Clickable,draggable:t.Draggable,editable:t.Editable,geodesic:t.Geodesic,path:t.Path,showTooltip:t.ShowTooltip,strokeColor:t.StrokeColor,strokeOpacity:t.StrokeOpacity,strokeWeight:t.StrokeWeight,title:t.Title,visible:t.Visible,zIndex:t.zIndex},n=this._mapService.CreatePolyline(e);this._polylines.set(t,n)},t.prototype.CreateEventObservable=function(n,t){var i=this;return a.Observable.create(function(e){i._polylines.get(t).then(function(t){(Array.isArray(t)?t:[t]).forEach(function(t){return t.AddListener(n,function(t){return i._zone.run(function(){return e.next(t)})})})})})},t.prototype.DeletePolyline=function(e){var n=this,t=this._polylines.get(e);return null==t?Promise.resolve():t.then(function(t){return n._zone.run(function(){(Array.isArray(t)?t:[t]).forEach(function(t){return t.Delete()}),n._polylines["delete"](e)})})},t.prototype.GetCoordinatesFromClick=function(t){return t&&t.latLng&&t.latLng.lat&&t.latLng.lng?{latitude:t.latLng.lat(),longitude:t.latLng.lng()}:null},t.prototype.GetNativePolyline=function(t){return this._polylines.get(t)},t.prototype.SetOptions=function(t,e){return this._polylines.get(t).then(function(t){(Array.isArray(t)?t:[t]).forEach(function(t){return t.SetOptions(e)})})},t.prototype.UpdatePolyline=function(i){var t=this,e=this._polylines.get(i);return null==e?Promise.resolve():e.then(function(e){return t._zone.run(function(){var t=Array.isArray(e)?e:[e],n=0<i.Path.length&&Array.isArray(i.Path[0])?i.Path:[i.Path];t.forEach(function(t,e){n.length>e&&t.SetPath(n[e])}),Array.isArray(e)&&e.length>n.length&&e.splice(n.length-1).forEach(function(t){return t.Delete()})})})},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:W},{type:Y},{type:r.NgZone}]},t}(),ne=function(){function t(t,e){var n=this;this._loader=t,this._zone=e,this._map=new Promise(function(t){n._mapResolver=t})}return t.prototype.Create=function(){return new $t(this._loader,this._zone)},t.prototype.CreateClusterService=function(t){return new Ht(t,this._zone)},t.prototype.CreateInfoBoxService=function(t,e){return new Ft(t,e,this._zone)},t.prototype.CreateLayerService=function(t){return new Ut(t,this._zone)},t.prototype.CreateMarkerService=function(t,e,n){return new Jt(t,e,n,this._zone)},t.prototype.CreatePolygonService=function(t,e){return new te(t,e,this._zone)},t.prototype.CreatePolylineService=function(t,e){return new ee(t,e,this._zone)},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:St},{type:r.NgZone}]},t}();function ie(t,e){return new ne(t,e)}function oe(){return new Xt(new Yt,new Pt,new Ot)}var re=function(){function n(){}return n.forRoot=function(t,e){return{ngModule:n,providers:[t?{provide:F,useValue:t}:{provide:F,deps:[St,r.NgZone],useFactory:Vt},e?{provide:St,useValue:e}:{provide:St,useFactory:Rt},Ot,Pt]}},n.forRootBing=function(){return{ngModule:n,providers:[{provide:F,deps:[St,r.NgZone],useFactory:Vt},{provide:St,useFactory:Rt},Ot,Pt]}},n.forRootGoogle=function(){return{ngModule:n,providers:[{provide:F,deps:[St,r.NgZone],useFactory:ie},{provide:St,useFactory:oe},Ot,Pt]}},n.decorators=[{type:r.NgModule,args:[{declarations:[ht,it,nt,tt,Q,yt,gt,ft,_t,Mt,Ct],imports:[e.CommonModule],exports:[e.CommonModule,it,nt,yt,gt,tt,Q,ht,ft,_t,Mt,Ct]}]}],n}();t.MapComponent=it,t.InfoBoxComponent=tt,t.MapMarkerDirective=nt,t.MapPolygonDirective=yt,t.MapPolylineDirective=gt,t.InfoBoxActionDirective=Q,t.MapMarkerLayerDirective=_t,t.MapPolygonLayerDirective=Mt,t.MapLayerDirective=ht,t.ClusterLayerDirective=ft,t.MapPolylineLayerDirective=Ct,t.MapTypeId=s,t.Marker=l,t.MarkerTypeId=u,t.InfoWindow=n,t.Layer=o,t.ClusterPlacementMode=g,t.ClusterClickAction=v,t.SpiderClusterMarker=m,t.Polygon=c,t.Polyline=p,t.CanvasOverlay=b,t.MapService=W,t.MapServiceFactory=F,t.MarkerService=U,t.InfoBoxService=q,t.MapAPILoader=St,t.WindowRef=Pt,t.DocumentRef=Ot,t.LayerService=Y,t.PolygonService=K,t.PolylineService=X,t.ClusterService=J,t.BingMapServiceFactory=Zt,t.BingMapAPILoaderConfig=Lt,t.BingMapService=At,t.BingInfoBoxService=Tt,t.BingMarkerService=xt,t.BingPolygonService=jt,t.BingPolylineService=Nt,t.BingMapAPILoader=Et,t.BingLayerService=Dt,t.BingClusterService=Gt,t.BingLayer=M,t.BingMarker=C,t.BingPolyline=x,t.BingMapEventsLookup=A,t.BingPolygon=T,t.BingInfoWindow=P,t.BingClusterLayer=O,t.BingSpiderClusterMarker=S,t.BingCanvasOverlay=z,t.GoogleClusterService=Ht,t.GoogleInfoBoxService=Ft,t.GoogleLayerService=Ut,t.GoogleMapAPILoader=Xt,t.GoogleMapAPILoaderConfig=Yt,t.GoogleMapServiceFactory=ne,t.GoogleMapService=$t,t.GoogleMarkerService=Jt,t.GooglePolygonService=te,t.GooglePolylineService=ee,t.GoogleMarker=N,t.GoogleInfoWindow=j,t.GooglePolygon=V,t.GooglePolyline=R,t.GoogleMapEventsLookup=B,t.GoogleCanvasOverlay=H,t.MapModule=re,t.ɵa=ot,t.ɵb=rt,t.ɵc=at,t.ɵd=st,t.ɵe=lt,t.ɵf=ut,t.ɵg=ct,t.ɵl=zt,t.ɵi=Rt,t.ɵh=Vt,t.ɵm=Bt,t.ɵk=oe,t.ɵj=ie,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=angular-maps.umd.min.js.map