Questions tagged [mapbox-gl]

A client-side map rendered with implementations in native platforms utilizing OpenGL.

Mapbox GL is an open-source framework and API being developed by Mapbox. Mapbox GL differs from Mapbox as it downloads vector map data and renders the map image on the client.

1207 questions
9
votes
2 answers

Clustering custom html markers with mapbox-gl-js

I'm using the mapbox-gl-js API and I'm using it with react to create some custom markers as follows: let div = document.createElement('div'); let marker = new mapboxgl.Marker(div, { offset: [ -20, 80 ] }); …
Huw Davies
  • 791
  • 7
  • 19
8
votes
2 answers

How to display custom vector tiles on Google Maps

The goal is to display large amount of data on Google Maps. By large amount I mean around 10 millions of segments stored in PostgreSQL database. The segments represent some characteristics of roads, so segments should overlay the roads in base map.…
YTerle
  • 2,606
  • 6
  • 24
  • 40
8
votes
2 answers

Vector tile route finding

Has anyone used either Mapbox or OpenMapTiles vector tiles to find routes from one place to another? It seems to me like those tiles are made for display and don't contain intersection information the way that say Open Street Map does.
dooderson
  • 547
  • 1
  • 9
  • 16
8
votes
3 answers

How to import non-module(!) JavaScript into Polymer 3.0

Polymer 3 uses import to load external Javascript. For example import {GoogleCharts} from 'google-charts'; However, it seems for this to work, the external library should use exports. I am trying to use mapbox-gl.js library. This library, installed…
anneb
  • 5,510
  • 2
  • 26
  • 26
8
votes
5 answers

Mapbox filters based on array

I have the following array: test = ['a', 'b', 'c'] I would like to filter objects on the map if they exist in the array. Is it possible to use this filter with array: mapObj.setFilter("hover", ['all', ["in", "letter", test[0]]]); Or alternately,…
guyyug
  • 897
  • 1
  • 11
  • 23
8
votes
2 answers

Mapbox GL JS: ignore map click event if marker is clicked

I have a marker in the map. I want to change its state when it is clicked and change it back when other place on the map is clicked. The problem is that map.on("click", console.log) is also fired upon clicking the marker. I want to see only the…
dvitonis
  • 263
  • 3
  • 9
8
votes
2 answers

Cause of MapBox GL JS Performance Difference

This question is for someone who understands the internals of MapBox GL JS. I'm using MapBox GL JS to render a geographic map of up to 40,000 polygons, each of which is colored based on the "owner" of that polygon. There are typically many polygons…
jasonpepper
  • 81
  • 1
  • 4
8
votes
1 answer

Mapbox GL setData to update layer with multiple markers

I have a Mapbox GL map with a single layer and multiple markers on that layer, I am trying to update a specific marker, so I am using setData in order to update only one marker but setData will reset the whole layer markers to add only that I am…
Mahmoud Metwally
  • 980
  • 1
  • 10
  • 24
7
votes
3 answers

Adding popups on hovering to custom markers using Mapbox gl js

I'm adopting this example but I need popups to appear on hover not on click. Here is how popups are added now: new mapboxgl.Marker(el, { offset: [0, -25] }) .setLngLat(marker.geometry.coordinates) .setPopup(new mapboxgl.Popup()//add popups …
Anton
  • 453
  • 1
  • 9
  • 20
7
votes
1 answer

How to color individual polygons drawn with mapbox-gl draw?

I'm reading a GeoJSON file and importing the polygons (and other stuff) into mapbox-gl draw using draw.set(geoJSON). How do I color individual polygons by an attribute in the properties of a feature. Example: { "type": "FeatureCollection", …
Shravan
  • 73
  • 1
  • 4
7
votes
2 answers

Multiple markers - Same coordinates

I'm having some troubles trying to display 2 different markers placed at exactly the same coordinates. The case is: we are displaying stores, and some of them are placed at the same building (ie. a mall), so, they are different stores but shares the…
Claudio Novoa
  • 93
  • 2
  • 5
7
votes
2 answers

Deck.gl how to show popup onClick

Setup: Basic react app using react-map-gl to show a map with a deck.gl ScatterplotLayer over the top to visualise the data Goal: 1) To show points on a map as circles of a given radius and colour. 2) When a user clicks on a circle, a tooltip/popup…
Naadof
  • 459
  • 5
  • 16
7
votes
1 answer

How to drag a polygon in the same fashion as the dragging a point mapbox-gl-js example?

I have a geojson polygon adding to the map with the click of a button. I also have the style of the polygon changing on the mousedown event on the geojson and the x/y coord pairs (the geojson geometry) printing to the console accessing it through…
7
votes
3 answers

How to set marker Z-index on MapBox Android?

My app shows a user marker. Basically, the user marker shows where the current user is on the map but I also have other markers placed on the map. In the end, it covers up my user marker. I want my User Marker to be on the top of the map. I want it…
Neon Warge
  • 1,817
  • 6
  • 29
  • 53
7
votes
1 answer

Adding custom markers to the mapbox gl

I would like to add a custom marker to my map. I am using a mapbox gl script. The only documentation that I found related to this topic is this one https://www.mapbox.com/mapbox-gl-js/example/geojson-markers/. I tried to customize given example…
Aiwatko
  • 385
  • 2
  • 6
  • 17
1 2
3
80 81