bbj-screen-widget 2.4.67 → 2.4.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bbj-screen-widget.d.ts +15 -12
- package/bbj-screen-widget.metadata.json +1 -1
- package/bundles/bbj-screen-widget-core.umd.js +147 -4
- package/bundles/bbj-screen-widget-core.umd.js.map +1 -1
- package/bundles/bbj-screen-widget-core.umd.min.js +1 -1
- package/bundles/bbj-screen-widget-core.umd.min.js.map +1 -1
- package/bundles/bbj-screen-widget.umd.js +1313 -205
- package/bundles/bbj-screen-widget.umd.js.map +1 -1
- package/bundles/bbj-screen-widget.umd.min.js +1 -1
- package/bundles/bbj-screen-widget.umd.min.js.map +1 -1
- package/core/bbj-screen-widget-core.metadata.json +1 -1
- package/core/public_api.d.ts +2 -0
- package/core/util/map.util.d.ts +23 -0
- package/core/util/scale.util.d.ts +4 -0
- package/esm2015/bbj-screen-widget.js +16 -13
- package/esm2015/core/public_api.js +3 -1
- package/esm2015/core/util/map.util.js +104 -0
- package/esm2015/core/util/scale.util.js +33 -0
- package/esm2015/lib/custom-baidu-map/custom-baidu-map.component.js +4 -42
- package/esm2015/lib/screen-widget.module.js +7 -1
- package/esm2015/lib/tianditu/base-layer.js +80 -0
- package/esm2015/lib/tianditu/tianditu-marker/tianditu-marker.component.js +666 -0
- package/esm2015/lib/tianditu/tianditu.component.js +399 -0
- package/esm2015/lib/tianditu/tianditu.module.js +21 -0
- package/esm2015/public-api.js +2 -1
- package/fesm2015/bbj-screen-widget-core.js +138 -1
- package/fesm2015/bbj-screen-widget-core.js.map +1 -1
- package/fesm2015/bbj-screen-widget.js +1193 -86
- package/fesm2015/bbj-screen-widget.js.map +1 -1
- package/lib/custom-baidu-map/custom-baidu-map.component.d.ts +1 -1
- package/lib/tianditu/base-layer.d.ts +20 -0
- package/lib/tianditu/tianditu-marker/tianditu-marker.component.d.ts +63 -0
- package/lib/tianditu/tianditu.component.d.ts +53 -0
- package/lib/tianditu/tianditu.module.d.ts +4 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ɵɵdefineInjectable, ɵɵinject, Injectable, Component, ChangeDetectionStrategy, ChangeDetectorRef, Renderer2, ElementRef, NgModule, EventEmitter, NgZone, ViewChild, Input, Pipe, forwardRef, Inject, Optional, HostBinding, Directive, CUSTOM_ELEMENTS_SCHEMA, HostListener } from '@angular/core';
|
|
2
|
-
import { BaiduMapService } from 'bbj-screen-widget/core';
|
|
2
|
+
import { BaiduMapService, scaleAdapter, bd09towgs84, gcj02towgs84, wgs84tobd09, wgs84togcj02 } from 'bbj-screen-widget/core';
|
|
3
3
|
export * from 'bbj-screen-widget/core';
|
|
4
4
|
import { HttpClient, HttpClientJsonpModule } from '@angular/common/http';
|
|
5
5
|
import { LazyService as LazyService$1, ArrayService, isNum } from '@delon/util';
|
|
@@ -21,7 +21,7 @@ import { NzSliderModule } from 'ng-zorro-antd/slider';
|
|
|
21
21
|
import 'echarts-gl';
|
|
22
22
|
import { NzResizeObserver } from 'ng-zorro-antd/core/resize-observers';
|
|
23
23
|
import { Subject, Observable } from 'rxjs';
|
|
24
|
-
import { takeUntil
|
|
24
|
+
import { takeUntil } from 'rxjs/operators';
|
|
25
25
|
import 'echarts-liquidfill';
|
|
26
26
|
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
|
|
27
27
|
import { getMap, registerMap } from 'echarts';
|
|
@@ -13173,44 +13173,7 @@ let CustomBaiduMapComponent = class CustomBaiduMapComponent {
|
|
|
13173
13173
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13174
13174
|
if (this.scale$) {
|
|
13175
13175
|
// 这是为了解决地图缩放中心不在鼠标所在位置的问题
|
|
13176
|
-
this.scale
|
|
13177
|
-
const { x: sx, y: sy, scaleContent } = scale;
|
|
13178
|
-
const style = this.element.style;
|
|
13179
|
-
if (scaleContent === false) {
|
|
13180
|
-
this.zone.onStable.pipe(take(1)).subscribe(() => {
|
|
13181
|
-
const parent = this.element.parentNode;
|
|
13182
|
-
if (parent) {
|
|
13183
|
-
const match = /translate\(([-\d.]+)px, ([-\d.]+)px\)/.exec(parent.style.transform);
|
|
13184
|
-
if (match) {
|
|
13185
|
-
const offsetX = parseFloat(match[1]);
|
|
13186
|
-
const offsetY = parseFloat(match[2]);
|
|
13187
|
-
style.transform = `translate(${-offsetX}px,${-offsetY}px)`;
|
|
13188
|
-
style.height = parent.clientHeight + offsetY + 'px';
|
|
13189
|
-
style.width = parent.clientWidth + offsetX + 'px';
|
|
13190
|
-
style.padding = `${offsetY}px 0 0 ${offsetX}px`;
|
|
13191
|
-
// this.containerStyle = {
|
|
13192
|
-
// transformOrigin: `0 0`,
|
|
13193
|
-
// transform: `translate(${-offsetX}px,${-offsetY}px)`,
|
|
13194
|
-
// height: parent.clientHeight + offsetY + 'px',
|
|
13195
|
-
// width: parent.clientWidth + offsetX + 'px',
|
|
13196
|
-
// padding: `${offsetY}px 0 0 ${offsetX}px`,
|
|
13197
|
-
// };
|
|
13198
|
-
}
|
|
13199
|
-
}
|
|
13200
|
-
// this.cd.markForCheck();
|
|
13201
|
-
});
|
|
13202
|
-
}
|
|
13203
|
-
else {
|
|
13204
|
-
const { position, size } = this.widgetRef.widget;
|
|
13205
|
-
const { x, y } = position;
|
|
13206
|
-
const { width, height } = size;
|
|
13207
|
-
style.transform = `translate(${-x}px,${-y}px) scale(${1 / sx},${1 / sy})`;
|
|
13208
|
-
style.height = (y + height) * sy + 'px';
|
|
13209
|
-
style.width = (x + width) * sx + 'px';
|
|
13210
|
-
style.padding = `${y * sy}px 0 0 ${x * sx}px`;
|
|
13211
|
-
}
|
|
13212
|
-
// this.cd.markForCheck();
|
|
13213
|
-
});
|
|
13176
|
+
scaleAdapter(this.scale$, this.destroy$, this.zone, this.elementRef.nativeElement, this.widgetRef);
|
|
13214
13177
|
}
|
|
13215
13178
|
yield this.initMap();
|
|
13216
13179
|
});
|
|
@@ -13555,7 +13518,7 @@ CustomBaiduMapComponent.decorators = [
|
|
|
13555
13518
|
{ type: Component, args: [{
|
|
13556
13519
|
selector: 'sc-custom-baidu-map',
|
|
13557
13520
|
template: "<ng-template *ngFor=\"let child of children\" widget-host [widget]=\"child\"></ng-template>\n\n<!-- {{children|json}} -->\n<!-- <div class=\"map-container\" [ngStyle]=\"containerStyle\"> -->\n<div #container class=\"map\"></div>\n<nz-radio-group\n *ngIf=\"showMapTypeRadio\"\n class=\"map-type-radio\"\n [(ngModel)]=\"mapTypeValue\"\n (ngModelChange)=\"mapTypeChange($event)\"\n nzButtonStyle=\"solid\"\n>\n <label *ngFor=\"let item of mapTypeEnum\" nz-radio-button [nzValue]=\"item.value\">{{ item.label }}</label>\n</nz-radio-group>\n<!-- </div> -->\n",
|
|
13558
|
-
styles: [":host{display:block;height:100%;width:100%;overflow:hidden;transform-origin:0 0;z-index:0;pointer-events:none}:host>*{pointer-events:auto}.map{height:100%;width:100%}:host::ng-deep .BMap_bubble_pop{background-color:var(--info-window-background,#fff)!important;border-color:var(--info-window-border-color,#ddd)!important}:host::ng-deep .BMap_bubble_content{color:var(--info-window-color,\"#555555\")!important}:host::ng-deep .BMap_pop div{background-color:var(--info-window-background,#fff)!important}:host::ng-deep .BMap_pop>div:nth-child(8){background-color:transparent!important}:host.hideInfoWindowTail::ng-deep .BMap_bubble_pop>img,:host.hideInfoWindowTail::ng-deep .BMap_pop>div:nth-child(8),:host::ng-deep .BMap_noprint.anchorTR,:host::ng-deep img[src$=\"/image/api/iws3.png\"]{display:none}:host.hideInfoWindowTop::ng-deep .BMap_bubble_pop{transform:translateY(31px)}:host.hideInfoWindowTop::ng-deep .BMap_bubble_pop>img{transform:translateY(-31px)}:host.hideInfoWindowTop::ng-deep .BMap_bubble_top,:host::ng-deep .anchorBL{display:none}.map-type-radio{position:absolute;bottom:20px;right:20px;z-index:10}"]
|
|
13521
|
+
styles: [":host{display:block;height:100%;width:100%;overflow:hidden;transform-origin:0 0;z-index:0;pointer-events:none;position:relative}:host>*{pointer-events:auto}.map{height:100%;width:100%}:host::ng-deep .BMap_bubble_pop{background-color:var(--info-window-background,#fff)!important;border-color:var(--info-window-border-color,#ddd)!important}:host::ng-deep .BMap_bubble_content{color:var(--info-window-color,\"#555555\")!important}:host::ng-deep .BMap_pop div{background-color:var(--info-window-background,#fff)!important}:host::ng-deep .BMap_pop>div:nth-child(8){background-color:transparent!important}:host.hideInfoWindowTail::ng-deep .BMap_bubble_pop>img,:host.hideInfoWindowTail::ng-deep .BMap_pop>div:nth-child(8),:host::ng-deep .BMap_noprint.anchorTR,:host::ng-deep img[src$=\"/image/api/iws3.png\"]{display:none}:host.hideInfoWindowTop::ng-deep .BMap_bubble_pop{transform:translateY(31px)}:host.hideInfoWindowTop::ng-deep .BMap_bubble_pop>img{transform:translateY(-31px)}:host.hideInfoWindowTop::ng-deep .BMap_bubble_top,:host::ng-deep .anchorBL{display:none}.map-type-radio{position:absolute;bottom:20px;right:20px;z-index:10}"]
|
|
13559
13522
|
},] }
|
|
13560
13523
|
];
|
|
13561
13524
|
CustomBaiduMapComponent.ctorParameters = () => [
|
|
@@ -19534,50 +19497,1189 @@ Scatter3dModule.ctorParameters = () => [
|
|
|
19534
19497
|
{ type: WidgetService }
|
|
19535
19498
|
];
|
|
19536
19499
|
|
|
19537
|
-
class
|
|
19538
|
-
constructor(
|
|
19539
|
-
|
|
19540
|
-
|
|
19541
|
-
|
|
19542
|
-
|
|
19543
|
-
|
|
19544
|
-
|
|
19545
|
-
|
|
19546
|
-
|
|
19547
|
-
|
|
19548
|
-
|
|
19549
|
-
|
|
19550
|
-
|
|
19551
|
-
|
|
19500
|
+
let TiandituComponent = class TiandituComponent {
|
|
19501
|
+
constructor(lazy, elementRef, zone, scale$, widgetRef) {
|
|
19502
|
+
this.lazy = lazy;
|
|
19503
|
+
this.elementRef = elementRef;
|
|
19504
|
+
this.zone = zone;
|
|
19505
|
+
this.scale$ = scale$;
|
|
19506
|
+
this.widgetRef = widgetRef;
|
|
19507
|
+
this.coordinateType = 'BD-09';
|
|
19508
|
+
// @Property('地图类型', {
|
|
19509
|
+
// enum: MapTypeEnum,
|
|
19510
|
+
// })
|
|
19511
|
+
// mapType = 'normal';
|
|
19512
|
+
// mapTypeValue: string;
|
|
19513
|
+
// @Property('上传样式', { type: 'string', ui: { widget: 'myUploadAudio', visibleIf: { mapType: ['custom'] } } })
|
|
19514
|
+
// uploadStyle: string;
|
|
19515
|
+
// @Property('切换按钮')
|
|
19516
|
+
// showMapTypeRadio: boolean;
|
|
19517
|
+
// @Property('全景地图', { type: 'boolean' })
|
|
19518
|
+
// minMapShow = false;
|
|
19519
|
+
// @Property('显示信息', {
|
|
19520
|
+
// ui: { widget: 'select' },
|
|
19521
|
+
// enum: [
|
|
19522
|
+
// { label: '点击', value: 'click' },
|
|
19523
|
+
// { label: '悬停', value: 'mouseover' },
|
|
19524
|
+
// ],
|
|
19525
|
+
// })
|
|
19526
|
+
// showType = 'click';
|
|
19527
|
+
// @Property('信息窗背景', { ui: { widget: 'myColor' } })
|
|
19528
|
+
// infoWindowBackground: string;
|
|
19529
|
+
// @Property('信息窗字体', { ui: { widget: 'myColor' } })
|
|
19530
|
+
// infoWindowColor: string;
|
|
19531
|
+
// @Property('信息窗宽度')
|
|
19532
|
+
// infoWindowWidth: number;
|
|
19533
|
+
// @Property('信息窗高度')
|
|
19534
|
+
// infoWindowHeight: number;
|
|
19535
|
+
// @Property('信息窗模板', { ui: { widget: 'textarea' } })
|
|
19536
|
+
// infoWindowTemplate: string;
|
|
19537
|
+
// @Property('信息窗边框', {
|
|
19538
|
+
// ui: { widget: 'myColor' },
|
|
19539
|
+
// example: ['#ffffff', '#F5A623', '#F8E71C', '#50E3C2', '#3285FF', '#B45FFF', '#9B9B9B', null],
|
|
19540
|
+
// })
|
|
19541
|
+
// infoWindowBorderColor: string;
|
|
19542
|
+
// @Property('隐藏尖角')
|
|
19543
|
+
// @HostBinding('class.hideInfoWindowTail')
|
|
19544
|
+
// hideInfoWindowTail: boolean;
|
|
19545
|
+
// @Property('隐藏关闭按钮')
|
|
19546
|
+
// @HostBinding('class.hideInfoWindowTop')
|
|
19547
|
+
// hideInfoWindowTop: boolean;
|
|
19548
|
+
this.dragging = true;
|
|
19549
|
+
// @Property('遮罩颜色', {
|
|
19550
|
+
// ui: { widget: 'myColor' },
|
|
19551
|
+
// example: ['#ffffff', '#F5A623', '#F8E71C', '#50E3C2', '#3285FF', '#B45FFF', '#9B9B9B', null],
|
|
19552
|
+
// })
|
|
19553
|
+
// shadeColor = '#004395';
|
|
19554
|
+
// @Property('背景颜色', {
|
|
19555
|
+
// ui: { widget: 'myColor' },
|
|
19556
|
+
// example: ['#ffffff', '#F5A623', '#F8E71C', '#50E3C2', '#3285FF', '#B45FFF', '#9B9B9B', null],
|
|
19557
|
+
// })
|
|
19558
|
+
// mapBackColor: string;
|
|
19559
|
+
// @Property('多边线色', {
|
|
19560
|
+
// ui: { widget: 'myColor' },
|
|
19561
|
+
// example: ['#ffffff', '#F5A623', '#F8E71C', '#50E3C2', '#3285FF', '#B45FFF', '#9B9B9B', null],
|
|
19562
|
+
// })
|
|
19563
|
+
// mapCityColor = '#41b7ff';
|
|
19564
|
+
this.zoom = 12;
|
|
19565
|
+
// @Property('遮罩透明', { type: 'number' })
|
|
19566
|
+
// fillOpacity = 0;
|
|
19567
|
+
// @Property('多边线粗', { type: 'number' })
|
|
19568
|
+
// strokesize = 2;
|
|
19569
|
+
// @Property('黑夜模式', { type: 'boolean', ui: { hidden: true } })
|
|
19570
|
+
// nightMode = false;
|
|
19571
|
+
// @Property('3D视角')
|
|
19572
|
+
// enable3D: boolean;
|
|
19573
|
+
// @Property('定位控件')
|
|
19574
|
+
// showLocationControl: boolean;
|
|
19575
|
+
// @Property('初始角度', { type: 'number', ui: { visibleIf: { enable3D: [true] } } })
|
|
19576
|
+
// tilt = 73;
|
|
19577
|
+
// centerLng = 120.7;
|
|
19578
|
+
// centerLat = 28;
|
|
19579
|
+
// @Property('显示省市', {
|
|
19580
|
+
// ui: {
|
|
19581
|
+
// widget: 'myUrlSelect',
|
|
19582
|
+
// allowClear: true,
|
|
19583
|
+
// url: '/assets/mapListItem.json',
|
|
19584
|
+
// },
|
|
19585
|
+
// })
|
|
19586
|
+
// cityName = null;
|
|
19587
|
+
this.data = [{ lng: 120.7, lat: 28 }];
|
|
19588
|
+
this.dataChange = new EventEmitter();
|
|
19589
|
+
this.zoomChange = new EventEmitter();
|
|
19590
|
+
this.mapClick = new EventEmitter();
|
|
19591
|
+
this.destroy$ = new Subject();
|
|
19592
|
+
this.init$ = new Promise((resolve) => {
|
|
19593
|
+
this.inited = resolve;
|
|
19594
|
+
});
|
|
19595
|
+
}
|
|
19596
|
+
ngOnInit() {
|
|
19597
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19598
|
+
scaleAdapter(this.scale$, this.destroy$, this.zone, this.elementRef.nativeElement, this.widgetRef);
|
|
19599
|
+
this.initMap();
|
|
19600
|
+
});
|
|
19601
|
+
}
|
|
19602
|
+
initMap() {
|
|
19603
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19604
|
+
yield this.lazy.loadScript('https://api.tianditu.gov.cn/api?v=4.0&tk=acbe009b9b9cc2c8f369b6415fc8dc99');
|
|
19605
|
+
if (!this.destroyed) {
|
|
19606
|
+
this.zone.runOutsideAngular(() => {
|
|
19607
|
+
this.map = new T.Map(this.container.nativeElement, {
|
|
19608
|
+
center: this.createLngLat(this.centerLng, this.centerLat),
|
|
19609
|
+
zoom: this.zoom,
|
|
19610
|
+
});
|
|
19611
|
+
// this.mapTypeChange(this.mapTypeValue);
|
|
19612
|
+
if (this.edit || this.dragging === false) {
|
|
19613
|
+
this.map.disableDrag();
|
|
19614
|
+
}
|
|
19615
|
+
// if (this.enable3D) {
|
|
19616
|
+
// this.map.setTilt(this.tilt == null ? 73 : this.tilt, { noAnimation: true });
|
|
19617
|
+
// this.map.setDisplayOptions({ skyColors: ['rgba(0, 0, 0, 0)'] }); // 隐藏天空
|
|
19618
|
+
// // const navi3DCtrl = new BMapGL.NavigationControl3D(); // 添加3D控件
|
|
19619
|
+
// // this.map.addControl(navi3DCtrl);
|
|
19620
|
+
// } else {
|
|
19621
|
+
// this.map.disableTilt();
|
|
19622
|
+
// this.map.disableRotate();
|
|
19623
|
+
// }
|
|
19624
|
+
// if (this.showLocationControl) {
|
|
19625
|
+
// const options = {
|
|
19626
|
+
// // 控件的停靠位置(可选,默认左上角)
|
|
19627
|
+
// anchor: BMAP_ANCHOR_TOP_LEFT,
|
|
19628
|
+
// // 控件基于停靠位置的偏移量(可选)
|
|
19629
|
+
// offset: new BMapGL.Size(20, 20),
|
|
19630
|
+
// };
|
|
19631
|
+
// let locationControl = new BMapGL.LocationControl(options);
|
|
19632
|
+
// // 将控件添加到地图上
|
|
19633
|
+
// this.map.addControl(locationControl);
|
|
19634
|
+
// }
|
|
19635
|
+
// if (this.minMapShow) {
|
|
19636
|
+
// const stCtrl = new BMapGL.PanoramaControl();
|
|
19637
|
+
// stCtrl.setOffset(new BMapGL.Size(20, 20));
|
|
19638
|
+
// this.map.addControl(stCtrl);
|
|
19639
|
+
// }
|
|
19640
|
+
// if (this.infoWindowBackground) {
|
|
19641
|
+
// this.element.style.setProperty('--info-window-background', this.infoWindowBackground);
|
|
19642
|
+
// }
|
|
19643
|
+
// if (this.infoWindowColor) {
|
|
19644
|
+
// this.element.style.setProperty('--info-window-color', this.infoWindowColor);
|
|
19645
|
+
// }
|
|
19646
|
+
// if (this.infoWindowBorderColor) {
|
|
19647
|
+
// this.element.style.setProperty('--info-window-border-color', this.infoWindowBorderColor);
|
|
19648
|
+
// }
|
|
19649
|
+
this.map.addEventListener('moveend', (event) => {
|
|
19650
|
+
const center = this.map.getCenter();
|
|
19651
|
+
this.dataChange.emit(this.transferCoordinate(center));
|
|
19652
|
+
});
|
|
19653
|
+
this.map.addEventListener('click', (event) => {
|
|
19654
|
+
console.log(event);
|
|
19655
|
+
this.mapClick.emit(this.transferCoordinate(event.latlng));
|
|
19656
|
+
});
|
|
19657
|
+
this.map.addEventListener('zoomend', (event) => {
|
|
19658
|
+
this.zoomChange.emit(this.map.getZoom());
|
|
19659
|
+
this.dataChange.emit(this.transferCoordinate(this.map.getCenter()));
|
|
19660
|
+
});
|
|
19661
|
+
this.mapLoaded(this.map);
|
|
19662
|
+
});
|
|
19663
|
+
this.inited(this.map);
|
|
19664
|
+
}
|
|
19665
|
+
});
|
|
19666
|
+
}
|
|
19667
|
+
ngOnChanges(changes) {
|
|
19668
|
+
if (changes.data && this.data[0]) {
|
|
19669
|
+
this.centerLng = +this.data[0].lng;
|
|
19670
|
+
this.centerLat = +this.data[0].lat;
|
|
19671
|
+
this.setCenter(this.centerLng, this.centerLat);
|
|
19672
|
+
}
|
|
19673
|
+
}
|
|
19674
|
+
ngOnDestroy() {
|
|
19675
|
+
this.destroy$.next();
|
|
19676
|
+
this.destroy$.complete();
|
|
19677
|
+
this.destroyed = true;
|
|
19678
|
+
}
|
|
19679
|
+
createLngLat(lng, lat) {
|
|
19680
|
+
if (this.coordinateType === 'BD-09') {
|
|
19681
|
+
[lng, lat] = bd09towgs84(lng, lat);
|
|
19682
|
+
}
|
|
19683
|
+
else if (this.coordinateType === 'GCJ-02') {
|
|
19684
|
+
[lng, lat] = gcj02towgs84(lng, lat);
|
|
19685
|
+
}
|
|
19686
|
+
return new T.LngLat(lng, lat);
|
|
19687
|
+
}
|
|
19688
|
+
transferCoordinate(latlng) {
|
|
19689
|
+
let { lng, lat } = latlng;
|
|
19690
|
+
if (this.coordinateType === 'BD-09') {
|
|
19691
|
+
[lng, lat] = wgs84tobd09(lng, lat);
|
|
19692
|
+
}
|
|
19693
|
+
else if (this.coordinateType === 'GCJ-02') {
|
|
19694
|
+
[lng, lat] = wgs84togcj02(lng, lat);
|
|
19695
|
+
}
|
|
19696
|
+
else {
|
|
19697
|
+
return latlng;
|
|
19698
|
+
}
|
|
19699
|
+
return { lng, lat };
|
|
19700
|
+
}
|
|
19701
|
+
setCenter(lng, lat) {
|
|
19702
|
+
if (this.map && lng && lat) {
|
|
19703
|
+
const center = this.map.getCenter();
|
|
19704
|
+
if (center.lng != lng || center.lat != lat) {
|
|
19705
|
+
this.setCenterAndZoom(lng, lat, this.map.getZoom());
|
|
19706
|
+
}
|
|
19707
|
+
}
|
|
19708
|
+
}
|
|
19709
|
+
setCenterAndZoom(lng, lat, zoom) {
|
|
19710
|
+
const center = this.map.getCenter();
|
|
19711
|
+
const currentZoom = this.map.getZoom();
|
|
19712
|
+
// 误差范围内不移动,防止背景抖动
|
|
19713
|
+
if (zoom != currentZoom || Math.abs(lng - center.lng) > 1e-13 || Math.abs(lat - center.lat) > 1e-7) {
|
|
19714
|
+
const point = this.createLngLat(lng, lat);
|
|
19715
|
+
this.map.centerAndZoom(point, zoom);
|
|
19716
|
+
}
|
|
19717
|
+
}
|
|
19718
|
+
/**
|
|
19719
|
+
* 根据经纬度范围设置中心和缩放等级
|
|
19720
|
+
* @param minLng
|
|
19721
|
+
* @param maxLng
|
|
19722
|
+
* @param minLat
|
|
19723
|
+
* @param maxLat
|
|
19724
|
+
*/
|
|
19725
|
+
setRectCenterAndZoom(minLng, maxLng, minLat, maxLat) {
|
|
19726
|
+
const pointB = this.createLngLat(minLng, minLat);
|
|
19727
|
+
const pointA = this.createLngLat(maxLng, maxLat);
|
|
19728
|
+
this.map.setViewport([pointA, pointB]);
|
|
19729
|
+
}
|
|
19730
|
+
mapLoaded(map) {
|
|
19731
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19732
|
+
// if (this.cityName) {
|
|
19733
|
+
// if (this.cityName === '温州') {
|
|
19734
|
+
// this.cityName = 'wenzhou';
|
|
19735
|
+
// }
|
|
19736
|
+
// const json: any = await this.http.get('assets/echarts/map/json/' + this.cityName + '.json').toPromise();
|
|
19737
|
+
// const polygonData = [];
|
|
19738
|
+
// let encodeScale = json.UTF8Scale || 1024;
|
|
19739
|
+
// json.features.forEach(({ geometry }) => {
|
|
19740
|
+
// geometry.coordinates = (geometry.coordinates as any[]).forEach((coordinate, i) => {
|
|
19741
|
+
// if (geometry.type === 'MultiPolygon') {
|
|
19742
|
+
// const coordinates = (coordinate as any[]).map((points, j) => {
|
|
19743
|
+
// if (json.UTF8Encoding) {
|
|
19744
|
+
// points = this.decodePolygon(points, geometry.encodeOffsets[i][j], encodeScale);
|
|
19745
|
+
// }
|
|
19746
|
+
// return points;
|
|
19747
|
+
// });
|
|
19748
|
+
// polygonData.push(coordinates);
|
|
19749
|
+
// } else {
|
|
19750
|
+
// if (json.UTF8Encoding) {
|
|
19751
|
+
// coordinate = this.decodePolygon(coordinate, geometry.encodeOffsets[i], encodeScale);
|
|
19752
|
+
// }
|
|
19753
|
+
// polygonData.push([coordinate]);
|
|
19754
|
+
// }
|
|
19755
|
+
// });
|
|
19756
|
+
// });
|
|
19757
|
+
// const data = [
|
|
19758
|
+
// {
|
|
19759
|
+
// geometry: {
|
|
19760
|
+
// type: 'MultiPolygon',
|
|
19761
|
+
// coordinates: polygonData,
|
|
19762
|
+
// },
|
|
19763
|
+
// },
|
|
19764
|
+
// ];
|
|
19765
|
+
// var layer = new mapvgl.PolygonLayer({
|
|
19766
|
+
// lineColor: this.mapCityColor,
|
|
19767
|
+
// lineWidth: this.strokesize || 2,
|
|
19768
|
+
// fillColor: this.shadeColor,
|
|
19769
|
+
// data,
|
|
19770
|
+
// renderOrder: -2,
|
|
19771
|
+
// });
|
|
19772
|
+
// this.view.addLayer(layer);
|
|
19773
|
+
// if (this.mapBackColor && !this.mapBackColor.match(/rgba\(\d+,\d+,\d+,0\)/)) {
|
|
19774
|
+
// var maskLayer = new mapvgl.MaskLayer({
|
|
19775
|
+
// color: this.mapBackColor,
|
|
19776
|
+
// data,
|
|
19777
|
+
// renderOrder: -3,
|
|
19778
|
+
// });
|
|
19779
|
+
// this.view.addLayer(maskLayer);
|
|
19780
|
+
// }
|
|
19781
|
+
// }
|
|
19782
|
+
});
|
|
19783
|
+
}
|
|
19784
|
+
decodePolygon(coordinate, encodeOffsets, encodeScale) {
|
|
19785
|
+
const result = [];
|
|
19786
|
+
let prevX = encodeOffsets[0];
|
|
19787
|
+
let prevY = encodeOffsets[1];
|
|
19788
|
+
for (let i = 0; i < coordinate.length; i += 2) {
|
|
19789
|
+
var x = coordinate.charCodeAt(i) - 64;
|
|
19790
|
+
var y = coordinate.charCodeAt(i + 1) - 64;
|
|
19791
|
+
// ZigZag decoding
|
|
19792
|
+
x = (x >> 1) ^ -(x & 1);
|
|
19793
|
+
y = (y >> 1) ^ -(y & 1);
|
|
19794
|
+
// Delta deocding
|
|
19795
|
+
x += prevX;
|
|
19796
|
+
y += prevY;
|
|
19797
|
+
prevX = x;
|
|
19798
|
+
prevY = y;
|
|
19799
|
+
// Dequantize
|
|
19800
|
+
result.push([x / encodeScale, y / encodeScale]);
|
|
19801
|
+
}
|
|
19802
|
+
return result;
|
|
19803
|
+
}
|
|
19804
|
+
};
|
|
19805
|
+
TiandituComponent.decorators = [
|
|
19806
|
+
{ type: Component, args: [{
|
|
19807
|
+
selector: 'sc-tianditu',
|
|
19808
|
+
template: "<div #container class=\"tianditu\"></div>\n<ng-template *ngFor=\"let child of children\" widget-host [widget]=\"child\"></ng-template>\n",
|
|
19809
|
+
styles: [":host{display:block;overflow:hidden;transform-origin:0 0;z-index:0;position:relative}.tianditu,:host{height:100%;width:100%}"]
|
|
19810
|
+
},] }
|
|
19811
|
+
];
|
|
19812
|
+
TiandituComponent.ctorParameters = () => [
|
|
19813
|
+
{ type: LazyService$1 },
|
|
19814
|
+
{ type: ElementRef },
|
|
19815
|
+
{ type: NgZone },
|
|
19816
|
+
{ type: ScaleSubject, decorators: [{ type: Optional }] },
|
|
19817
|
+
{ type: WidgetRef }
|
|
19818
|
+
];
|
|
19819
|
+
TiandituComponent.propDecorators = {
|
|
19820
|
+
container: [{ type: ViewChild, args: ['container',] }]
|
|
19821
|
+
};
|
|
19822
|
+
__decorate([
|
|
19823
|
+
Property('坐标系', {
|
|
19824
|
+
enum: [
|
|
19825
|
+
{ label: '百度坐标', value: 'BD-09' },
|
|
19826
|
+
{ label: '高德/腾讯坐标', value: 'GCJ-02' },
|
|
19827
|
+
{ label: '天地图坐标', value: 'WGS84' },
|
|
19828
|
+
],
|
|
19829
|
+
}),
|
|
19830
|
+
__metadata("design:type", Object)
|
|
19831
|
+
], TiandituComponent.prototype, "coordinateType", void 0);
|
|
19832
|
+
__decorate([
|
|
19833
|
+
Property('地图拖动', { type: 'boolean' }),
|
|
19834
|
+
__metadata("design:type", Object)
|
|
19835
|
+
], TiandituComponent.prototype, "dragging", void 0);
|
|
19836
|
+
__decorate([
|
|
19837
|
+
Property('地图缩放', {
|
|
19838
|
+
ui: { widget: 'myRange', min: 1, max: 40, step: 1 },
|
|
19839
|
+
}),
|
|
19840
|
+
__metadata("design:type", Object)
|
|
19841
|
+
], TiandituComponent.prototype, "zoom", void 0);
|
|
19842
|
+
__decorate([
|
|
19843
|
+
Data({
|
|
19844
|
+
properties: {
|
|
19845
|
+
lng: { type: 'number', title: '经度' },
|
|
19846
|
+
lat: { type: 'number', title: '纬度' },
|
|
19847
|
+
},
|
|
19848
|
+
}),
|
|
19849
|
+
__metadata("design:type", Array)
|
|
19850
|
+
], TiandituComponent.prototype, "data", void 0);
|
|
19851
|
+
__decorate([
|
|
19852
|
+
DataOutput(['lng', 'lat']),
|
|
19853
|
+
Event('中心点改变', {
|
|
19854
|
+
params: { properties: { lng: { title: '经度', type: 'number' }, lat: { title: '纬度', type: 'number' } } },
|
|
19855
|
+
}),
|
|
19856
|
+
__metadata("design:type", Object)
|
|
19857
|
+
], TiandituComponent.prototype, "dataChange", void 0);
|
|
19858
|
+
__decorate([
|
|
19859
|
+
DataOutput('缩放等级'),
|
|
19860
|
+
Event('缩放', {
|
|
19861
|
+
params: '缩放等级',
|
|
19862
|
+
}),
|
|
19863
|
+
__metadata("design:type", Object)
|
|
19864
|
+
], TiandituComponent.prototype, "zoomChange", void 0);
|
|
19865
|
+
__decorate([
|
|
19866
|
+
Event('地图点击', {
|
|
19867
|
+
params: { properties: { lng: { title: '经度', type: 'number' }, lat: { title: '纬度', type: 'number' } } },
|
|
19868
|
+
}),
|
|
19869
|
+
__metadata("design:type", Object)
|
|
19870
|
+
], TiandituComponent.prototype, "mapClick", void 0);
|
|
19871
|
+
TiandituComponent = __decorate([
|
|
19872
|
+
Widget('天地图', {
|
|
19873
|
+
children: [
|
|
19874
|
+
{
|
|
19875
|
+
title: '标记层',
|
|
19876
|
+
type: 'sc-tianditu-marker',
|
|
19877
|
+
option: {},
|
|
19878
|
+
hidden: true,
|
|
19879
|
+
hideChild: true,
|
|
19552
19880
|
},
|
|
19881
|
+
],
|
|
19882
|
+
childTypes: ['sc-tianditu-marker'],
|
|
19883
|
+
description: 'hasChildItem',
|
|
19884
|
+
}),
|
|
19885
|
+
__metadata("design:paramtypes", [LazyService$1,
|
|
19886
|
+
ElementRef,
|
|
19887
|
+
NgZone,
|
|
19888
|
+
ScaleSubject,
|
|
19889
|
+
WidgetRef])
|
|
19890
|
+
], TiandituComponent);
|
|
19891
|
+
|
|
19892
|
+
class BaseLayer$1 {
|
|
19893
|
+
constructor(parent, zone) {
|
|
19894
|
+
this.parent = parent;
|
|
19895
|
+
this.zone = zone;
|
|
19896
|
+
this.layers = [];
|
|
19897
|
+
this.overlays = [];
|
|
19898
|
+
this.destroy$ = new Subject();
|
|
19899
|
+
}
|
|
19900
|
+
ngOnInit() {
|
|
19901
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19902
|
+
yield this.parent.init$;
|
|
19903
|
+
this.init();
|
|
19904
|
+
this.inited = true;
|
|
19905
|
+
this.zone.runOutsideAngular(() => {
|
|
19906
|
+
this.updateOverlays();
|
|
19907
|
+
});
|
|
19553
19908
|
});
|
|
19554
|
-
|
|
19555
|
-
|
|
19556
|
-
|
|
19909
|
+
}
|
|
19910
|
+
ngOnChanges(changes) {
|
|
19911
|
+
if (this.inited) {
|
|
19912
|
+
this.zone.runOutsideAngular(() => {
|
|
19913
|
+
this.updateOverlays();
|
|
19557
19914
|
});
|
|
19558
19915
|
}
|
|
19559
|
-
|
|
19560
|
-
|
|
19561
|
-
|
|
19916
|
+
}
|
|
19917
|
+
ngOnDestroy() {
|
|
19918
|
+
this.destroy$.next();
|
|
19919
|
+
this.destroy$.complete();
|
|
19920
|
+
this.removeOverlays();
|
|
19921
|
+
}
|
|
19922
|
+
init() { }
|
|
19923
|
+
updateOverlays() {
|
|
19924
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19925
|
+
this.removeOverlays();
|
|
19926
|
+
this.overlays = this.createOverlays();
|
|
19927
|
+
this.overlays.forEach((overlay) => {
|
|
19928
|
+
this.parent.map.addOverLay(overlay);
|
|
19562
19929
|
});
|
|
19930
|
+
this.inited = true;
|
|
19563
19931
|
});
|
|
19564
|
-
|
|
19565
|
-
|
|
19566
|
-
|
|
19567
|
-
|
|
19568
|
-
|
|
19569
|
-
|
|
19570
|
-
|
|
19571
|
-
}
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
|
|
19575
|
-
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19579
|
-
|
|
19580
|
-
|
|
19932
|
+
}
|
|
19933
|
+
removeOverlays() {
|
|
19934
|
+
if (this.overlays.length) {
|
|
19935
|
+
this.overlays.forEach((overlay) => {
|
|
19936
|
+
this.parent.map.removeOverLay(overlay);
|
|
19937
|
+
});
|
|
19938
|
+
this.overlays = [];
|
|
19939
|
+
}
|
|
19940
|
+
// if (this.layers.length) {
|
|
19941
|
+
// this.layers.forEach((layer) => {
|
|
19942
|
+
// this.parent.removeLayer(layer);
|
|
19943
|
+
// });
|
|
19944
|
+
// this.layers = [];
|
|
19945
|
+
// }
|
|
19946
|
+
}
|
|
19947
|
+
getTextOptions(font) {
|
|
19948
|
+
const textOptions = {};
|
|
19949
|
+
if (font) {
|
|
19950
|
+
if (font.size)
|
|
19951
|
+
textOptions.fontSize = font.size;
|
|
19952
|
+
if (font.family)
|
|
19953
|
+
textOptions.fontFamily = font.family;
|
|
19954
|
+
if (font.color)
|
|
19955
|
+
textOptions.color = font.color;
|
|
19956
|
+
}
|
|
19957
|
+
return textOptions;
|
|
19958
|
+
}
|
|
19959
|
+
}
|
|
19960
|
+
BaseLayer$1.decorators = [
|
|
19961
|
+
{ type: Directive }
|
|
19962
|
+
];
|
|
19963
|
+
BaseLayer$1.ctorParameters = () => [
|
|
19964
|
+
{ type: TiandituComponent },
|
|
19965
|
+
{ type: NgZone }
|
|
19966
|
+
];
|
|
19967
|
+
|
|
19968
|
+
const ɵ0$e = { type: 'string', title: 'id' }, ɵ1$c = { type: 'string', title: 'id' }, ɵ2$a = { type: 'string', title: 'id' };
|
|
19969
|
+
let TiandituMarkerComponent = class TiandituMarkerComponent extends BaseLayer$1 {
|
|
19970
|
+
constructor(parent, zone, fileUrlService, nzContextMenuService) {
|
|
19971
|
+
super(parent, zone);
|
|
19972
|
+
this.parent = parent;
|
|
19973
|
+
this.zone = zone;
|
|
19974
|
+
this.fileUrlService = fileUrlService;
|
|
19975
|
+
this.nzContextMenuService = nzContextMenuService;
|
|
19976
|
+
this.iconUrl = 'assets/img/screen/marker.png';
|
|
19977
|
+
this.iconWidth = 20;
|
|
19978
|
+
this.iconHeight = 30;
|
|
19979
|
+
this.iconOffsetX = 10;
|
|
19980
|
+
this.iconOffsetY = 30;
|
|
19981
|
+
// @Property('分组', {type: 'string'})
|
|
19982
|
+
// group = '';
|
|
19983
|
+
this.toCenter = false;
|
|
19984
|
+
// @Property('标签底色', { ui: { widget: 'myColor', visibleIf: { showLabel: [true] } } })
|
|
19985
|
+
// labelBackground: string;
|
|
19986
|
+
this.labelFont = {
|
|
19987
|
+
family: '',
|
|
19988
|
+
color: '#000000',
|
|
19989
|
+
weight: 'normal',
|
|
19990
|
+
size: 16,
|
|
19991
|
+
space: 0,
|
|
19992
|
+
lineHeight: 0,
|
|
19993
|
+
};
|
|
19994
|
+
// @Property('阴影', { ui: { widget: 'myShadow' } })
|
|
19995
|
+
// shadow: any = { color: '', X: 0, Y: 0, Z: 0 };
|
|
19996
|
+
this.labelOffsetX = -50;
|
|
19997
|
+
this.labelOffsetY = 10;
|
|
19998
|
+
this.unselectOnClickBlank = true;
|
|
19999
|
+
this.groups = [];
|
|
20000
|
+
this.data = [
|
|
20001
|
+
{
|
|
20002
|
+
id: '1',
|
|
20003
|
+
address: '',
|
|
20004
|
+
information: '暂无信息',
|
|
20005
|
+
group: '',
|
|
20006
|
+
lng: '120.7',
|
|
20007
|
+
lat: '28',
|
|
20008
|
+
},
|
|
20009
|
+
];
|
|
20010
|
+
// id: string;
|
|
20011
|
+
this.makerClick = new EventEmitter();
|
|
20012
|
+
this.onClick = new EventEmitter();
|
|
20013
|
+
this.layers = [];
|
|
20014
|
+
// defaultLayer: any;
|
|
20015
|
+
this.optionsMap = {};
|
|
20016
|
+
this.dataMap = {};
|
|
20017
|
+
}
|
|
20018
|
+
ngOnInit() {
|
|
20019
|
+
const _super = Object.create(null, {
|
|
20020
|
+
ngOnInit: { get: () => super.ngOnInit }
|
|
20021
|
+
});
|
|
20022
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20023
|
+
yield _super.ngOnInit.call(this);
|
|
20024
|
+
if (this.showLabel && this.showLabelMinZoom != null) {
|
|
20025
|
+
this.parent.zoomChange.pipe(takeUntil(this.destroy$)).subscribe((zoom) => {
|
|
20026
|
+
this.updateTextVisible(zoom);
|
|
20027
|
+
});
|
|
20028
|
+
}
|
|
20029
|
+
});
|
|
20030
|
+
}
|
|
20031
|
+
ngOnChanges(changes) {
|
|
20032
|
+
if (this.inited) {
|
|
20033
|
+
if (changes.data) {
|
|
20034
|
+
this.zone.runOutsideAngular(() => {
|
|
20035
|
+
this.updateOverlays();
|
|
20036
|
+
});
|
|
20037
|
+
}
|
|
20038
|
+
if (changes.selectedId) {
|
|
20039
|
+
if (this.selectedId != this.currentSelectedId) {
|
|
20040
|
+
this.select(this.selectedId, { move: true });
|
|
20041
|
+
}
|
|
20042
|
+
}
|
|
20043
|
+
}
|
|
20044
|
+
}
|
|
20045
|
+
ngOnDestroy() {
|
|
20046
|
+
super.ngOnDestroy();
|
|
20047
|
+
this.destroy$.next();
|
|
20048
|
+
this.destroy$.complete();
|
|
20049
|
+
}
|
|
20050
|
+
init() {
|
|
20051
|
+
var _a;
|
|
20052
|
+
this.optionsMap = {};
|
|
20053
|
+
const defaultOptions = this.createOptions();
|
|
20054
|
+
this.optionsMap[''] = defaultOptions;
|
|
20055
|
+
if ((_a = this.groups) === null || _a === void 0 ? void 0 : _a.length) {
|
|
20056
|
+
this.groups.forEach((group) => {
|
|
20057
|
+
if (group.group) {
|
|
20058
|
+
const options = this.createOptions(group);
|
|
20059
|
+
this.optionsMap[group.group] = options;
|
|
20060
|
+
}
|
|
20061
|
+
});
|
|
20062
|
+
}
|
|
20063
|
+
if (this.unselectOnClickBlank) {
|
|
20064
|
+
this.parent.mapClick.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
20065
|
+
this.selectedId = null;
|
|
20066
|
+
this.select(null);
|
|
20067
|
+
});
|
|
20068
|
+
}
|
|
20069
|
+
// if (!this.enableMarkerClusterer && this.showLabel) {
|
|
20070
|
+
// const textOptions = {
|
|
20071
|
+
// ...this.getTextOptions(this.labelFont),
|
|
20072
|
+
// // color: '#fff',
|
|
20073
|
+
// // fontFamily: 'Microsoft Yahei',
|
|
20074
|
+
// // fontSize: 14,
|
|
20075
|
+
// flat: false,
|
|
20076
|
+
// collides: true,
|
|
20077
|
+
// offset: [this.labelOffsetX || 0, this.labelOffsetY || 0],
|
|
20078
|
+
// stroke: {
|
|
20079
|
+
// color: this.stroke,
|
|
20080
|
+
// },
|
|
20081
|
+
// padding: [2, 2],
|
|
20082
|
+
// margin: [0, 0],
|
|
20083
|
+
// };
|
|
20084
|
+
// if (this.stroke && this.stroke !== 'rgba(0,0,0,0)') {
|
|
20085
|
+
// textOptions.stroke = { color: this.stroke };
|
|
20086
|
+
// }
|
|
20087
|
+
// if (this.strokeWidth) {
|
|
20088
|
+
// textOptions.lineWidth = this.strokeWidth;
|
|
20089
|
+
// }
|
|
20090
|
+
// if (this.shadow) {
|
|
20091
|
+
// textOptions.shadow = {
|
|
20092
|
+
// color: this.shadow.color,
|
|
20093
|
+
// blur: this.shadow.Z,
|
|
20094
|
+
// offsetX: this.shadow.X,
|
|
20095
|
+
// offsetY: this.shadow.Y,
|
|
20096
|
+
// };
|
|
20097
|
+
// }
|
|
20098
|
+
// this.textLayer = new mapvgl.TextLayer(textOptions);
|
|
20099
|
+
// if (this.showLabelMinZoom != null) {
|
|
20100
|
+
// this.parent.init$.then(() => {
|
|
20101
|
+
// const zoom = this.parent.map.getZoom();
|
|
20102
|
+
// this.updateTextVisible(zoom);
|
|
20103
|
+
// });
|
|
20104
|
+
// }
|
|
20105
|
+
// layers.push(this.textLayer);
|
|
20106
|
+
// }
|
|
20107
|
+
}
|
|
20108
|
+
createOptions(group) {
|
|
20109
|
+
const iconOptions = this.getIconOptions(group);
|
|
20110
|
+
return { icon: iconOptions };
|
|
20111
|
+
// if (this.enableMarkerClusterer || group?.enableMarkerClusterer) {
|
|
20112
|
+
// const options: any = {
|
|
20113
|
+
// iconOptions,
|
|
20114
|
+
// textOptions: this.getTextOptions(this.clusterFont),
|
|
20115
|
+
// minSize: this.clusterMinSize || 25,
|
|
20116
|
+
// maxSize: this.clusterMaxSize || 40,
|
|
20117
|
+
// };
|
|
20118
|
+
// if (this.clusterGradient?.length) {
|
|
20119
|
+
// const gradient: any = {};
|
|
20120
|
+
// gradient[0] = this.clusterGradient[0];
|
|
20121
|
+
// this.clusterGradient.slice(1).forEach((g, i) => {
|
|
20122
|
+
// gradient[(i + 1) / this.clusterGradient.length] = g;
|
|
20123
|
+
// });
|
|
20124
|
+
// options.gradient = gradient;
|
|
20125
|
+
// }
|
|
20126
|
+
// if (this.clusterMaxZoom != null) {
|
|
20127
|
+
// options.maxZoom = this.clusterMaxZoom;
|
|
20128
|
+
// }
|
|
20129
|
+
// this.addPickEvent(options);
|
|
20130
|
+
// layer = new mapvgl.ClusterLayer(options);
|
|
20131
|
+
// } else {
|
|
20132
|
+
// this.addPickEvent(iconOptions);
|
|
20133
|
+
// layer = new mapvgl.IconLayer(iconOptions);
|
|
20134
|
+
// }
|
|
20135
|
+
}
|
|
20136
|
+
updateTextVisible(zoom) {
|
|
20137
|
+
if (this.textLayer) {
|
|
20138
|
+
if (zoom >= this.showLabelMinZoom) {
|
|
20139
|
+
this.textLayer.show();
|
|
20140
|
+
}
|
|
20141
|
+
else {
|
|
20142
|
+
this.textLayer.hide();
|
|
20143
|
+
}
|
|
20144
|
+
}
|
|
20145
|
+
}
|
|
20146
|
+
createOverlays() {
|
|
20147
|
+
const overlays = [];
|
|
20148
|
+
this.dataMap = {};
|
|
20149
|
+
if (this.toCenter && this.data.length > 0) {
|
|
20150
|
+
let maxLng = -180;
|
|
20151
|
+
let minLng = 180;
|
|
20152
|
+
let maxLat = -90;
|
|
20153
|
+
let minLat = 90;
|
|
20154
|
+
this.data.forEach((res) => {
|
|
20155
|
+
maxLng = Math.max(maxLng, res.lng);
|
|
20156
|
+
minLng = Math.min(minLng, res.lng);
|
|
20157
|
+
maxLat = Math.max(maxLat, res.lat);
|
|
20158
|
+
minLat = Math.min(minLat, res.lat);
|
|
20159
|
+
});
|
|
20160
|
+
this.parent.setRectCenterAndZoom(minLng, maxLng, minLat, maxLat);
|
|
20161
|
+
}
|
|
20162
|
+
const groupData = {};
|
|
20163
|
+
this.groupData = groupData;
|
|
20164
|
+
const textData = [];
|
|
20165
|
+
const groups = Object.keys(this.optionsMap);
|
|
20166
|
+
groups.forEach((group) => {
|
|
20167
|
+
groupData[group] = [];
|
|
20168
|
+
});
|
|
20169
|
+
// const defaultData = [];
|
|
20170
|
+
this.data.forEach((record) => {
|
|
20171
|
+
let groupName = record.group;
|
|
20172
|
+
if (groupName == null || this.optionsMap[groupName] == null) {
|
|
20173
|
+
groupName = '';
|
|
20174
|
+
}
|
|
20175
|
+
let id = record.id_value || record.id;
|
|
20176
|
+
if (id == null || id == '') {
|
|
20177
|
+
id = getUUID();
|
|
20178
|
+
}
|
|
20179
|
+
// MapVGL的bug,ClusterLayer的iconOptions无效,只能通过properties设置
|
|
20180
|
+
const options = this.optionsMap[groupName];
|
|
20181
|
+
// if (layer != null && layer instanceof mapvgl.ClusterLayer) {
|
|
20182
|
+
// const options = layer.getOptions();
|
|
20183
|
+
// if (options.iconOptions) {
|
|
20184
|
+
// const { height, width, offset, icon } = options.iconOptions;
|
|
20185
|
+
// item.properties = { height, width, offset, icon, ...item.properties };
|
|
20186
|
+
// }
|
|
20187
|
+
// }
|
|
20188
|
+
var point = this.parent.createLngLat(record.lng, record.lat);
|
|
20189
|
+
var marker = new T.Marker(point, options); // 创建标注
|
|
20190
|
+
marker.addEventListener('click', (e) => {
|
|
20191
|
+
this.selectedId = id;
|
|
20192
|
+
this.select(id);
|
|
20193
|
+
this.zone.run(() => {
|
|
20194
|
+
this.onClick.emit(Object.assign(Object.assign({}, record), { id }));
|
|
20195
|
+
});
|
|
20196
|
+
if (record.information) {
|
|
20197
|
+
this.openInfo(record.information, e);
|
|
20198
|
+
}
|
|
20199
|
+
});
|
|
20200
|
+
overlays.push(marker);
|
|
20201
|
+
if (this.showLabel && record.address) {
|
|
20202
|
+
const label = new T.Label({
|
|
20203
|
+
text: `${record.address}`,
|
|
20204
|
+
position: marker.getLngLat(),
|
|
20205
|
+
offset: new T.Point(this.labelOffsetX || -50, this.labelOffsetY || 10),
|
|
20206
|
+
});
|
|
20207
|
+
label.setBorderLine(this.strokeWidth || 0);
|
|
20208
|
+
label.setBorderColor(this.stroke);
|
|
20209
|
+
label.setBackgroundColor('rgba(0,0,0,0)');
|
|
20210
|
+
label.setFontColor(this.labelFont.color);
|
|
20211
|
+
label.setFontSize(this.labelFont.size);
|
|
20212
|
+
overlays.push(label);
|
|
20213
|
+
}
|
|
20214
|
+
// if (this.selectedId && this.selectedId == id) {
|
|
20215
|
+
// this.updateSize(item, 1.5);
|
|
20216
|
+
// this.lastSelect = item;
|
|
20217
|
+
// }
|
|
20218
|
+
groupData[groupName].push(record);
|
|
20219
|
+
this.dataMap[id] = record;
|
|
20220
|
+
if (this.textLayer) {
|
|
20221
|
+
textData.push(record);
|
|
20222
|
+
}
|
|
20223
|
+
});
|
|
20224
|
+
// if (this.selectedId) {
|
|
20225
|
+
// this.select(this.selectedId, { move: this.selectedId != this.currentSelectedId, resetLayer: false, force: true });
|
|
20226
|
+
// }
|
|
20227
|
+
// groups.forEach((group) => {
|
|
20228
|
+
// const layer = this.layerMap[group];
|
|
20229
|
+
// const data = groupData[group];
|
|
20230
|
+
// layer.setData(data);
|
|
20231
|
+
// });
|
|
20232
|
+
// if (this.textLayer) {
|
|
20233
|
+
// this.textLayer.setData(textData);
|
|
20234
|
+
// }
|
|
20235
|
+
return overlays;
|
|
20236
|
+
}
|
|
20237
|
+
getIconOptions(group) {
|
|
20238
|
+
let icon = this.iconUrl || 'assets/img/screen/marker.png';
|
|
20239
|
+
let height = this.iconHeight || 30;
|
|
20240
|
+
let width = this.iconWidth || 20;
|
|
20241
|
+
let offsetX = this.iconOffsetX == null ? width / 2 : this.iconOffsetX;
|
|
20242
|
+
let offsetY = this.iconOffsetY == null ? height : this.iconOffsetY;
|
|
20243
|
+
if (group && group.imageUrl) {
|
|
20244
|
+
icon = this.fileUrlService.getUrl(group.imageUrl);
|
|
20245
|
+
width = group.width || width;
|
|
20246
|
+
height = group.height || height;
|
|
20247
|
+
offsetX = group.XOffset != null ? group.XOffset : width / 2;
|
|
20248
|
+
offsetY = group.YOffset != null ? group.YOffset : height;
|
|
20249
|
+
}
|
|
20250
|
+
const iconOptions = new T.Icon({
|
|
20251
|
+
iconUrl: icon,
|
|
20252
|
+
iconSize: new T.Point(width, height),
|
|
20253
|
+
iconAnchor: new T.Point(offsetX, offsetY),
|
|
20254
|
+
});
|
|
20255
|
+
return iconOptions;
|
|
20256
|
+
}
|
|
20257
|
+
openInfo(content, e) {
|
|
20258
|
+
var point = e.lnglat;
|
|
20259
|
+
var markerInfoWin = new T.InfoWindow(content, { offset: new T.Point(0, -30) }); // 创建信息窗口对象
|
|
20260
|
+
this.parent.map.openInfoWindow(markerInfoWin, point); //开启信息窗口
|
|
20261
|
+
}
|
|
20262
|
+
addPickEvent(options) {
|
|
20263
|
+
// options.enablePicked = true;
|
|
20264
|
+
// options.onClick = ({ dataItem }) => {
|
|
20265
|
+
// // 每个图层都会触发一次click事件,如果每个图层都没有点中标记点,传出null
|
|
20266
|
+
// if (dataItem) {
|
|
20267
|
+
// this.clickData = dataItem;
|
|
20268
|
+
// }
|
|
20269
|
+
// if (this.unselectOnClickBlank !== false && this.clickTimeout == null) {
|
|
20270
|
+
// this.clickTimeout = setTimeout(() => {
|
|
20271
|
+
// if (this.clickData == null) {
|
|
20272
|
+
// this.selectedId = null;
|
|
20273
|
+
// this.select(null);
|
|
20274
|
+
// }
|
|
20275
|
+
// this.clickTimeout = null;
|
|
20276
|
+
// this.clickData = null;
|
|
20277
|
+
// this.subMarkers = null;
|
|
20278
|
+
// });
|
|
20279
|
+
// }
|
|
20280
|
+
// if (dataItem) {
|
|
20281
|
+
// if (dataItem.type === 'Feature') {
|
|
20282
|
+
// const coordinates = dataItem.geometry.coordinates;
|
|
20283
|
+
// this.parent.setCenterAndZoom(coordinates[0], coordinates[1], this.parent.map.getZoom() + 2);
|
|
20284
|
+
// } else {
|
|
20285
|
+
// const data = dataItem.properties.raw;
|
|
20286
|
+
// if (data) {
|
|
20287
|
+
// this.selectedId = dataItem.properties.id;
|
|
20288
|
+
// this.select(dataItem.properties.id);
|
|
20289
|
+
// this.zone.run(() => {
|
|
20290
|
+
// this.onClick.emit({ ...data, id: data.id_value || data.id });
|
|
20291
|
+
// });
|
|
20292
|
+
// }
|
|
20293
|
+
// }
|
|
20294
|
+
// }
|
|
20295
|
+
// };
|
|
20296
|
+
// if (this.parent.showType === 'mouseover') {
|
|
20297
|
+
// let infoWindow = null;
|
|
20298
|
+
// let infoWindowData = null;
|
|
20299
|
+
// options.onMousemove = ({ dataItem }) => {
|
|
20300
|
+
// const data = dataItem != null ? dataItem.properties.raw : null;
|
|
20301
|
+
// if (infoWindow != null && infoWindowData != data) {
|
|
20302
|
+
// infoWindow.close();
|
|
20303
|
+
// infoWindow = null;
|
|
20304
|
+
// }
|
|
20305
|
+
// if (data && data.information && infoWindow == null) {
|
|
20306
|
+
// infoWindowData = data;
|
|
20307
|
+
// infoWindow = this.parent.openInfoWindow(data, data.lng, data.lat);
|
|
20308
|
+
// }
|
|
20309
|
+
// };
|
|
20310
|
+
// }
|
|
20311
|
+
}
|
|
20312
|
+
select(id, options = {}) {
|
|
20313
|
+
if (id != this.currentSelectedId || options.force) {
|
|
20314
|
+
let item;
|
|
20315
|
+
if (id != null && id !== '') {
|
|
20316
|
+
item = this.dataMap[id];
|
|
20317
|
+
// 如果找不到数据,可能是数据还没加载,等数据加载了再执行
|
|
20318
|
+
if (item == null) {
|
|
20319
|
+
return;
|
|
20320
|
+
}
|
|
20321
|
+
}
|
|
20322
|
+
this.currentSelectedId = id;
|
|
20323
|
+
// let lastSelectGroup: string;
|
|
20324
|
+
// let currentSelectGroup: string;
|
|
20325
|
+
let selectedData;
|
|
20326
|
+
if (this.lastSelect) {
|
|
20327
|
+
// lastSelectGroup = this.lastSelect.properties.group;
|
|
20328
|
+
this.updateSize(this.lastSelect, 1);
|
|
20329
|
+
this.lastSelect = null;
|
|
20330
|
+
}
|
|
20331
|
+
if (item) {
|
|
20332
|
+
// currentSelectGroup = item.properties.group;
|
|
20333
|
+
// this.updateSize(item, this.selectedSize ?? 1.5);
|
|
20334
|
+
this.lastSelect = item;
|
|
20335
|
+
selectedData = item;
|
|
20336
|
+
if (options.move) {
|
|
20337
|
+
// const layer = this.optionsMap[currentSelectGroup];
|
|
20338
|
+
let zoom = this.parent.map.getZoom();
|
|
20339
|
+
if (this.selectedMapZoom) {
|
|
20340
|
+
zoom = this.selectedMapZoom;
|
|
20341
|
+
}
|
|
20342
|
+
// else if (
|
|
20343
|
+
// layer instanceof mapvgl.ClusterLayer &&
|
|
20344
|
+
// this.clusterMaxZoom != null &&
|
|
20345
|
+
// Math.floor(zoom) <= this.clusterMaxZoom
|
|
20346
|
+
// ) {
|
|
20347
|
+
// zoom = this.clusterMaxZoom + 2;
|
|
20348
|
+
// }
|
|
20349
|
+
this.parent.setCenterAndZoom(selectedData.lng, selectedData.lat, zoom);
|
|
20350
|
+
}
|
|
20351
|
+
// if (selectedData.information && this.parent.showType !== 'mouseover') {
|
|
20352
|
+
// // 防止其他图层将信息窗口关闭
|
|
20353
|
+
// setTimeout(() => {
|
|
20354
|
+
// this.parent.openInfoWindow(selectedData, selectedData.lng, selectedData.lat);
|
|
20355
|
+
// });
|
|
20356
|
+
// }
|
|
20357
|
+
}
|
|
20358
|
+
else {
|
|
20359
|
+
selectedData = {};
|
|
20360
|
+
}
|
|
20361
|
+
// if (options.resetLayer !== false) {
|
|
20362
|
+
// if (currentSelectGroup != null) {
|
|
20363
|
+
// this.resetLayerData(currentSelectGroup);
|
|
20364
|
+
// }
|
|
20365
|
+
// if (lastSelectGroup != null && lastSelectGroup !== currentSelectGroup) {
|
|
20366
|
+
// this.resetLayerData(lastSelectGroup);
|
|
20367
|
+
// }
|
|
20368
|
+
// }
|
|
20369
|
+
// 如果选中的id找不到对应数据,可能是数据还没加载,
|
|
20370
|
+
if (id == null || item != null) {
|
|
20371
|
+
this.zone.run(() => {
|
|
20372
|
+
this.makerClick.emit(Object.assign(Object.assign({}, selectedData), { id: selectedData.id_value || selectedData.id }));
|
|
20373
|
+
});
|
|
20374
|
+
}
|
|
20375
|
+
}
|
|
20376
|
+
}
|
|
20377
|
+
resetLayerData(group) {
|
|
20378
|
+
// const layer = this.layerMap[group];
|
|
20379
|
+
// const data = this.groupData[group];
|
|
20380
|
+
// if (layer && data) {
|
|
20381
|
+
// layer.setData(data);
|
|
20382
|
+
// }
|
|
20383
|
+
}
|
|
20384
|
+
updateSize(item, scale) {
|
|
20385
|
+
// if (item && this.enlargeOnSelect) {
|
|
20386
|
+
// const layer = this.layerMap[item.properties.group];
|
|
20387
|
+
// let options: any;
|
|
20388
|
+
// if (layer instanceof mapvgl.ClusterLayer) {
|
|
20389
|
+
// options = layer.getOptions().iconOptions;
|
|
20390
|
+
// } else {
|
|
20391
|
+
// options = layer.getOptions();
|
|
20392
|
+
// }
|
|
20393
|
+
// const { height, width, offset } = options;
|
|
20394
|
+
// item.properties.height = height * scale;
|
|
20395
|
+
// item.properties.width = width * scale;
|
|
20396
|
+
// if (item.properties.offset) {
|
|
20397
|
+
// item.properties.offset = [offset[0] * scale, offset[1] * scale];
|
|
20398
|
+
// }
|
|
20399
|
+
// }
|
|
20400
|
+
}
|
|
20401
|
+
};
|
|
20402
|
+
TiandituMarkerComponent.decorators = [
|
|
20403
|
+
{ type: Component, args: [{
|
|
20404
|
+
selector: 'sc-tianditu-marker',
|
|
20405
|
+
template: "",
|
|
20406
|
+
styles: [""]
|
|
20407
|
+
},] }
|
|
20408
|
+
];
|
|
20409
|
+
TiandituMarkerComponent.ctorParameters = () => [
|
|
20410
|
+
{ type: TiandituComponent },
|
|
20411
|
+
{ type: NgZone },
|
|
20412
|
+
{ type: FileUrlService },
|
|
20413
|
+
{ type: NzContextMenuService }
|
|
20414
|
+
];
|
|
20415
|
+
TiandituMarkerComponent.propDecorators = {
|
|
20416
|
+
menu: [{ type: ViewChild, args: ['menu',] }]
|
|
20417
|
+
};
|
|
20418
|
+
__decorate([
|
|
20419
|
+
Property('', { min: 1, ui: { widget: 'myPicture', spanLabel: 0, spanControl: 24 } }),
|
|
20420
|
+
__metadata("design:type", Object)
|
|
20421
|
+
], TiandituMarkerComponent.prototype, "iconUrl", void 0);
|
|
20422
|
+
__decorate([
|
|
20423
|
+
Property('图标宽', { type: 'number' }),
|
|
20424
|
+
__metadata("design:type", Object)
|
|
20425
|
+
], TiandituMarkerComponent.prototype, "iconWidth", void 0);
|
|
20426
|
+
__decorate([
|
|
20427
|
+
Property('图标高', { type: 'number' }),
|
|
20428
|
+
__metadata("design:type", Object)
|
|
20429
|
+
], TiandituMarkerComponent.prototype, "iconHeight", void 0);
|
|
20430
|
+
__decorate([
|
|
20431
|
+
Property('图标偏移x', { type: 'number' }),
|
|
20432
|
+
__metadata("design:type", Object)
|
|
20433
|
+
], TiandituMarkerComponent.prototype, "iconOffsetX", void 0);
|
|
20434
|
+
__decorate([
|
|
20435
|
+
Property('图标偏移y', { type: 'number' }),
|
|
20436
|
+
__metadata("design:type", Object)
|
|
20437
|
+
], TiandituMarkerComponent.prototype, "iconOffsetY", void 0);
|
|
20438
|
+
__decorate([
|
|
20439
|
+
Property('移至中心'),
|
|
20440
|
+
__metadata("design:type", Boolean)
|
|
20441
|
+
], TiandituMarkerComponent.prototype, "toCenter", void 0);
|
|
20442
|
+
__decorate([
|
|
20443
|
+
Property('显示标签', { ui: { visibleIf: { enableMarkerClusterer: [false] } } }),
|
|
20444
|
+
__metadata("design:type", Boolean)
|
|
20445
|
+
], TiandituMarkerComponent.prototype, "showLabel", void 0);
|
|
20446
|
+
__decorate([
|
|
20447
|
+
Property('标签显示缩放等级', { ui: { visibleIf: { showLabel: [true] } } }),
|
|
20448
|
+
__metadata("design:type", Number)
|
|
20449
|
+
], TiandituMarkerComponent.prototype, "showLabelMinZoom", void 0);
|
|
20450
|
+
__decorate([
|
|
20451
|
+
Property('标签字体', { ui: { widget: 'myFont', visibleIf: { showLabel: [true] } } }),
|
|
20452
|
+
__metadata("design:type", Object)
|
|
20453
|
+
], TiandituMarkerComponent.prototype, "labelFont", void 0);
|
|
20454
|
+
__decorate([
|
|
20455
|
+
Property('描边颜色', {
|
|
20456
|
+
ui: {
|
|
20457
|
+
widget: 'myColor',
|
|
20458
|
+
},
|
|
20459
|
+
}),
|
|
20460
|
+
__metadata("design:type", String)
|
|
20461
|
+
], TiandituMarkerComponent.prototype, "stroke", void 0);
|
|
20462
|
+
__decorate([
|
|
20463
|
+
Property('描边粗细', { type: 'integer' }),
|
|
20464
|
+
__metadata("design:type", Number)
|
|
20465
|
+
], TiandituMarkerComponent.prototype, "strokeWidth", void 0);
|
|
20466
|
+
__decorate([
|
|
20467
|
+
Property('标签偏移x', { ui: { widget: 'number', visibleIf: { showLabel: [true] } } }),
|
|
20468
|
+
__metadata("design:type", Object)
|
|
20469
|
+
], TiandituMarkerComponent.prototype, "labelOffsetX", void 0);
|
|
20470
|
+
__decorate([
|
|
20471
|
+
Property('标签偏移y', { ui: { widget: 'number', visibleIf: { showLabel: [true] } } }),
|
|
20472
|
+
__metadata("design:type", Object)
|
|
20473
|
+
], TiandituMarkerComponent.prototype, "labelOffsetY", void 0);
|
|
20474
|
+
__decorate([
|
|
20475
|
+
Property('选中时地图缩放', { type: 'number' }),
|
|
20476
|
+
__metadata("design:type", Number)
|
|
20477
|
+
], TiandituMarkerComponent.prototype, "selectedMapZoom", void 0);
|
|
20478
|
+
__decorate([
|
|
20479
|
+
Property('点击空白取消选中', { type: 'boolean', default: true }),
|
|
20480
|
+
__metadata("design:type", Object)
|
|
20481
|
+
], TiandituMarkerComponent.prototype, "unselectOnClickBlank", void 0);
|
|
20482
|
+
__decorate([
|
|
20483
|
+
Property('标记分组', {
|
|
20484
|
+
type: 'array',
|
|
20485
|
+
title: '标记分组',
|
|
20486
|
+
maxItems: 10,
|
|
20487
|
+
items: {
|
|
20488
|
+
type: 'object',
|
|
20489
|
+
properties: {
|
|
20490
|
+
group: {
|
|
20491
|
+
type: 'string',
|
|
20492
|
+
title: '分组',
|
|
20493
|
+
},
|
|
20494
|
+
// type: {
|
|
20495
|
+
// title: '类型',
|
|
20496
|
+
// type: 'string',
|
|
20497
|
+
// enum: [
|
|
20498
|
+
// {
|
|
20499
|
+
// label: '图标',
|
|
20500
|
+
// value: 'icon',
|
|
20501
|
+
// },
|
|
20502
|
+
// {
|
|
20503
|
+
// label: '圆点',
|
|
20504
|
+
// value: 'circle',
|
|
20505
|
+
// },
|
|
20506
|
+
// {
|
|
20507
|
+
// label: '正方形',
|
|
20508
|
+
// value: 'square',
|
|
20509
|
+
// },
|
|
20510
|
+
// {
|
|
20511
|
+
// label: '波纹',
|
|
20512
|
+
// value: 'wave',
|
|
20513
|
+
// },
|
|
20514
|
+
// {
|
|
20515
|
+
// label: '扩散',
|
|
20516
|
+
// value: 'bubble',
|
|
20517
|
+
// },
|
|
20518
|
+
// ],
|
|
20519
|
+
// default: 'icon',
|
|
20520
|
+
// },
|
|
20521
|
+
// color: {
|
|
20522
|
+
// type: 'string',
|
|
20523
|
+
// title: '颜色',
|
|
20524
|
+
// ui: { widget: 'myColor', visibleIf: { type: ['circle', 'square'] } },
|
|
20525
|
+
// },
|
|
20526
|
+
// size: {
|
|
20527
|
+
// type: 'number',
|
|
20528
|
+
// title: '尺寸',
|
|
20529
|
+
// ui: { visibleIf: { type: ['circle', 'square', 'wave', 'bubble'] } },
|
|
20530
|
+
// },
|
|
20531
|
+
imageUrl: {
|
|
20532
|
+
type: 'string',
|
|
20533
|
+
title: '图片',
|
|
20534
|
+
ui: {
|
|
20535
|
+
widget: 'myPicture',
|
|
20536
|
+
visibleIf: { type: ['icon'] },
|
|
20537
|
+
},
|
|
20538
|
+
},
|
|
20539
|
+
width: {
|
|
20540
|
+
type: 'number',
|
|
20541
|
+
title: '宽度',
|
|
20542
|
+
default: 19,
|
|
20543
|
+
ui: { visibleIf: { type: ['icon'] } },
|
|
20544
|
+
},
|
|
20545
|
+
height: {
|
|
20546
|
+
type: 'number',
|
|
20547
|
+
title: '高度',
|
|
20548
|
+
default: 25,
|
|
20549
|
+
ui: { visibleIf: { type: ['icon'] } },
|
|
20550
|
+
},
|
|
20551
|
+
XOffset: {
|
|
20552
|
+
type: 'number',
|
|
20553
|
+
title: 'X轴偏移',
|
|
20554
|
+
ui: { visibleIf: { type: ['icon'] } },
|
|
20555
|
+
},
|
|
20556
|
+
YOffset: {
|
|
20557
|
+
type: 'number',
|
|
20558
|
+
title: 'Y轴偏移',
|
|
20559
|
+
ui: { visibleIf: { type: ['icon'] } },
|
|
20560
|
+
},
|
|
20561
|
+
},
|
|
20562
|
+
required: [],
|
|
20563
|
+
},
|
|
20564
|
+
ui: { grid: { arraySpan: 24 }, spanControl: 24 },
|
|
20565
|
+
}),
|
|
20566
|
+
__metadata("design:type", Object)
|
|
20567
|
+
], TiandituMarkerComponent.prototype, "groups", void 0);
|
|
20568
|
+
__decorate([
|
|
20569
|
+
Data({
|
|
20570
|
+
properties: {
|
|
20571
|
+
id: ɵ0$e,
|
|
20572
|
+
address: { type: 'string', title: '地点' },
|
|
20573
|
+
information: { type: 'string', title: '信息' },
|
|
20574
|
+
group: { type: 'string', title: '标记分组' },
|
|
20575
|
+
lng: { type: 'number', title: '经度' },
|
|
20576
|
+
lat: { type: 'number', title: '纬度' },
|
|
20577
|
+
icon: { type: 'string', title: '图标' },
|
|
20578
|
+
},
|
|
20579
|
+
}),
|
|
20580
|
+
__metadata("design:type", Array)
|
|
20581
|
+
], TiandituMarkerComponent.prototype, "data", void 0);
|
|
20582
|
+
__decorate([
|
|
20583
|
+
DataOutput(['id', 'address', 'lng', 'lat']),
|
|
20584
|
+
Event('选中值改变', {
|
|
20585
|
+
params: {
|
|
20586
|
+
properties: {
|
|
20587
|
+
id: ɵ1$c,
|
|
20588
|
+
address: { type: 'string', title: '地点' },
|
|
20589
|
+
lng: { type: 'number', title: '经度' },
|
|
20590
|
+
lat: { type: 'number', title: '纬度' },
|
|
20591
|
+
},
|
|
20592
|
+
},
|
|
20593
|
+
}),
|
|
20594
|
+
__metadata("design:type", Object)
|
|
20595
|
+
], TiandituMarkerComponent.prototype, "makerClick", void 0);
|
|
20596
|
+
__decorate([
|
|
20597
|
+
DataInput('选中id'),
|
|
20598
|
+
__metadata("design:type", String)
|
|
20599
|
+
], TiandituMarkerComponent.prototype, "selectedId", void 0);
|
|
20600
|
+
__decorate([
|
|
20601
|
+
Event('点击', {
|
|
20602
|
+
params: {
|
|
20603
|
+
properties: {
|
|
20604
|
+
id: ɵ2$a,
|
|
20605
|
+
address: { type: 'string', title: '地点' },
|
|
20606
|
+
lng: { type: 'number', title: '经度' },
|
|
20607
|
+
lat: { type: 'number', title: '纬度' },
|
|
20608
|
+
},
|
|
20609
|
+
},
|
|
20610
|
+
}),
|
|
20611
|
+
__metadata("design:type", Object)
|
|
20612
|
+
], TiandituMarkerComponent.prototype, "onClick", void 0);
|
|
20613
|
+
TiandituMarkerComponent = __decorate([
|
|
20614
|
+
Widget('标记层', {
|
|
20615
|
+
hidden: true,
|
|
20616
|
+
}),
|
|
20617
|
+
__metadata("design:paramtypes", [TiandituComponent,
|
|
20618
|
+
NgZone,
|
|
20619
|
+
FileUrlService,
|
|
20620
|
+
NzContextMenuService])
|
|
20621
|
+
], TiandituMarkerComponent);
|
|
20622
|
+
|
|
20623
|
+
class TiandituModule {
|
|
20624
|
+
constructor(widgetService) {
|
|
20625
|
+
widgetService.register(TiandituComponent, { scaleContent: false });
|
|
20626
|
+
widgetService.register(TiandituMarkerComponent);
|
|
20627
|
+
}
|
|
20628
|
+
}
|
|
20629
|
+
TiandituModule.decorators = [
|
|
20630
|
+
{ type: NgModule, args: [{
|
|
20631
|
+
declarations: [TiandituComponent, TiandituMarkerComponent],
|
|
20632
|
+
imports: [CommonModule, WidgetBaseModule],
|
|
20633
|
+
},] }
|
|
20634
|
+
];
|
|
20635
|
+
TiandituModule.ctorParameters = () => [
|
|
20636
|
+
{ type: WidgetService }
|
|
20637
|
+
];
|
|
20638
|
+
|
|
20639
|
+
class ScreenWidgetModule {
|
|
20640
|
+
constructor(widgetService) {
|
|
20641
|
+
widgetService.register(ButtonComponent, { size: { width: 60, height: 30 } });
|
|
20642
|
+
widgetService.register(SelectComponent, {
|
|
20643
|
+
size: { width: 200, height: 36 },
|
|
20644
|
+
option: {
|
|
20645
|
+
borderColor: '#3285ff',
|
|
20646
|
+
background: 'rgba(50,133,255,0.2)',
|
|
20647
|
+
dropdownBackgroundColor: '#3285ff',
|
|
20648
|
+
selectDropDownColor: '#fff',
|
|
20649
|
+
selectHoverColor: '#fff',
|
|
20650
|
+
selectHoverBackgroundColor: '#3285ff',
|
|
20651
|
+
font: { color: '#ffffff' },
|
|
20652
|
+
dropdownBg: 'rgba(50,133,255,0.2)',
|
|
20653
|
+
dropdownBorderColor: '#3285ff',
|
|
20654
|
+
},
|
|
20655
|
+
});
|
|
20656
|
+
for (let i = 1; i <= 82; i++) {
|
|
20657
|
+
widgetService.register(ImageComponent, {
|
|
20658
|
+
option: { image: `assets/img/screen/picture${i}.png` },
|
|
20659
|
+
});
|
|
20660
|
+
}
|
|
20661
|
+
icons.forEach((icon) => {
|
|
20662
|
+
widgetService.register(IconfontComponent, {
|
|
20663
|
+
option: { icon },
|
|
20664
|
+
});
|
|
20665
|
+
});
|
|
20666
|
+
widgetService.register(GeneralTextComponent, {
|
|
20667
|
+
className: 'big-title title',
|
|
20668
|
+
title: '大标题',
|
|
20669
|
+
option: {
|
|
20670
|
+
title: '大标题',
|
|
20671
|
+
font: { family: '', color: '#ffffff', weight: 'normal', size: 36, space: 0, lineHeight: 50 },
|
|
20672
|
+
},
|
|
20673
|
+
}, {
|
|
20674
|
+
className: 'normal-title title',
|
|
20675
|
+
title: '标题',
|
|
20676
|
+
option: {
|
|
20677
|
+
title: '标题',
|
|
20678
|
+
font: { family: '', color: '#ffffff', weight: 'normal', size: 32, space: 0, lineHeight: 45 },
|
|
20679
|
+
},
|
|
20680
|
+
}, {
|
|
20681
|
+
className: 'subtitle title',
|
|
20682
|
+
title: '副标题',
|
|
19581
20683
|
option: {
|
|
19582
20684
|
title: '副标题',
|
|
19583
20685
|
font: { family: '', color: '#ffffff', weight: 'normal', size: 24, space: 0, lineHeight: 33 },
|
|
@@ -19981,6 +21083,11 @@ ScreenWidgetModule.decorators = [
|
|
|
19981
21083
|
IframeModule,
|
|
19982
21084
|
VideoGridModule,
|
|
19983
21085
|
Scatter3dModule,
|
|
21086
|
+
TiandituModule
|
|
21087
|
+
// DropDownDetailListModule,
|
|
21088
|
+
// DynamicListModule,
|
|
21089
|
+
// MyBaiduMapModule,
|
|
21090
|
+
// DataMapModule
|
|
19984
21091
|
],
|
|
19985
21092
|
exports: [],
|
|
19986
21093
|
declarations: [],
|
|
@@ -20098,7 +21205,7 @@ function updateEndTime(event) {
|
|
|
20098
21205
|
}
|
|
20099
21206
|
}
|
|
20100
21207
|
|
|
20101
|
-
const ɵ0$
|
|
21208
|
+
const ɵ0$f = { type: 'string', title: 'id' };
|
|
20102
21209
|
let CalendarComponent = class CalendarComponent {
|
|
20103
21210
|
constructor(router, cd) {
|
|
20104
21211
|
this.router = router;
|
|
@@ -20226,7 +21333,7 @@ __decorate([
|
|
|
20226
21333
|
__decorate([
|
|
20227
21334
|
Data({
|
|
20228
21335
|
properties: {
|
|
20229
|
-
id: ɵ0$
|
|
21336
|
+
id: ɵ0$f,
|
|
20230
21337
|
start: { type: 'string', title: '开始日期' },
|
|
20231
21338
|
end: { type: 'string', title: '结束日期' },
|
|
20232
21339
|
title: { type: 'string', title: '内容' },
|
|
@@ -20284,7 +21391,7 @@ CalendarEventsChild.ctorParameters = () => [
|
|
|
20284
21391
|
{ type: CalendarComponent }
|
|
20285
21392
|
];
|
|
20286
21393
|
|
|
20287
|
-
const ɵ0$
|
|
21394
|
+
const ɵ0$g = { type: 'string', title: 'id' };
|
|
20288
21395
|
let BackgroundEventsComponent = class BackgroundEventsComponent extends CalendarEventsChild {
|
|
20289
21396
|
constructor(parent) {
|
|
20290
21397
|
super(parent);
|
|
@@ -20327,7 +21434,7 @@ __decorate([
|
|
|
20327
21434
|
__decorate([
|
|
20328
21435
|
Data({
|
|
20329
21436
|
properties: {
|
|
20330
|
-
id: ɵ0$
|
|
21437
|
+
id: ɵ0$g,
|
|
20331
21438
|
start: { type: 'string', title: '开始日期' },
|
|
20332
21439
|
end: { type: 'string', title: '结束日期' },
|
|
20333
21440
|
title: { type: 'string', title: '标题' },
|
|
@@ -20341,7 +21448,7 @@ BackgroundEventsComponent = __decorate([
|
|
|
20341
21448
|
__metadata("design:paramtypes", [CalendarComponent])
|
|
20342
21449
|
], BackgroundEventsComponent);
|
|
20343
21450
|
|
|
20344
|
-
const ɵ0$
|
|
21451
|
+
const ɵ0$h = { type: 'string', title: 'id' };
|
|
20345
21452
|
let EventsComponent = class EventsComponent extends CalendarEventsChild {
|
|
20346
21453
|
constructor(parent) {
|
|
20347
21454
|
super(parent);
|
|
@@ -20390,7 +21497,7 @@ __decorate([
|
|
|
20390
21497
|
__decorate([
|
|
20391
21498
|
Data({
|
|
20392
21499
|
properties: {
|
|
20393
|
-
id: ɵ0$
|
|
21500
|
+
id: ɵ0$h,
|
|
20394
21501
|
start: { type: 'string', title: '开始日期' },
|
|
20395
21502
|
end: { type: 'string', title: '结束日期' },
|
|
20396
21503
|
title: { type: 'string', title: '标题' },
|
|
@@ -21334,5 +22441,5 @@ WorkbenchWidgetModule.ctorParameters = () => [
|
|
|
21334
22441
|
* Generated bundle index. Do not edit.
|
|
21335
22442
|
*/
|
|
21336
22443
|
|
|
21337
|
-
export { AudioModule, BarChartThreeDModule, BasicBarChartComponent, BasicBarChartModule, BasicLineChartModule, BasicPieChartModule, BasicPlanimetricMapModule, BubbleChartModule, CheckboxModule, CommonService, CrossTableModule, CustomBaiduMapModule, DatePickerModule, FileUrlService, FunnelChartModule, GaodeMapService, GaugeModule, IframeModule, LiquidFillModule, MarqueeModule, PercentPieChartModule, PlanimetricMap2dModule, PlanimetricMap3dModule, RadarChartModule, Scatter3dModule, ScreenWidgetModule, SelectModule, TableModule, TreeControlModule, TreeRingChartModule, VideoGridModule, VideoPlayerModule, VisualMapChartModule, WorkbenchWidgetModule, ɵ0$2 as ɵ0, ɵ1$2 as ɵ1, ɵ2$2 as ɵ2, ɵ3$2 as ɵ3, ImageModule as ɵa, ImageComponent as ɵb, WeatherModule as ɵba, WeatherComponent as ɵbb, RadioModule as ɵbc, RadioComponent as ɵbd, CheckboxComponent as ɵbe, RateModule as ɵbf, RateComponent as ɵbg, GeneralTextModule as ɵbh, GeneralTextComponent as ɵbi, MarqueeComponent as ɵbj, WordartModule as ɵbk, WordartComponent as ɵbl, IconfontModule as ɵbm, IconfontComponent as ɵbn, TableComponent as ɵbo, AudioComponent as ɵbp, VideoPlayerComponent as ɵbq, ShapeModule as ɵbr, ShapeComponent as ɵbs, BackgroundModule as ɵbt, BackgroundComponent as ɵbu, ShufflingListModule as ɵbv, ShufflingListComponent as ɵbw, ColorPipe as ɵbx, BasicPlanimetricMapComponent as ɵby, ParentContainerComponent as ɵbz, BasicLineChartComponent as ɵc, BreathingBubbleLayerModule as ɵca, BreathingBubbleLayerComponent as ɵcb, PlanimetricMap2dComponent as ɵcc, FlyLineLayerModule as ɵcd, FlyLineLayerComponent as ɵce, Map2dPolylineLayerModule as ɵcf, Map2dPolylineLayerComponent as ɵcg, Map2dMarkLayerModule as ɵch, Map2dMarkLayerComponent as ɵci, Map2dVisualLayerModule as ɵcj, Map2dVisualLayerComponent as ɵck, ParentContainerModule as ɵcl, PlanimetricMap3dComponent as ɵcm, Map3dMarkLayerModule as ɵcn, Map3dMarkLayerComponent as ɵco, Map3dLineLayerModule as ɵcp, Map3dLineLayerComponent as ɵcq, MipAnimModule as ɵcr, MipAnimComponent as ɵcs, TreeControlComponent as ɵct, VisualMapChartComponent as ɵcu, DatePickerComponent as ɵcv, TimePickerModule as ɵcw, TimePickerComponent as ɵcx, CustomBaiduMapComponent as ɵcy, BaiduMarkerLayerComponent as ɵcz, BasicPieChartComponent as ɵd, BaseLayer as ɵda, BaiduPolylineLayerComponent as ɵdb, WindLayerComponent as ɵdc, TyphoonAreaLayerComponent as ɵdd, BaiduFenceComponent as ɵde, BaiduLushuComponent as ɵdf, UploadModule as ɵdg, UploadComponent as ɵdh, CrossTableComponent as ɵdi, Pie3dChartModule as ɵdj, Pie3dChartComponent as ɵdk, HighChartsService as ɵdl, MultiTitleGaugeModule as ɵdm, MultiTitleGaugeComponent as ɵdn, GaugeProgressModule as ɵdo, GaugeProgressComponent as ɵdp, ItemSwiperModule as ɵdq, ItemSwiperComponent as ɵdr, BulletinBoardModule as ɵds, BulletinBoardComponent as ɵdt, TemporaryDataModule as ɵdu, TemporaryDataComponent as ɵdv, LineLightFlowModule as ɵdw, LineLightFlowComponent as ɵdx, IframeComponent as ɵdy, VideoGridComponent as ɵdz, LineBarChartModule as ɵe, Scatter3dComponent as ɵea,
|
|
22444
|
+
export { AudioModule, BarChartThreeDModule, BasicBarChartComponent, BasicBarChartModule, BasicLineChartModule, BasicPieChartModule, BasicPlanimetricMapModule, BubbleChartModule, CheckboxModule, CommonService, CrossTableModule, CustomBaiduMapModule, DatePickerModule, FileUrlService, FunnelChartModule, GaodeMapService, GaugeModule, IframeModule, LiquidFillModule, MarqueeModule, PercentPieChartModule, PlanimetricMap2dModule, PlanimetricMap3dModule, RadarChartModule, Scatter3dModule, ScreenWidgetModule, SelectModule, TableModule, TiandituModule, TreeControlModule, TreeRingChartModule, VideoGridModule, VideoPlayerModule, VisualMapChartModule, WorkbenchWidgetModule, ɵ0$2 as ɵ0, ɵ1$2 as ɵ1, ɵ2$2 as ɵ2, ɵ3$2 as ɵ3, ImageModule as ɵa, ImageComponent as ɵb, WeatherModule as ɵba, WeatherComponent as ɵbb, RadioModule as ɵbc, RadioComponent as ɵbd, CheckboxComponent as ɵbe, RateModule as ɵbf, RateComponent as ɵbg, GeneralTextModule as ɵbh, GeneralTextComponent as ɵbi, MarqueeComponent as ɵbj, WordartModule as ɵbk, WordartComponent as ɵbl, IconfontModule as ɵbm, IconfontComponent as ɵbn, TableComponent as ɵbo, AudioComponent as ɵbp, VideoPlayerComponent as ɵbq, ShapeModule as ɵbr, ShapeComponent as ɵbs, BackgroundModule as ɵbt, BackgroundComponent as ɵbu, ShufflingListModule as ɵbv, ShufflingListComponent as ɵbw, ColorPipe as ɵbx, BasicPlanimetricMapComponent as ɵby, ParentContainerComponent as ɵbz, BasicLineChartComponent as ɵc, BreathingBubbleLayerModule as ɵca, BreathingBubbleLayerComponent as ɵcb, PlanimetricMap2dComponent as ɵcc, FlyLineLayerModule as ɵcd, FlyLineLayerComponent as ɵce, Map2dPolylineLayerModule as ɵcf, Map2dPolylineLayerComponent as ɵcg, Map2dMarkLayerModule as ɵch, Map2dMarkLayerComponent as ɵci, Map2dVisualLayerModule as ɵcj, Map2dVisualLayerComponent as ɵck, ParentContainerModule as ɵcl, PlanimetricMap3dComponent as ɵcm, Map3dMarkLayerModule as ɵcn, Map3dMarkLayerComponent as ɵco, Map3dLineLayerModule as ɵcp, Map3dLineLayerComponent as ɵcq, MipAnimModule as ɵcr, MipAnimComponent as ɵcs, TreeControlComponent as ɵct, VisualMapChartComponent as ɵcu, DatePickerComponent as ɵcv, TimePickerModule as ɵcw, TimePickerComponent as ɵcx, CustomBaiduMapComponent as ɵcy, BaiduMarkerLayerComponent as ɵcz, BasicPieChartComponent as ɵd, BaseLayer as ɵda, BaiduPolylineLayerComponent as ɵdb, WindLayerComponent as ɵdc, TyphoonAreaLayerComponent as ɵdd, BaiduFenceComponent as ɵde, BaiduLushuComponent as ɵdf, UploadModule as ɵdg, UploadComponent as ɵdh, CrossTableComponent as ɵdi, Pie3dChartModule as ɵdj, Pie3dChartComponent as ɵdk, HighChartsService as ɵdl, MultiTitleGaugeModule as ɵdm, MultiTitleGaugeComponent as ɵdn, GaugeProgressModule as ɵdo, GaugeProgressComponent as ɵdp, ItemSwiperModule as ɵdq, ItemSwiperComponent as ɵdr, BulletinBoardModule as ɵds, BulletinBoardComponent as ɵdt, TemporaryDataModule as ɵdu, TemporaryDataComponent as ɵdv, LineLightFlowModule as ɵdw, LineLightFlowComponent as ɵdx, IframeComponent as ɵdy, VideoGridComponent as ɵdz, LineBarChartModule as ɵe, Scatter3dComponent as ɵea, TiandituComponent as ɵeb, TiandituMarkerComponent as ɵec, BaseLayer$1 as ɵed, AnnouncementModule as ɵee, AnnouncementComponent as ɵef, TabsModule as ɵeg, TabsComponent as ɵeh, TabComponent as ɵei, CalendarModule as ɵej, CalendarComponent as ɵek, BackgroundEventsComponent as ɵel, CalendarEventsChild as ɵem, EventsComponent as ɵen, GanttModule as ɵeo, GanttComponent as ɵep, LineBarChartComponent as ɵf, BarChartThreeDComponent as ɵg, BubbleChartComponent as ɵh, RadarChartComponent as ɵi, FunnelChartComponent as ɵj, PercentPieChartComponent as ɵk, TreeRingChartComponent as ɵl, GaugeComponent as ɵm, LiquidFillComponent as ɵn, ButtonModule as ɵo, ButtonComponent as ɵp, HttpService as ɵq, TimerModule as ɵr, TimerComponent as ɵs, NumberFlopModule as ɵt, NumberFlopComponent as ɵu, VoteModule as ɵv, VoteComponent as ɵw, SelectComponent as ɵx, SearchModule as ɵy, SearchComponent as ɵz };
|
|
21338
22445
|
//# sourceMappingURL=bbj-screen-widget.js.map
|