Skip to content

Can't load Web Maps or Feature Layers #2197

Open
@torbenal

Description

@torbenal

Hello!

I'm working with the arcgis API for Python, but I'm having some serious issues getting it to work as expected.

I'm using portal-tier authentication.

First I try loading a Web Map directly. That gives me the following error.

from arcgis.gis import GIS

portal = GIS(url="https://maps.xyz.com/portal", username="xyz", password="xyz")
web_map_id = 'xyz'
web_map = portal.content.get(web_map_id)
portal.map(web_map)

============
ValidationError: 3680 validation errors for Webmap
operationalLayers.5.AnnotationLayerArcGISAnnotationLayer.layerType
  Input should be 'ArcGISAnnotationLayer' [type=literal_error, input_value='ArcGISMapServiceLayer', input_type=str]
    For further information visit https://errors.pydantic.dev/2.4/v/literal_error
operationalLayers.5.CatalogLayerCatalogLayer.layerType
  Input should be 'CatalogLayer' [type=literal_error, input_value='ArcGISMapServiceLayer', input_type=str]
    For further information visit https://errors.pydantic.dev/2.4/v/literal_error
operationalLayers.5.CSVLayerCSV.layerType
  Input should be 'CSV' [type=literal_error, input_value='ArcGISMapServiceLayer', input_type=str]
    For further information visit https://errors.pydantic.dev/2.4/v/literal_error
operationalLayers.5.DimensionLayerArcGISDimensionLayer.layerType
...
  Field required [type=missing, input_value={'id': 911, 'layerDefinit...efaultVisibility': True}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.4/v/missing
operationalLayers.5.LinkChartLayerLinkChartLayer.layerType
  Input should be 'LinkChartLayer' [type=literal_error, input_value='ArcGISMapServiceLayer', input_type=str]
    For further information visit https://errors.pydantic.dev/2.4/v/literal_error

Subsequently, I tried starting with an empty map, and loading Feature Layers directly

from arcgis.layers import Service

layers = Service(
    "https://xyz.com/arcgis/rest/services/xyz/xyz/FeatureServer"
)
m = portal.map()
m.basemap.basemap = 'satellite'

for lyr in layers.layers:
    m.content.add(lyr)

m.center = [xyz, xyz]
m.zoom = 30

That just outputs the basemap, with no layers to be seen.

Printing layers gives the following

<FeatureLayerCollection url:"https://xyz.com/arcgis/rest/services/xyz/xyz/FeatureServer">

Is this maybe a permission issue? I have no other ideas left. I've followed the guides in the documentation.
Also, this is all on version 2.4.0

Cheers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions