I really love that Windows 10 has its native UWP (Universal Plattform, simply Windows 10 apps) maps app.
It happens that i want to see locations of many images at once. I know about the Image LOCATE
command, but to start an uwp app a little bit more work has to be done.
My button now allows you to transfer existing GPS tags from the selected images to the maps app.
The maps app will start, open a new tab with the name of the current folder of DOpus and the count of images containing GPS tags and display those tags with the corresponding file name on the map and it does some kind of geocoding. Default map style forced by script is sattelite ("3d"). See Maps UWP Parameters Reference for further parameters.
As far as i know this shouldn't cause any leakage of sensitve information (or at least not more than using the app itself).
This is how it looks for my trip in Norway.
And here is the code. Copy&Paste to your lister menu bar.
<?xml version="1.0"?>
<button backcol="none" display="both" hotkey="ctrl+shift+M" label_pos="right" textcol="none">
<label>Show GPS in Windows Maps</label>
<icon1>#downloads</icon1>
<function type="script">
<instruction>@script JScript</instruction>
<instruction>function OnInit(initData)</instruction>
<instruction>{</instruction>
<instruction> initData.name = "Open contained GPS tags in Windows Maps";</instruction>
<instruction> initData.desc = "Opens the Windows Maps UWP app and shows the GPS locations contained in selected images";</instruction>
<instruction> initData.copyright = "Felix Froemel https://resource.dopus.com/u/Felix.Froemel/"; </instruction>
<instruction> initData.version = "1.0 (6.2.2020)";</instruction>
<instruction> initData.url= "https://resource.dopus.com/t/open-gps-tags-of-images-in-windows-maps-app-win10-uwp/34577";</instruction>
<instruction>}</instruction>
<instruction />
<instruction>function OnClick(clickData)</instruction>
<instruction>{</instruction>
<instruction> var selectedFiles = clickData.func.sourcetab.selected_files;</instruction>
<instruction> if(selectedFiles.count >= 1)</instruction>
<instruction> {</instruction>
<instruction> var collectionPoints = ""; </instruction>
<instruction> var gpsCount = 0;</instruction>
<instruction> for (var fileEnum = new Enumerator(selectedFiles); !fileEnum.atEnd(); fileEnum.moveNext()) </instruction>
<instruction> {</instruction>
<instruction> var currentItem = fileEnum.item();</instruction>
<instruction> if (!currentItem.is_dir)</instruction>
<instruction> { </instruction>
<instruction> var fileMeta = currentItem.metadata;</instruction>
<instruction> if (fileMeta == "image")</instruction>
<instruction> {</instruction>
<instruction> var imageMeta = fileMeta.image;</instruction>
<instruction> var lat = imageMeta["latitude"];</instruction>
<instruction> var lng = imageMeta["longitude"];</instruction>
<instruction> if(lat == "" || typeof(lat) === 'undefined' || lng == "" || typeof(lng) === 'undefined')</instruction>
<instruction> {</instruction>
<instruction> Log(currentItem .name + ": GPS Meta error (" + lat + "|" + lng + "). Skipping...");</instruction>
<instruction> }</instruction>
<instruction> else</instruction>
<instruction> {</instruction>
<instruction> collectionPoints += "~point." + lat + "_" + lng + "_" + currentItem.name;</instruction>
<instruction> //~point.36.116584_-115.176753_Las%20Vegas</instruction>
<instruction> gpsCount++;</instruction>
<instruction> }</instruction>
<instruction> }</instruction>
<instruction> }</instruction>
<instruction> }</instruction>
<instruction> var collectionName = clickData.func.sourcetab.path + " (" + gpsCount + " images with GPS tag)";</instruction>
<instruction> </instruction>
<instruction> StartWindowsMapsApp(collectionName, collectionPoints);</instruction>
<instruction> }</instruction>
<instruction>}</instruction>
<instruction />
<instruction>function StartWindowsMapsApp(collectionName, collectionPoints)</instruction>
<instruction>{</instruction>
<instruction> //https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-maps-app#bingmaps-param-reference</instruction>
<instruction>//collection=name.My%20Trip%20Stops~point.36.116584_-115.176753_Las%20Vegas~point.37.8268_-122.4798_Golden%20Gate%20Bridge</instruction>
<instruction> var cmd = "shell:appsFolder\\Microsoft.WindowsMaps_8wekyb3d8bbwe!App bingmaps:?collection=name.";</instruction>
<instruction> cmd += collectionName;</instruction>
<instruction> cmd += collectionPoints;</instruction>
<instruction> cmd += "&sty=3d"; //3d map style, "a"/"r"/"3d"</instruction>
<instruction> DOpus.NewCommand.RunCommand(cmd);</instruction>
<instruction>}</instruction>
<instruction />
<instruction>function Log(msg)</instruction>
<instruction>{</instruction>
<instruction> DOpus.Output(msg);</instruction>
<instruction>}</instruction>
</function>
</button>