Merge pull request #3303 from vvlladd28/bugs/map/add-marker
Fixed show icon marker in edit mode map into production build
This commit is contained in:
commit
42b47bc504
@ -28,7 +28,10 @@
|
|||||||
{ "glob": "worker-html.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" },
|
{ "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-css.js", "input": "./node_modules/ace-builds/src-min/", "output": "/" },
|
||||||
{ "glob": "worker-json.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": [
|
"styles": [
|
||||||
"src/styles.scss",
|
"src/styles.scss",
|
||||||
|
|||||||
@ -122,8 +122,16 @@ export default abstract class LeafletMap {
|
|||||||
});
|
});
|
||||||
const dragListener = (e: L.DragEndEvent) => {
|
const dragListener = (e: L.DragEndEvent) => {
|
||||||
if (e.type === 'dragend' && mousePositionOnMap) {
|
if (e.type === 'dragend' && mousePositionOnMap) {
|
||||||
const icon = new L.Icon.Default();
|
const icon = L.icon({
|
||||||
icon.options.shadowSize = [0, 0];
|
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 newMarker = L.marker(mousePositionOnMap, { icon }).addTo(this.map);
|
||||||
const datasourcesList = document.createElement('div');
|
const datasourcesList = document.createElement('div');
|
||||||
const customLatLng = this.convertToCustomFormat(mousePositionOnMap);
|
const customLatLng = this.convertToCustomFormat(mousePositionOnMap);
|
||||||
@ -195,8 +203,6 @@ export default abstract class LeafletMap {
|
|||||||
});
|
});
|
||||||
const dragListener = (e: L.DragEndEvent) => {
|
const dragListener = (e: L.DragEndEvent) => {
|
||||||
if (e.type === 'dragend' && mousePositionOnMap) {
|
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 newPolygon = L.polygon(mousePositionOnMap).addTo(this.map);
|
||||||
const datasourcesList = document.createElement('div');
|
const datasourcesList = document.createElement('div');
|
||||||
const customLatLng = {[this.options.polygonKeyName]: this.convertToPolygonFormat(mousePositionOnMap)};
|
const customLatLng = {[this.options.polygonKeyName]: this.convertToPolygonFormat(mousePositionOnMap)};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user