Closed sabas closed 10 years ago
More context (link to actual working demo) would be necessary to debug this. leaflet-omnivore's level of abstraction over topojson is very very thin, so it's likely issues are rooted elsewhere.
@tmcw here it is http://kode-tech.it/andrea/choro_bad/ief1_2009.html
it seems a bug...
What seems like a bug isn't always a bug :) This is the classic MultiPolygon corner case in Leaflet: multipolygons do not have .feature
: you'll need to iterate through eachLayer()
to grab the .feature
of a sub-layer (or bring this up in Leaflet core). Same effect is easily replicable with a L.geoJson layer or any other MultiPolygon-containing collection.
Thanks @tmcw appreciate it :-) I'll look into your suggestion.
I'm using a topojson derived from a geojson (and properties preserved with -p flag), and it behaves correctly with polygons . I'm attaching events with this chain
and each function has an e argument, but console.log shows e.layer.feature.properties only on Polygon type geometries. This gives an error when trying to populate a popup with properties.something..
The console.log trace is