5 Replies Latest reply on Sep 18, 2019 9:32 AM by Simon Runc

    Map coordinates from click on a map?

    Heidi Dragoo

      I would like to set parameters to the coordinates (longitude and latitude) of a click on a map.  Is this possible? Currently I'm using Desktop version 19.2.


      Basically I would like to have a user click a location and then list in a sheet the nearest location to a click. My idea is to use a custom variable that is dependent on the parameters  set from the map click that gives distance from a click to marks and present in a sorted list of "top" (closest) entries. Perhaps there is another to do this. Is this possible using the JavaScript API when accessing a dashboard online?

        • 1. Re: Map coordinates from click on a map?
          Esther Aller

          Hi Heidi,


          If the user is clicking on a data point on a map, then the latitude/longitude values for that point could be used to update parameters via Parameter Actions (added in Tableau Desktop 2019.2)


          You could also add annotations to the map to find the lat/long coordinates of any arbitrary point. But the user would have to know how to create the annotations, and then they would have to type in the coordinates into parameters (copy/paste won't work). See Find Background Image Coordinates - Tableau


          The Tableau website has an Ideas section where customers can add, comment, and vote on features they would like to see in the product. Votes are used to help prioritize new features. Our Development team also loves to see everyone's use cases in the comments, which helps them better design features that will meet the most possible needs.


          I found the following Idea that may be of interest Mode to "annotate points" in bulk


          Hope this helps



          Coming to Tableau Conference? Check out my session: Calculations Survival Guide!

          • 2. Re: Map coordinates from click on a map?
            Don Wise

            Hello Heidi,


            I'm getting the impression that you want a user to simply click anywhere on the map and the Latitude/Longitude would update along with any near data points?  That's not currently feasible at all. 


            For now, the points would have to be there to begin with and a user could then click on a point and the Latitude/Longitude parameter would update automatically thereafter, using Parameter Actions, to display related points based on a distance filter or some other filter.


            I recently did something (page 2 of the thread) that might be similar or useful to you:  Maps - Mileage 


            You could change the single parameter to use Parameter Actions with that and then build it out to use two separate Parameters, one each for Latitude/Longtiude.  Best, Don  

            • 3. Re: Map coordinates from click on a map?
              Heidi Dragoo

              Thank you for your response. The issue stymies me is that I'm there is no mark for a user to click.  I want the coordinates of where the user clicked on the map (or graph). This may work if there is a way to tile the map with invisible marks that get selected by a click, then the selection is automatically cleared. My thoughts are that in this way it should be possible to get a rough approximation of where the user clicked that could be utilized through an action which changes a parameter.

              • 4. Re: Map coordinates from click on a map?
                Heidi Dragoo

                Thank you for your response. Your impression is correct. I did see the "Maps-Mileage" topic/discussion and that will not work, since the (lat,lon) of the two point are still required and I know only one of the points not where the user clicked.  If I did get the two point's coordinates I would have to use the formula mentioned in the "Maps-Mileage" topic/discussion.

                • 5. Re: Map coordinates from click on a map?
                  Simon Runc

                  hi Heidi,


                  You might find this useful




                  If you scroll down to the "Map Overlays" section this does something very similar to what you want ....however Ken's map has data points for all the cities in the US, which is how it works (along with Parameter actions)