razorness / vue-maplibre-gl

Vue 3 plugin for maplibre-gl-js
77 stars 21 forks source link

Need documentation for using Raster Tiles Sources #51

Closed aymux closed 1 year ago

aymux commented 1 year ago

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 ^^

razorness commented 1 year ago

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: https://github.com/razorness/vue-maplibre-gl/blob/fde5c521626ec000fd3363e0f1e0485f8ee52a41/dev/serve.vue#L28-L36

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 1 year ago

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

razorness commented 1 year ago

That's also fine.