Skip to content

remove added layer from map #275

Open
@amirsamani

Description

hi
I have added a layer to the map with below code and after I want to remove that layer from the map, how can I do this?

        vectorUrl ='http://localhost:7800/asphalt/{z}/{x}/{y}.pbf';

        vectorTileStyling[vectorLayerId] = {
            fill: true,
            fillColor: 'green',
            fillOpacity: 0.1,
            color: 'green',
            opacity: 0.7,
            weight: 2,
            // dashArray: '2, 6',
        }

        var vectorTileOptions = {
            rendererFactory: L.canvas.tile,
            subdomains: '0123',	// 01234 for openmaptiles, abcd for mapbox
            vectorTileLayerStyles: vectorTileStyling
        }

            bandar_asphalt = L.vectorGrid.protobuf(vectorUrl, vectorTileOptions).addTo(MAP);`

Activity

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

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