Comments (9)
Thanks for the report! I will have time for this only on the weekend =(
from leaflet.activelayers.
@petemills I have now only one map overlay configuration. The Clouds
from TestLayers.js. Can you please share with me the Overlay map configurations that you use? It would be very nice to have them in the format of TestLayers.js
as the Clouds
are:
this.clouds = {
name: 'Clouds',
layer: L.tileLayer(
'http://{s}.tile.openweathermap.org/map/clouds/{z}/{x}/{y}.png', {
attribution: 'Map data © <a href="http://openweathermap.org">OpenWeatherMap</a>'
, opacity: 0.5
}
)
}
from leaflet.activelayers.
Hey, unfortunately, I can't share the layers I'm working with as they're confidential, sorry :(. This should occur with any set of overlay layers though. If it's any consolation; I've managed to do what I was trying to do without having to use this functionality and what I was trying to do might be an incorrect use of the plugin, rather than a bug/issue!
from leaflet.activelayers.
Hi! Sorry that I returned so lately to the issue. There are still some thing to clarify. Please explain to me what the onadd
event did you mean? As I can see now there are only two places in Leaflet that can fire such event: L.Marker and L.Path.
How can I attach to the event, that you've meant?
from leaflet.activelayers.
from leaflet.activelayers.
Hi, sorry for not responding. I completely forgot! I found a way around this in the end (using a completely different method) and can't remember exactly what I was doing! I believe the onadd was fired simply when I added a marker to the map. I then wanted to push that new layer (marker) into an array to store it's position relative to other layers.
Thing is, every time I added a marker and the onadd function fired, getActiveLayers() was called. My question was: is that function asynchronous because it seemed that the rest of the function (pushing the layer into the array) carried on without the getActiveLayers() function returning. Not a problem anymore though let me know if you need any clarification.
Cheers.
from leaflet.activelayers.
I'm having a very similar problem:
I'm using a map with several overlay layers and saving the selected ones in the url. I have something like this:
map.on('overlayadd', function () {
console.log(control.getActiveOverlayLayers());
});
The problem is that when you see the output of console.log, it's always on the previous state. I think it may be because the variable _activeOverlayLayers is being updated after the event's call. By the moment, my workaround is as follows:
map.on('overlayadd', function () {
setTimeout(function () {
console.log(control.getActiveOverlayLayers());
}, 1);
});
from leaflet.activelayers.
@petemills @quique0194 please verify.
from leaflet.activelayers.
It works! Thanks
from leaflet.activelayers.
Related Issues (6)
- Please add versioning HOT 3
- Add Bower Support HOT 2
- Leaflet 1.0.3 issue HOT 3
- cant load ActiveLayers HOT 1
- ActiveLayers fails with new Leaflet versions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaflet.activelayers.