I have a Leaflet slippy map with a GeoJSON layer loaded. I can click this layer manually and read attribute values from it. Now my question is:
How can I read attributes of said layer without selecting it? I'd like to do that by using my current location. I've managed to check if my location is within the GeoJSON layer with d3.js, but can't figure out how to select attributes of the respective feature. Which JavaScript client side framework could be used to face this problem?
code from d3.js console.log(d3.geoContains(jsondata[map.getCenter().lng,map.getCenter().lat]));
returns boolean answer.
onEachFeature()
should indicate a way! If you don't want toclick
ormouseover
on each feature, you could emulate the user actions. See the answer below.