Select to view content in your preferred language

how to open EXB 3D/2D map directly at location taken from the url?

689
6
Jump to solution
02-28-2024 04:07 AM
Labels (2)
MichaelLev
Regular Contributor

I work with 3D scenes.

Regularly EXB opens a 3D scene at its default location.

Sometimes I want to append specific x,y coordinates (or specific Viewpoint) to the url which activates the EXB web app, in order that when EXB starts, it will open the scene exactly at this place.

I assume I'll need to copy client/dist/widgets/arcgis-map widget into "your-extensions" and I want to be sure where and how to modify the code to get the data from the url and  open the 3D scene directly at that location.

(I assume that for 2D maps it will be very similar)

0 Kudos
2 Solutions

Accepted Solutions
Jianxia
Esri Regular Contributor

The  Viewpoint URL parameter will be available in ExB in ArcGIS Online February release (Tomorrow, PST), and picked up by the developer edition 1.14 on March 20.

View solution in original post

MichaelLev
Regular Contributor

@Jianxia , I succeeded.

I copied client/dist/widgets/arcgis-map widget into my custom widgets folder and modified it to open the scene according to x,y in the url. I had to add dependency as in solution-to-failed-to-load-map .

As I present both geographic coordinates and ITM (2039) in my custom widget coordinates (I copied esri's coordinates and modified) "on the fly" as the mouse moves, I allow inserting x,y in the url either by degrees or by ITM. by checking x,y magnitude I can tell if it's degrees or not.

View solution in original post

6 Replies
Jianxia
Esri Regular Contributor

The  Viewpoint URL parameter will be available in ExB in ArcGIS Online February release (Tomorrow, PST), and picked up by the developer edition 1.14 on March 20.

MichaelLev
Regular Contributor

Thank you!

Am I understanding correctly that it will be able to put the whole viewpoint json in the url?

Question: what if I want to give in the url less data, e.g, only x, y, and camera height above ground? Or, only x and y (and let EXB put the camera automatically at some 200 meter, for example, above ground?

(meanwhile I am trying as I wrote above, but I have not finished yet, and I'm not sure whether I'll succeed)

0 Kudos
MichaelLev
Regular Contributor

@Jianxia , I succeeded.

I copied client/dist/widgets/arcgis-map widget into my custom widgets folder and modified it to open the scene according to x,y in the url. I had to add dependency as in solution-to-failed-to-load-map .

As I present both geographic coordinates and ITM (2039) in my custom widget coordinates (I copied esri's coordinates and modified) "on the fly" as the mouse moves, I allow inserting x,y in the url either by degrees or by ITM. by checking x,y magnitude I can tell if it's degrees or not.

Jianxia
Esri Regular Contributor

@MichaelLev, Glad that you figure it out! You are right that Viewpoint url parameter uses the viewpoint json.

0 Kudos
FredericPoliart_EsriAU
Occasional Contributor II

Great! 
I have been waiting for this Viewpoint/Xmin,Ymin, Xmax, Ymax, roatation, angle, zoom level  in the URL , so we can invoke ExB and make it zoom to a specific location 

What would be awesome would be a ?find={searchquery} which would inject the {searchquery} into the search widget so we can start ExB with a https://URL:3001?find=Property1560