Merge branch 'master' of https://gitlab.com/m3f_usm/admin_transporte/frontend into develop/Ronald
commit
fac33c2d8a
|
@ -85,8 +85,12 @@
|
||||||
}
|
}
|
||||||
if (!myMap) {
|
if (!myMap) {
|
||||||
myMap = L.map(elMap)
|
myMap = L.map(elMap)
|
||||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
L.tileLayer(
|
||||||
{ attribution: '© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors' }
|
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
|
{
|
||||||
|
maxZoom: 19,
|
||||||
|
attribution: '© <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||||
|
}
|
||||||
).addTo(myMap);
|
).addTo(myMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +118,11 @@
|
||||||
|
|
||||||
const coordenadas = data.positions.map(({ shape_pt_lat, shape_pt_lon}) => [shape_pt_lat, shape_pt_lon])
|
const coordenadas = data.positions.map(({ shape_pt_lat, shape_pt_lon}) => [shape_pt_lat, shape_pt_lon])
|
||||||
polyline = L.polyline(coordenadas, { color: 'red' }).addTo(myMap)
|
polyline = L.polyline(coordenadas, { color: 'red' }).addTo(myMap)
|
||||||
|
|
||||||
|
const bound = polyline.getBounds()
|
||||||
|
if (bound._northEast && bound._southWset) {
|
||||||
myMap.fitBounds(polyline.getBounds());
|
myMap.fitBounds(polyline.getBounds());
|
||||||
|
}
|
||||||
|
|
||||||
if (coordenadas) {
|
if (coordenadas) {
|
||||||
marker1 = L.marker(coordenadas[0], { icon: iconPartida }).addTo(myMap)
|
marker1 = L.marker(coordenadas[0], { icon: iconPartida }).addTo(myMap)
|
||||||
|
@ -124,6 +132,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log({ error })
|
||||||
globalThis.toast.error(error)
|
globalThis.toast.error(error)
|
||||||
} finally {
|
} finally {
|
||||||
loading = false;
|
loading = false;
|
||||||
|
|
Loading…
Reference in New Issue