Set zoom param for search
This commit is contained in:
@@ -19,19 +19,21 @@ export default class extends Controller {
|
|||||||
|
|
||||||
END_ZOOM = 19;
|
END_ZOOM = 19;
|
||||||
|
|
||||||
go() {
|
/**
|
||||||
|
* @param {Event} event
|
||||||
|
* @returns {L.Marker}
|
||||||
|
*/
|
||||||
|
go(event) {
|
||||||
let map = GisState.map;
|
let map = GisState.map;
|
||||||
const coords = this.coordsValue.split(' ');
|
const coords = this.coordsValue.split(' ');
|
||||||
|
|
||||||
map.setView(
|
map.setView(
|
||||||
coords,
|
coords,
|
||||||
this.END_ZOOM,
|
event.params?.zoom ? event.params.zoom : this.END_ZOOM,
|
||||||
{animate: false}
|
{animate: false}
|
||||||
);
|
);
|
||||||
|
|
||||||
let marker = this.getMarker(map, coords);
|
let marker = this.getMarker(map, coords);
|
||||||
// DEBUG for sites
|
|
||||||
//if (this.groupValue) marker = getMarkerByCoords(coords, this.groupValue);
|
|
||||||
marker?.openTooltip();
|
marker?.openTooltip();
|
||||||
|
|
||||||
return marker;
|
return marker;
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ export default class extends Controller {
|
|||||||
<button class="button is-link"
|
<button class="button is-link"
|
||||||
data-controller="marker"
|
data-controller="marker"
|
||||||
data-action="marker#go"
|
data-action="marker#go"
|
||||||
|
data-marker-zoom-param="17"
|
||||||
data-marker-coords-value="${coordinates}"
|
data-marker-coords-value="${coordinates}"
|
||||||
data-marker-group-value="sites">
|
data-marker-group-value="sites">
|
||||||
Vai
|
Vai
|
||||||
|
|||||||
Reference in New Issue
Block a user