@artstesh/maps 4.0.11 → 4.1.0
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/dist/esm2020/map/map-plate/controls/index.mjs +3 -0
- package/dist/esm2020/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +49 -0
- package/dist/esm2020/map/map-plate/controls/map-control-zoom/zoom-control.factory.mjs +13 -0
- package/dist/esm2020/map/map-plate/controls/map-control-zoom/zoom-control.settings.mjs +47 -0
- package/dist/esm2020/map/map.module.mjs +8 -3
- package/dist/esm2020/map/messages/executors/generate-zoom-control.executor.mjs +12 -0
- package/dist/esm2020/map/public-api.mjs +2 -1
- package/dist/esm2020/map/services/message-registrator.service.mjs +4 -1
- package/dist/esm2020/src/map/map-plate/controls/index.mjs +3 -0
- package/dist/esm2020/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.mjs +49 -0
- package/dist/esm2020/src/map/map-plate/controls/map-control-zoom/zoom-control.factory.mjs +13 -0
- package/dist/esm2020/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.mjs +47 -0
- package/dist/esm2020/src/map/map.module.mjs +8 -3
- package/dist/esm2020/src/map/messages/executors/generate-zoom-control.executor.mjs +12 -0
- package/dist/esm2020/src/map/public-api.mjs +2 -1
- package/dist/esm2020/src/map/services/message-registrator.service.mjs +4 -1
- package/dist/fesm2015/maps-components-src-map.mjs +120 -3
- package/dist/fesm2015/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2015/maps-components.mjs +120 -3
- package/dist/fesm2015/maps-components.mjs.map +1 -1
- package/dist/fesm2020/maps-components-src-map.mjs +120 -3
- package/dist/fesm2020/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2020/maps-components.mjs +120 -3
- package/dist/fesm2020/maps-components.mjs.map +1 -1
- package/dist/map/map-plate/controls/index.d.ts +2 -0
- package/dist/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +19 -0
- package/dist/map/map-plate/controls/map-control-zoom/zoom-control.factory.d.ts +5 -0
- package/dist/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +14 -0
- package/dist/map/map.module.d.ts +3 -2
- package/dist/map/messages/executors/generate-zoom-control.executor.d.ts +9 -0
- package/dist/map/public-api.d.ts +1 -0
- package/dist/src/map/map-plate/controls/index.d.ts +2 -0
- package/dist/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.d.ts +19 -0
- package/dist/src/map/map-plate/controls/map-control-zoom/zoom-control.factory.d.ts +5 -0
- package/dist/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.d.ts +14 -0
- package/dist/src/map/map.module.d.ts +3 -2
- package/dist/src/map/messages/executors/generate-zoom-control.executor.d.ts +9 -0
- package/dist/src/map/public-api.d.ts +1 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import { get, useGeographic, transform } from 'ol/proj';
|
|
|
10
10
|
import { PostboyGenericMessage, PostboyCallbackMessage, PostboyExecutor, PostboyService, PostboyAbstractRegistrator } from '@artstesh/postboy';
|
|
11
11
|
import { Draw, Modify, Translate } from 'ol/interaction';
|
|
12
12
|
import { createRegularPolygon } from 'ol/interaction/Draw';
|
|
13
|
+
import { Zoom } from 'ol/control';
|
|
13
14
|
import { first, filter, auditTime } from 'rxjs/operators';
|
|
14
15
|
import { Vector, XYZ } from 'ol/source';
|
|
15
16
|
import TileLayer from 'ol/layer/Tile';
|
|
@@ -507,6 +508,29 @@ class GenerateDrawExecutor extends PostboyExecutor {
|
|
|
507
508
|
}
|
|
508
509
|
GenerateDrawExecutor.ID = 'f01c99ba-0953-4ab5-82f9-04e6fbb678c1';
|
|
509
510
|
|
|
511
|
+
class GenerateZoomControlExecutor extends PostboyExecutor {
|
|
512
|
+
constructor(settings) {
|
|
513
|
+
super();
|
|
514
|
+
this.settings = settings;
|
|
515
|
+
}
|
|
516
|
+
get id() {
|
|
517
|
+
return GenerateZoomControlExecutor.ID;
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
GenerateZoomControlExecutor.ID = 'ff16a833-c68e-4b1a-bc23-c0d16b002810';
|
|
521
|
+
|
|
522
|
+
class ZoomControlFactory {
|
|
523
|
+
static build(settings) {
|
|
524
|
+
return new Zoom({
|
|
525
|
+
zoomInTipLabel: settings.zoomInLabel,
|
|
526
|
+
zoomOutTipLabel: settings.zoomOutLabel,
|
|
527
|
+
zoomInClassName: settings.zoomInClass,
|
|
528
|
+
zoomOutClassName: settings.zoomOutClass,
|
|
529
|
+
className: settings.controlClass,
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
510
534
|
class MapPostboyService extends PostboyService {
|
|
511
535
|
constructor() {
|
|
512
536
|
super();
|
|
@@ -915,6 +939,7 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
915
939
|
setExecutors() {
|
|
916
940
|
this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
|
|
917
941
|
this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
|
|
942
|
+
this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
|
|
918
943
|
}
|
|
919
944
|
}
|
|
920
945
|
MessageRegistratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: FeatureModificationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1667,6 +1692,94 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1667
1692
|
type: Input
|
|
1668
1693
|
}] } });
|
|
1669
1694
|
|
|
1695
|
+
class ZoomControlSettings {
|
|
1696
|
+
constructor() {
|
|
1697
|
+
this.controlClass = 'ol-zoom';
|
|
1698
|
+
this.zoomInClass = 'ol-zoom-in';
|
|
1699
|
+
this.zoomOutClass = 'ol-zoom-out';
|
|
1700
|
+
this.zoomInLabel = 'Zoom In';
|
|
1701
|
+
this.zoomOutLabel = 'Zoom Out';
|
|
1702
|
+
}
|
|
1703
|
+
static copy(model) {
|
|
1704
|
+
const result = new ZoomControlSettings();
|
|
1705
|
+
result.controlClass = model.controlClass;
|
|
1706
|
+
result.zoomInClass = model.zoomInClass;
|
|
1707
|
+
result.zoomOutClass = model.zoomOutClass;
|
|
1708
|
+
result.zoomInLabel = model.zoomInLabel;
|
|
1709
|
+
result.zoomOutLabel = model.zoomOutLabel;
|
|
1710
|
+
return result;
|
|
1711
|
+
}
|
|
1712
|
+
isSame(model) {
|
|
1713
|
+
if (this.zoomInClass !== model.zoomInClass)
|
|
1714
|
+
return false;
|
|
1715
|
+
if (this.zoomOutClass !== model.zoomOutClass)
|
|
1716
|
+
return false;
|
|
1717
|
+
if (this.zoomInLabel !== model.zoomInLabel)
|
|
1718
|
+
return false;
|
|
1719
|
+
if (this.controlClass !== model.controlClass)
|
|
1720
|
+
return false;
|
|
1721
|
+
if (this.zoomOutLabel !== model.zoomOutLabel)
|
|
1722
|
+
return false;
|
|
1723
|
+
return true;
|
|
1724
|
+
}
|
|
1725
|
+
setZoomInLabel(zoomInLabel) {
|
|
1726
|
+
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInLabel }));
|
|
1727
|
+
}
|
|
1728
|
+
setZoomOutClass(zoomOutClass) {
|
|
1729
|
+
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutClass }));
|
|
1730
|
+
}
|
|
1731
|
+
setZoomInClass(zoomInClass) {
|
|
1732
|
+
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInClass }));
|
|
1733
|
+
}
|
|
1734
|
+
setZoomOutLabel(zoomOutLabel) {
|
|
1735
|
+
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutLabel }));
|
|
1736
|
+
}
|
|
1737
|
+
setControlClass(controlClass) {
|
|
1738
|
+
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { controlClass }));
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
class MapControlZoomComponent extends DestructibleComponent {
|
|
1743
|
+
set settings(value) {
|
|
1744
|
+
if (!value || this._settings.isSame(value))
|
|
1745
|
+
return;
|
|
1746
|
+
this._settings = value;
|
|
1747
|
+
this.setControl();
|
|
1748
|
+
}
|
|
1749
|
+
constructor(postboy) {
|
|
1750
|
+
super();
|
|
1751
|
+
this.postboy = postboy;
|
|
1752
|
+
this._settings = new ZoomControlSettings();
|
|
1753
|
+
this.onDestroy = () => {
|
|
1754
|
+
this.eliminate();
|
|
1755
|
+
};
|
|
1756
|
+
this.eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
|
|
1757
|
+
}
|
|
1758
|
+
ngOnInit() {
|
|
1759
|
+
this.postboy
|
|
1760
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1761
|
+
.pipe(filter((m) => !!m), first())
|
|
1762
|
+
.subscribe((m) => {
|
|
1763
|
+
this.map = m.map;
|
|
1764
|
+
this.setControl();
|
|
1765
|
+
});
|
|
1766
|
+
}
|
|
1767
|
+
setControl() {
|
|
1768
|
+
if (!this.map)
|
|
1769
|
+
return;
|
|
1770
|
+
this.control = this.postboy.execute(new GenerateZoomControlExecutor(this._settings));
|
|
1771
|
+
this.map.addControl(this.control);
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
MapControlZoomComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapControlZoomComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1775
|
+
MapControlZoomComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: MapControlZoomComponent, selector: "lib-map-control-zoom", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1776
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapControlZoomComponent, decorators: [{
|
|
1777
|
+
type: Component,
|
|
1778
|
+
args: [{ selector: 'lib-map-control-zoom', template: '', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
1779
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }]; }, propDecorators: { settings: [{
|
|
1780
|
+
type: Input
|
|
1781
|
+
}] } });
|
|
1782
|
+
|
|
1670
1783
|
class MapModule {
|
|
1671
1784
|
}
|
|
1672
1785
|
MapModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -1678,13 +1791,15 @@ MapModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.
|
|
|
1678
1791
|
MarkersComponent,
|
|
1679
1792
|
TooltipComponent,
|
|
1680
1793
|
PolygonsComponent,
|
|
1681
|
-
ClusterLayerComponent
|
|
1794
|
+
ClusterLayerComponent,
|
|
1795
|
+
MapControlZoomComponent], imports: [CommonModule], exports: [MapPlateComponent,
|
|
1682
1796
|
FeatureLayerComponent,
|
|
1683
1797
|
MarkersComponent,
|
|
1684
1798
|
TileLayerComponent,
|
|
1685
1799
|
TooltipComponent,
|
|
1686
1800
|
PolygonsComponent,
|
|
1687
|
-
ClusterLayerComponent
|
|
1801
|
+
ClusterLayerComponent,
|
|
1802
|
+
MapControlZoomComponent] });
|
|
1688
1803
|
MapModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapModule, imports: [CommonModule] });
|
|
1689
1804
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapModule, decorators: [{
|
|
1690
1805
|
type: NgModule,
|
|
@@ -1700,6 +1815,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1700
1815
|
TooltipComponent,
|
|
1701
1816
|
PolygonsComponent,
|
|
1702
1817
|
ClusterLayerComponent,
|
|
1818
|
+
MapControlZoomComponent,
|
|
1703
1819
|
],
|
|
1704
1820
|
exports: [
|
|
1705
1821
|
MapPlateComponent,
|
|
@@ -1709,6 +1825,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1709
1825
|
TooltipComponent,
|
|
1710
1826
|
PolygonsComponent,
|
|
1711
1827
|
ClusterLayerComponent,
|
|
1828
|
+
MapControlZoomComponent,
|
|
1712
1829
|
],
|
|
1713
1830
|
}]
|
|
1714
1831
|
}] });
|
|
@@ -1843,5 +1960,5 @@ class StringifyFeatureHelper {
|
|
|
1843
1960
|
* Generated bundle index. Do not edit.
|
|
1844
1961
|
*/
|
|
1845
1962
|
|
|
1846
|
-
export { CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, Dictionary, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, MapClickEvent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings };
|
|
1963
|
+
export { CancelDrawingCommand, CancelFeatureModificationCommand, CloseTooltipCommand, ClusterLayerComponent, ClusterLayerSettings, Dictionary, DrawSelectionAreaCommand, DrawingType, FeatureLayerComponent, FeatureLayerSettings, FeatureOutputFormat, MapClickEvent, MapControlZoomComponent, MapLyrs, MapLyrsLabel, MapModule, MapMoveEndEvent, MapPlateComponent, MapPostboyService, MapRenderedEvent, MapSettings, MarkerModel, MarkerStyleHelper, MarkersComponent, MessageRegistratorService, ModifyFeatureCommand, OsmTileLayerComponent, PolygonModel, PolygonStyleHelper, PolygonsComponent, StartDrawingCommand, StringifyFeatureHelper, TextStyleHelper, TileLayerComponent, TileLayerSettings, TooltipComponent, TooltipSettings, ZoomControlSettings };
|
|
1847
1964
|
//# sourceMappingURL=maps-components-src-map.mjs.map
|