|
|
|
@ -14,7 +14,7 @@ |
|
|
|
/// limitations under the License.
|
|
|
|
///
|
|
|
|
|
|
|
|
import L, { FeatureGroup, LatLngBounds, LatLngTuple, markerClusterGroup, MarkerClusterGroupOptions } from 'leaflet'; |
|
|
|
import L, { FeatureGroup, LatLngBounds, LatLngTuple, markerClusterGroup, MarkerClusterGroupOptions, MarkerClusterGroup } from 'leaflet'; |
|
|
|
|
|
|
|
import 'leaflet-providers'; |
|
|
|
import 'leaflet.markercluster/dist/leaflet.markercluster'; |
|
|
|
@ -45,9 +45,9 @@ export default abstract class LeafletMap { |
|
|
|
options: UnitedMapSettings; |
|
|
|
bounds: L.LatLngBounds; |
|
|
|
datasources: FormattedData[]; |
|
|
|
markersCluster; |
|
|
|
markersCluster: MarkerClusterGroup; |
|
|
|
points: FeatureGroup; |
|
|
|
markersData = []; |
|
|
|
markersData: FormattedData[] = []; |
|
|
|
|
|
|
|
protected constructor(public $container: HTMLElement, options: UnitedMapSettings) { |
|
|
|
this.options = options; |
|
|
|
@ -245,7 +245,7 @@ export default abstract class LeafletMap { |
|
|
|
} |
|
|
|
|
|
|
|
// Markers
|
|
|
|
updateMarkers(markersData, callback?) { |
|
|
|
updateMarkers(markersData: FormattedData[], callback?) { |
|
|
|
markersData.filter(mdata => !!this.convertPosition(mdata)).forEach(data => { |
|
|
|
if (data.rotationAngle || data.rotationAngle === 0) { |
|
|
|
const currentImage = this.options.useMarkerImageFunction ? |
|
|
|
@ -272,7 +272,7 @@ export default abstract class LeafletMap { |
|
|
|
this.markersData = markersData; |
|
|
|
} |
|
|
|
|
|
|
|
dragMarker = (e, data?) => { |
|
|
|
dragMarker = (e, data = {}) => { |
|
|
|
if (e.type !== 'dragend') return; |
|
|
|
this.saveMarkerLocation({ ...data, ...this.convertToCustomFormat(e.target._latlng) }); |
|
|
|
} |
|
|
|
|