From 1a40bc2739a74f9ecdd64ab3673eb2fa06b66380 Mon Sep 17 00:00:00 2001 From: capdiem Date: Mon, 2 Sep 2024 23:13:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=90=9B=20(BaiduMap):=20failed=20to=20?= =?UTF-8?q?add=20marker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Masa.Blazor/Core/MasaComponentBase.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Masa.Blazor/Core/MasaComponentBase.cs b/src/Masa.Blazor/Core/MasaComponentBase.cs index 0e0263a60d..f43ee1ce79 100644 --- a/src/Masa.Blazor/Core/MasaComponentBase.cs +++ b/src/Masa.Blazor/Core/MasaComponentBase.cs @@ -51,7 +51,8 @@ public ForwardRef RefBack private ElementReference? _prevRef; private bool _elementReferenceChanged; - public ILogger Logger => LoggerFactory.CreateLogger(GetType()); + [JsonIgnore] + public ILogger? Logger => LoggerFactory.CreateLogger(GetType()); #region Build class and style From 5322f1e1d49d948ba7bf8971131cab4678ba369b Mon Sep 17 00:00:00 2001 From: capdiem Date: Mon, 2 Sep 2024 23:13:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=86=95=20(BaiduMap):=20add=20support?= =?UTF-8?q?=20for=20custom=20the=20marker=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Masa.Blazor.JS/package.json | 1 + src/Masa.Blazor.JS/rollup.config.maps.ts | 6 +- .../maps/baidumap/{index.js => index.ts} | 94 +++++++++++-------- .../Components/Map/BaiduMap/BaiduMapIcon.cs | 7 ++ .../Map/BaiduMap/Overlays/MBaiduMarker.cs | 22 +++-- .../wwwroot/js/proxies/baidumap-proxy.js | 2 +- .../wwwroot/js/proxies/baidumap-proxy.js.map | 2 +- 7 files changed, 83 insertions(+), 51 deletions(-) rename src/Masa.Blazor.JS/src/proxies/maps/baidumap/{index.js => index.ts} (70%) create mode 100644 src/Masa.Blazor/Components/Map/BaiduMap/BaiduMapIcon.cs diff --git a/src/Masa.Blazor.JS/package.json b/src/Masa.Blazor.JS/package.json index ba424a79bd..7bfea80a3b 100644 --- a/src/Masa.Blazor.JS/package.json +++ b/src/Masa.Blazor.JS/package.json @@ -48,6 +48,7 @@ "@rollup/plugin-replace": "^5.0.1", "@rollup/plugin-typescript": "^8.4.0", "@types/blazor__javascript-interop": "^3.1.4", + "@types/bmapgl-browser": "^0.0.3", "@types/drawflow": "^0.0.5", "@types/echarts": "^4.9.16", "@types/node": "^18.7.14", diff --git a/src/Masa.Blazor.JS/rollup.config.maps.ts b/src/Masa.Blazor.JS/rollup.config.maps.ts index 1e2daad54c..e58852f916 100644 --- a/src/Masa.Blazor.JS/rollup.config.maps.ts +++ b/src/Masa.Blazor.JS/rollup.config.maps.ts @@ -1,8 +1,10 @@ import { defineConfig } from "rollup"; import { terser } from "rollup-plugin-terser"; +import typescript from "@rollup/plugin-typescript"; + export default defineConfig({ - input: "./src/proxies/maps/baidumap/index.js", + input: "./src/proxies/maps/baidumap/index.ts", output: [ { file: "../Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js", @@ -10,5 +12,5 @@ export default defineConfig({ sourcemap: true, }, ], - plugins: [terser()], + plugins: [typescript(), terser()], }); diff --git a/src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.js b/src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts similarity index 70% rename from src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.js rename to src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts index 59b3c1db2b..3c30f64cf7 100644 --- a/src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.js +++ b/src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts @@ -5,8 +5,7 @@ class BaiduMapProxy { constructor(containerId, initArgs) { this.instance = new BMapGL.Map(containerId); - if (initArgs.enableScrollWheelZoom) - this.instance.enableScrollWheelZoom(); + if (initArgs.enableScrollWheelZoom) this.instance.enableScrollWheelZoom(); this.instance.setMaxZoom(initArgs.maxZoom); this.instance.setMinZoom(initArgs.minZoom); @@ -14,12 +13,11 @@ class BaiduMapProxy { this.instance.setMapType(initArgs.mapTypeString); - if (initArgs.trafficOn) - this.instance.setTrafficOn(); + if (initArgs.trafficOn) this.instance.setTrafficOn(); if (initArgs.dark) this.instance.setMapStyleV2({ - styleId: initArgs.darkThemeId + styleId: initArgs.darkThemeId, }); } @@ -28,25 +26,27 @@ class BaiduMapProxy { events.forEach((event_name) => { this.instance.addEventListener(event_name, async function (e) { - if (event_name == "dragstart" || + if ( + event_name == "dragstart" || event_name == "dragging" || event_name == "dragend" || - event_name == "dblclick") { + event_name == "dblclick" + ) { await dotNetHelper.invokeMethodAsync("OnEvent", event_name, { latlng: e.point, pixel: e.pixel, }); - } - else if (event_name == "click" || + } else if ( + event_name == "click" || event_name == "rightclick" || event_name == "rightdblclick" || - event_name == "mousemove") { + event_name == "mousemove" + ) { await dotNetHelper.invokeMethodAsync("OnEvent", event_name, { latlng: e.latlng, pixel: e.pixel, }); - } - else { + } else { await dotNetHelper.invokeMethodAsync("OnEvent", event_name, null); } }); @@ -74,7 +74,6 @@ class BaiduMapProxy { getMapType = () => this.instance.getMapType(); setTrafficOn = () => this.instance.setTrafficOn(); - setTrafficOff = () => this.instance.setTrafficOff(); setMapStyleV2 = (options) => this.instance.setMapStyleV2(options); @@ -94,7 +93,7 @@ class BaiduMapProxy { strokeOpacity: circle.strokeOpacity, strokeStyle: circle.strokeStyle == 0 ? "solid" : "dashed", fillColor: circle.fillColor, - fillOpacity: circle.fillOpacity + fillOpacity: circle.fillOpacity, }); this.instance.addOverlay(c); @@ -106,9 +105,27 @@ class BaiduMapProxy { var m = new BMapGL.Marker(marker.point, { offset: marker.offset, rotation: marker.rotation, - title: marker.title + title: marker.title, }); + console.log(marker.icon); + if (marker.icon && marker.icon.url) { + const { url, size, options } = marker.icon; + const opts: BMapGL.IconOptions = {}; + if (options) { + if (options.anchor) { + opts.anchor = new BMapGL.Size(options.anchor.width, options.anchor.height); + } + + if (options.imageOffset) { + opts.imageOffset = new BMapGL.Size(options.imageOffset.width, options.imageOffset.height); + } + } + m.setIcon( + new BMapGL.Icon(url, new BMapGL.Size(size.width, size.height), opts) + ); + } + this.instance.addOverlay(m); return m; @@ -117,7 +134,7 @@ class BaiduMapProxy { addLabel(label) { var l = new BMapGL.Label(label.content, { offset: label.offset, - position: label.position + position: label.position, }); this.instance.addOverlay(l); @@ -126,8 +143,7 @@ class BaiduMapProxy { } addPolyline(polyline) { - if (polyline.points == null) - return null; + if (polyline.points == null) return null; var pl = new BMapGL.Polyline(polyline.points, { strokeColor: polyline.strokeColor, @@ -135,8 +151,8 @@ class BaiduMapProxy { strokeOpacity: polyline.strokeOpacity, strokeStyle: polyline.strokeStyle == 0 ? "solid" : "dashed", geodesic: polyline.geodesic, - clip: polyline.clip - }); + clip: polyline.clip, + } as any); this.instance.addOverlay(pl); @@ -144,11 +160,10 @@ class BaiduMapProxy { } addPolygon(polygon) { - if (polygon.points == null) - return null; + if (polygon.points == null) return null; var bmapPoints = []; - polygon.points.forEach(element => { + polygon.points.forEach((element) => { bmapPoints.push(toBMapGLPoint(element)); }); @@ -158,7 +173,7 @@ class BaiduMapProxy { strokeOpacity: polygon.strokeOpacity, strokeStyle: polygon.strokeStyle == 0 ? "solid" : "dashed", fillColor: polygon.fillColor, - fillOpacity: polygon.fillOpacity + fillOpacity: polygon.fillOpacity, }); this.instance.addOverlay(pg); @@ -169,28 +184,31 @@ class BaiduMapProxy { contains(overlay) { var os = this.instance.getOverlays(); for (let index = 0; index < os.length; index++) { - if (os[index] === overlay) - return true; + if (os[index] === overlay) return true; } return false; } destroyMap() { - if (this.instance != null) - delete this.instance; + if (this.instance != null) delete this.instance; } } -BMapGL.Polygon.prototype.setPathWithGeoPoint = (points, polygon) => { - if (points == null) - return; +if (typeof BMapGL !== "undefined") { + BMapGL.Polygon.prototype.setPathWithGeoPoint = (points, polygon) => { + if (points == null) return; - var bmapPoints = []; - points.forEach(element => { - bmapPoints.push(toBMapGLPoint(element)); - }); + var bmapPoints = []; + points.forEach((element) => { + bmapPoints.push(toBMapGLPoint(element)); + }); + + polygon.setPath(bmapPoints); + }; - polygon.setPath(bmapPoints); + console.log("BMapGL is loaded"); +} else { + console.error("BMapGL is not defined"); } const toBMapGLPoint = (point) => new BMapGL.Point(point.lng, point.lat); @@ -201,6 +219,6 @@ const init = (containerId, initArgs) => { } return null; -} +}; -export { init } \ No newline at end of file +export { init }; diff --git a/src/Masa.Blazor/Components/Map/BaiduMap/BaiduMapIcon.cs b/src/Masa.Blazor/Components/Map/BaiduMap/BaiduMapIcon.cs new file mode 100644 index 0000000000..b6de18ef73 --- /dev/null +++ b/src/Masa.Blazor/Components/Map/BaiduMap/BaiduMapIcon.cs @@ -0,0 +1,7 @@ +namespace Masa.Blazor; + +public record BaiduMapIcon(string Url, BaiduMapSize Size, BaiduMapIconOptions? Options = null); + +public record BaiduMapSize(int Width, int Height); + +public record BaiduMapIconOptions(BaiduMapSize? Anchor = null, BaiduMapSize? ImageOffset = null); \ No newline at end of file diff --git a/src/Masa.Blazor/Components/Map/BaiduMap/Overlays/MBaiduMarker.cs b/src/Masa.Blazor/Components/Map/BaiduMap/Overlays/MBaiduMarker.cs index de816a765e..87935b71aa 100644 --- a/src/Masa.Blazor/Components/Map/BaiduMap/Overlays/MBaiduMarker.cs +++ b/src/Masa.Blazor/Components/Map/BaiduMap/Overlays/MBaiduMarker.cs @@ -33,21 +33,25 @@ public string? Title set => SetValue(value); } + [Parameter] + [MasaApiParameter(ReleasedOn = "v1.7.1")] + public BaiduMapIcon? Icon { get; set; } + protected override void RegisterWatchers(PropertyWatcher watcher) { base.RegisterWatchers(watcher); - watcher.Watch(nameof(Title), async (val) - => await OverlayJSObjectRef.TryInvokeVoidAsync("setTitle", val)); - - watcher.Watch(nameof(Point), async (val) - => await OverlayJSObjectRef.TryInvokeVoidAsync("setPosition", val)); + watcher.Watch(nameof(Title), (val) => InvokeJsMethod("setTitle", val)) + .Watch(nameof(Point), (val) => InvokeJsMethod("setPosition", val)) + .Watch(nameof(Offset), (val) => InvokeJsMethod("setOffset", val)) + .Watch(nameof(Rotation), (val) => InvokeJsMethod("setRotation", val)); - watcher.Watch(nameof(Offset), async (val) - => await OverlayJSObjectRef.TryInvokeVoidAsync("setOffset", val)); + return; - watcher.Watch(nameof(Rotation), async (val) - => await OverlayJSObjectRef.TryInvokeVoidAsync("setRotation", val)); + void InvokeJsMethod(string methodName, object args) + { + _ = OverlayJSObjectRef.TryInvokeVoidAsync(methodName, args); + } } } } \ No newline at end of file diff --git a/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js b/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js index f5a35b810e..7adb52bd24 100644 --- a/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js +++ b/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js @@ -1,2 +1,2 @@ -class e{instance;dotNetHelper;constructor(e,t){this.instance=new BMapGL.Map(e),t.enableScrollWheelZoom&&this.instance.enableScrollWheelZoom(),this.instance.setMaxZoom(t.maxZoom),this.instance.setMinZoom(t.minZoom),this.instance.centerAndZoom(t.center,t.zoom),this.instance.setMapType(t.mapTypeString),t.trafficOn&&this.instance.setTrafficOn(),t.dark&&this.instance.setMapStyleV2({styleId:t.darkThemeId})}setDotNetObjectReference(e,t){this.dotNetHelper=e,t.forEach((t=>{this.instance.addEventListener(t,(async function(n){"dragstart"==t||"dragging"==t||"dragend"==t||"dblclick"==t?await e.invokeMethodAsync("OnEvent",t,{latlng:n.point,pixel:n.pixel}):"click"==t||"rightclick"==t||"rightdblclick"==t||"mousemove"==t?await e.invokeMethodAsync("OnEvent",t,{latlng:n.latlng,pixel:n.pixel}):await e.invokeMethodAsync("OnEvent",t,null)}))}))}getOriginInstance=()=>this.instance;getCenter=()=>this.instance.getCenter();setZoom=e=>this.instance.setZoom(e);getZoom=()=>this.instance.getZoom();setMaxZoom=e=>this.instance.setMaxZoom(e);setMinZoom=e=>this.instance.setMinZoom(e);enableScrollWheelZoom=()=>this.instance.enableScrollWheelZoom();disableScrollWheelZoom=()=>this.instance.disableScrollWheelZoom();setMapType=e=>this.instance.setMapType(e);getMapType=()=>this.instance.getMapType();setTrafficOn=()=>this.instance.setTrafficOn();setTrafficOff=()=>this.instance.setTrafficOff();setMapStyleV2=e=>this.instance.setMapStyleV2(e);panTo=e=>this.instance.panTo(e);addOverlay=e=>this.instance.addOverlay(e);removeOverlay=e=>this.instance.removeOverlay(e);clearOverlays=()=>this.instance.clearOverlays();addCircle(e){var t=new BMapGL.Circle(e.center,e.radius,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",fillColor:e.fillColor,fillOpacity:e.fillOpacity});return this.instance.addOverlay(t),t}addMarker(e){var t=new BMapGL.Marker(e.point,{offset:e.offset,rotation:e.rotation,title:e.title});return this.instance.addOverlay(t),t}addLabel(e){var t=new BMapGL.Label(e.content,{offset:e.offset,position:e.position});return this.instance.addOverlay(t),t}addPolyline(e){if(null==e.points)return null;var t=new BMapGL.Polyline(e.points,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",geodesic:e.geodesic,clip:e.clip});return this.instance.addOverlay(t),t}addPolygon(e){if(null==e.points)return null;var n=[];e.points.forEach((e=>{n.push(t(e))}));var i=new BMapGL.Polygon(n,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",fillColor:e.fillColor,fillOpacity:e.fillOpacity});return this.instance.addOverlay(i),i}contains(e){var t=this.instance.getOverlays();for(let n=0;n{if(null!=e){var i=[];e.forEach((e=>{i.push(t(e))})),n.setPath(i)}};const t=e=>new BMapGL.Point(e.lng,e.lat),n=(t,n)=>t&&document.getElementById(t)?new e(t,n):null;export{n as init}; +function e(e,t,i,n){return new(i||(i=Promise))((function(o,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function r(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,r)}l((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class t{constructor(e,t){this.getOriginInstance=()=>this.instance,this.getCenter=()=>this.instance.getCenter(),this.setZoom=e=>this.instance.setZoom(e),this.getZoom=()=>this.instance.getZoom(),this.setMaxZoom=e=>this.instance.setMaxZoom(e),this.setMinZoom=e=>this.instance.setMinZoom(e),this.enableScrollWheelZoom=()=>this.instance.enableScrollWheelZoom(),this.disableScrollWheelZoom=()=>this.instance.disableScrollWheelZoom(),this.setMapType=e=>this.instance.setMapType(e),this.getMapType=()=>this.instance.getMapType(),this.setTrafficOn=()=>this.instance.setTrafficOn(),this.setTrafficOff=()=>this.instance.setTrafficOff(),this.setMapStyleV2=e=>this.instance.setMapStyleV2(e),this.panTo=e=>this.instance.panTo(e),this.addOverlay=e=>this.instance.addOverlay(e),this.removeOverlay=e=>this.instance.removeOverlay(e),this.clearOverlays=()=>this.instance.clearOverlays(),this.instance=new BMapGL.Map(e),t.enableScrollWheelZoom&&this.instance.enableScrollWheelZoom(),this.instance.setMaxZoom(t.maxZoom),this.instance.setMinZoom(t.minZoom),this.instance.centerAndZoom(t.center,t.zoom),this.instance.setMapType(t.mapTypeString),t.trafficOn&&this.instance.setTrafficOn(),t.dark&&this.instance.setMapStyleV2({styleId:t.darkThemeId})}setDotNetObjectReference(t,i){this.dotNetHelper=t,i.forEach((i=>{this.instance.addEventListener(i,(function(n){return e(this,void 0,void 0,(function*(){"dragstart"==i||"dragging"==i||"dragend"==i||"dblclick"==i?yield t.invokeMethodAsync("OnEvent",i,{latlng:n.point,pixel:n.pixel}):"click"==i||"rightclick"==i||"rightdblclick"==i||"mousemove"==i?yield t.invokeMethodAsync("OnEvent",i,{latlng:n.latlng,pixel:n.pixel}):yield t.invokeMethodAsync("OnEvent",i,null)}))}))}))}addCircle(e){var t=new BMapGL.Circle(e.center,e.radius,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",fillColor:e.fillColor,fillOpacity:e.fillOpacity});return this.instance.addOverlay(t),t}addMarker(e){var t=new BMapGL.Marker(e.point,{offset:e.offset,rotation:e.rotation,title:e.title});if(console.log(e.icon),e.icon&&e.icon.url){const{url:i,size:n,options:o}=e.icon,s={};o&&(o.anchor&&(s.anchor=new BMapGL.Size(o.anchor.width,o.anchor.height)),o.imageOffset&&(s.imageOffset=new BMapGL.Size(o.imageOffset.width,o.imageOffset.height))),t.setIcon(new BMapGL.Icon(i,new BMapGL.Size(n.width,n.height),s))}return this.instance.addOverlay(t),t}addLabel(e){var t=new BMapGL.Label(e.content,{offset:e.offset,position:e.position});return this.instance.addOverlay(t),t}addPolyline(e){if(null==e.points)return null;var t=new BMapGL.Polyline(e.points,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",geodesic:e.geodesic,clip:e.clip});return this.instance.addOverlay(t),t}addPolygon(e){if(null==e.points)return null;var t=[];e.points.forEach((e=>{t.push(i(e))}));var n=new BMapGL.Polygon(t,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",fillColor:e.fillColor,fillOpacity:e.fillOpacity});return this.instance.addOverlay(n),n}contains(e){var t=this.instance.getOverlays();for(let i=0;i{if(null!=e){var n=[];e.forEach((e=>{n.push(i(e))})),t.setPath(n)}},console.log("BMapGL is loaded")):console.error("BMapGL is not defined");const i=e=>new BMapGL.Point(e.lng,e.lat),n=(e,i)=>e&&document.getElementById(e)?new t(e,i):null;export{n as init}; //# sourceMappingURL=baidumap-proxy.js.map diff --git a/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js.map b/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js.map index f1f9b4d545..4d93506021 100644 --- a/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js.map +++ b/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js.map @@ -1 +1 @@ -{"version":3,"file":"baidumap-proxy.js","sources":["../../../../Masa.Blazor.JS/src/proxies/maps/baidumap/index.js"],"sourcesContent":["class BaiduMapProxy {\r\n instance;\r\n dotNetHelper;\r\n\r\n constructor(containerId, initArgs) {\r\n this.instance = new BMapGL.Map(containerId);\r\n\r\n if (initArgs.enableScrollWheelZoom)\r\n this.instance.enableScrollWheelZoom();\r\n\r\n this.instance.setMaxZoom(initArgs.maxZoom);\r\n this.instance.setMinZoom(initArgs.minZoom);\r\n this.instance.centerAndZoom(initArgs.center, initArgs.zoom);\r\n\r\n this.instance.setMapType(initArgs.mapTypeString);\r\n\r\n if (initArgs.trafficOn)\r\n this.instance.setTrafficOn();\r\n\r\n if (initArgs.dark)\r\n this.instance.setMapStyleV2({\r\n styleId: initArgs.darkThemeId\r\n });\r\n }\r\n\r\n setDotNetObjectReference(dotNetHelper, events) {\r\n this.dotNetHelper = dotNetHelper;\r\n\r\n events.forEach((event_name) => {\r\n this.instance.addEventListener(event_name, async function (e) {\r\n if (event_name == \"dragstart\" ||\r\n event_name == \"dragging\" ||\r\n event_name == \"dragend\" ||\r\n event_name == \"dblclick\") {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, {\r\n latlng: e.point,\r\n pixel: e.pixel,\r\n });\r\n }\r\n else if (event_name == \"click\" ||\r\n event_name == \"rightclick\" ||\r\n event_name == \"rightdblclick\" ||\r\n event_name == \"mousemove\") {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, {\r\n latlng: e.latlng,\r\n pixel: e.pixel,\r\n });\r\n }\r\n else {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, null);\r\n }\r\n });\r\n });\r\n }\r\n\r\n getOriginInstance = () => this.instance;\r\n\r\n getCenter = () => this.instance.getCenter();\r\n\r\n setZoom = (zoom) => this.instance.setZoom(zoom);\r\n\r\n getZoom = () => this.instance.getZoom();\r\n\r\n setMaxZoom = (maxZoom) => this.instance.setMaxZoom(maxZoom);\r\n\r\n setMinZoom = (minZoom) => this.instance.setMinZoom(minZoom);\r\n\r\n enableScrollWheelZoom = () => this.instance.enableScrollWheelZoom();\r\n\r\n disableScrollWheelZoom = () => this.instance.disableScrollWheelZoom();\r\n\r\n setMapType = (mapType) => this.instance.setMapType(mapType);\r\n\r\n getMapType = () => this.instance.getMapType();\r\n\r\n setTrafficOn = () => this.instance.setTrafficOn();\r\n\r\n setTrafficOff = () => this.instance.setTrafficOff();\r\n\r\n setMapStyleV2 = (options) => this.instance.setMapStyleV2(options);\r\n\r\n panTo = (point) => this.instance.panTo(point);\r\n\r\n addOverlay = (overlay) => this.instance.addOverlay(overlay);\r\n\r\n removeOverlay = (overlay) => this.instance.removeOverlay(overlay);\r\n\r\n clearOverlays = () => this.instance.clearOverlays();\r\n\r\n addCircle(circle) {\r\n var c = new BMapGL.Circle(circle.center, circle.radius, {\r\n strokeColor: circle.strokeColor,\r\n strokeWeight: circle.strokeWeight,\r\n strokeOpacity: circle.strokeOpacity,\r\n strokeStyle: circle.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n fillColor: circle.fillColor,\r\n fillOpacity: circle.fillOpacity\r\n });\r\n\r\n this.instance.addOverlay(c);\r\n\r\n return c;\r\n }\r\n\r\n addMarker(marker) {\r\n var m = new BMapGL.Marker(marker.point, {\r\n offset: marker.offset,\r\n rotation: marker.rotation,\r\n title: marker.title\r\n });\r\n\r\n this.instance.addOverlay(m);\r\n\r\n return m;\r\n }\r\n\r\n addLabel(label) {\r\n var l = new BMapGL.Label(label.content, {\r\n offset: label.offset,\r\n position: label.position\r\n });\r\n\r\n this.instance.addOverlay(l);\r\n\r\n return l;\r\n }\r\n\r\n addPolyline(polyline) {\r\n if (polyline.points == null)\r\n return null;\r\n\r\n var pl = new BMapGL.Polyline(polyline.points, {\r\n strokeColor: polyline.strokeColor,\r\n strokeWeight: polyline.strokeWeight,\r\n strokeOpacity: polyline.strokeOpacity,\r\n strokeStyle: polyline.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n geodesic: polyline.geodesic,\r\n clip: polyline.clip\r\n });\r\n\r\n this.instance.addOverlay(pl);\r\n\r\n return pl;\r\n }\r\n\r\n addPolygon(polygon) {\r\n if (polygon.points == null)\r\n return null;\r\n\r\n var bmapPoints = [];\r\n polygon.points.forEach(element => {\r\n bmapPoints.push(toBMapGLPoint(element));\r\n });\r\n\r\n var pg = new BMapGL.Polygon(bmapPoints, {\r\n strokeColor: polygon.strokeColor,\r\n strokeWeight: polygon.strokeWeight,\r\n strokeOpacity: polygon.strokeOpacity,\r\n strokeStyle: polygon.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n fillColor: polygon.fillColor,\r\n fillOpacity: polygon.fillOpacity\r\n });\r\n\r\n this.instance.addOverlay(pg);\r\n\r\n return pg;\r\n }\r\n\r\n contains(overlay) {\r\n var os = this.instance.getOverlays();\r\n for (let index = 0; index < os.length; index++) {\r\n if (os[index] === overlay)\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n destroyMap() {\r\n if (this.instance != null)\r\n delete this.instance;\r\n }\r\n}\r\n\r\nBMapGL.Polygon.prototype.setPathWithGeoPoint = (points, polygon) => {\r\n if (points == null)\r\n return;\r\n\r\n var bmapPoints = [];\r\n points.forEach(element => {\r\n bmapPoints.push(toBMapGLPoint(element));\r\n });\r\n\r\n polygon.setPath(bmapPoints);\r\n}\r\n\r\nconst toBMapGLPoint = (point) => new BMapGL.Point(point.lng, point.lat);\r\n\r\nconst init = (containerId, initArgs) => {\r\n if (containerId && document.getElementById(containerId)) {\r\n return new BaiduMapProxy(containerId, initArgs);\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport { init }"],"names":["BaiduMapProxy","instance","dotNetHelper","constructor","containerId","initArgs","this","BMapGL","Map","enableScrollWheelZoom","setMaxZoom","maxZoom","setMinZoom","minZoom","centerAndZoom","center","zoom","setMapType","mapTypeString","trafficOn","setTrafficOn","dark","setMapStyleV2","styleId","darkThemeId","setDotNetObjectReference","events","forEach","event_name","addEventListener","async","e","invokeMethodAsync","latlng","point","pixel","getOriginInstance","getCenter","setZoom","getZoom","disableScrollWheelZoom","mapType","getMapType","setTrafficOff","options","panTo","addOverlay","overlay","removeOverlay","clearOverlays","addCircle","circle","c","Circle","radius","strokeColor","strokeWeight","strokeOpacity","strokeStyle","fillColor","fillOpacity","addMarker","marker","m","Marker","offset","rotation","title","addLabel","label","l","Label","content","position","addPolyline","polyline","points","pl","Polyline","geodesic","clip","addPolygon","polygon","bmapPoints","element","push","toBMapGLPoint","pg","Polygon","contains","os","getOverlays","index","length","destroyMap","prototype","setPathWithGeoPoint","setPath","Point","lng","lat","init","document","getElementById"],"mappings":"AAAA,MAAMA,EACJC,SACAC,aAEAC,YAAYC,EAAaC,GACvBC,KAAKL,SAAW,IAAIM,OAAOC,IAAIJ,GAE3BC,EAASI,uBACXH,KAAKL,SAASQ,wBAEhBH,KAAKL,SAASS,WAAWL,EAASM,SAClCL,KAAKL,SAASW,WAAWP,EAASQ,SAClCP,KAAKL,SAASa,cAAcT,EAASU,OAAQV,EAASW,MAEtDV,KAAKL,SAASgB,WAAWZ,EAASa,eAE9Bb,EAASc,WACXb,KAAKL,SAASmB,eAEZf,EAASgB,MACXf,KAAKL,SAASqB,cAAc,CAC1BC,QAASlB,EAASmB,aAEvB,CAEDC,yBAAyBvB,EAAcwB,GACrCpB,KAAKJ,aAAeA,EAEpBwB,EAAOC,SAASC,IACdtB,KAAKL,SAAS4B,iBAAiBD,GAAYE,eAAgBC,GACvC,aAAdH,GACY,YAAdA,GACc,WAAdA,GAC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EAAQF,EAAGG,OAAQD,IACrC,GAAIF,EAAGE,KAAW7C,EAChB,OAAO,EAEX,OAAO,CACR,CAED+C,aACuB,MAAjBxF,KAAKL,iBACAK,KAAKL,QACf,EAGHM,OAAOiF,QAAQO,UAAUC,oBAAsB,CAACpB,EAAQM,KACtD,GAAc,MAAVN,EAAJ,CAGA,IAAIO,EAAa,GACjBP,EAAOjD,SAAQyD,IACbD,EAAWE,KAAKC,EAAcF,GAAS,IAGzCF,EAAQe,QAAQd,EAPP,CAOkB,EAG7B,MAAMG,EAAiBpD,GAAU,IAAI3B,OAAO2F,MAAMhE,EAAMiE,IAAKjE,EAAMkE,KAE7DC,EAAO,CAACjG,EAAaC,IACrBD,GAAekG,SAASC,eAAenG,GAClC,IAAIJ,EAAcI,EAAaC,GAGjC"} \ No newline at end of file +{"version":3,"file":"baidumap-proxy.js","sources":["../../../../Masa.Blazor.JS/node_modules/tslib/tslib.es6.js","../../../../Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","class BaiduMapProxy {\r\n instance;\r\n dotNetHelper;\r\n\r\n constructor(containerId, initArgs) {\r\n this.instance = new BMapGL.Map(containerId);\r\n\r\n if (initArgs.enableScrollWheelZoom) this.instance.enableScrollWheelZoom();\r\n\r\n this.instance.setMaxZoom(initArgs.maxZoom);\r\n this.instance.setMinZoom(initArgs.minZoom);\r\n this.instance.centerAndZoom(initArgs.center, initArgs.zoom);\r\n\r\n this.instance.setMapType(initArgs.mapTypeString);\r\n\r\n if (initArgs.trafficOn) this.instance.setTrafficOn();\r\n\r\n if (initArgs.dark)\r\n this.instance.setMapStyleV2({\r\n styleId: initArgs.darkThemeId,\r\n });\r\n }\r\n\r\n setDotNetObjectReference(dotNetHelper, events) {\r\n this.dotNetHelper = dotNetHelper;\r\n\r\n events.forEach((event_name) => {\r\n this.instance.addEventListener(event_name, async function (e) {\r\n if (\r\n event_name == \"dragstart\" ||\r\n event_name == \"dragging\" ||\r\n event_name == \"dragend\" ||\r\n event_name == \"dblclick\"\r\n ) {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, {\r\n latlng: e.point,\r\n pixel: e.pixel,\r\n });\r\n } else if (\r\n event_name == \"click\" ||\r\n event_name == \"rightclick\" ||\r\n event_name == \"rightdblclick\" ||\r\n event_name == \"mousemove\"\r\n ) {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, {\r\n latlng: e.latlng,\r\n pixel: e.pixel,\r\n });\r\n } else {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, null);\r\n }\r\n });\r\n });\r\n }\r\n\r\n getOriginInstance = () => this.instance;\r\n\r\n getCenter = () => this.instance.getCenter();\r\n\r\n setZoom = (zoom) => this.instance.setZoom(zoom);\r\n\r\n getZoom = () => this.instance.getZoom();\r\n\r\n setMaxZoom = (maxZoom) => this.instance.setMaxZoom(maxZoom);\r\n\r\n setMinZoom = (minZoom) => this.instance.setMinZoom(minZoom);\r\n\r\n enableScrollWheelZoom = () => this.instance.enableScrollWheelZoom();\r\n\r\n disableScrollWheelZoom = () => this.instance.disableScrollWheelZoom();\r\n\r\n setMapType = (mapType) => this.instance.setMapType(mapType);\r\n\r\n getMapType = () => this.instance.getMapType();\r\n\r\n setTrafficOn = () => this.instance.setTrafficOn();\r\n setTrafficOff = () => this.instance.setTrafficOff();\r\n\r\n setMapStyleV2 = (options) => this.instance.setMapStyleV2(options);\r\n\r\n panTo = (point) => this.instance.panTo(point);\r\n\r\n addOverlay = (overlay) => this.instance.addOverlay(overlay);\r\n\r\n removeOverlay = (overlay) => this.instance.removeOverlay(overlay);\r\n\r\n clearOverlays = () => this.instance.clearOverlays();\r\n\r\n addCircle(circle) {\r\n var c = new BMapGL.Circle(circle.center, circle.radius, {\r\n strokeColor: circle.strokeColor,\r\n strokeWeight: circle.strokeWeight,\r\n strokeOpacity: circle.strokeOpacity,\r\n strokeStyle: circle.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n fillColor: circle.fillColor,\r\n fillOpacity: circle.fillOpacity,\r\n });\r\n\r\n this.instance.addOverlay(c);\r\n\r\n return c;\r\n }\r\n\r\n addMarker(marker) {\r\n var m = new BMapGL.Marker(marker.point, {\r\n offset: marker.offset,\r\n rotation: marker.rotation,\r\n title: marker.title,\r\n });\r\n\r\n console.log(marker.icon);\r\n if (marker.icon && marker.icon.url) {\r\n const { url, size, options } = marker.icon;\r\n const opts: BMapGL.IconOptions = {};\r\n if (options) {\r\n if (options.anchor) {\r\n opts.anchor = new BMapGL.Size(options.anchor.width, options.anchor.height);\r\n }\r\n\r\n if (options.imageOffset) {\r\n opts.imageOffset = new BMapGL.Size(options.imageOffset.width, options.imageOffset.height);\r\n }\r\n }\r\n m.setIcon(\r\n new BMapGL.Icon(url, new BMapGL.Size(size.width, size.height), opts)\r\n );\r\n }\r\n\r\n this.instance.addOverlay(m);\r\n\r\n return m;\r\n }\r\n\r\n addLabel(label) {\r\n var l = new BMapGL.Label(label.content, {\r\n offset: label.offset,\r\n position: label.position,\r\n });\r\n\r\n this.instance.addOverlay(l);\r\n\r\n return l;\r\n }\r\n\r\n addPolyline(polyline) {\r\n if (polyline.points == null) return null;\r\n\r\n var pl = new BMapGL.Polyline(polyline.points, {\r\n strokeColor: polyline.strokeColor,\r\n strokeWeight: polyline.strokeWeight,\r\n strokeOpacity: polyline.strokeOpacity,\r\n strokeStyle: polyline.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n geodesic: polyline.geodesic,\r\n clip: polyline.clip,\r\n } as any);\r\n\r\n this.instance.addOverlay(pl);\r\n\r\n return pl;\r\n }\r\n\r\n addPolygon(polygon) {\r\n if (polygon.points == null) return null;\r\n\r\n var bmapPoints = [];\r\n polygon.points.forEach((element) => {\r\n bmapPoints.push(toBMapGLPoint(element));\r\n });\r\n\r\n var pg = new BMapGL.Polygon(bmapPoints, {\r\n strokeColor: polygon.strokeColor,\r\n strokeWeight: polygon.strokeWeight,\r\n strokeOpacity: polygon.strokeOpacity,\r\n strokeStyle: polygon.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n fillColor: polygon.fillColor,\r\n fillOpacity: polygon.fillOpacity,\r\n });\r\n\r\n this.instance.addOverlay(pg);\r\n\r\n return pg;\r\n }\r\n\r\n contains(overlay) {\r\n var os = this.instance.getOverlays();\r\n for (let index = 0; index < os.length; index++) {\r\n if (os[index] === overlay) return true;\r\n }\r\n return false;\r\n }\r\n\r\n destroyMap() {\r\n if (this.instance != null) delete this.instance;\r\n }\r\n}\r\n\r\nif (typeof BMapGL !== \"undefined\") {\r\n BMapGL.Polygon.prototype.setPathWithGeoPoint = (points, polygon) => {\r\n if (points == null) return;\r\n\r\n var bmapPoints = [];\r\n points.forEach((element) => {\r\n bmapPoints.push(toBMapGLPoint(element));\r\n });\r\n\r\n polygon.setPath(bmapPoints);\r\n };\r\n\r\n console.log(\"BMapGL is loaded\");\r\n} else {\r\n console.error(\"BMapGL is not defined\");\r\n}\r\n\r\nconst toBMapGLPoint = (point) => new BMapGL.Point(point.lng, point.lat);\r\n\r\nconst init = (containerId, initArgs) => {\r\n if (containerId && document.getElementById(containerId)) {\r\n return new BaiduMapProxy(containerId, initArgs);\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { init };\r\n"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","SuppressedError","BaiduMapProxy","constructor","containerId","initArgs","this","getOriginInstance","instance","getCenter","setZoom","zoom","getZoom","setMaxZoom","maxZoom","setMinZoom","minZoom","enableScrollWheelZoom","disableScrollWheelZoom","setMapType","mapType","getMapType","setTrafficOn","setTrafficOff","setMapStyleV2","options","panTo","point","addOverlay","overlay","removeOverlay","clearOverlays","BMapGL","Map","centerAndZoom","center","mapTypeString","trafficOn","dark","styleId","darkThemeId","setDotNetObjectReference","dotNetHelper","events","forEach","event_name","addEventListener","invokeMethodAsync","latlng","pixel","addCircle","circle","c","Circle","radius","strokeColor","strokeWeight","strokeOpacity","strokeStyle","fillColor","fillOpacity","addMarker","marker","m","Marker","offset","rotation","title","console","log","icon","url","size","opts","anchor","Size","width","height","imageOffset","setIcon","Icon","addLabel","label","l","Label","content","position","addPolyline","polyline","points","pl","Polyline","geodesic","clip","addPolygon","polygon","bmapPoints","element","push","toBMapGLPoint","pg","Polygon","contains","os","getOverlays","index","length","destroyMap","prototype","setPathWithGeoPoint","setPath","error","Point","lng","lat","init","document","getElementById"],"mappings":"AAkHO,SAASA,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,GAAU,CAAC,MAAOG,GAAKL,EAAOK,GAAO,CAC9F,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,GAAE,SAAUG,GAAWA,EAAQG,EAAO,KAIhBO,KAAKR,EAAWK,EAAY,CAC9GH,GAAMN,EAAYA,EAAUa,MAAMhB,EAASC,GAAc,KAAKS,OACtE,GACA,CAqMkD,mBAApBO,iBAAiCA,gBC/T/D,MAAMC,EAIJ,WAAAC,CAAYC,EAAaC,GAmDzBC,KAAAC,kBAAoB,IAAMD,KAAKE,SAE/BF,KAASG,UAAG,IAAM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QACTA,OAAOqE,QAAQO,UAAUC,oBAAsB,CAACpB,EAAQM,KACtD,GAAc,MAAVN,EAAJ,CAEA,IAAIO,EAAa,GACjBP,EAAO7C,SAASqD,IACdD,EAAWE,KAAKC,EAAcF,GAAS,IAGzCF,EAAQe,QAAQd,EAPW,CAOA,EAG7B5B,QAAQC,IAAI,qBAEZD,QAAQ2C,MAAM,yBAGhB,MAAMZ,EAAiBxE,GAAU,IAAIK,OAAOgF,MAAMrF,EAAMsF,IAAKtF,EAAMuF,KAE7DC,EAAO,CAAC/G,EAAaC,IACrBD,GAAegH,SAASC,eAAejH,GAClC,IAAIF,EAAcE,EAAaC,GAGjC"} \ No newline at end of file From 3546a5522f52bdbbebabcbfb10a82f1e44b37e1c Mon Sep 17 00:00:00 2001 From: capdiem Date: Tue, 3 Sep 2024 11:56:56 +0800 Subject: [PATCH 3/4] update js --- src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts | 3 +-- src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js | 2 +- src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js.map | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts b/src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts index 3c30f64cf7..2418b9fc1e 100644 --- a/src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts +++ b/src/Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts @@ -108,7 +108,6 @@ class BaiduMapProxy { title: marker.title, }); - console.log(marker.icon); if (marker.icon && marker.icon.url) { const { url, size, options } = marker.icon; const opts: BMapGL.IconOptions = {}; @@ -206,7 +205,7 @@ if (typeof BMapGL !== "undefined") { polygon.setPath(bmapPoints); }; - console.log("BMapGL is loaded"); + console.info("BMapGL is loaded"); } else { console.error("BMapGL is not defined"); } diff --git a/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js b/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js index 7adb52bd24..e2e1845f7e 100644 --- a/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js +++ b/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js @@ -1,2 +1,2 @@ -function e(e,t,i,n){return new(i||(i=Promise))((function(o,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function r(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,r)}l((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class t{constructor(e,t){this.getOriginInstance=()=>this.instance,this.getCenter=()=>this.instance.getCenter(),this.setZoom=e=>this.instance.setZoom(e),this.getZoom=()=>this.instance.getZoom(),this.setMaxZoom=e=>this.instance.setMaxZoom(e),this.setMinZoom=e=>this.instance.setMinZoom(e),this.enableScrollWheelZoom=()=>this.instance.enableScrollWheelZoom(),this.disableScrollWheelZoom=()=>this.instance.disableScrollWheelZoom(),this.setMapType=e=>this.instance.setMapType(e),this.getMapType=()=>this.instance.getMapType(),this.setTrafficOn=()=>this.instance.setTrafficOn(),this.setTrafficOff=()=>this.instance.setTrafficOff(),this.setMapStyleV2=e=>this.instance.setMapStyleV2(e),this.panTo=e=>this.instance.panTo(e),this.addOverlay=e=>this.instance.addOverlay(e),this.removeOverlay=e=>this.instance.removeOverlay(e),this.clearOverlays=()=>this.instance.clearOverlays(),this.instance=new BMapGL.Map(e),t.enableScrollWheelZoom&&this.instance.enableScrollWheelZoom(),this.instance.setMaxZoom(t.maxZoom),this.instance.setMinZoom(t.minZoom),this.instance.centerAndZoom(t.center,t.zoom),this.instance.setMapType(t.mapTypeString),t.trafficOn&&this.instance.setTrafficOn(),t.dark&&this.instance.setMapStyleV2({styleId:t.darkThemeId})}setDotNetObjectReference(t,i){this.dotNetHelper=t,i.forEach((i=>{this.instance.addEventListener(i,(function(n){return e(this,void 0,void 0,(function*(){"dragstart"==i||"dragging"==i||"dragend"==i||"dblclick"==i?yield t.invokeMethodAsync("OnEvent",i,{latlng:n.point,pixel:n.pixel}):"click"==i||"rightclick"==i||"rightdblclick"==i||"mousemove"==i?yield t.invokeMethodAsync("OnEvent",i,{latlng:n.latlng,pixel:n.pixel}):yield t.invokeMethodAsync("OnEvent",i,null)}))}))}))}addCircle(e){var t=new BMapGL.Circle(e.center,e.radius,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",fillColor:e.fillColor,fillOpacity:e.fillOpacity});return this.instance.addOverlay(t),t}addMarker(e){var t=new BMapGL.Marker(e.point,{offset:e.offset,rotation:e.rotation,title:e.title});if(console.log(e.icon),e.icon&&e.icon.url){const{url:i,size:n,options:o}=e.icon,s={};o&&(o.anchor&&(s.anchor=new BMapGL.Size(o.anchor.width,o.anchor.height)),o.imageOffset&&(s.imageOffset=new BMapGL.Size(o.imageOffset.width,o.imageOffset.height))),t.setIcon(new BMapGL.Icon(i,new BMapGL.Size(n.width,n.height),s))}return this.instance.addOverlay(t),t}addLabel(e){var t=new BMapGL.Label(e.content,{offset:e.offset,position:e.position});return this.instance.addOverlay(t),t}addPolyline(e){if(null==e.points)return null;var t=new BMapGL.Polyline(e.points,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",geodesic:e.geodesic,clip:e.clip});return this.instance.addOverlay(t),t}addPolygon(e){if(null==e.points)return null;var t=[];e.points.forEach((e=>{t.push(i(e))}));var n=new BMapGL.Polygon(t,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",fillColor:e.fillColor,fillOpacity:e.fillOpacity});return this.instance.addOverlay(n),n}contains(e){var t=this.instance.getOverlays();for(let i=0;i{if(null!=e){var n=[];e.forEach((e=>{n.push(i(e))})),t.setPath(n)}},console.log("BMapGL is loaded")):console.error("BMapGL is not defined");const i=e=>new BMapGL.Point(e.lng,e.lat),n=(e,i)=>e&&document.getElementById(e)?new t(e,i):null;export{n as init}; +function e(e,t,i,n){return new(i||(i=Promise))((function(o,s){function a(e){try{r(n.next(e))}catch(e){s(e)}}function l(e){try{r(n.throw(e))}catch(e){s(e)}}function r(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,l)}r((n=n.apply(e,t||[])).next())}))}class t{constructor(e,t){this.getOriginInstance=()=>this.instance,this.getCenter=()=>this.instance.getCenter(),this.setZoom=e=>this.instance.setZoom(e),this.getZoom=()=>this.instance.getZoom(),this.setMaxZoom=e=>this.instance.setMaxZoom(e),this.setMinZoom=e=>this.instance.setMinZoom(e),this.enableScrollWheelZoom=()=>this.instance.enableScrollWheelZoom(),this.disableScrollWheelZoom=()=>this.instance.disableScrollWheelZoom(),this.setMapType=e=>this.instance.setMapType(e),this.getMapType=()=>this.instance.getMapType(),this.setTrafficOn=()=>this.instance.setTrafficOn(),this.setTrafficOff=()=>this.instance.setTrafficOff(),this.setMapStyleV2=e=>this.instance.setMapStyleV2(e),this.panTo=e=>this.instance.panTo(e),this.addOverlay=e=>this.instance.addOverlay(e),this.removeOverlay=e=>this.instance.removeOverlay(e),this.clearOverlays=()=>this.instance.clearOverlays(),this.instance=new BMapGL.Map(e),t.enableScrollWheelZoom&&this.instance.enableScrollWheelZoom(),this.instance.setMaxZoom(t.maxZoom),this.instance.setMinZoom(t.minZoom),this.instance.centerAndZoom(t.center,t.zoom),this.instance.setMapType(t.mapTypeString),t.trafficOn&&this.instance.setTrafficOn(),t.dark&&this.instance.setMapStyleV2({styleId:t.darkThemeId})}setDotNetObjectReference(t,i){this.dotNetHelper=t,i.forEach((i=>{this.instance.addEventListener(i,(function(n){return e(this,void 0,void 0,(function*(){"dragstart"==i||"dragging"==i||"dragend"==i||"dblclick"==i?yield t.invokeMethodAsync("OnEvent",i,{latlng:n.point,pixel:n.pixel}):"click"==i||"rightclick"==i||"rightdblclick"==i||"mousemove"==i?yield t.invokeMethodAsync("OnEvent",i,{latlng:n.latlng,pixel:n.pixel}):yield t.invokeMethodAsync("OnEvent",i,null)}))}))}))}addCircle(e){var t=new BMapGL.Circle(e.center,e.radius,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",fillColor:e.fillColor,fillOpacity:e.fillOpacity});return this.instance.addOverlay(t),t}addMarker(e){var t=new BMapGL.Marker(e.point,{offset:e.offset,rotation:e.rotation,title:e.title});if(e.icon&&e.icon.url){const{url:i,size:n,options:o}=e.icon,s={};o&&(o.anchor&&(s.anchor=new BMapGL.Size(o.anchor.width,o.anchor.height)),o.imageOffset&&(s.imageOffset=new BMapGL.Size(o.imageOffset.width,o.imageOffset.height))),t.setIcon(new BMapGL.Icon(i,new BMapGL.Size(n.width,n.height),s))}return this.instance.addOverlay(t),t}addLabel(e){var t=new BMapGL.Label(e.content,{offset:e.offset,position:e.position});return this.instance.addOverlay(t),t}addPolyline(e){if(null==e.points)return null;var t=new BMapGL.Polyline(e.points,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",geodesic:e.geodesic,clip:e.clip});return this.instance.addOverlay(t),t}addPolygon(e){if(null==e.points)return null;var t=[];e.points.forEach((e=>{t.push(i(e))}));var n=new BMapGL.Polygon(t,{strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,strokeStyle:0==e.strokeStyle?"solid":"dashed",fillColor:e.fillColor,fillOpacity:e.fillOpacity});return this.instance.addOverlay(n),n}contains(e){var t=this.instance.getOverlays();for(let i=0;i{if(null!=e){var n=[];e.forEach((e=>{n.push(i(e))})),t.setPath(n)}},console.info("BMapGL is loaded")):console.error("BMapGL is not defined");const i=e=>new BMapGL.Point(e.lng,e.lat),n=(e,i)=>e&&document.getElementById(e)?new t(e,i):null;export{n as init}; //# sourceMappingURL=baidumap-proxy.js.map diff --git a/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js.map b/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js.map index 4d93506021..2e80769a85 100644 --- a/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js.map +++ b/src/Masa.Blazor/wwwroot/js/proxies/baidumap-proxy.js.map @@ -1 +1 @@ -{"version":3,"file":"baidumap-proxy.js","sources":["../../../../Masa.Blazor.JS/node_modules/tslib/tslib.es6.js","../../../../Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","class BaiduMapProxy {\r\n instance;\r\n dotNetHelper;\r\n\r\n constructor(containerId, initArgs) {\r\n this.instance = new BMapGL.Map(containerId);\r\n\r\n if (initArgs.enableScrollWheelZoom) this.instance.enableScrollWheelZoom();\r\n\r\n this.instance.setMaxZoom(initArgs.maxZoom);\r\n this.instance.setMinZoom(initArgs.minZoom);\r\n this.instance.centerAndZoom(initArgs.center, initArgs.zoom);\r\n\r\n this.instance.setMapType(initArgs.mapTypeString);\r\n\r\n if (initArgs.trafficOn) this.instance.setTrafficOn();\r\n\r\n if (initArgs.dark)\r\n this.instance.setMapStyleV2({\r\n styleId: initArgs.darkThemeId,\r\n });\r\n }\r\n\r\n setDotNetObjectReference(dotNetHelper, events) {\r\n this.dotNetHelper = dotNetHelper;\r\n\r\n events.forEach((event_name) => {\r\n this.instance.addEventListener(event_name, async function (e) {\r\n if (\r\n event_name == \"dragstart\" ||\r\n event_name == \"dragging\" ||\r\n event_name == \"dragend\" ||\r\n event_name == \"dblclick\"\r\n ) {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, {\r\n latlng: e.point,\r\n pixel: e.pixel,\r\n });\r\n } else if (\r\n event_name == \"click\" ||\r\n event_name == \"rightclick\" ||\r\n event_name == \"rightdblclick\" ||\r\n event_name == \"mousemove\"\r\n ) {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, {\r\n latlng: e.latlng,\r\n pixel: e.pixel,\r\n });\r\n } else {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, null);\r\n }\r\n });\r\n });\r\n }\r\n\r\n getOriginInstance = () => this.instance;\r\n\r\n getCenter = () => this.instance.getCenter();\r\n\r\n setZoom = (zoom) => this.instance.setZoom(zoom);\r\n\r\n getZoom = () => this.instance.getZoom();\r\n\r\n setMaxZoom = (maxZoom) => this.instance.setMaxZoom(maxZoom);\r\n\r\n setMinZoom = (minZoom) => this.instance.setMinZoom(minZoom);\r\n\r\n enableScrollWheelZoom = () => this.instance.enableScrollWheelZoom();\r\n\r\n disableScrollWheelZoom = () => this.instance.disableScrollWheelZoom();\r\n\r\n setMapType = (mapType) => this.instance.setMapType(mapType);\r\n\r\n getMapType = () => this.instance.getMapType();\r\n\r\n setTrafficOn = () => this.instance.setTrafficOn();\r\n setTrafficOff = () => this.instance.setTrafficOff();\r\n\r\n setMapStyleV2 = (options) => this.instance.setMapStyleV2(options);\r\n\r\n panTo = (point) => this.instance.panTo(point);\r\n\r\n addOverlay = (overlay) => this.instance.addOverlay(overlay);\r\n\r\n removeOverlay = (overlay) => this.instance.removeOverlay(overlay);\r\n\r\n clearOverlays = () => this.instance.clearOverlays();\r\n\r\n addCircle(circle) {\r\n var c = new BMapGL.Circle(circle.center, circle.radius, {\r\n strokeColor: circle.strokeColor,\r\n strokeWeight: circle.strokeWeight,\r\n strokeOpacity: circle.strokeOpacity,\r\n strokeStyle: circle.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n fillColor: circle.fillColor,\r\n fillOpacity: circle.fillOpacity,\r\n });\r\n\r\n this.instance.addOverlay(c);\r\n\r\n return c;\r\n }\r\n\r\n addMarker(marker) {\r\n var m = new BMapGL.Marker(marker.point, {\r\n offset: marker.offset,\r\n rotation: marker.rotation,\r\n title: marker.title,\r\n });\r\n\r\n console.log(marker.icon);\r\n if (marker.icon && marker.icon.url) {\r\n const { url, size, options } = marker.icon;\r\n const opts: BMapGL.IconOptions = {};\r\n if (options) {\r\n if (options.anchor) {\r\n opts.anchor = new BMapGL.Size(options.anchor.width, options.anchor.height);\r\n }\r\n\r\n if (options.imageOffset) {\r\n opts.imageOffset = new BMapGL.Size(options.imageOffset.width, options.imageOffset.height);\r\n }\r\n }\r\n m.setIcon(\r\n new BMapGL.Icon(url, new BMapGL.Size(size.width, size.height), opts)\r\n );\r\n }\r\n\r\n this.instance.addOverlay(m);\r\n\r\n return m;\r\n }\r\n\r\n addLabel(label) {\r\n var l = new BMapGL.Label(label.content, {\r\n offset: label.offset,\r\n position: label.position,\r\n });\r\n\r\n this.instance.addOverlay(l);\r\n\r\n return l;\r\n }\r\n\r\n addPolyline(polyline) {\r\n if (polyline.points == null) return null;\r\n\r\n var pl = new BMapGL.Polyline(polyline.points, {\r\n strokeColor: polyline.strokeColor,\r\n strokeWeight: polyline.strokeWeight,\r\n strokeOpacity: polyline.strokeOpacity,\r\n strokeStyle: polyline.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n geodesic: polyline.geodesic,\r\n clip: polyline.clip,\r\n } as any);\r\n\r\n this.instance.addOverlay(pl);\r\n\r\n return pl;\r\n }\r\n\r\n addPolygon(polygon) {\r\n if (polygon.points == null) return null;\r\n\r\n var bmapPoints = [];\r\n polygon.points.forEach((element) => {\r\n bmapPoints.push(toBMapGLPoint(element));\r\n });\r\n\r\n var pg = new BMapGL.Polygon(bmapPoints, {\r\n strokeColor: polygon.strokeColor,\r\n strokeWeight: polygon.strokeWeight,\r\n strokeOpacity: polygon.strokeOpacity,\r\n strokeStyle: polygon.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n fillColor: polygon.fillColor,\r\n fillOpacity: polygon.fillOpacity,\r\n });\r\n\r\n this.instance.addOverlay(pg);\r\n\r\n return pg;\r\n }\r\n\r\n contains(overlay) {\r\n var os = this.instance.getOverlays();\r\n for (let index = 0; index < os.length; index++) {\r\n if (os[index] === overlay) return true;\r\n }\r\n return false;\r\n }\r\n\r\n destroyMap() {\r\n if (this.instance != null) delete this.instance;\r\n }\r\n}\r\n\r\nif (typeof BMapGL !== \"undefined\") {\r\n BMapGL.Polygon.prototype.setPathWithGeoPoint = (points, polygon) => {\r\n if (points == null) return;\r\n\r\n var bmapPoints = [];\r\n points.forEach((element) => {\r\n bmapPoints.push(toBMapGLPoint(element));\r\n });\r\n\r\n polygon.setPath(bmapPoints);\r\n };\r\n\r\n console.log(\"BMapGL is loaded\");\r\n} else {\r\n console.error(\"BMapGL is not defined\");\r\n}\r\n\r\nconst toBMapGLPoint = (point) => new BMapGL.Point(point.lng, point.lat);\r\n\r\nconst init = (containerId, initArgs) => {\r\n if (containerId && document.getElementById(containerId)) {\r\n return new BaiduMapProxy(containerId, initArgs);\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { init };\r\n"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","SuppressedError","BaiduMapProxy","constructor","containerId","initArgs","this","getOriginInstance","instance","getCenter","setZoom","zoom","getZoom","setMaxZoom","maxZoom","setMinZoom","minZoom","enableScrollWheelZoom","disableScrollWheelZoom","setMapType","mapType","getMapType","setTrafficOn","setTrafficOff","setMapStyleV2","options","panTo","point","addOverlay","overlay","removeOverlay","clearOverlays","BMapGL","Map","centerAndZoom","center","mapTypeString","trafficOn","dark","styleId","darkThemeId","setDotNetObjectReference","dotNetHelper","events","forEach","event_name","addEventListener","invokeMethodAsync","latlng","pixel","addCircle","circle","c","Circle","radius","strokeColor","strokeWeight","strokeOpacity","strokeStyle","fillColor","fillOpacity","addMarker","marker","m","Marker","offset","rotation","title","console","log","icon","url","size","opts","anchor","Size","width","height","imageOffset","setIcon","Icon","addLabel","label","l","Label","content","position","addPolyline","polyline","points","pl","Polyline","geodesic","clip","addPolygon","polygon","bmapPoints","element","push","toBMapGLPoint","pg","Polygon","contains","os","getOverlays","index","length","destroyMap","prototype","setPathWithGeoPoint","setPath","error","Point","lng","lat","init","document","getElementById"],"mappings":"AAkHO,SAASA,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,GAAU,CAAC,MAAOG,GAAKL,EAAOK,GAAO,CAC9F,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,GAAE,SAAUG,GAAWA,EAAQG,EAAO,KAIhBO,KAAKR,EAAWK,EAAY,CAC9GH,GAAMN,EAAYA,EAAUa,MAAMhB,EAASC,GAAc,KAAKS,OACtE,GACA,CAqMkD,mBAApBO,iBAAiCA,gBC/T/D,MAAMC,EAIJ,WAAAC,CAAYC,EAAaC,GAmDzBC,KAAAC,kBAAoB,IAAMD,KAAKE,SAE/BF,KAASG,UAAG,IAAMH,KAAKE,SAASC,YAEhCH,KAAAI,QAAWC,GAASL,KAAKE,SAASE,QAAQC,GAE1CL,KAAOM,QAAG,IAAMN,KAAKE,SAASI,UAE9BN,KAAAO,WAAcC,GAAYR,KAAKE,SAASK,WAAWC,GAEnDR,KAAAS,WAAcC,GAAYV,KAAKE,SAASO,WAAWC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AAI,qBAEZD,QAAQ2C,MAAM,yBAGhB,MAAMZ,EAAiBxE,GAAU,IAAIK,OAAOgF,MAAMrF,EAAMsF,IAAKtF,EAAMuF,KAE7DC,EAAO,CAAC/G,EAAaC,IACrBD,GAAegH,SAASC,eAAejH,GAClC,IAAIF,EAAcE,EAAaC,GAGjC"} \ No newline at end of file +{"version":3,"file":"baidumap-proxy.js","sources":["../../../../Masa.Blazor.JS/node_modules/tslib/tslib.es6.js","../../../../Masa.Blazor.JS/src/proxies/maps/baidumap/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.push(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.push(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","class BaiduMapProxy {\r\n instance;\r\n dotNetHelper;\r\n\r\n constructor(containerId, initArgs) {\r\n this.instance = new BMapGL.Map(containerId);\r\n\r\n if (initArgs.enableScrollWheelZoom) this.instance.enableScrollWheelZoom();\r\n\r\n this.instance.setMaxZoom(initArgs.maxZoom);\r\n this.instance.setMinZoom(initArgs.minZoom);\r\n this.instance.centerAndZoom(initArgs.center, initArgs.zoom);\r\n\r\n this.instance.setMapType(initArgs.mapTypeString);\r\n\r\n if (initArgs.trafficOn) this.instance.setTrafficOn();\r\n\r\n if (initArgs.dark)\r\n this.instance.setMapStyleV2({\r\n styleId: initArgs.darkThemeId,\r\n });\r\n }\r\n\r\n setDotNetObjectReference(dotNetHelper, events) {\r\n this.dotNetHelper = dotNetHelper;\r\n\r\n events.forEach((event_name) => {\r\n this.instance.addEventListener(event_name, async function (e) {\r\n if (\r\n event_name == \"dragstart\" ||\r\n event_name == \"dragging\" ||\r\n event_name == \"dragend\" ||\r\n event_name == \"dblclick\"\r\n ) {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, {\r\n latlng: e.point,\r\n pixel: e.pixel,\r\n });\r\n } else if (\r\n event_name == \"click\" ||\r\n event_name == \"rightclick\" ||\r\n event_name == \"rightdblclick\" ||\r\n event_name == \"mousemove\"\r\n ) {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, {\r\n latlng: e.latlng,\r\n pixel: e.pixel,\r\n });\r\n } else {\r\n await dotNetHelper.invokeMethodAsync(\"OnEvent\", event_name, null);\r\n }\r\n });\r\n });\r\n }\r\n\r\n getOriginInstance = () => this.instance;\r\n\r\n getCenter = () => this.instance.getCenter();\r\n\r\n setZoom = (zoom) => this.instance.setZoom(zoom);\r\n\r\n getZoom = () => this.instance.getZoom();\r\n\r\n setMaxZoom = (maxZoom) => this.instance.setMaxZoom(maxZoom);\r\n\r\n setMinZoom = (minZoom) => this.instance.setMinZoom(minZoom);\r\n\r\n enableScrollWheelZoom = () => this.instance.enableScrollWheelZoom();\r\n\r\n disableScrollWheelZoom = () => this.instance.disableScrollWheelZoom();\r\n\r\n setMapType = (mapType) => this.instance.setMapType(mapType);\r\n\r\n getMapType = () => this.instance.getMapType();\r\n\r\n setTrafficOn = () => this.instance.setTrafficOn();\r\n setTrafficOff = () => this.instance.setTrafficOff();\r\n\r\n setMapStyleV2 = (options) => this.instance.setMapStyleV2(options);\r\n\r\n panTo = (point) => this.instance.panTo(point);\r\n\r\n addOverlay = (overlay) => this.instance.addOverlay(overlay);\r\n\r\n removeOverlay = (overlay) => this.instance.removeOverlay(overlay);\r\n\r\n clearOverlays = () => this.instance.clearOverlays();\r\n\r\n addCircle(circle) {\r\n var c = new BMapGL.Circle(circle.center, circle.radius, {\r\n strokeColor: circle.strokeColor,\r\n strokeWeight: circle.strokeWeight,\r\n strokeOpacity: circle.strokeOpacity,\r\n strokeStyle: circle.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n fillColor: circle.fillColor,\r\n fillOpacity: circle.fillOpacity,\r\n });\r\n\r\n this.instance.addOverlay(c);\r\n\r\n return c;\r\n }\r\n\r\n addMarker(marker) {\r\n var m = new BMapGL.Marker(marker.point, {\r\n offset: marker.offset,\r\n rotation: marker.rotation,\r\n title: marker.title,\r\n });\r\n\r\n if (marker.icon && marker.icon.url) {\r\n const { url, size, options } = marker.icon;\r\n const opts: BMapGL.IconOptions = {};\r\n if (options) {\r\n if (options.anchor) {\r\n opts.anchor = new BMapGL.Size(options.anchor.width, options.anchor.height);\r\n }\r\n\r\n if (options.imageOffset) {\r\n opts.imageOffset = new BMapGL.Size(options.imageOffset.width, options.imageOffset.height);\r\n }\r\n }\r\n m.setIcon(\r\n new BMapGL.Icon(url, new BMapGL.Size(size.width, size.height), opts)\r\n );\r\n }\r\n\r\n this.instance.addOverlay(m);\r\n\r\n return m;\r\n }\r\n\r\n addLabel(label) {\r\n var l = new BMapGL.Label(label.content, {\r\n offset: label.offset,\r\n position: label.position,\r\n });\r\n\r\n this.instance.addOverlay(l);\r\n\r\n return l;\r\n }\r\n\r\n addPolyline(polyline) {\r\n if (polyline.points == null) return null;\r\n\r\n var pl = new BMapGL.Polyline(polyline.points, {\r\n strokeColor: polyline.strokeColor,\r\n strokeWeight: polyline.strokeWeight,\r\n strokeOpacity: polyline.strokeOpacity,\r\n strokeStyle: polyline.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n geodesic: polyline.geodesic,\r\n clip: polyline.clip,\r\n } as any);\r\n\r\n this.instance.addOverlay(pl);\r\n\r\n return pl;\r\n }\r\n\r\n addPolygon(polygon) {\r\n if (polygon.points == null) return null;\r\n\r\n var bmapPoints = [];\r\n polygon.points.forEach((element) => {\r\n bmapPoints.push(toBMapGLPoint(element));\r\n });\r\n\r\n var pg = new BMapGL.Polygon(bmapPoints, {\r\n strokeColor: polygon.strokeColor,\r\n strokeWeight: polygon.strokeWeight,\r\n strokeOpacity: polygon.strokeOpacity,\r\n strokeStyle: polygon.strokeStyle == 0 ? \"solid\" : \"dashed\",\r\n fillColor: polygon.fillColor,\r\n fillOpacity: polygon.fillOpacity,\r\n });\r\n\r\n this.instance.addOverlay(pg);\r\n\r\n return pg;\r\n }\r\n\r\n contains(overlay) {\r\n var os = this.instance.getOverlays();\r\n for (let index = 0; index < os.length; index++) {\r\n if (os[index] === overlay) return true;\r\n }\r\n return false;\r\n }\r\n\r\n destroyMap() {\r\n if (this.instance != null) delete this.instance;\r\n }\r\n}\r\n\r\nif (typeof BMapGL !== \"undefined\") {\r\n BMapGL.Polygon.prototype.setPathWithGeoPoint = (points, polygon) => {\r\n if (points == null) return;\r\n\r\n var bmapPoints = [];\r\n points.forEach((element) => {\r\n bmapPoints.push(toBMapGLPoint(element));\r\n });\r\n\r\n polygon.setPath(bmapPoints);\r\n };\r\n\r\n console.info(\"BMapGL is loaded\");\r\n} else {\r\n console.error(\"BMapGL is not defined\");\r\n}\r\n\r\nconst toBMapGLPoint = (point) => new BMapGL.Point(point.lng, point.lat);\r\n\r\nconst init = (containerId, initArgs) => {\r\n if (containerId && document.getElementById(containerId)) {\r\n return new BaiduMapProxy(containerId, initArgs);\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport { init };\r\n"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","BaiduMapProxy","constructor","containerId","initArgs","this","getOriginInstance","instance","getCenter","setZoom","zoom","getZoom","setMaxZoom","maxZoom","setMinZoom","minZoom","enableScrollWheelZoom","disableScrollWheelZoom","setMapType","mapType","getMapType","setTrafficOn","setTrafficOff","setMapStyleV2","options","panTo","point","addOverlay","overlay","removeOverlay","clearOverlays","BMapGL","Map","centerAndZoom","center","mapTypeString","trafficOn","dark","styleId","darkThemeId","setDotNetObjectReference","dotNetHelper","events","forEach","event_name","addEventListener","invokeMethodAsync","latlng","pixel","addCircle","circle","c","Circle","radius","strokeColor","strokeWeight","strokeOpacity","strokeStyle","fillColor","fillOpacity","addMarker","marker","m","Marker","offset","rotation","title","icon","url","size","opts","anchor","Size","width","height","imageOffset","setIcon","Icon","addLabel","label","l","Label","content","position","addPolyline","polyline","points","pl","Polyline","geodesic","clip","addPolygon","polygon","bmapPoints","element","push","toBMapGLPoint","pg","Polygon","contains","os","getOverlays","index","length","destroyMap","prototype","setPathWithGeoPoint","setPath","console","info","error","Point","lng","lat","init","document","getElementById"],"mappings":"AAkHO,SAASA,EAAUC,EAASC,EAAYC,EAAGC,GAE9C,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,GAAQ,CAAG,MAAOG,GAAKL,EAAOK,GAAO,CAC3F,SAASC,EAASJ,GAA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AAoC,GAAvBmC,EAAQnC,YAAmB,QAAU,SAClDC,UAAWkC,EAAQlC,UACnBC,YAAaiC,EAAQjC,cAKvB,OAFAtD,KAAKE,SAASoB,WAAWsE,GAElBA,CACR,CAEDE,SAASvE,GACP,IAAIwE,EAAK/F,KAAKE,SAAS8F,cACvB,IAAK,IAAIC,EAAQ,EAAGA,EAAQF,EAAGG,OAAQD,IACrC,GAAIF,EAAGE,KAAW1E,EAAS,OAAO,EAEpC,OAAO,CACR,CAED4E,aACuB,MAAjBnG,KAAKE,iBAAyBF,KAAKE,QACxC,EAGmB,oBAAXwB,QACTA,OAAOmE,QAAQO,UAAUC,oBAAsB,CAACpB,EAAQM,KACtD,GAAc,MAAVN,EAAJ,CAEA,IAAIO,EAAa,GACjBP,EAAO3C,SAASmD,IACdD,EAAWE,KAAKC,EAAcF,GAAS,IAGzCF,EAAQe,QAAQd,EAPW,CAOA,EAG7Be,QAAQC,KAAK,qBAEbD,QAAQE,MAAM,yBAGhB,MAAMd,EAAiBtE,GAAU,IAAIK,OAAOgF,MAAMrF,EAAMsF,IAAKtF,EAAMuF,KAE7DC,EAAO,CAAC/G,EAAaC,IACrBD,GAAegH,SAASC,eAAejH,GAClC,IAAIF,EAAcE,EAAaC,GAGjC"} \ No newline at end of file From 2285d7527d2762fef4d63be8a16ce60326d45e57 Mon Sep 17 00:00:00 2001 From: capdiem Date: Tue, 3 Sep 2024 12:00:20 +0800 Subject: [PATCH 4/4] update page-to-api --- docs/Masa.Blazor.Docs/wwwroot/data/page-to-api.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/Masa.Blazor.Docs/wwwroot/data/page-to-api.json b/docs/Masa.Blazor.Docs/wwwroot/data/page-to-api.json index ab070c91f8..1406cf62dd 100644 --- a/docs/Masa.Blazor.Docs/wwwroot/data/page-to-api.json +++ b/docs/Masa.Blazor.Docs/wwwroot/data/page-to-api.json @@ -11,6 +11,15 @@ "aspect-ratios": [ "MResponsive" ], + "baidumaps":[ + "MBaiduMap", + "MBaiduCircle", + "MBaiduLabel", + "MBaiduMarker", + "MBaiduOverlay", + "MBaiduPolygon", + "MBaiduPolyline" + ], "breadcrumbs": [ "MBreadcrumbs", "MBreadcrumbsItem",