Select to view content in your preferred language

Web AppBuilder Url Extent Parameters

5221
4
Jump to solution
04-29-2015 10:11 PM
SamDrummond2
Deactivated User

Hello All,

As per the Esri documentation I know that I can pass a URL parameter to go to a predefined extent using a projected coordinate system.  The parameters require a xmin, ymin, xmax, ymax and a WKID.  I'm building a web app builder widget that allows the user to open a new web app at the same extent that they are currently viewing - however, I need to be able to handle multiple projection system (NZTM, NZMG and Web Mercator). What I want to know is if the Web App Builder takes care of reprojecting the extent?

So if I capture the current extent of the map in NZTM, open a new tab and pass in a NZTM URL Extent to a NZMG based webmap will the app reproject and go to the correct location in my new app instance.

Thanks

Sam

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Sam,

   I do not see anywhere in the code where re-projection of the urls extent parameter is handled, so my response would be no that is not supported.

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Sam,

   I do not see anywhere in the code where re-projection of the urls extent parameter is handled, so my response would be no that is not supported.

SamDrummond2
Deactivated User

Thanks Robert, I scoured through the code last night and agree - I don't see anywhere where the extent is reprojected. So it strikes me as odd that you need to specify a WKID, if the app is simply going to ignore it and use the extent parameters in whatever projection the web map is in. Oh well.

0 Kudos
berniejconnors
Frequent Contributor

Sam,

     Since version 10.1 the ArcGIS Server REST API has a "project" operation ​that can transform the coordinates.  So you could call the "project" operation to transform the bounding box coordinates before you build the URL for the other Web AppBuilder app.  The "project" operation is powered by the ArcGIS Server geometry service.

Bernie.

0 Kudos
SamDrummond2
Deactivated User

Thanks Bernie. To be honest, this was how I was going to tackle the problem intially. The issue is that there is not an easy way to get a handle on the unopened web maps spatial reference - so I can perform a projection using a geometry service for sure - but I don't know what I'm projecting it into. Would seem more sensible for the web app builder to:

1. Get the parameters from the URL

2. If there is a webmap ID - load the webmap and

3. Get a web maps spatial reference

4. check if the WKID of the webmap and the extent args match

5. If they don't do a reproject

6. Move the map to the reprojected extent.

Thanks

0 Kudos