Tethys Platform
Table Of Contents
Table Of Contents

ESRI Map

Last Updated: February 15, 2017

class tethys_sdk.gizmos.ESRIMap(height='100%', width='100%', basemap='topo-vector', view=None, layers=None)

ESRI Map View

The ESRI Map View is similar to Map View, but it is powered by ArcGIS API for JavaScript 4.0

Attributes

height(string, required): Height of map container in normal css units width(string, required): Width of map container in normal css units basemap(string, required): Basemap layer. Values=[streets,satellite,hybrid,topo,gray,dark-gray,oceans, national-geographic,terrain,osm,dark-gray-vector,gray-vector,street-vector, topo-vector,streets-night-vector,streets-relief-vector,streets-navigation-vector] zoom(string,required): Zoom Level of the Basemap. view(EMView): An EVView object specifying the initial view or extent for the map

Example

# CONTROLLER
from tethys_sdk.gizmos import EMView, EMLayer, ESRIMap

# Set initial view
esri_map_view = EMView(
    center=[-100, 40],
    zoom=4
)

# Define layers
esri_layer = EMLayer(
    type='FeatureLayer',
    url='https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_States_Generalized/FeatureServer'
)

vector_tile = EMLayer(
    type='ImageryLayer',
    url='https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer'
)

esri_map = ESRIMap(
    height='700px',
    width='100%',
    basemap='topo',
    view=esri_map_view,
    layers=[vector_tile, esri_layer]
)

context = {
    'docs_endpoint': docs_endpoint,
    'esri_map': esri_map
}

# TEMPLATE

{% gizmo esri_map_view_options %}

EMLayer

class tethys_sdk.gizmos.EMLayer(type, url)

EMLayer objects are used to define map layers for the ESRI Map Gizmo.

type

The ESRI Layer Type (e.g.: FeatureLayer, ImageLayer)

Type

str,required

url

The ESRI Layer WMS url

Type

str,required

Example

# Define ArcGIS FeatureLayer

esri_feature_layer = EMLayer(
    type='FeatureLayer',
    url='http://geoserver.byu.edu/arcgis/rest/services/Alabama_Flood/Flood_45/MapServer/0'
)

# Define ArcGIS ImageLayer
esri_image_layer = EMLayer(
    type='ImageryLayer',
    url='https://sampleserver6.arcgisonline.com/arcgis/rest/services/NLCDLandCover2001/ImageServer'
)

EMView

s .. autoclass:: tethys_sdk.gizmos.EMView