Jump to content

Store Coordinates from Map to Document Property


Kem Azlan

Recommended Posts

Just asking is there a way, let say we click at some point at the map visualization, and automatically stored its coordinate into a document property in Spotfire. So far, we just can right-click the point, then copy and paste the coordinate as below:

image.png.686a7fe647a948760757953194d77da3.png

Link to comment
Share on other sites

Hi Kem,

I'm not sure if you could capture the coordinates using iron python or an action mod. I have asked my colleagues to find out if this is possible using the current API set in Spotfire (and will come back to you once I know more about it).


You can, however, capture the location (north/east/south/west) points in a map chart. Maybe that's also an option for you:

You can use the first script to capture these settings by marking a town on the map (see also the attached .dxp file for the setup). The script isn't run automatically in the example .dxp, but you can trigger that with the use of a data function or a button in a text area.
The script then stores the values in document properties you can re-use for your use case.

Kind regards,

David

Link to comment
Share on other sites

Hi Kem,

We don't think it's possible with the current API's to capture a right mouse-click (it's certainly not doable with an action mod since they cannot react to clicks).

You could either use the above mentioned script or create a custom tool in Spotfire. For the latter, see here and browse to the Map Chart Coordinates Context:

Kind regards,

David

Edited by David Boot-Olazabal
Link to comment
Share on other sites

  • 2 weeks later...

Hi @David Boot-Olazabal,

I think I figured out on how to store map coordinate into document property. I have to create the map (including pointer) using Leaflet.js and Text Area. I attached the "Map_Test.dxp" file here.

However, I have some display issues regarding the map I created:

1. Once I loaded the dashboard for the first time, the map did not load automatically, and I have to click the button to update the HTML to load map manually. Is there a way to modify the HTML script to load the map automatically when loading the dashboard? You can refer to "loading_map_manual.mp4" video as attached.

2. The map is overflow, when I try to go to settings. Is there a way to prevent of map overlapping? You can refer to "map_overflow.mp4" video as attached.

Map_Test.dxp

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...