razorness/vue-maplibre-gl

Need documentation for using Raster Tiles Sources

aymux opened this issue · 3 comments

aymux commented

After spending some time reading the source code, i cannot get a clue on how to use the mgl-raster-source component.

I don't understand either the props needed ( url - tiles - scheme etc )

Please could you give example or doc on how to use It ?

Thanks for your time ^^

Hey @aymux, the components basically get just mapped to their corresponding style specification and bound to the map instance.

Take a look at maplibre-gl documentation for map-tiles and the style specification.

You should be able to use MglRasterSource and MglRasterLayer in a way like MglGeoJsonSource in this example:

<mgl-geo-json-source source-id="geojson" :data="geoJsonSource.data">
<mgl-line-layer
v-if="geoJsonSource.show.value"
layer-id="geojson"
:layout="geoJsonSource.layout"
:paint="geoJsonSource.paint"
@mouseenter="onMouseenter"
/>
</mgl-geo-json-source>

In this way, you are able to combine different sources to display f.e. GeoJSON over raster/vector map tiles or partially transparent raster tiles over vector tiles.

Maplibre needs a source definition and a layer definition.

aymux commented

Thank you i managed to inject style directly on main component mgl-map with mapStyle props

That's also fine.