# Apply default zoom to Google Maps

**URL:** <https://resource.dopus.com/t/apply-default-zoom-to-google-maps/53499>\
**Category:** Tutorials\
**Created:** [November 15, 2024, 4:38pm UTC](https://resource.dopus.com/t/apply-default-zoom-to-google-maps/53499 "2024-11-15T16:38:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fred](https://resource.dopus.com/user_avatar/resource.dopus.com/fred/32/58927_2.png) [@fred](https://resource.dopus.com/u/fred)\
**Post date:** [November 15, 2024, 4:38pm UTC](https://resource.dopus.com/t/apply-default-zoom-to-google-maps/53499/1 "2024-11-15T16:38:05Z")

</div>

Hi,

In v13, the new `locate image` command can be customized.

 ![image](https://resource.dopus.com/uploads/default/original/3X/3/2/3232b90e42db9335f726a07dfdd7af456b5d48f3.png)

Go to **Preferences\>Miscellaneous\>Advanced\>image\_locate\_service** and replace the line with google map with:

```auto
google[Google Maps]=https://maps.google.com/?q=%lat%,%lon%&ll=%lat%,%lon%&z=7

```

Change the `z=#` to apply a zoom between 1 to 20.

Select an image file containing GPS coordinates to display the image toolbar. Customize and drag and drop the `locate image` command to this toolbar. I set the button to only display an icon.

 ![image](https://resource.dopus.com/uploads/default/original/3X/f/6/f62a8b10dd8f5a8b387202dea51309559949834f.png)

_ **TODO** : I think we could improve this button making it disabled if the selected image doesn’t have GPS info. If someone wants to help. I guess it would use the `evaluator`._

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [November 15, 2024, 5:02pm UTC](https://resource.dopus.com/t/apply-default-zoom-to-google-maps/53499/2 "2024-11-15T17:02:57Z")

</div>

> [@fred](#):
>
> improve this button making it disabled if the selected image doesn’t have coordinates GPS

Some info here:

> [@Locate image command](https://resource.dopus.com/t/locate-image-command/45922/9):
>
> `Image LOCATE` buttons are hidden by default if there's no GPS information; the ones in the submenu are an exception, which are only disabled.
> 
> You should be able to use `IsEnabled()` in the evaluator to use this to check for GPS, e.g. `IsEnabled("Image LOCATE")` should return true if GPS is available.

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [November 15, 2024, 6:00pm UTC](https://resource.dopus.com/t/apply-default-zoom-to-google-maps/53499/3 "2024-11-15T18:00:47Z")

</div>

Note that `Image LOCATE` only hides/disables itself in the viewer, not when placed on lister toolbars. Checking if the selected file(s) contain GPS data each time the selection changes would be slow/expensive, while the image viewer already knows about the file it has loaded and displayed.

> [@Locate image command](https://resource.dopus.com/t/locate-image-command/45922/11):
>
> Context stuff won't work in the Lister itself, since determining whether a file has coordinates in it or not is an expensive operation. You could maybe do something with the evaluator, but by default it ignores Image LOCATE commands completely (wit…

---

<div class="post-metadata">

**Author:** ![fred](https://resource.dopus.com/user_avatar/resource.dopus.com/fred/32/58927_2.png) [@fred](https://resource.dopus.com/u/fred)\
**Post date:** [November 15, 2024, 7:02pm UTC](https://resource.dopus.com/t/apply-default-zoom-to-google-maps/53499/4 "2024-11-15T19:02:21Z")

</div>

Could I use `@enableif` with this button ?

```auto
Image LOCATE=google

```

How?

---

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [November 15, 2024, 7:21pm UTC](https://resource.dopus.com/t/apply-default-zoom-to-google-maps/53499/5 "2024-11-15T19:21:59Z")

</div>

Yes. For example, this would create a button that works only on Sundays:

```plaintext
@enableif:=DatePart(Now(), "D")=="1"
Image LOCATE=google

```
