The first part of this post gave an overview of the ArcGIS Platform as it relates to developing ArcGIS Runtime apps. It briefly described some of the tools in the context of a Data, Design, and Develop workflow. The second part walked through signing up for an ArcGIS for Developers account and using it to create an Application portal item with metadata to describe a yet-to-be-created app.
We'll continue in this post by using ArcGIS Online to create a simple map for use in an ArcGIS Runtime SDK for .NET app.
Part 3 - Get yer ArcGIS On(line)!
If you are continuing from the previous post, and are still logged in to ArcGIS for Developers, you can use the following "shortcut" to open ArcGIS Online from your developers account.
- From your Applications page, choose the application you just created (Portal Maps, for example).
- Click the Settings tab for that application.
- In the upper right portion of the Settings page, click the View in ArcGIS Online link. The application (portal item) properties page will open in ArcGIS Online.
If you are not currently logged in to ArcGIS for Developers, you can simply navigate to the ArcGIS Online sign in page, enter your ArcGIS for Developers username and password, and click Sign In.
Create a map
The ArcGIS Online Map Viewer provides an excellent tool for interactively creating a map (or scene) for use in your ArcGIS Runtime SDK apps. You can add and style a variety of layers, choose from existing basemaps, incorporate your own data, configure popups and bookmarks, and so on. Once created, you can simply load the map into your app using it's unique portal item ID. Any updates made to your web map will show up in all apps that use it.
- After logging in to ArcGIS Online, click the Map tab at the top of the page to open the Map Viewer.
- In the Map Viewer, click the Basemap dropdown and select your favorite basemap.
- Click the Add drop down and choose Browse Living Atlas Layers.
- In the Browse Living Atlas Layers dialog, filter by the Demographics and Lifestyle > Poverty & At Risk category. Add 2016 USA Crime Index to the map as a layer, then close the dialog. This is a premium layer that requires an ArcGIS Online subscription to view.
- When the layer is added to the map, click the ellipsis (...) under the layer name to show the layer context menu. Click Transparency and adjust the layer transparency to your liking (so you can see the basemap below, for example.
- Zoom the map to an area in the United States. Notice that the layer updates to show more detailed information as the scale increases (shows a smaller area).
- Click the Bookmarks drop down. Click Add Bookmark to create a bookmark for the current area.
- Zoom to a few other places on the map (in the United States) and add a few bookmarks. You can also test your bookmarks by selecting them in the drop down to zoom the map to those places.
- Click Save on the Map Viewer toolbar to launch the Save Map dialog.
- Provide a Title, some Tags, and a Summary for the new map. If you have additional folders set up, you can choose to save your map in a folder other than the default one for your account.
- Click Save Map to save the current state of the map as a new portal item (web map). When the save is complete, you'll notice the map's title update in the viewer to display the title you provided above (US Crime Index, for example).
Check the URL displayed in the Map Viewer. This is where you'll find the most important piece of information when you want to add this map to your ArcGIS Runtime SDK app. The alphanumeric string after "webmap=" in the URL is the unique ID for this map. Take note of this ID, you'll use it later when you create your app.
Share your map
You can set sharing properties on any of the portal items you own. You can choose to share an item with everyone, with your organization, with certain groups, or to keep the item strictly private. You can update sharing for an item whenever you like. You may keep a web map private, for example, until you have it polished up enough to share with everyone. Sharing settings for your portal items can have an impact on your ArcGIS Runtime SDK apps that consume them, of course, and you'll need to plan for authenticating users that need to access things that aren't publically available.
- From the Home menu (on the upper left portion of the Map Viewer), select My Content. This will change to a view of all the current portal items in your account (in the default folder).
- Locate your new web map portal item (US Crime Index, for example) in the list of items. Hint: if you have a lot of items, you can filter to only show web maps by clicking Maps in the list on the left of the page.
- Click the item to view its details page. Notice that the web map ID also appears in the URL for the details page, this time following "id=".
- On the right side of the item details page, click the Share button.
- In the Share dialog that appears, check Everyone (public). Click OK to apply the new settings.
OK, you now have a map that you can load into an ArcGIS Runtime SDK app (or several apps if you like). Remember the web map ID, because you'll need it to reference the web map in your app (better yet, just keep the page open so you can copy and paste it).
In the next post in this series, you'll put together a simple ArcGIS Runtime SDK for .NET app that displays this web map as well as the web map's bookmarks so the user can navigate to them.
If you're anxious to write code for saving a map to ArcGIS Online (including implementing OAuth 2.0 authentication), please see the Author, edit, and save maps tutorial in the .NET developers guide!