Skip to main content

All Questions

Tagged with
7 votes
2 answers
11k views

Next.js dynamic import with server-side-rendering turned off not working on production build

I'm currently building a site using the leaflet package. This package however needs the window object. That's why I'm importing a component made with leaflet as a dynamic component with ssr turned off....
Mr Brickstar's user avatar
7 votes
0 answers
3k views

React Leaflet.draw: How to create draw functions with standard buttons without using the react-leaflet toolbar, however, have it written in "React"

how can I create custom buttons that reside on a leaflet map in a separate control box to create "Polylines", "Polygons" or a "Marker" which will all be on separate ...
robert's user avatar
  • 71
6 votes
3 answers
6k views

React Leaflet - Marker image fails to load

Issue I'm using leaflet v1.7.1 and react-leaflet v3.0.5 in my React project. When I try out the setup example in React Router's "Setup" documentation page, the marker icon becomes a broken ...
AnsonH's user avatar
  • 2,948
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....
Vincent Audebert's user avatar
6 votes
1 answer
10k views

How to use Leaflet Routing Machine with React-Leaflet 3?

The old way of doing things in react-leaflet 2.8.0 was to use MapLayer and withLeaflet. But now in react-leaflet: MapLayer and withLeaflet are deprecated as of version 3. I'm trying to grasp the ...
lys's user avatar
  • 1,009
6 votes
5 answers
9k views

close popup react-leaflet after user click on button in popup

So basically want to make custom close for react-leaflet Popup component, seams that is not a big problem to do with native API leaflet but with react component from react-leaflet I can't find the ...
Kibo_007's user avatar
  • 171
6 votes
2 answers
5k views

An example of using the 'react-leaflet' new useLeaflet() hook?

I'm trying to get a reference to the leaflet object using the hook, so I can query the new map boundaries on different events (like Map.getBoundaries()). I'm pretty new to reac-leaflet, and this ...
bitstream's user avatar
  • 1,118
6 votes
1 answer
2k views

React Leaflet map rendering all over the page

I am fairly new to React and Leaflet. I have gotten Leaflet working just fine in a simple HTML page. So now I am trying to make a more dynamic site by using React. The problem I am running into is I ...
Patrick's user avatar
  • 3,421
6 votes
1 answer
5k views

How to select an area in react leaflet

I am using react leaflet to interact with leaflet map. Now I want to use a leaflet plugin called leaflet-area-select to select an area on the map and get current long lat of the rectangle selected. ...
Nguyen Tu's user avatar
  • 159
6 votes
0 answers
2k views

Leaflet map with react-leaflet-markercluster cluster spiderfy's or closes onClick

I have a Leaflet map in React using react-leaflet and react-leaflet-markercluster Clustering seems to work beautifully, but if I click on one of the cluster CircleMarker or Tooltip it opens a new ...
 Rolo Tomasi's user avatar
6 votes
3 answers
4k views

enable react-leaflet to use be usable offline

I have been using the react-leaflet library, so far it worked well. Now I wanted the site to pre-load as much of the tiles as possible so that the web-app(also a PWA) could be used w/o internet. I ...
Theo's user avatar
  • 2,012
5 votes
3 answers
9k views

react leaflet mouseover / hover popup

Hej! I want my popup to open via a hover/mouseover. I tried the recommended but it still only opens on click. Does anyone have an idea what is missing? Any help is appreciated! import React from "...
piah's user avatar
  • 158
5 votes
3 answers
8k views

react-leaflet create a custom components

I would like to create a custom component with react-leaflet that shows the actual position (x,y) of the mouse, but I don't know how to create it. I found react-leaflet-control but it seems that it is ...
William Varlet's user avatar
5 votes
2 answers
11k views

Missing Leaflet Map Tiles when using react-leaflet

I am using the simple example from leaflet-react in a barebones create-react-app app. Problem: The map tiles do render, but there is always 1-2 rows of map tiles that do not render (grayed out). ...
Nyxynyx's user avatar
  • 62.9k
5 votes
2 answers
7k views

Add text inside leaflet rectangle

I'm using the following code to create a rectangle in the leaflet map. const rectangles = [[51.49, -0.08], [51.5, -0.06]] <Rectangle key={key} bounds={rectangle} color="green"> </...
Kokulan's user avatar
  • 1,346

15 30 50 per page
1 2
3
4 5
74