GithubHelp home page GithubHelp logo

phloose / leaflet-layervisibility Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 5.0 697 KB

Change the visibility of L.Layer and L.LayerGroup instances

License: MIT License

JavaScript 85.70% HTML 14.30%

leaflet-layervisibility's People

Contributors

phloose avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

leaflet-layervisibility's Issues

Properties of undefined

Hello I am trying to use the hide and show functions of the library but when I load the library I get this error and also when I try to use the property that I need I get an error in the geojson that the property does not exist.

attached evidence of the errors.

Screenshot_1

Screenshot_2

dont work leaflet 1.9.0

In version 1.9.0 of leafltet when you want to hide or show the layers it marks error when used in a geojson marking that it is not a function.

Attached evidence.

image

show() Invalid method .

I created a layer group
Then add the geojson layer
First hide the geojson layer
The geojson layer is displayed again
The show method is invalid
I read the source code
It is found that the loop changes the display attribute of SVG
But the map is still display: none

undefined context._shadow" error

I am trying to use your leaflet plugin but am getting an "undefined context._shadow" error(details below) when trying to hide or show a leaflet Marker.

Cannot figure out what I am doing wrong!

I am using Leaflet v1.7.1
Browsers tested : Microsoft Edge(Version 98.0.1108.43) and Firefox(v96.0.3)

<script src="lib/leaflet/leaflet.js"></script> <script src="https://unpkg.com/leaflet-layervisibility/dist/leaflet-layervisibility.js"></script>

// JAVASCRIPT code
eventLocationMarker = L.marker([locationLong, locationLat]);
eventLocationMarker.hide();

Browser console stacktrace:
Uncaught TypeError: context._shadow is undefined
setMarkerShadowDisplayStyle leaflet-layervisibility.js:51
hide leaflet-layervisibility.js:57
map_page.js:398
leaflet-layervisibility.js:51:4
setMarkerShadowDisplayStyle leaflet-layervisibility.js:51
hide leaflet-layervisibility.js:57
map_page.js:398

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.