@artstesh/maps 1.0.5 → 1.0.6
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 +118 -6
- package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
- package/dist/bundles/maps-components.umd.js +118 -6
- package/dist/bundles/maps-components.umd.js.map +1 -1
- package/dist/esm2015/map/helpers/index.js +2 -1
- package/dist/esm2015/map/helpers/polygon-style.helper.js +16 -0
- package/dist/esm2015/map/map-plate/features/index.js +2 -1
- package/dist/esm2015/map/map-plate/features/polygons/polygons.component.js +47 -0
- package/dist/esm2015/map/map.module.js +18 -3
- package/dist/esm2015/map/models/index.js +2 -1
- package/dist/esm2015/map/models/polygon.model.js +26 -0
- package/dist/esm2015/src/map/helpers/index.js +2 -1
- package/dist/esm2015/src/map/helpers/polygon-style.helper.js +16 -0
- package/dist/esm2015/src/map/map-plate/features/index.js +2 -1
- package/dist/esm2015/src/map/map-plate/features/polygons/polygons.component.js +47 -0
- package/dist/esm2015/src/map/map.module.js +18 -3
- package/dist/esm2015/src/map/models/index.js +2 -1
- package/dist/esm2015/src/map/models/polygon.model.js +26 -0
- package/dist/fesm2015/maps-components-src-map.js +96 -3
- package/dist/fesm2015/maps-components-src-map.js.map +1 -1
- package/dist/fesm2015/maps-components.js +96 -3
- package/dist/fesm2015/maps-components.js.map +1 -1
- package/dist/map/helpers/index.d.ts +1 -0
- package/dist/map/helpers/polygon-style.helper.d.ts +4 -0
- package/dist/map/map-plate/features/index.d.ts +1 -0
- package/dist/map/map-plate/features/polygons/polygons.component.d.ts +16 -0
- package/dist/map/map.module.d.ts +3 -2
- package/dist/map/models/index.d.ts +1 -0
- package/dist/map/models/polygon.model.d.ts +19 -0
- package/dist/src/map/helpers/index.d.ts +1 -0
- package/dist/src/map/helpers/polygon-style.helper.d.ts +4 -0
- package/dist/src/map/map-plate/features/index.d.ts +1 -0
- package/dist/src/map/map-plate/features/polygons/polygons.component.d.ts +16 -0
- package/dist/src/map/map.module.d.ts +3 -2
- package/dist/src/map/models/index.d.ts +1 -0
- package/dist/src/map/models/polygon.model.d.ts +19 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ol'), require('ol/geom'), require('ol/proj'), require('rxjs'), require('@artstesh/postboy'), require('ol/Map'), require('ol/View'), require('ol/layer/Tile'), require('ol/source/OSM'), require('rxjs/operators'), require('ol/source'), require('ol/layer'), require('ol/Overlay'), require('ol/style/Style'), require('ol/style')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('maps-components', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/proj', 'rxjs', '@artstesh/postboy', 'ol/Map', 'ol/View', 'ol/layer/Tile', 'ol/source/OSM', 'rxjs/operators', 'ol/source', 'ol/layer', 'ol/Overlay', 'ol/style/Style', 'ol/style'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["maps-components"] = {}, global.ng.core, global.ng.common, global.ol, global.geom, global.proj, global.rxjs, global.postboy, global.Map, global.View, global.TileLayer, global.OSM, global.rxjs.operators, global.source, global.layer, global.Overlay, global.Style, global.style));
|
|
5
|
-
})(this, (function (exports, i0, i5, ol, geom, proj, rxjs, postboy, Map, View, TileLayer, OSM, operators, source, layer, Overlay, Style, style) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ol'), require('ol/geom'), require('ol/format'), require('ol/extent'), require('ol/proj'), require('rxjs'), require('@artstesh/postboy'), require('ol/Map'), require('ol/View'), require('ol/layer/Tile'), require('ol/source/OSM'), require('rxjs/operators'), require('ol/source'), require('ol/layer'), require('ol/Overlay'), require('ol/style/Style'), require('ol/style')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('maps-components', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/proj', 'rxjs', '@artstesh/postboy', 'ol/Map', 'ol/View', 'ol/layer/Tile', 'ol/source/OSM', 'rxjs/operators', 'ol/source', 'ol/layer', 'ol/Overlay', 'ol/style/Style', 'ol/style'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["maps-components"] = {}, global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.proj, global.rxjs, global.postboy, global.Map, global.View, global.TileLayer, global.OSM, global.rxjs.operators, global.source, global.layer, global.Overlay, global.Style, global.style));
|
|
5
|
+
})(this, (function (exports, i0, i5, ol, geom, format, extent, proj, rxjs, postboy, Map, View, TileLayer, OSM, operators, source, layer, Overlay, Style, style) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -633,6 +633,35 @@
|
|
|
633
633
|
return MarkerModel;
|
|
634
634
|
}());
|
|
635
635
|
|
|
636
|
+
var PolygonModel = /** @class */ (function () {
|
|
637
|
+
function PolygonModel(feature, id, info) {
|
|
638
|
+
var _b;
|
|
639
|
+
var _a;
|
|
640
|
+
this.info = info;
|
|
641
|
+
this.id = id == null ? IdGenerator.get() : id;
|
|
642
|
+
this._feature = feature;
|
|
643
|
+
_b = __read(extent.getCenter((_a = this._feature.getGeometry()) === null || _a === void 0 ? void 0 : _a.getExtent()), 2), this.lng = _b[0], this.lat = _b[1];
|
|
644
|
+
}
|
|
645
|
+
PolygonModel.fromGeoJson = function (id, json, info) {
|
|
646
|
+
var feature = new format.GeoJSON().readFeature(json);
|
|
647
|
+
feature.setId(id);
|
|
648
|
+
return new PolygonModel(feature, id, info);
|
|
649
|
+
};
|
|
650
|
+
PolygonModel.fromWKT = function (id, wkt, info) {
|
|
651
|
+
var feature = new format.WKT().readFeature(wkt);
|
|
652
|
+
feature.setId(id);
|
|
653
|
+
return new PolygonModel(feature, id, info);
|
|
654
|
+
};
|
|
655
|
+
Object.defineProperty(PolygonModel.prototype, "feature", {
|
|
656
|
+
get: function () {
|
|
657
|
+
return this._feature;
|
|
658
|
+
},
|
|
659
|
+
enumerable: false,
|
|
660
|
+
configurable: true
|
|
661
|
+
});
|
|
662
|
+
return PolygonModel;
|
|
663
|
+
}());
|
|
664
|
+
|
|
636
665
|
var GenericMessage = /** @class */ (function () {
|
|
637
666
|
function GenericMessage() {
|
|
638
667
|
}
|
|
@@ -1570,6 +1599,54 @@
|
|
|
1570
1599
|
type: i0.Input
|
|
1571
1600
|
}] } });
|
|
1572
1601
|
|
|
1602
|
+
var PolygonsComponent = /** @class */ (function (_super) {
|
|
1603
|
+
__extends(PolygonsComponent, _super);
|
|
1604
|
+
function PolygonsComponent(postboy) {
|
|
1605
|
+
var _this = _super.call(this) || this;
|
|
1606
|
+
_this.postboy = postboy;
|
|
1607
|
+
_this.layerName = '';
|
|
1608
|
+
_this._polygons = [];
|
|
1609
|
+
return _this;
|
|
1610
|
+
}
|
|
1611
|
+
Object.defineProperty(PolygonsComponent.prototype, "polygons", {
|
|
1612
|
+
set: function (value) {
|
|
1613
|
+
this._polygons = value;
|
|
1614
|
+
this.putPolygons();
|
|
1615
|
+
},
|
|
1616
|
+
enumerable: false,
|
|
1617
|
+
configurable: true
|
|
1618
|
+
});
|
|
1619
|
+
PolygonsComponent.prototype.ngOnInit = function () {
|
|
1620
|
+
var _this = this;
|
|
1621
|
+
this.postboy
|
|
1622
|
+
.subscribe(MapRenderedEvent.ID)
|
|
1623
|
+
.pipe(operators.filter(function (m) { return !!m; }), operators.first())
|
|
1624
|
+
.subscribe(function () { return _this.putPolygons(); });
|
|
1625
|
+
};
|
|
1626
|
+
PolygonsComponent.prototype.putPolygons = function () {
|
|
1627
|
+
var _a;
|
|
1628
|
+
if (!((_a = this._polygons) === null || _a === void 0 ? void 0 : _a.length))
|
|
1629
|
+
return;
|
|
1630
|
+
this.postboy.fire(new PlaceLayerFeaturesCommand(this.layerName, this._polygons.map(function (m) { return m.feature; })));
|
|
1631
|
+
};
|
|
1632
|
+
return PolygonsComponent;
|
|
1633
|
+
}(DestructibleComponent));
|
|
1634
|
+
PolygonsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PolygonsComponent, deps: [{ token: MapPostboyService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1635
|
+
PolygonsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: PolygonsComponent, selector: "lib-polygons", inputs: { layerName: "layerName", polygons: "polygons" }, usesInheritance: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1636
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: PolygonsComponent, decorators: [{
|
|
1637
|
+
type: i0.Component,
|
|
1638
|
+
args: [{
|
|
1639
|
+
selector: 'lib-polygons',
|
|
1640
|
+
template: '',
|
|
1641
|
+
styleUrls: [],
|
|
1642
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1643
|
+
}]
|
|
1644
|
+
}], ctorParameters: function () { return [{ type: MapPostboyService }]; }, propDecorators: { layerName: [{
|
|
1645
|
+
type: i0.Input
|
|
1646
|
+
}], polygons: [{
|
|
1647
|
+
type: i0.Input
|
|
1648
|
+
}] } });
|
|
1649
|
+
|
|
1573
1650
|
var MapModule = /** @class */ (function () {
|
|
1574
1651
|
function MapModule() {
|
|
1575
1652
|
}
|
|
@@ -1582,7 +1659,13 @@
|
|
|
1582
1659
|
OsmTileLayerComponent,
|
|
1583
1660
|
FeatureLayerComponent,
|
|
1584
1661
|
MarkersComponent,
|
|
1585
|
-
TooltipComponent
|
|
1662
|
+
TooltipComponent,
|
|
1663
|
+
PolygonsComponent], imports: [i5.CommonModule], exports: [MapPlateComponent,
|
|
1664
|
+
FeatureLayerComponent,
|
|
1665
|
+
MarkersComponent,
|
|
1666
|
+
TileLayerComponent,
|
|
1667
|
+
TooltipComponent,
|
|
1668
|
+
PolygonsComponent] });
|
|
1586
1669
|
MapModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapModule, imports: [[i5.CommonModule]] });
|
|
1587
1670
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapModule, decorators: [{
|
|
1588
1671
|
type: i0.NgModule,
|
|
@@ -1596,8 +1679,16 @@
|
|
|
1596
1679
|
FeatureLayerComponent,
|
|
1597
1680
|
MarkersComponent,
|
|
1598
1681
|
TooltipComponent,
|
|
1682
|
+
PolygonsComponent,
|
|
1683
|
+
],
|
|
1684
|
+
exports: [
|
|
1685
|
+
MapPlateComponent,
|
|
1686
|
+
FeatureLayerComponent,
|
|
1687
|
+
MarkersComponent,
|
|
1688
|
+
TileLayerComponent,
|
|
1689
|
+
TooltipComponent,
|
|
1690
|
+
PolygonsComponent,
|
|
1599
1691
|
],
|
|
1600
|
-
exports: [MapPlateComponent, FeatureLayerComponent, MarkersComponent, TileLayerComponent, TooltipComponent],
|
|
1601
1692
|
}]
|
|
1602
1693
|
}] });
|
|
1603
1694
|
|
|
@@ -1630,6 +1721,24 @@
|
|
|
1630
1721
|
return MarkerStyleHelper;
|
|
1631
1722
|
}());
|
|
1632
1723
|
|
|
1724
|
+
var PolygonStyleHelper = /** @class */ (function () {
|
|
1725
|
+
function PolygonStyleHelper() {
|
|
1726
|
+
}
|
|
1727
|
+
PolygonStyleHelper.simple = function (fill, stroke, strokeWidth) {
|
|
1728
|
+
if (strokeWidth === void 0) { strokeWidth = 1; }
|
|
1729
|
+
return new Style__default["default"]({
|
|
1730
|
+
fill: new style.Fill({
|
|
1731
|
+
color: fill,
|
|
1732
|
+
}),
|
|
1733
|
+
stroke: new style.Stroke({
|
|
1734
|
+
color: stroke,
|
|
1735
|
+
width: strokeWidth,
|
|
1736
|
+
}),
|
|
1737
|
+
});
|
|
1738
|
+
};
|
|
1739
|
+
return PolygonStyleHelper;
|
|
1740
|
+
}());
|
|
1741
|
+
|
|
1633
1742
|
/*
|
|
1634
1743
|
* Public API Surface of maps
|
|
1635
1744
|
*/
|
|
@@ -1659,6 +1768,9 @@
|
|
|
1659
1768
|
exports.MarkersComponent = MarkersComponent;
|
|
1660
1769
|
exports.MessageRegistratorService = MessageRegistratorService;
|
|
1661
1770
|
exports.OsmTileLayerComponent = OsmTileLayerComponent;
|
|
1771
|
+
exports.PolygonModel = PolygonModel;
|
|
1772
|
+
exports.PolygonStyleHelper = PolygonStyleHelper;
|
|
1773
|
+
exports.PolygonsComponent = PolygonsComponent;
|
|
1662
1774
|
exports.TileLayerComponent = TileLayerComponent;
|
|
1663
1775
|
exports.TileLayerSettings = TileLayerSettings;
|
|
1664
1776
|
exports.TooltipComponent = TooltipComponent;
|