This may well be impossible, but I was wondering whether there was a way to open an app in a specific location based on parameters in a URL etc.
What I'm trying to do is to have a national app showing aerial photos that can be accessed via a number of different regional hubs built by another part of the organisation. The idea would be to go to the app from say the Devon web page and it would open focussed on Devon, whereas if you came at it from Yorkshire, it would open focussed on Yorkshire.
Is this possible, and if so how would I go about it?
Thanks
Solved! Go to Solution.
There is a hack for this.
It is possible to use URL parameters to control your map.
https://doc.arcgis.com/en/experience-builder/latest/build-apps/url-parameters.htm
Center a map
To center a map on a particular location, usecenterfollowed by the desired coordinates and the desired coordinate system's well-known ID(WKID). The following are examples:
https://experience.arcgis.com/experience/<AppId>#<mapWidgetID>=center:<x,y,wkid>
https://experience.arcgis.com/experience/<AppId>#map_1=center:-10373125.398783844%2C4598516.55871741%2C102100
Hi there, that looks promising. Can you also set the scale, as unfortunately the counties vary in size quite a bit?
Also having just tried it I'm afraid I'm not fully understanding the various elements. I take it that the App id is the 32 character string, but what's the mapwidgetID? Is that just the name that I've given to my map?
Assuming my App ID is 68347442a9b54fe9a2d2d7a09dabf525, my map is call Aerofilms and the centre I want is 433019 429554 in British National Grid (WKID 2770) would it be
https://experience.arcgis.com/experience/<68347442a9b54fe9a2d2d7a09dabf525>#<Aerofilms>=center:<433019,429554,27700> or should I not be using the <>s?
When I try that I get 'Item does not exist or is inaccessible.' so i'm clearly doing something wrong.
Sorry
Yes, remove the <> characters. You will also need to enable the URL Parameters from the settings within Experience Builder.
Look for the Define Map Viewpoint section on the page linked above for more complex options.
Right. I removed all the <>s and it took me to the map. Unfortunately, whether I used Leeds in the north-east, or Truro in the south-west, it just took me to the full extents, so I'm clearly missing something.
I've set the URL parameters for Map to on, and I've looked at the 'Define Map Viewpoint section' but I'm afraid I don't understand what it all means and how to get from the JSON format to the URL. I guess if I could get one example to work, I could tweak for others, but I'm not getting anywhere. No matter what I enter, I just get a full screen.
I even tried zooming somewhere else and copying the URL, but this has two of everything and I don't understand what it's referring to and how to edit it
Sorry
There is a hack for this.
Brilliant and simple. Thanks 😊