You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm displaying a few thousand points so the circles look better and perform better for me.
For the onEachFeature I'm simply just setting the pop up as follows:
function onEachFeature(feature, layer) { if (feature.properties && feature.properties.popupContent) { layer.bindPopup('test'); layer.on('mouseover', function(e) { this.openPopup(); }); } }
I had the popup being set to other things but this is my foolproof debugging mode, I know its brilliant.
So the problem I'm facing is that I'm not getting any sort of popup for a mouseover (or an click for that matter when I change the 'mouseover' to 'click'.
I know that I haven't lost the functionality to click the page because I created an event listener for:
`
mymap.on('click', function(){
alert('test');
});
`
And when I click on the map I still get a response so at least that layer is responding.
Now the current rabbit hole that I am down is that maybe because of the way that the slider creates a bunch of layers to display all the points its just overloading leaflet (keep in mind I'm dealing with thousands of points) or maybe the map is just being brought to the front and overriding the clicks (but I tried to move it to the back with mymap.bringToBack() with no change in functionality).
Just wondering if anyone else has managed to make this work/ has had a similar problem to me with this. I'll try it with a smaller data set to try and see if its a data size issue but I really don't think that's the case because you would think that the map layer would stop responding as well if that were the problem.
Also sorry about poor formatting (battery dying and I left my charger at work) I'll try and fix it tomorrow.
The text was updated successfully, but these errors were encountered:
This commented.html provides in-line comments to walk through how to add markers with popups, and control them with the slider either individually, or in groups.
I've also written a step-by-step guide to explain how to use this module with geoJSON data.
(EDIT on 9/26/20 to update links and link to new tutorial)
Hi @geyerbri you have done nice work. Maybe you can create a new fork/branche from my master and update your code to the branche and then make a pull request to my fork. This would remove the ton of not necessary commits in you current master branche.
So I've been trying to get this to work with the bindPopup feature in leaflet once the data points are placed by I can't seem to get them to appear.
Currently I'm setting the data points as follows:
`var Circles = L.geoJSON(someFeatures, {
pointToLayer: function(feature, latlng) {
var col = getColor(feature);
return L.circle(latlng, {
color: col,
fillColor: col,
fillOpacity: .5,
opacity: .5,
radius: 2
});
},
onEachFeature: onEachFeature
});`
I'm displaying a few thousand points so the circles look better and perform better for me.
For the onEachFeature I'm simply just setting the pop up as follows:
function onEachFeature(feature, layer) { if (feature.properties && feature.properties.popupContent) { layer.bindPopup('test'); layer.on('mouseover', function(e) { this.openPopup(); }); } }
I had the popup being set to other things but this is my foolproof debugging mode, I know its brilliant.
So the problem I'm facing is that I'm not getting any sort of popup for a mouseover (or an click for that matter when I change the 'mouseover' to 'click'.
I know that I haven't lost the functionality to click the page because I created an event listener for:
`
mymap.on('click', function(){
alert('test');
});
`
And when I click on the map I still get a response so at least that layer is responding.
Now the current rabbit hole that I am down is that maybe because of the way that the slider creates a bunch of layers to display all the points its just overloading leaflet (keep in mind I'm dealing with thousands of points) or maybe the map is just being brought to the front and overriding the clicks (but I tried to move it to the back with mymap.bringToBack() with no change in functionality).
Just wondering if anyone else has managed to make this work/ has had a similar problem to me with this. I'll try it with a smaller data set to try and see if its a data size issue but I really don't think that's the case because you would think that the map layer would stop responding as well if that were the problem.
Also sorry about poor formatting (battery dying and I left my charger at work) I'll try and fix it tomorrow.
The text was updated successfully, but these errors were encountered: