diff --git a/ui-ngx/angular.json b/ui-ngx/angular.json index 59a58c4b96..f3a2eb37fb 100644 --- a/ui-ngx/angular.json +++ b/ui-ngx/angular.json @@ -28,7 +28,10 @@ { "glob": "worker-html.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" }, { "glob": "worker-css.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" }, { "glob": "worker-json.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" }, - { "glob": "worker-javascript.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" } + { "glob": "worker-javascript.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" }, + { "glob": "marker-icon-2x.png", "input": "node_modules/leaflet/dist/images/", "output": "/" }, + { "glob": "marker-icon.png", "input": "node_modules/leaflet/dist/images/", "output": "/" }, + { "glob": "marker-shadow.png", "input": "node_modules/leaflet/dist/images/", "output": "/" } ], "styles": [ "src/styles.scss", diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts index beb8662a40..2da560b8cb 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts @@ -122,8 +122,16 @@ export default abstract class LeafletMap { }); const dragListener = (e: L.DragEndEvent) => { if (e.type === 'dragend' && mousePositionOnMap) { - const icon = new L.Icon.Default(); - icon.options.shadowSize = [0, 0]; + const icon = L.icon({ + iconRetinaUrl: 'marker-icon-2x.png', + iconUrl: 'marker-icon.png', + shadowUrl: 'marker-shadow.png', + iconSize: [25, 41], + iconAnchor: [12, 41], + popupAnchor: [1, -34], + tooltipAnchor: [16, -28], + shadowSize: [41, 41] + }); const newMarker = L.marker(mousePositionOnMap, { icon }).addTo(this.map); const datasourcesList = document.createElement('div'); const customLatLng = this.convertToCustomFormat(mousePositionOnMap); @@ -195,8 +203,6 @@ export default abstract class LeafletMap { }); const dragListener = (e: L.DragEndEvent) => { if (e.type === 'dragend' && mousePositionOnMap) { - const icon = new L.Icon.Default(); - icon.options.shadowSize = [0, 0]; const newPolygon = L.polygon(mousePositionOnMap).addTo(this.map); const datasourcesList = document.createElement('div'); const customLatLng = {[this.options.polygonKeyName]: this.convertToPolygonFormat(mousePositionOnMap)};