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();
3
  • 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
    Commented Aug 8, 2019 at 15:08
  • Please edit your answer with additional code, don't put it into comments.
    – TomazicM
    Commented Aug 8, 2019 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/[email protected]/dist/leaflet.js"</script> can you provide your entire html or all relevant parts of it?
    – MrXsquared
    Commented Aug 8, 2019 at 22:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.