@artstesh/maps 1.0.11 → 1.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/bundles/maps-components-src-map.umd.js +148 -6
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +148 -6
- package/dist/bundles/maps-components.umd.js.map +1 -1
- package/dist/esm2015/map/map-plate/controls/index.js +3 -0
- package/dist/esm2015/map/map-plate/controls/map-control-zoom/map-control-zoom.component.js +54 -0
- package/dist/esm2015/map/map-plate/controls/map-control-zoom/zoom-control.factory.js +13 -0
- package/dist/esm2015/map/map-plate/controls/map-control-zoom/zoom-control.settings.js +47 -0
- package/dist/esm2015/map/map.module.js +8 -3
- package/dist/esm2015/map/messages/executors/generate-zoom-control.executor.js +12 -0
- package/dist/esm2015/map/public-api.js +2 -1
- package/dist/esm2015/map/services/message-registrator.service.js +4 -1
- package/dist/esm2015/src/map/map-plate/controls/index.js +3 -0
- package/dist/esm2015/src/map/map-plate/controls/map-control-zoom/map-control-zoom.component.js +54 -0
- package/dist/esm2015/src/map/map-plate/controls/map-control-zoom/zoom-control.factory.js +13 -0
- package/dist/esm2015/src/map/map-plate/controls/map-control-zoom/zoom-control.settings.js +47 -0
- package/dist/esm2015/src/map/map.module.js +8 -3
- package/dist/esm2015/src/map/messages/executors/generate-zoom-control.executor.js +12 -0
- package/dist/esm2015/src/map/public-api.js +2 -1
- package/dist/esm2015/src/map/services/message-registrator.service.js +4 -1
- package/dist/fesm2015/maps-components-src-map.js +125 -3
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +125 -3
- package/dist/fesm2015/maps-components.js.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();
|
|
@@ -916,6 +940,7 @@ class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
|
916
940
|
setExecutors() {
|
|
917
941
|
this.registerExecutor(FilterFeaturesInAreaExecutor.ID, (e) => FeatureService.filterFeaturesInArea(e));
|
|
918
942
|
this.registerExecutor(GenerateDrawExecutor.ID, (e) => DrawingGenerationService.getDraw(e));
|
|
943
|
+
this.registerExecutor(GenerateZoomControlExecutor.ID, (e) => ZoomControlFactory.build(e.settings));
|
|
919
944
|
}
|
|
920
945
|
}
|
|
921
946
|
MessageRegistratorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MessageRegistratorService, deps: [{ token: MapPostboyService }, { token: MapManagementService }, { token: MapStateService }, { token: MapFeatureService }, { token: MapClickService }, { token: DrawingService }, { token: FeatureModificationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1709,6 +1734,99 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1709
1734
|
type: Input
|
|
1710
1735
|
}] } });
|
|
1711
1736
|
|
|
1737
|
+
class ZoomControlSettings {
|
|
1738
|
+
constructor() {
|
|
1739
|
+
this.controlClass = 'ol-zoom';
|
|
1740
|
+
this.zoomInClass = 'ol-zoom-in';
|
|
1741
|
+
this.zoomOutClass = 'ol-zoom-out';
|
|
1742
|
+
this.zoomInLabel = 'Zoom In';
|
|
1743
|
+
this.zoomOutLabel = 'Zoom Out';
|
|
1744
|
+
}
|
|
1745
|
+
static copy(model) {
|
|
1746
|
+
const result = new ZoomControlSettings();
|
|
1747
|
+
result.controlClass = model.controlClass;
|
|
1748
|
+
result.zoomInClass = model.zoomInClass;
|
|
1749
|
+
result.zoomOutClass = model.zoomOutClass;
|
|
1750
|
+
result.zoomInLabel = model.zoomInLabel;
|
|
1751
|
+
result.zoomOutLabel = model.zoomOutLabel;
|
|
1752
|
+
return result;
|
|
1753
|
+
}
|
|
1754
|
+
isSame(model) {
|
|
1755
|
+
if (this.zoomInClass !== model.zoomInClass)
|
|
1756
|
+
return false;
|
|
1757
|
+
if (this.zoomOutClass !== model.zoomOutClass)
|
|
1758
|
+
return false;
|
|
1759
|
+
if (this.zoomInLabel !== model.zoomInLabel)
|
|
1760
|
+
return false;
|
|
1761
|
+
if (this.controlClass !== model.controlClass)
|
|
1762
|
+
return false;
|
|
1763
|
+
if (this.zoomOutLabel !== model.zoomOutLabel)
|
|
1764
|
+
return false;
|
|
1765
|
+
return true;
|
|
1766
|
+
}
|
|
1767
|
+
setZoomInLabel(zoomInLabel) {
|
|
1768
|
+
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInLabel }));
|
|
1769
|
+
}
|
|
1770
|
+
setZoomOutClass(zoomOutClass) {
|
|
1771
|
+
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutClass }));
|
|
1772
|
+
}
|
|
1773
|
+
setZoomInClass(zoomInClass) {
|
|
1774
|
+
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomInClass }));
|
|
1775
|
+
}
|
|
1776
|
+
setZoomOutLabel(zoomOutLabel) {
|
|
1777
|
+
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { zoomOutLabel }));
|
|
1778
|
+
}
|
|
1779
|
+
setControlClass(controlClass) {
|
|
1780
|
+
return ZoomControlSettings.copy(Object.assign(Object.assign({}, this), { controlClass }));
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
class MapControlZoomComponent extends DestructibleComponent {
|
|
1785
|
+
constructor(postboy) {
|
|
1786
|
+
super();
|
|
1787
|
+
this.postboy = postboy;
|
|
1788
|
+
this._settings = new ZoomControlSettings();
|
|
1789
|
+
this.onDestroy = () => {
|
|
1790
|
+
this.eliminate();
|
|
1791
|
+
};
|
|
1792
|
+
this.eliminate = () => !!this.map && !!this.control && this.map.removeControl(this.control);
|
|
1793
|
+
}
|
|
1794
|
+
set settings(value) {
|
|
1795
|
+
if (!value || this._settings.isSame(value))
|
|
1796
|
+
return;
|
|
1797
|
+
this._settings = value;
|
|
1798
|
+
this.setControl();
|
|
1799
|
+
}
|
|
1800
|
+
ngOnInit() {
|
|
1801
|
+
this.postboy
|
|
1802
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1803
|
+
.pipe(filter((m) => !!m), first())
|
|
1804
|
+
.subscribe((m) => {
|
|
1805
|
+
this.map = m.map;
|
|
1806
|
+
this.setControl();
|
|
1807
|
+
});
|
|
1808
|
+
}
|
|
1809
|
+
setControl() {
|
|
1810
|
+
if (!this.map)
|
|
1811
|
+
return;
|
|
1812
|
+
this.control = this.postboy.execute(new GenerateZoomControlExecutor(this._settings));
|
|
1813
|
+
this.map.addControl(this.control);
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
MapControlZoomComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapControlZoomComponent, deps: [{ token: MapPostboyService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1817
|
+
MapControlZoomComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: MapControlZoomComponent, selector: "lib-map-control-zoom", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1818
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapControlZoomComponent, decorators: [{
|
|
1819
|
+
type: Component,
|
|
1820
|
+
args: [{
|
|
1821
|
+
selector: 'lib-map-control-zoom',
|
|
1822
|
+
template: '',
|
|
1823
|
+
styleUrls: [],
|
|
1824
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1825
|
+
}]
|
|
1826
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }]; }, propDecorators: { settings: [{
|
|
1827
|
+
type: Input
|
|
1828
|
+
}] } });
|
|
1829
|
+
|
|
1712
1830
|
class MapModule {
|
|
1713
1831
|
}
|
|
1714
1832
|
MapModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -1720,13 +1838,15 @@ MapModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.
|
|
|
1720
1838
|
MarkersComponent,
|
|
1721
1839
|
TooltipComponent,
|
|
1722
1840
|
PolygonsComponent,
|
|
1723
|
-
ClusterLayerComponent
|
|
1841
|
+
ClusterLayerComponent,
|
|
1842
|
+
MapControlZoomComponent], imports: [CommonModule], exports: [MapPlateComponent,
|
|
1724
1843
|
FeatureLayerComponent,
|
|
1725
1844
|
MarkersComponent,
|
|
1726
1845
|
TileLayerComponent,
|
|
1727
1846
|
TooltipComponent,
|
|
1728
1847
|
PolygonsComponent,
|
|
1729
|
-
ClusterLayerComponent
|
|
1848
|
+
ClusterLayerComponent,
|
|
1849
|
+
MapControlZoomComponent] });
|
|
1730
1850
|
MapModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapModule, imports: [[CommonModule]] });
|
|
1731
1851
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapModule, decorators: [{
|
|
1732
1852
|
type: NgModule,
|
|
@@ -1742,6 +1862,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1742
1862
|
TooltipComponent,
|
|
1743
1863
|
PolygonsComponent,
|
|
1744
1864
|
ClusterLayerComponent,
|
|
1865
|
+
MapControlZoomComponent,
|
|
1745
1866
|
],
|
|
1746
1867
|
exports: [
|
|
1747
1868
|
MapPlateComponent,
|
|
@@ -1751,6 +1872,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1751
1872
|
TooltipComponent,
|
|
1752
1873
|
PolygonsComponent,
|
|
1753
1874
|
ClusterLayerComponent,
|
|
1875
|
+
MapControlZoomComponent,
|
|
1754
1876
|
],
|
|
1755
1877
|
}]
|
|
1756
1878
|
}] });
|
|
@@ -1889,5 +2011,5 @@ class StringifyFeatureHelper {
|
|
|
1889
2011
|
* Generated bundle index. Do not edit.
|
|
1890
2012
|
*/
|
|
1891
2013
|
|
|
1892
|
-
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 };
|
|
2014
|
+
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 };
|
|
1893
2015
|
//# sourceMappingURL=maps-components.js.map
|