Commit 1cf49faebc25a3944276aee51a38cabae259b595

Authored by Vladyslav_Prykhodko
1 parent dc0572f8

Fixed icon show marker in edit mode map into production build

@@ -28,7 +28,10 @@ @@ -28,7 +28,10 @@
28 { "glob": "worker-html.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" }, 28 { "glob": "worker-html.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" },
29 { "glob": "worker-css.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" }, 29 { "glob": "worker-css.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" },
30 { "glob": "worker-json.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" }, 30 { "glob": "worker-json.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" },
31 - { "glob": "worker-javascript.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" } 31 + { "glob": "worker-javascript.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" },
  32 + { "glob": "marker-icon-2x.png", "input": "node_modules/leaflet/dist/images/", "output": "/" },
  33 + { "glob": "marker-icon.png", "input": "node_modules/leaflet/dist/images/", "output": "/" },
  34 + { "glob": "marker-shadow.png", "input": "node_modules/leaflet/dist/images/", "output": "/" }
32 ], 35 ],
33 "styles": [ 36 "styles": [
34 "src/styles.scss", 37 "src/styles.scss",
@@ -122,8 +122,16 @@ export default abstract class LeafletMap { @@ -122,8 +122,16 @@ export default abstract class LeafletMap {
122 }); 122 });
123 const dragListener = (e: L.DragEndEvent) => { 123 const dragListener = (e: L.DragEndEvent) => {
124 if (e.type === 'dragend' && mousePositionOnMap) { 124 if (e.type === 'dragend' && mousePositionOnMap) {
125 - const icon = new L.Icon.Default();  
126 - icon.options.shadowSize = [0, 0]; 125 + const icon = L.icon({
  126 + iconRetinaUrl: 'marker-icon-2x.png',
  127 + iconUrl: 'marker-icon.png',
  128 + shadowUrl: 'marker-shadow.png',
  129 + iconSize: [25, 41],
  130 + iconAnchor: [12, 41],
  131 + popupAnchor: [1, -34],
  132 + tooltipAnchor: [16, -28],
  133 + shadowSize: [41, 41]
  134 + });
127 const newMarker = L.marker(mousePositionOnMap, { icon }).addTo(this.map); 135 const newMarker = L.marker(mousePositionOnMap, { icon }).addTo(this.map);
128 const datasourcesList = document.createElement('div'); 136 const datasourcesList = document.createElement('div');
129 const customLatLng = this.convertToCustomFormat(mousePositionOnMap); 137 const customLatLng = this.convertToCustomFormat(mousePositionOnMap);
@@ -195,8 +203,6 @@ export default abstract class LeafletMap { @@ -195,8 +203,6 @@ export default abstract class LeafletMap {
195 }); 203 });
196 const dragListener = (e: L.DragEndEvent) => { 204 const dragListener = (e: L.DragEndEvent) => {
197 if (e.type === 'dragend' && mousePositionOnMap) { 205 if (e.type === 'dragend' && mousePositionOnMap) {
198 - const icon = new L.Icon.Default();  
199 - icon.options.shadowSize = [0, 0];  
200 const newPolygon = L.polygon(mousePositionOnMap).addTo(this.map); 206 const newPolygon = L.polygon(mousePositionOnMap).addTo(this.map);
201 const datasourcesList = document.createElement('div'); 207 const datasourcesList = document.createElement('div');
202 const customLatLng = {[this.options.polygonKeyName]: this.convertToPolygonFormat(mousePositionOnMap)}; 208 const customLatLng = {[this.options.polygonKeyName]: this.convertToPolygonFormat(mousePositionOnMap)};