roemhildtg

VSCode - ArcGIS Assistant Extension

Blog Post created by roemhildtg on Dec 1, 2019

Are you a developer, working with ArcGIS? Are you using VSCode? So am I, let me take you down the road of my experiences in working with ArcGIS Portal/AGO and how/why I ended up building an extension to integrate ArcGIS with VSCode.

 

The extension for the curious: GitHub - roemhildtg/vscode-arcgis-assistant: An arcgis administration tool for vscode 

 

 

As a developer, I'm constantly working with ArcGIS Online items and their relevant JSON structure. While working between different layer sources and switching between development and production environments, I use JSON editors to update things like URL's, copy arcade/label expressions, and popup templates without having to rebuild a web map from scratch. Existing web map editors fall short with regards to these features:

 

  • Fixing broken layer URL's and Item ID's or modifying these from development to production environments
  • Copy/paste functionality like copying symbology or popup configuration to different layers
  • Updating internal properties like layerId for use in a web application

 

There are already some tools available to do this sort of thing:

 

ArcGIS Assistant - ArcGIS Online Assistant - the swiss army knife tool for this sort of thing. It provides a GUI for editing raw JSON and updating some of the items we mentioned.

REST API - ArcGIS REST API | ArcGIS for Developers - raw data endpoints for doing all of the operations we need.

 

So why build another? In using VS Code as the platform for editing, we get lots of functionality for free:

  • Scaling - VSCode easily handles the editing of large files. We can quickly download, format, and edit a file with hundreds and thousands of lines of JSON code and have very issues in performance or editing functionality.
  • Text Editing - VSCode is  powerful editor and comes with lots of functionality like Find/Replace, Regex, etc, out of the box.
  • Extending - There are hundreds of extensions for VS Code that allow you to edit files in powerful ways, like a JSON Editor, for example.

 

  • Editing ArcGIS Item in JSON Editor

 

So what does the extension do? Its essentially a virtual file system in VSCode for ArcGIS Online/Portal. It allows us to:

 

  • Download JSON items from ArcGIS Online/Portal and save to a temporary in-memory workspace.
  • Watches the file for changes and prompts the user to sync it back up to ArcGIS Online.
  • Management tools, like Copy/Paste items between accounts and Delete items. (See Issues -> Feature Requests)

 

While completely functional, there are a list of enhancements I have already thought about implementing. But I've reached the point where I have been able to make extensive use of it already so I am hoping to solicit some feedback whether that be suggestions, user feedback, and constructive criticism of course. Feel free to drop a line.

 

December Update: Groups!

Group browsing/editing items in groups is now functional! Update to the latest version (1.5.0) and give it a try!

Releases · roemhildtg/vscode-arcgis-assistant · GitHub 

Outcomes