Questions tagged [maplibre-gl]

Questions about MapLibre GL, a community-governed collection of open source mapping libraries.

web site: https://maplibre.org/

About:

MapLibre is a community-governed collection of open source mapping libraries. Which believes in building and maintaining freely licensed libraries that enable developers worldwide to build vital tools using maps.

Motivated by the 2020 transition to proprietary licensing for Mapbox GL JS, the initial libraries are forks of the Mapbox GL ecosystem—for the web and mobile platforms.

Goal is to continue building on the foundation of Mapbox’s original open-source code under the BSD license without tracking end-users.

81 questions
1
vote
0 answers

Mapbox/Maplibre GL JS querySourceFeatures not working correctly

I have two vector tile sources A and B and for each one layer. Both sources are loaded initially, the layers are set to not visible and can be toggled to be visible. When a feature from source A is selected on the map, I want to query features from…
Robbert
  • 109
  • 5
1
vote
0 answers

Side-By-Side Two Maps using the react-map-gl and maplibre-gl without Token

I have the code ready in ReactJS. The code is specifically for generating two maps side by side in a single screen using the react-map-gl and maplibre-gl libraries. Both maps are moving individually. I need to synchronize both maps. Both maps should…
Rana Hamza
  • 11
  • 2
1
vote
1 answer

Mapbox GL/Maplibre GL 'to-number' fallback if null and not 0

As the documentation states, in the style specification expressions, the to-number expression converts null values to 0 as intended behavior. For my use case, null and 0 mean different things, as 0 is a valid value. Here is and example of how I'd…
walking_the_cow
  • 461
  • 4
  • 16
1
vote
1 answer

Combining MapLibre GL JS with ThreeLoader3dTiles

So the below code works to show a Cesium 3d tiles model. This code works. It creates a basic scene, loads the cesium model and adds it to the scene. import { useEffect, useRef, useState } from 'react'; import * as THREE from 'three'; import {…
John
  • 346
  • 1
  • 11
1
vote
0 answers

Serving multiple mbtiles that have the same style

I'm generating a few mbtiles with TileMaker, using the exact same configuration: test1.mbtiles test2.mbtiles Those tiles have a source-layer=poi. I would like to serve them, without merging them beforehand (as I'm planning to have a…
1
vote
2 answers

Expression to get value from nested objects

I am struggling to write a style expression in Mapbox/Maplibre GL JS to set a circle-radius based on a value in my geojson. I have many features, whose properties look something like this: "properties": { "name": "Site A", "type": "Bucket…
1
vote
2 answers

React-Map-GL: How to make hovered marker appear on top?

I have a map with different markers and as much as I am aware the markers are rendered in the order they appear which means marker 3 is on top of marker 1 and 2. I am using React Map Gl with mapblibre-gl and React(typescript) I'm fine with that, but…
carlo711
  • 645
  • 1
  • 6
  • 11
1
vote
0 answers

DeckGL and MapLibre Not Working Correctly

We are wanting to migrate away from Leaflet for one of our projects due to the amount of data we will need to render. I am trying to make DeckGL and MapLibre work with React JS but haven't had any luck so far. The kicker is that the client will be…
1
vote
1 answer

Turf.js along method is giving wrong results

I tried to use truf js and plot the route and i am getting horizontal line along with route. I dont know what else to do as it works for other types of routes. for (let i = 0; i < lineDistance; i += steps) { const segment =…
hasanac
  • 168
  • 3
  • 13
1
vote
0 answers

MapLibre - Trigger geolocation without zooming to location

Is there any way to start the geolocate service without the map zooming to the the geolocation position one the device has a position (as Google Maps does)? Setting fitBoundsOptions to empty doesn't seem to help.
Andrew
  • 569
  • 4
  • 9
1
vote
0 answers

Rendering Mapbox Vector Tiles using maplibre-gl-js

I'm trying to render Mapbox Vector Tiles using maplibre-gl-js library with the following code: this.map = new maplibregl.Map({ container: this.element, style: 'mapbox://styles/mapbox/light-v10' }) It works, but all Mapbox requests are listed in…
1
vote
0 answers

How to alias node_module in NextJS + TypeScript setup?

We have NextJS + TypeScript setup and were looking to integrate Maplibre, which is basically a fork of Mapbox BSD. Also there's this nice wrapper around Mapbox - React Map GL, however it is not designed to work with Maplibre. Workaround is to create…
jayarjo
  • 16,124
  • 24
  • 94
  • 138
1
vote
1 answer

mapbox-gl Adding multiple geojson layers with distinct IDs returns error

I am adding geojson sources from multiple datasets via an internal URI. My addSources() function loops through ds_list, an array of IDs needed to make each call. If I fetch each dataset in a map.addSource() call, this works (example #1), but then I…
kgeo
  • 412
  • 5
  • 19
1
vote
1 answer

How to use maplibre-gl with react-map-gl

I am currently taking my first steps in using maplibre together with react-map-gl. I have read the documentation about how to use a fork of mapbox. I have adapted webpack-config. I use a create-react-app project with rewind. This is my…
astridx
  • 6,581
  • 4
  • 17
  • 35
0
votes
0 answers

Is there a way to color raster tile layer in Maplibre?

Tried the below code but the browser crashes when the raster tile dimensions are large due to the number of iterations in the nested for loop. Mapbox recently released a feature to colorise raster tile layer but maplibre hasn't released yet. The…
Manish
  • 67
  • 1
  • 8