Closed distantnative closed 5 years ago
That can indeed be handy! I'm adding it now.
💛
I just tried it and it isn't working for me so far.
To specify it further: It seems so far you only tried to save zoom when something is find via geocoding lookup. It is not set when dragging the marker and it is not updated and saved when zooming in and out
@distantnative, I have added a saveZoom
and autoSaveZoom
option, to fine tune the behavior of this zoom saving feature. I have set them both to false
by default to keep the default past behavior of the field, you can turn them on either in your config.php
or blueprint 😉
Hi, I also ran in this issue. I've added this to the config.php
'sylvainjule.locator.saveZoom' => true,
'sylvainjule.locator.autoSaveZoom' => true,
I want to display the zoom level in a template like this:
<?php $location = $entry->cf_map()->yaml(); ?>
<a href="#map" data-id="<?= $entry->id() ?>" data-index="0" data-zoom="<?= $location['zoom']; ?>" class="show-marker">Show on map</a>
So far, this doesn't work. data-zoom is always empty.
Am I missing something?
I would love if the zoom factor gets stored as well, so I can choose the right one in the Panel that I want to replicate on the front-end.