Select to view content in your preferred language

Portal web map in json (web map specification) format

1430
5
Jump to solution
11-01-2022 10:34 AM
CraigSturzaker2
Emerging Contributor

Hi

Does anyone know if it is possible to get a webmap from Portal in it's web map specification format using the JS API (4.x)?  If so, any help would be greatly appreciated.

Thanks

0 Kudos
1 Solution

Accepted Solutions
JeffreyWilkerson
Frequent Contributor

I guess the key is figuring out at what level you need the JSON info, like looking for the webmap info might be just adding 'webmap?f=pjson' to the end of a known content item, like:

https://wvdep.maps.arcgis.com/sharing/rest/content/items/b062fc8f8d6e4ec1a44ab466829a1494/webmap?f=p... 

While looking at the data would mean adding 'data?f=pjson' to the end of the item:

https://wvdep.maps.arcgis.com/sharing/rest/content/items/b062fc8f8d6e4ec1a44ab466829a1494/data?f=pjs... 

View solution in original post

0 Kudos
5 Replies
JeffreyWilkerson
Frequent Contributor

Portal is like your own personal ArcGIS Online. You can create layers that are accessible using their defined REST endpoint. The 'JSON web map specification' is accessible by entering the feature layer's URL, with our without the ArcGIS Javascript API. Such as https://services5.arcgis.com/4LKAHwqnBooVDUlX/arcgis/rest/services/PARKS_Historic_Old_Growth_Trees/F... . The only difference between this (ArcGIS Online) and Portal would be the server information such as https://services5.arcgis.com would be something else like https://local.server.com

ArcGIS Javascript API is a Javascript library located through a URL that provides functionality (through Javascript) to access ArcGIS Online and Portal REST endpoints (and other things). But the 'JSON' representation of the data being access is available through the layers URL (REST URL).  The only thing needed to write a publicly accessible ArcGIS Javascript API web application that access Portal data is to have the web app housed on a publicly exposed server running IIS or Apache, and the Portal publicly (outside the agency's firewall) available with data layers that are shared to everyone.

Hope this makes sense and is answering your question.

0 Kudos
CraigSturzaker2
Emerging Contributor

Thanks, that all makes sense. 

However what I'm after is the web map specification of a web map as opposed to an individual feature layer.  A JSON object with all the properties listed here that describes a web map on portal.

0 Kudos
JeffreyWilkerson
Frequent Contributor

Not sure what you are missing. If you are looking for Map information you can see that by looking at the map REST service such as:

https://tagis.dep.wv.gov/arcgis/rest/services/Hosted/Apples_and_Solar/MapServer 

Or as JSON:

https://tagis.dep.wv.gov/arcgis/rest/services/Hosted/Apples_and_Solar/MapServer?f=pjson

A lot of those properties, like 'bookmarks' or 'widgets' almost seem like attributes for an application, even though it does say they are available for the Webmap. Not sure if that's viewable like this or not.

 

0 Kudos
JeffreyWilkerson
Frequent Contributor

I guess the key is figuring out at what level you need the JSON info, like looking for the webmap info might be just adding 'webmap?f=pjson' to the end of a known content item, like:

https://wvdep.maps.arcgis.com/sharing/rest/content/items/b062fc8f8d6e4ec1a44ab466829a1494/webmap?f=p... 

While looking at the data would mean adding 'data?f=pjson' to the end of the item:

https://wvdep.maps.arcgis.com/sharing/rest/content/items/b062fc8f8d6e4ec1a44ab466829a1494/data?f=pjs... 

0 Kudos
CraigSturzaker2
Emerging Contributor

It looks like the second URL example is the one we need.  Thanks

0 Kudos