Skip to content

RasterLayer fails without URL #80

@duebbert

Description

@duebbert

I have a raster layer that I want to add without a TileJSON URL, so I'm loading it like this:

<MglRasterLayer
                :sourceId="layer.id"
                :layerId="layer.id"
                :minZoom="layer.zoom_min"
                :maxZoom="layer.zoom_max"
                :tiles="[layer.url]"
                :tileSize="256"
                :attribution="layer.attribution"
/>

This fails because mapbox-gl sees a url property on the source object. It's undefined but this seems to trigger a validation error in mapbox-gl and it ignores the tiles parameter then.

I believe the problem is in src/components/layer/RasterLayer.js line 47:

let source = {
        type: "raster",
        url: this.url,
        tileSize: this.tileSize
};

The url property should only be defined if this.url has been defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions