I'm using react-map-gl to display a Mapbox map in my Next.js app. I want to show a popover when the user hovers over a line segment in the map. Here's my code:
import React from "react";
import Map, {Popup, Source, Layer} from…
I have a table where when I click on a row of the table, I get the content/objects of the row which I am passing to the Dialog component that uses
react-map-gl
to display the item's location based on the xy coordinate.
When clicked it shows the map,…
I have added a token in my react app using the .env file. No matter what I do I still get an error (index.js:1 Error: An API access token is required to use Mapbox GL.)
This is my code:
import mapboxgl from '!mapbox-gl';
import {Marker} from…
I am using react-map-gl and I want to somewhat put a background color outside the polygon that was created. I tried using multiple but it looks like it does not accept multiple instances.
I am able to print the blog array in the console and it includes the object. I want to use the object components by mapping through the id as the key but I am not able to get inside the map function. I was able to use the same map structure in my…
The example on mapbox.com returns nice information on the hovered feature, also the fill-color https://docs.mapbox.com/mapbox-gl-js/example/queryrenderedfeatures/
The fill-color returned looks like this:
"feature": {
"type": "Feature",
…
I've been running into a problem for a few days now that I just simply can't understand. Every time I use Mapbox-gl-js or wrappers like ReactMapGL, I get a CORS error saying The Same Origin Policy disallows reading the remote resource at…
So what I want is for all the clusters and markers to be visible from the start. that is, when entering the page. But that's not the case.
Everything that should be on the map loads completely sporadically. Like when i hit hard refresh some times it…
The problem: The map doesn´t update.
Hello!
I´m trying to make a button that will toggle on/off map clustering. I followed the example here:https://visgl.github.io/react-map-gl/examples/clusters.
I whant to be able to toggle it, like this example on…
Hi I have the following code which I just currently want to print the images out and will style later. It should be printing a picture as it comes across them in the list and printing them alongside its facedown side.
I have changed the way…
I'm developing a web application using Mapbox GL, more specifically, its binding for React, react-map-gl.
One of the planned functionalities for the app is adding markers and connecting them.
However, I'm having trouble connecting markers.
I want to…
Using react 18 and react-map-gl 7.0.11, im not able to load the map on the location of the user.
I am able to get this button on the screen using the GeoLocateControl component
https://i.stack.imgur.com/fBy1y.png
I am trying to pass a prop down to a REACTMAPGL in react, I am calling the method displayMarkers() which returns an array for JSX Elements.
The problem revolves mainly around why I am getting the error in this specific project. I created the…
I have array useState hook which consists of items with className. I want to update className of a single item from that hook. How do I update single value of a useState hook.Of course I am going to put condition before updating .
here is the code…