All Questions
1,097
questions
1
vote
1
answer
1k
views
plot lines to leaflet map
I have a working leaflet map where the location is shown real time. The lat and long value comes per second and the map is shown based on that values which changes everytime. Now i want to show the ...
1
vote
1
answer
587
views
How to request new tiles in TileLayer (React Leaflet) every 30min?
This is what I have:
const RL = require('react-leaflet');
var Map = RL.Map;
var TileLayer = RL.TileLayer;
<Map
zoom={14}
zoomSnap={0}
style={{height: "100%"}}
ref={(map) => { this.map =...
1
vote
1
answer
2k
views
How to implement a tile source to mapbox-gl
I am switching over from react-leaflet to mapbox-gl and have a question about a propriety tile service I am using for spatial data. The api has little documentation. They offer 4 different ways of ...
0
votes
1
answer
957
views
Leaflet with Webpack: error in css-loader
If you are trying to import Leaflet CSS within a project using Webpack
require('leaflet/dist/leaflet.css');
and is having this error:
ERROR in ./~/css-loader!./~/sass-loader/lib/loader.js!./~/...
6
votes
3
answers
2k
views
React Router Link doesn't work with LeafletJS
Versions:
react-router-dom 4.1.1
react-router-redux 5.0.0-alpha.4
react-leaflet 1.1.3
leaflet 1.0.3
Steps to reproduce
I create a leaflet map. In which I add some markers. These markers have popups....
0
votes
1
answer
336
views
How to obtain proper React key for Marker component?
When using react-leaflet and rendering e.g. several Marker components from array of latlons, one ends up with e.g.:
latlons.map((lat, lon, i) => <Marker key={i} position={L.latLng(lat, lon)} /&...
0
votes
1
answer
1k
views
Integrate Leaflet.Polyline.SnakeAnim with react-leaflet
I'm wondering how I might integrate the Leaflet.Polyline.SnakeAnim (https://github.com/IvanSanchez/Leaflet.Polyline.SnakeAnim) and react-leaflet (https://github.com/PaulLeCam/react-leaflet) Leafletjs ...
1
vote
1
answer
2k
views
Wrapping react-leaflet Map componet in <div> tag makes it disappear
I am attempting to add a sibling <DeviceControls/> component alongside my <MapContainer/> component. But when when I do so the OpenStreetMap / Leaflet map disappears from the DOM and all ...
5
votes
1
answer
6k
views
Leaflet error: clearLayers is not a function
I'm using a Leaflet offline map with React where I manually load in a countries.js GeoJSON file with every country in the world. I then conditionally color each country depending on data received from ...
3
votes
1
answer
9k
views
How do I force leaflet to update the map?
I'm running into issues as I am using Leaflet together with React, the issue being that Leaflet wants to control the DOM rendering as well, as far as I've researched.
Right now, the countries will ...
0
votes
1
answer
933
views
Leaflet w/ React: Individual country color won't re-render when this.props updates, only when mouse-over happens?
I have managed to make a Leaflet map where the color of each country changes dependent on an input I receive as this.props.data in this specific React component.
It will correctly display the ...
17
votes
3
answers
40k
views
React Leaflet: Add markers dynamically
How to add markers dynamically to React-Leaflet maps?
I want to add new markers when user clicks on map. And I cannot get it work.
import React, { Component } from 'react'
import { render } from '...
0
votes
1
answer
502
views
How do I add a data property to an offline leaflet map from react props?
I'm using Leaflet as an offline map for a website. Basically, I am mapping the countries by importing them from a big(13.000 line) javascript file a la this codepen: http://codepen.io/dagmara223/pen/...
0
votes
0
answers
1k
views
How to add custom markers to mapbox-gl js?
I am trying to add markers in a map using mapbox gl. I checked mapbox gl example but they have set of default icons predefined in there style. I want to add my custom markers and their styling. And I ...
57
votes
7
answers
99k
views
Leaflet: Map container not found
I have the below react class which fetches the geolocation through the browser.
I am mapping a leaflet map. I want to geolocation to be an input to the setView, for such that the map "zooms" into the ...