0

I trying to add a leaflet control window to my map, but i get an error in the console of browser. The error is in console is:

Uncaught ReferenceError: L is not defined
at L.Control.Window.js:1
Uncaught TypeError: L.control.window is not a function
at visor.js:16

I copied the folder of plugin to my public html, and added the url to css and js file of plugin in my index.html.

My code is:

var win = L.control.window(mapa, {title: 'Hello world!', content: 'This is my first control window.'})
    .show();
  • This simply means that Leaflet library is not loaded because it's not where you are referencing it in your `<script src=... ></scipt> statement. – TomazicM Aug 8 at 15:08
  • Please edit your answer with additional code, don't put it into comments. – TomazicM Aug 8 at 15:24
  • 1
    "L is not defined" looks like you did not add leaflet to your html site. E.g. <script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js"</script> can you provide your entire html or all relevant parts of it? – MrXsquared Aug 8 at 22:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.