# Locate image command

**URL:** <https://resource.dopus.com/t/locate-image-command/45922>\
**Category:** Help & Support\
**Created:** [September 20, 2023, 6:48pm UTC](https://resource.dopus.com/t/locate-image-command/45922 "2023-09-20T18:48:18Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlbatorV](https://resource.dopus.com/user_avatar/resource.dopus.com/albatorv/32/25847_2.png) [@AlbatorV](https://resource.dopus.com/u/AlbatorV)\
**Post date:** [September 20, 2023, 6:48pm UTC](https://resource.dopus.com/t/locate-image-command/45922/1 "2023-09-20T18:48:19Z")

</div>

There is a default sub-menu 'Locate image' with this command `Image LOCATE=menu,nohide`.

I think that this menu or maps services under this menu should be disable if no file is selected, or better if no image is selected, or better if file without coordonate is selected.

Now if I create button with this command `Image LOCATE=google`, how to disable it with Evaluator if image have no coordonates ?

---

<div class="post-metadata">

**Author:** ![AlbatorV](https://resource.dopus.com/user_avatar/resource.dopus.com/albatorv/32/25847_2.png) [@AlbatorV](https://resource.dopus.com/u/AlbatorV)\
**Post date:** [September 20, 2023, 6:59pm UTC](https://resource.dopus.com/t/locate-image-command/45922/2 "2023-09-20T18:59:07Z")

</div>

If I create button `Image LOCATE=google` in viewer toolbar, button is always hidden 🤔

---

<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:** [September 21, 2023, 6:49am UTC](https://resource.dopus.com/t/locate-image-command/45922/3 "2023-09-21T06:49:28Z")

</div>

> [@AlbatorV](#):
>
> how to disable it with Evaluator if image have no coordonates ?

I expected this to work...

```plaintext
@enableif:=(IsSet(latitude) && IsSet(longitude))
Image LOCATE=google

```

... but apparently `IsSet()` is not one of the functions referenced here:

> As well as the above variables, you can also use [evaluator functions](https://docs.dopus.com/doku.php?id=reference:evaluator) like [IsChecked](https://docs.dopus.com/doku.php?id=reference:evaluator:ischecked) and [IsEnabled](https://docs.dopus.com/doku.php?id=reference:evaluator:isenabled) to query other information about the state of the Lister.

[Evaluator Dynamic Button State](https://docs.dopus.com/doku.php?id=evaluator:applicable_contexts:functions:dynamic_state)

---

<div class="post-metadata">

**Author:** ![AlbatorV](https://resource.dopus.com/user_avatar/resource.dopus.com/albatorv/32/25847_2.png) [@AlbatorV](https://resource.dopus.com/u/AlbatorV)\
**Post date:** [September 21, 2023, 10:51am UTC](https://resource.dopus.com/t/locate-image-command/45922/4 "2023-09-21T10:51:24Z")

</div>

Yes, I use this for Evaluator column but nothing for button...

`if (IsSet(coords)) return "yes";`

---

<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:** [September 21, 2023, 1:10pm UTC](https://resource.dopus.com/t/locate-image-command/45922/5 "2023-09-21T13:10:08Z")

</div>

The neatest solution is a little script that filters the selected images and only passes those with GPS info to the command.

---

<div class="post-metadata">

**Author:** ![AlbatorV](https://resource.dopus.com/user_avatar/resource.dopus.com/albatorv/32/25847_2.png) [@AlbatorV](https://resource.dopus.com/u/AlbatorV)\
**Post date:** [September 25, 2023, 8:41am UTC](https://resource.dopus.com/t/locate-image-command/45922/6 "2023-09-25T08:41:35Z")

</div>

Another note about this sub-menu 'Locate image'...

Display the real services names in button labels:

- google =\> Google Maps
- osm =\> OpenStreetMap
- bing =\> Bing Maps
- etc...

---

<div class="post-metadata">

**Author:** ![AlbatorV](https://resource.dopus.com/user_avatar/resource.dopus.com/albatorv/32/25847_2.png) [@AlbatorV](https://resource.dopus.com/u/AlbatorV)\
**Post date:** [October 7, 2023, 4:57pm UTC](https://resource.dopus.com/t/locate-image-command/45922/7 "2023-10-07T16:57:23Z")

</div>

> [@AlbatorV](#):
>
> There is a default sub-menu 'Locate image' with this command `Image LOCATE=menu,nohide`.
> 
> I think that this menu or maps services under this menu should be disable if no file is selected, or better if no image is selected, or better if file without coordonate is selected.
> 
> Now if I create button with this command `Image LOCATE=google`, how to disable it with Evaluator if image have no coordonates ?

> [@AlbatorV](#):
>
> If I create button `Image LOCATE=google` in viewer toolbar, button is always hidden 🤔

Surprised that this bug is not resolved...

---

<div class="post-metadata">

**Author:** ![AlbatorV](https://resource.dopus.com/user_avatar/resource.dopus.com/albatorv/32/25847_2.png) [@AlbatorV](https://resource.dopus.com/u/AlbatorV)\
**Post date:** [October 9, 2023, 8:29am UTC](https://resource.dopus.com/t/locate-image-command/45922/8 "2023-10-09T08:29:03Z")

</div>

> [@AlbatorV](#):
>
> Another note about this sub-menu 'Locate image'...
> 
> Display the real services names in button labels:
> 
> - google =\> Google Maps
> - osm =\> OpenStreetMap
> - bing =\> Bing Maps
> - etc...

For others to solved this problem...

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

You need to reset option `image_locate_services` in `Preferences / Miscellaneous / Advanced: [Behavior]`. The service names are added in brackets and will be displayed after restarting Opus.

 ![image](https://resource.dopus.com/uploads/default/original/3X/5/3/533d9141692c5328a6c2310dc79c9f237f4f5fa9.png)

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [October 10, 2023, 6:40am UTC](https://resource.dopus.com/t/locate-image-command/45922/9 "2023-10-10T06:40:19Z")

</div>

`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:** ![AlbatorV](https://resource.dopus.com/user_avatar/resource.dopus.com/albatorv/32/25847_2.png) [@AlbatorV](https://resource.dopus.com/u/AlbatorV)\
**Post date:** [October 10, 2023, 11:53am UTC](https://resource.dopus.com/t/locate-image-command/45922/10 "2023-10-10T11:53:50Z")

</div>

Sorry to insist but…

I have 2 images in this folder, with and without coordinates.

**Boutons in Lister**  
I have toolbar with 3 buttons, `Image LOCATE=menu`, `Image LOCATE=menu,nohide` and `Image LOCATE=google`.  
Look this video, if no files are selected, items in both menus are not disable and the last button too. Normal ?

[/uploads/default/original/3X/8/b/8b50d0bea81b6f930f3264302d129e3e4840e237.mp4](https://resource.dopus.com/uploads/default/original/3X/8/b/8b50d0bea81b6f930f3264302d129e3e4840e237.mp4)

Note that Google Earth is not visible in button `Image LOCATE=menu,nohide` despite keyword nohide. Normal ?

Look now, if the file does not have GPS coordinates, items in both menus are not disable and the last button too. Normal ?

[/uploads/default/original/3X/6/a/6a617aaa9e49a64b2f1efbdc63eda43d2681ebd9.mp4](https://resource.dopus.com/uploads/default/original/3X/6/a/6a617aaa9e49a64b2f1efbdc63eda43d2681ebd9.mp4)

**Boutons in Viewer**  
Look, I have button `Image LOCATE=menu,nohide` in menu, items in menu are not disable. Normal ?  
 ![2023-10-10_112301](https://resource.dopus.com/uploads/default/original/3X/f/9/f958e2d9b638227aca33707dcdb3eb952ee77064.png)

Now, I have button `Image LOCATE=google` that is not display in toolbar even if image have coordinates. Normal ?

[/uploads/default/original/3X/b/9/b93b8653210f07a4050770c919c65ad807bd28a7.mp4](https://resource.dopus.com/uploads/default/original/3X/b/9/b93b8653210f07a4050770c919c65ad807bd28a7.mp4)

**Evaluator**  
This do nothing... Maybe not possible to disable based on metadata ?  
 ![2023-10-10_113618](https://resource.dopus.com/uploads/default/original/3X/b/6/b65f7cd785e9c648a041249a83318a96b44a3a4b.png)

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [October 10, 2023, 7:21pm UTC](https://resource.dopus.com/t/locate-image-command/45922/11 "2023-10-10T19:21:09Z")

</div>

1. 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 (with the exception of Bing Maps, which we check if it's installed or not) and they'll always be enabled.

2. In the viewer, we already have the image data so we know if there are coordinates or not. In the main toolbar, Image LOCATE commands are hidden if there are no coordinates. In the menu they're disabled. It's normal Windows behaviour for the parent menu to stay enabled whether the things in it are disabled or not.

3. I would have expected that to work, but I haven't tried it yet.

---

<div class="post-metadata">

**Author:** ![AlbatorV](https://resource.dopus.com/user_avatar/resource.dopus.com/albatorv/32/25847_2.png) [@AlbatorV](https://resource.dopus.com/u/AlbatorV)\
**Post date:** [October 10, 2023, 8:01pm UTC](https://resource.dopus.com/t/locate-image-command/45922/12 "2023-10-10T20:01:44Z")

</div>

1. Ok I understand that extract date from metadata could be an expensive operation. I didn't succeed with Evaluator, maybe one day someone will...

2. In my example, file have coordinates, so items in locate menu should be enable and button in toolbar should be visible. That is, currently items in locate menu are always disabled and the buttons are always hidden

3. Maybe one day...

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [October 10, 2023, 8:54pm UTC](https://resource.dopus.com/t/locate-image-command/45922/13 "2023-10-10T20:54:11Z")

</div>

In the viewer, if the current image has coordinates, items in the locate menu should be enabled and the toolbar button should be visible, yes. That's what happens for me.

---

<div class="post-metadata">

**Author:** ![AlbatorV](https://resource.dopus.com/user_avatar/resource.dopus.com/albatorv/32/25847_2.png) [@AlbatorV](https://resource.dopus.com/u/AlbatorV)\
**Post date:** [October 12, 2023, 1:11pm UTC](https://resource.dopus.com/t/locate-image-command/45922/14 "2023-10-12T13:11:02Z")

</div>

I just did some testing and found something, by myself.

I remind you that the problem is that the `Locate image` menu items are disabled in the viewer even though the image has GPS coordinates in the metadata.  
I did a reset of the viewer toolbar and the `Locate image` menu items are enabled, so there is a problem with the toolbar.  
I have the `Image LOCATE=menu` button in the `File` menu and I also have an `Image LOCATE=google` button in my bar.  
I removed the `Image LOCATE=google` button and closed the viewer.  
After reopening the viewer, the `Image LOCATE=menu` menu items are now activated.

So to reproduce the problem:

1. Reset the viewer toolbar and close it.
2. Reopen the viewer (so items activated in the `Image menu LOCATE=menu` in File)
3. Create a button anywhere in the toolbar with the `Image LOCATE=google` command.
4. Close and reopen the viewer.
5. The menu items are disabled and the created button is hidden.

Now, another test in defaut viewer toolbar, if I move `Locate image` menu out of `File` menu and restart viewer… it’s ok, items in menu are still enabled.  
If you change this button command to `Image LOCATE=google` and restart viewer… button is always hidden.

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [October 15, 2023, 6:17am UTC](https://resource.dopus.com/t/locate-image-command/45922/15 "2023-10-15T06:17:22Z")

</div>

I can't reproduce that I'm sorry. Maybe it depends on the image? Could you upload one that does it for you?

---

<div class="post-metadata">

**Author:** ![AlbatorV](https://resource.dopus.com/user_avatar/resource.dopus.com/albatorv/32/25847_2.png) [@AlbatorV](https://resource.dopus.com/u/AlbatorV)\
**Post date:** [October 15, 2023, 8:37am UTC](https://resource.dopus.com/t/locate-image-command/45922/16 "2023-10-15T08:37:14Z")

</div>

[20230825\_125425.zip](https://resource.dopus.com/uploads/short-url/7RFN7s0GWEZANpqvudnIiU9iV8.zip) (2.8 MB)

---

<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, 9:11pm UTC](https://resource.dopus.com/t/locate-image-command/45922/17 "2024-11-15T21:11:21Z")

</div>

Now that Everything is used to index files and we can add longitude and latitude to the properties scan, could not DOpus take advantage of that ?

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

So we could add a such a button in a lister toolbar whose state works as expected:

```auto
@enableIf:=IsEnabled("Image LOCATE")
Image LOCATE=google

```
