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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-geojson-view-ts",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -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
- // Si es Point o MultiPoint
420
- if (geometryType === "Point" || geometryType === "MultiPoint") {
421
- // Si multipoint está habilitado, usar circleMarker con opciones personalizadas
422
- if (this.configurationMap?.createFigures?.multipoint) {
423
- const multipointOpts = this.configurationMap.createFigures.multipoint;
424
- return L.circleMarker(latlng, {
425
- color: multipointOpts.color || "green",
426
- fillColor: multipointOpts.fillColor || "green",
427
- fillOpacity: multipointOpts.fillOpacity ?? 0.8,
428
- radius: multipointOpts.radius ?? 6,
429
- weight: multipointOpts.weight ?? 2,
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
- // Si marker está habilitado, usar icono personalizado
434
- if (this.configurationMap?.createFigures?.marker) {
435
- return L.marker(latlng, {
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
- // Por defecto, usar circleMarker básico
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
- // Para otros tipos de geometría, dejar que Leaflet use el valor por defecto
444
+ // Otros tipos: icono por defecto
451
445
  return L.marker(latlng);
452
446
  },
453
447
  async searchAddress(query: string) {