vue-geojson-view-ts 1.3.9 → 1.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/MapView.vue.d.ts +1 -1
- package/dist/image/end.png +0 -0
- package/dist/image/home.png +0 -0
- package/dist/image/tracking.png +0 -0
- package/dist/vue-geojson-view-ts.js +8106 -8114
- package/dist/vue-geojson-view-ts.umd.cjs +20 -20
- package/package.json +1 -1
- package/src/components/MapView.vue +24 -30
package/package.json
CHANGED
|
@@ -307,8 +307,7 @@ export default defineComponent({
|
|
|
307
307
|
feature.geometry.type === "MultiPolygon" ||
|
|
308
308
|
feature.geometry.type === "LineString" ||
|
|
309
309
|
feature.geometry.type === "MultiLineString" ||
|
|
310
|
-
feature.geometry.type === "Point"
|
|
311
|
-
feature.geometry.type === "MultiPoint"
|
|
310
|
+
feature.geometry.type === "Point"
|
|
312
311
|
) {
|
|
313
312
|
L.geoJson(feature, {
|
|
314
313
|
pointToLayer: this.getPointToLayer.bind(this),
|
|
@@ -416,38 +415,33 @@ export default defineComponent({
|
|
|
416
415
|
getPointToLayer(feature: any, latlng: any) {
|
|
417
416
|
const geometryType = feature.geometry?.type;
|
|
418
417
|
|
|
419
|
-
//
|
|
420
|
-
if (geometryType === "Point"
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
}
|
|
418
|
+
// Point: icono según properties.tipo
|
|
419
|
+
if (geometryType === "Point") {
|
|
420
|
+
const tipo = feature.properties?.tipo;
|
|
421
|
+
const firstIcon = L.icon({
|
|
422
|
+
iconUrl: "/image/home.png",
|
|
423
|
+
iconSize: [38, 38],
|
|
424
|
+
iconAnchor: [16, 41],
|
|
425
|
+
});
|
|
426
|
+
const lastIcon = L.icon({
|
|
427
|
+
iconUrl: "/image/end.png",
|
|
428
|
+
iconSize: [38, 38],
|
|
429
|
+
iconAnchor: [16, 41],
|
|
430
|
+
});
|
|
431
|
+
const pointerIcon = L.icon({
|
|
432
|
+
iconUrl: "/image/tracking.png",
|
|
433
|
+
iconSize: [38, 38],
|
|
434
|
+
iconAnchor: [16, 41],
|
|
435
|
+
});
|
|
432
436
|
|
|
433
|
-
|
|
434
|
-
if (
|
|
435
|
-
|
|
436
|
-
icon: L.icon(this.configurationMap.iconMarker || this.markerIcon),
|
|
437
|
-
});
|
|
438
|
-
}
|
|
437
|
+
let icon = pointerIcon;
|
|
438
|
+
if (tipo === 0) icon = firstIcon;
|
|
439
|
+
else if (tipo === 1) icon = lastIcon;
|
|
439
440
|
|
|
440
|
-
|
|
441
|
-
return L.circleMarker(latlng, {
|
|
442
|
-
color: "green",
|
|
443
|
-
fillColor: "green",
|
|
444
|
-
fillOpacity: 0.8,
|
|
445
|
-
radius: 6,
|
|
446
|
-
weight: 2,
|
|
447
|
-
});
|
|
441
|
+
return L.marker(latlng, { icon });
|
|
448
442
|
}
|
|
449
443
|
|
|
450
|
-
//
|
|
444
|
+
// Otros tipos: icono por defecto
|
|
451
445
|
return L.marker(latlng);
|
|
452
446
|
},
|
|
453
447
|
async searchAddress(query: string) {
|