Showing
4 changed files
with
8 additions
and
4 deletions
... | ... | @@ -49,6 +49,7 @@ export default abstract class LeafletMap { |
49 | 49 | datasources: FormattedData[]; |
50 | 50 | markersCluster; |
51 | 51 | points: FeatureGroup; |
52 | + markersData = []; | |
52 | 53 | |
53 | 54 | protected constructor(public $container: HTMLElement, options: UnitedMapSettings) { |
54 | 55 | this.options = options; |
... | ... | @@ -159,9 +160,9 @@ export default abstract class LeafletMap { |
159 | 160 | this.map = map; |
160 | 161 | if (this.options.useDefaultCenterPosition) { |
161 | 162 | this.map.panTo(this.options.defaultCenterPosition); |
162 | - // this.bounds = map.getBounds(); | |
163 | + this.bounds = map.getBounds(); | |
163 | 164 | } |
164 | - // else this.bounds = new L.LatLngBounds(null, null); | |
165 | + else this.bounds = new L.LatLngBounds(null, null); | |
165 | 166 | if (this.options.draggableMarker) { |
166 | 167 | this.addMarkerControl(); |
167 | 168 | } |
... | ... | @@ -269,6 +270,7 @@ export default abstract class LeafletMap { |
269 | 270 | this.createMarker(data.entityName, data, markersData, this.options as MarkerSettings); |
270 | 271 | } |
271 | 272 | }); |
273 | + this.markersData = markersData; | |
272 | 274 | } |
273 | 275 | |
274 | 276 | dragMarker = (e, data?) => { | ... | ... |
... | ... | @@ -128,6 +128,7 @@ export type PolygonSettings = { |
128 | 128 | polygonTooltipPattern: string; |
129 | 129 | usePolygonTooltipFunction: boolean; |
130 | 130 | polygonClick: { [name: string]: actionsHandler }; |
131 | + usePolygonColorFunction: boolean; | |
131 | 132 | polygonTooltipFunction: GenericFunction; |
132 | 133 | polygonColorFunction?: GenericFunction; |
133 | 134 | } | ... | ... |
... | ... | @@ -72,9 +72,9 @@ export class Polygon { |
72 | 72 | this.map.removeLayer(this.leafletPoly); |
73 | 73 | } |
74 | 74 | |
75 | - updatePolygonColor(settings) { | |
75 | + updatePolygonColor(settings: PolygonSettings) { | |
76 | 76 | const color = settings.usePolygonColorFunction ? |
77 | - safeExecute(settings.polygoncolorFunction, [this.data, this.dataSources, this.data.dsIndex]) : settings.polygonColor; | |
77 | + safeExecute(settings.polygonColorFunction, [this.data, this.dataSources, this.data.dsIndex]) : settings.polygonColor; | |
78 | 78 | const style: L.PathOptions = { |
79 | 79 | fill: true, |
80 | 80 | fillColor: color, | ... | ... |