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
7
votes
0 answers

MapLibre GL JS with terrain layer: How to pin a horizontal plane to a specific altitude?

I based some code on the "Add a 3D model" example at maplibre.org in order to draw only a horizontal plane on a map which uses setTerrain to add a terrain layer. My intention is to draw a couple of semitransparent layers at a given heights above sea…
Daniel F
  • 13,684
  • 11
  • 87
  • 116
5
votes
2 answers

How to use MapLibre GL Js in react native

I am looking for a mean to use OpenStreetMap data in my react native application. During my last reasearches, I found MapLibre, which is free option based on MapBox GL old versions. The matter I am facing is that I am not able to find any plugin to…
4
votes
0 answers

Load markers dynamically with react and mapbox gl or maplibre gl

I am learning React. I want to display a map on which markers are dynamically shown and hidden. This works. I use Maplibre GL, which is a fork of Mapbox GL and the handling is the same. Unfortunately, however, when the markers are changed, the map…
astridx
  • 6,581
  • 4
  • 17
  • 35
3
votes
2 answers

Mapbox warning setAccessToken requires setWellKnownTileServer for MapLibre Blank Screen - React Native expo

App.js import { StatusBar } from 'expo-status-bar'; import { StyleSheet, Text, View } from 'react-native'; import MapboxGL from '@rnmapbox/maps'; MapboxGL.setAccessToken('TOKEN'); export default function App() { return (
SR JOY
  • 31
  • 4
3
votes
1 answer

How to show/hide labels according to zoom levels with expressions in mapbox-gl-js / maplibre-gl?

I have a point layer with an icon, and I would like to display the labels in addition to the icon only from a certain zoom level (9). I would like to avoid creating a dedicated label layer. Looking at the expression documentation, Stet and Zoom…
Oliver
  • 81
  • 1
  • 7
3
votes
1 answer

Load local .mbtiles with maplibre-gl-js

I want to load a local .mbtiles (with vector tiles) with maplibre-gl-js (in a Cordova app if it's important to know). As far as I understand, I should use the addProtocol method. That works fine as I get my console.log, but I don't know how to load…
Hollul
  • 319
  • 4
  • 16
2
votes
1 answer

Mapbox/MapLibre how to use custom hash to show parameters in URL?

Mapbox and MapLibre both provide an option for the map object to show parameters in the URL. Setting this "hash" option to true shows the center (lat, lon), zoom, bearing and pitch information in the URL. It can be set like this: var map = new…
Robbert
  • 109
  • 5
2
votes
0 answers

How to pass ThreeJS renderer to MapLibre GL JS

I want to make MapLibre work with other ThreeJS elements, allowing me to add various other components to the MapLibre. I want to be able to: initialise my scene+ renderer + camera, etc. Initialise MapLibre GL adding it to the threeJS…
John
  • 346
  • 1
  • 11
2
votes
2 answers

How to style a map container with CSS using ReactJS

My map is implemented using MapLibre GL, but this issue also happens with Google Maps API or Mapbox GL. I have the following ReactJS component: import React, { useRef, useEffect } from "react"; import maplibregl from "maplibre-gl"; import map_style…
Fabian
  • 229
  • 3
  • 8
2
votes
1 answer

Map{box,libre} expression syntax for dynamic property value

I am stuck trying to write an expression that evaluates to a number for my paint.circle-radius property. If I set something like this, to use the radius feature property, it works fine: "circle-radius": { property: "radius", type:…
dmarr
  • 491
  • 1
  • 5
  • 15
2
votes
1 answer

maplibre reduce xyz vector tile requests

I'm fairly new to maplibre/mapbox. I've about 40,000 polygons in my PostGIS database. That's just too much data to load it all at once into the maplibre map as a geojson source when the webapp starts. Thus I implemented a simple rest server which…
Humppakäräjät
  • 1,156
  • 2
  • 13
  • 17
2
votes
1 answer

maplibre-gl-js : load offline (local) glyphs, sprites and mbtiles - HTML website

I'm currently coding a simple HTML page with embedded Javascript to visualise a local mbtiles, including local glyphs and sprites. The html index.html is : ...
2
votes
0 answers

New AWS Amplify withAuthenticator error related to maplibre-gl-js-amplify

NPM recommended I upgrade aws-amplify to the latest version yesterday, which I did. I then started a new React project in a dev environment (using "npm start"). The package.json file indicates these dependency versions: "dependencies": { …
2
votes
0 answers

mapbox GL JS - pass source data to custom layer

I've added some quads with custom shaders to map (Examples are here and here). I need to pass data from my source to shader. Tutorials says that I can just pass 'source': 'point', to layer class constructor. Is it possible to pass source data to…
microspace
  • 386
  • 1
  • 5
  • 18
1
vote
1 answer

Adding MapLibre to a new Android project is not working

I am following the documentation to add the MapLiber library to a new Android project https://maplibre.org/maplibre-native/docs/book/android/getting-started-guide.html The Gradle sync seems to be working ok, but I get this error when trying to…
Mariksel Azemaj
  • 530
  • 7
  • 18
1
2 3 4 5 6