Questions tagged [react-mapbox-gl]
11 questions
4
votes
2 answers
How to solve that A valid Mapbox access token is required to use Mapbox GL JS?
Here is my code and the result is none.
import React, {Component} from 'react';
import ReactMapBox from 'react-map-gl';
import 'mapbox-gl/dist/mapbox-gl.css';
class MapExample1 extends Component {
state = {
viewport: {
…

Royce
- 41
- 1
- 2
2
votes
0 answers
React-mapbox-gl: Unable to hook into Mapbox API for adding 3D terrain to a map
I am using react-mapbox-gl in my next application, according to the documentation:
onStyleLoad: (map, loadEvent) => void called with the Mapbox Map
instance when the load event is fired. You can use the callback's
first argument to then interact…

Antonio Pavicevac-Ortiz
- 7,239
- 17
- 68
- 141
1
vote
0 answers
How to create two layered MbTiles for large featured files using Tippecanoe?
My requirement is to process 3+ millions of geojson data(Polygon feature) and visualize it on Map in a way that it should show Polygons on the highest zoom level(individual entity) and clusters(in form of bubbles/circles may be) on the lower zoom…

bharti godwani
- 11
- 2
1
vote
0 answers
react-map-gl circle 10KM radius
According to the documentation this is how you add a point to React-Map-GL however I am needing to make the radius KM based not pixel based.
I am wondering how this could be done?
import * as React from 'react';
import Map, {Source, Layer} from…

RussellHarrower
- 6,470
- 21
- 102
- 204
0
votes
0 answers
Load offline maps from mbtiles file and render it in react native android app
I need to display an offline map in a mobile application for Android on React Native.
I have a generated mbtiles file. Tried different libraries.
Tell me what I'm doing wrong? Which library is better to use? If it is possible give refer to code…

LocalUser
- 101
- 1
0
votes
1 answer
Map marker is not rendering using Mapbox GL JS
I am trying to render markers using Mapbox GL JS in a React / Next application. The map is rendering, but the markers are not. Here is my code:
import { useEffect, useRef } from "react";
import { Container, Box, Button } from '@mui/material';
import…

Vaibhav Verma
- 937
- 1
- 8
- 25
0
votes
1 answer
Is there a way to avoid overlapping of markers and labels in react mapbox-gl?
How to avoid marker and label overlapping in mapbox gl using react?
Am trying to avoid the overlap of labels when the labels are very close to each other in both zoom-in and zoom-out conditions.
Is there any way that we can overcome this issue in…

Inspond
- 13
- 4
0
votes
0 answers
Why polygon does not show in react-map-gl?
I have a polygon data in my map that I used react-map-gl for showing the map; I used Source and Layer to show my polygon but it shows nothing.
here is my codes, what is my problem?
const geojson = {
type: 'FeatureCollection',
features: [
…

N.SH
- 616
- 7
- 20
0
votes
0 answers
Adjusting Icon Size in Mapbox Based on Zoom Level and Pitch
I am a beginner with Mapbox. While the size of objects such as buildings on the map is changed by the zoom level and pitch, the regular icons do not change their size, making them difficult to see when there are many icons.
Therefore, I am trying to…

秋山諒次郎
- 1
- 2
0
votes
0 answers
How do I get the ReactMapGl Popup to work
I am trying to get the popup that will display a specific message when I click on the marker, but it is not working for some reason. I can log the coordinate from the clicked function, but no popup. Here is my code:
import React, {useEffect,…

Tombrown Anuma
- 9
- 3
0
votes
1 answer
Is there a draw event for a single click of a feature in mapbox-gl-draw?
I'm playing around with react-map-gl and mapbox-gl-draw to draw polygons on to my map
I'm wondering if there is a better way to get the details of a selected feature on click, rather than using the draw.selectionchange event? This event handles…

Saterz
- 33
- 5