UMD JS API Workshop
Exercise 2 - Builder a Starter 2D Map

Exercise:

This lab covers the basics for creating a basic starter mapping application. The starter map simply loads a default base map, and centers and zooms it in in a MapView.

The output on the 'Map' tab should show an imagery basemap of the United States.

Change the center and zoom to look more specifically at New York state.

-The center coordinates are [-75.992824, 42.978188]

Hint: The smaller the zoom number, the smaller the map scale.

Refresh as you make changes to view the updated map.

If you're stuck, ensure that your code looks like the solution in the picture below:





Challenges:

1. Change the basemap!
Experiment with different basemaps such as topo-vector or gray-vector. Other basemap options can also be found here.

2. To get a better understanding, explore the MapView Class

3. Run the code locally on your machine.
Eventually if your app gets larger you'll want to migrate it from the code playground. Click “Download” to get your html page, choose to “open with…” Chrome or your favorite browser and you can see your website!

Note: This can be done throughout the workshop, so if you would like to save the results of each of these lessons, feel free to do so!

Final Solution