Pass lat/long coords to URL of Exp Builder webapp

735
5
05-20-2022 07:46 AM
USLEOperations
New Contributor III

With the EB webapp I created, I would like the webapp to go to a location specified by latitude, longitude coordinates passed through the URL of the webapp.  I am unable to find the URL parameters to do this and if this is possible.  Thanks!

5 Replies
TonghuiMing
Esri Regular Contributor

@USLEOperations Unfortunately, I don't think we've supported that yet. You might consider bringing it to Esri Support for an ENH or post it in the Experience Builder Ideas category for further evaluation. Thanks.

0 Kudos
StefanFreelanFreelan
New Contributor III

This is such basic functionality - the ability to pass location / scale to a map via a URL. Yes, I know that Ex B does "so much more" than a basic map. But if ESRI isn't going to maintain (or truly replace) WAB (or other, previous options) and tell us that Ex B is so great it needs to be able to do Basic stuff too.

Shen_Zhang
Esri Contributor

Hi All,

Just a quick update to let you know that the Map widget now supports center parameter that allows you to center a map by desired coordinates. please refer to Center a map for more details. Thanks!

Shen Zhang
JoabelBarbieri
Occasional Contributor II

Thank you Shen. Very good.

However I'm having some problems to make it work. If my map is in sub page of ExB it doesn't seem to work. Also, the coordinates aren't working when using simple lat/long wgs84 format. Can I find examples and more documentation about that anywhere other than the link you posted above (which doesn't contain much)? Thanks

0 Kudos
Shen_Zhang
Esri Contributor

@JoabelBarbieri I think there will be a blog about using URL parameters soon. Regarding to the issues you have:

  • You mentioned that map URL parameters do not work for sub-page maps? I'm not sure what your URL looks like, but for example, to locate a map centre, you need to specify the <mapWidgetID>, which is the identifier of your map widget. To find the <mapWidgetID>, you can go to Experience settings -> Manage URL status to turn on the map widget toggle - the map URL parameters will be added to your URL automatically at runtime when you interact with the map.
  • To use <center> to locate your map, <wkid> is required. The common syntax is : center:<x,y,wkid>. Foe example, to find a center with WGS84 coordinates, the URL parameters should be like: #<mapWidgetID>=center:<20,40,4326> 
Shen Zhang