Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector Tile Layer Basemap Dropped During Template Creation #1255

Open
shoe913 opened this issue Oct 4, 2023 · 7 comments
Open

Vector Tile Layer Basemap Dropped During Template Creation #1255

shoe913 opened this issue Oct 4, 2023 · 7 comments
Assignees
Labels

Comments

@shoe913
Copy link

shoe913 commented Oct 4, 2023

It appears that basemap with custom effects are getting dropped during template creation.

The item below was created from a map using a vector tile basemap with custom display properties. When created those, properties were lost.

https://localdeployment.maps.arcgis.com/home/item.html?id=52721adac6844466b027649d3a575e47

Original Basemap Code:
image

Code Copied into Solution Template:
image

This is could be related to #46

@MikeTschudi
Copy link
Member

Webmap 86ca7f552f1a49329fcb259201d6df54 contains Vector Tile Service basemap "Community Map" (273bf8d5c8ac400183fc24e109d20bcf). Because the VTS doesn't contain the typeKeyword "Vector Tile Style Editor", its style is excluded as specified in #46 (comment).

@chris-fox
Copy link
Collaborator

@MikeTschudi, I think it is the correct logic that we are not templatizing it in this scenario as per #46. However, I don't think we should be changing the definition of the original basemap. I would expect the definition of the basemap in the template to be the same as it was in the original web map. The definition that it is changed to will result in a broken basemap in the deployed WebMap as we don't have any reference to any layers in the baseMap object.

            "baseMap": {
                "baseMapLayers": [],
                "title": "Community Map"
            },

@MikeTschudi
Copy link
Member

@chris-fox, this makes sense; thank you.

The current implementation discards any VectorTileLayers that don't have the "Vector Tile Style Editor" typeKeyword.

Webmap 86ca7f552f1a49329fcb259201d6df54 has

"baseMap": {
    "baseMapLayers": [
        {
            "id": "18aa9f7c016-layer-12",
            "title": "Community",
            "itemId": "273bf8d5c8ac400183fc24e109d20bcf",
            "layerType": "VectorTileLayer",
            "effect": [
                {
                    "type": "grayscale",
                    "amount": 0.7
                }
            ],
            "styleUrl": "https://www.arcgis.com/sharing/rest/content/items/273bf8d5c8ac400183fc24e109d20bcf/resources/styles/root.json"
        }
    ],
    "title": "Community Map"
},

Should we instead discard just the styleUrl if the typeKeyword is missing, thus handling the layer like other layers?

"baseMap": {
    "baseMapLayers": [
        {
            "id": "18aa9f7c016-layer-12",
            "title": "Community",
            "itemId": "273bf8d5c8ac400183fc24e109d20bcf",
            "layerType": "VectorTileLayer",
            "effect": [
                {
                    "type": "grayscale",
                    "amount": 0.7
                }
            ]
        }
    ],
    "title": "Community Map"
},

@chris-fox
Copy link
Collaborator

@MikeTschudi, we need to keep the styleUrl property otherwise the layer will fail to load. Basically we just want it to be identical to before and continue to point to the original item and url that was referenced in the web map.

@MikeTschudi
Copy link
Member

So we no longer need to check for the "Vector Tile Style Editor" typeKeyword?

Push the layer as a dependency and templatize the URL to the style resource all the time?

@chris-fox
Copy link
Collaborator

No, I am saying if you check the item and it doesn't have the typekeyword than you don't push the layer as a dependency or templatize the url. But you also shouldn't change anything about the original layer. The json definition of the basemap layer should be pushed to the template unchanged, no properties removed or modified.

For example this is the json definition in the original basemap and the item id '273bf8d5c8ac400183fc24e109d20bcf' does not have the typeKeyword.

"baseMap": {
    "baseMapLayers": [
        {
            "id": "18aa9f7c016-layer-12",
            "title": "Community",
            "itemId": "273bf8d5c8ac400183fc24e109d20bcf",
            "layerType": "VectorTileLayer",
            "effect": [
                {
                    "type": "grayscale",
                    "amount": 0.7
                }
            ],
            "styleUrl": "https://www.arcgis.com/sharing/rest/content/items/273bf8d5c8ac400183fc24e109d20bcf/resources/styles/root.json"
        }
    ],
    "title": "Community Map"
},

This is the json I would expect in the resulting template:

"baseMap": {
    "baseMapLayers": [
        {
            "id": "18aa9f7c016-layer-12",
            "title": "Community",
            "itemId": "273bf8d5c8ac400183fc24e109d20bcf",
            "layerType": "VectorTileLayer",
            "effect": [
                {
                    "type": "grayscale",
                    "amount": 0.7
                }
            ],
            "styleUrl": "https://www.arcgis.com/sharing/rest/content/items/273bf8d5c8ac400183fc24e109d20bcf/resources/styles/root.json"
        }
    ],
    "title": "Community Map"
},

@MikeTschudi
Copy link
Member

Got it--thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants