Skip to content
Advertisement

Tag: leaflet

Leaflet geoman “Button with this name already exists” error when creating a new button in react

I am trying to create a custom button for arrows in the drawing tool of leaflet-geoman. The idea was to work with the copyDrawControl function, and to use Line as a model to make Polylines with arrow tips. I wrote a code mostly inspired from this demonstration https://codesandbox.io/s/394eq?file=/src/index.js and modified it for my goals. Here is the code : When

Importing leaflet into module from cdn with typescript support

I’m trying to import leaflet into a javascript module with typescript support but can’t get it to work. I’ve installed @types/leaflet and have tried to following: import ‘https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.8.0/leaflet.js’ This works fine in the browser but typescript gives the following error: ‘L’ refers to a UMD global, but the current file is a module. Consider adding an import instead.ts(2686) (I call

How can I use leaflet-polylinedecorator with a vue app

I have a Vue 2 sample project at https://github.com/ericg-vue-questions/leaflet-test This is a simple import issue for my code that I am not sure how to handle. A couple of things I have tried are to modify the code to do: but this results in a build error: To the index.html, I also tried adding: but that results in the runtime

leaflet load markers and pop ups from external file

I am currently building a leaflet map where I will implement a bunch of markers with popups. I want all of my markers and popups stored in an external file to keep the code as clean as possible. My question is, how can I achieve this? Do I create a geojson file with the markers and popups and if so,

How to reset a leaflet map after a case in JS

Hi, i have the following problem: I have a map in leaflet linked to a change function in jquery, depending on the ID that I receive in the “select” of the previous query, the case is entered below in JS: At the moment of choosing another case (Stored in a select in HTML ) the data that the first case

How to modify href property on Leaflet 1.8 Popup?

Is there a way to modify the href property of the close button on a Leaflet 1.8 popup? I can’t find anything in the documentation for it. Answer Unfortunately there is indeed no API in Leaflet for that specifically. However you can easily customize Leaflet behaviour by modifying how its classes behave. In your case, you would override L.Popup._initLayout method.

Advertisement