Part 2 - Navigating the map widget¶
Using the map widget¶
The GIS
object includes a map widget for displaying geographic locations, visualizing GIS content, and displaying the results of your analysis. To use the map widget, call gis.map()
and assign it to a variable that you will then be able to query to bring up the widget in the notebook:
import arcgis
from arcgis.gis import GIS
# Create a GIS object, as an anonymous user for this example
gis = GIS()
# Create a map widget
map1 = gis.map('Redlands, CA') # Passing a place name to the constructor
# will initialize the extent of the map.
map1
Buttons¶
Now that we have created a map view, let us explore the default buttons enabled on the widget:
1. Zoom in¶
Click the "+" sign shown on the top left corner of the widget (marked as button #1 in previous map output) to zoom into details of the map. Users can either manually zoom into a desired level of detail or set the zoom levels to an assigned number, which we will elaborate on in the next section.
2. Zoom out¶
Click the "-" sign shown on the top left corner of the widget (marked as button #2 in previous map output) to zoom out to a rough display of the map. Users can either manually zoom out to a desired level of details, or set the zoom levels to an assigned number, which we will elaborate on in the next section.
3. Reset the compass orientation¶
Click the compass sign (marked as button #3 in the previous map display) to switch the map's heading to 0.0 (north) in relation to the current device, and click again to switch back to the absolute 0.0 north.
4. 2D Map to 3D Scene¶
Click the "Map to Scene" button (marked as #4 in the previous map display) to switch the current view from a 2D Map to a 3D Scene. Click the button again to switch back.
Properties of the map widget¶
# Create a map widget
map2 = gis.map('Redlands, CA') # Passing a place name to the constructor
# will initialize the extent of the map.
map2