Fix: selectFeature and window.openViewer JS syntax in project-map.blade.php
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<div x-data="{ formFullscreen: $wire.entangle('formFullscreen') }"
|
<div x-data="{ formFullscreen: $wire.entangle('formFullscreen') }"
|
||||||
class="flex flex-col lg:flex-row gap-0 h-screen p-1">
|
class="flex flex-col lg:flex-row gap-0 h-screen p-1">
|
||||||
<!-- Columna izquierda: Mapa -->
|
<!-- Columna izquierda: Mapa -->
|
||||||
<div x-show="!formFullscreen" x-cloak class="w-full lg:w-2/3 relative">
|
<div x-show="!formFullscreen" x-cloak class="w-full lg:w-2/3 flex-1 relative">
|
||||||
<div id="map" style="height: 100%; min-height: 500px; width: 100%;" wire:ignore></div>
|
<div id="map" style="height: 100%; min-height: 500px; width: 100%;" wire:ignore></div>
|
||||||
|
|
||||||
<!-- Panel lateral de capas -->
|
<!-- Panel lateral de capas -->
|
||||||
@@ -262,9 +262,9 @@
|
|||||||
let content = `<b>${props.name || 'Elemento'}</b><br>
|
let content = `<b>${props.name || 'Elemento'}</b><br>
|
||||||
{{ __("Progress") }}: ${props.progress || 0}%<br>
|
{{ __("Progress") }}: ${props.progress || 0}%<br>
|
||||||
{{ __("Responsible") }}: ${props.responsible || '-'}<br>
|
{{ __("Responsible") }}: ${props.responsible || '-'}<br>
|
||||||
<button class="btn btn-xs btn-primary mt-1" onclick="selectFeature(' + featId + ')">✏️ Editar</button>`;
|
<button class="btn btn-xs btn-primary mt-1" onclick="selectFeature('${featId}')">✏️ Editar</button>`;
|
||||||
layer.bindPopup(content);
|
layer.bindPopup(content);
|
||||||
layer.on('click', function() { selectFeature(featId); });
|
layer.on('click', function() { selectFeature(' + featId + '); });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
layers[{{ $phase->id }}] = phaseLayer;
|
layers[{{ $phase->id }}] = phaseLayer;
|
||||||
@@ -348,7 +348,7 @@
|
|||||||
m.forEach(marker => {
|
m.forEach(marker => {
|
||||||
const popupContent = `<b>${marker.name}</b><br>
|
const popupContent = `<b>${marker.name}</b><br>
|
||||||
<img src="${marker.image_url}" class="max-w-[200px] max-h-[150px] rounded cursor-pointer"
|
<img src="${marker.image_url}" class="max-w-[200px] max-h-[150px] rounded cursor-pointer"
|
||||||
onclick="window.openViewer(' + marker.image_url + ', ' + marker.image_name + ')" />`;
|
onclick="window.openViewer('${marker.image_url}', '${marker.image_name}')" />`;
|
||||||
L.marker([marker.lat, marker.lng], { icon: photoIcon })
|
L.marker([marker.lat, marker.lng], { icon: photoIcon })
|
||||||
.bindPopup(popupContent)
|
.bindPopup(popupContent)
|
||||||
.addTo(imageMarkersLayer);
|
.addTo(imageMarkersLayer);
|
||||||
|
|||||||
Reference in New Issue
Block a user