docstrings: explicit effect of L.GeoJSON filter
Following https://stackoverflow.com/questions/39776919/how-to-reference-the-data-of-an-existing-geojson-leaflet-object/39787583#39787583, sounds like the current definition "decide whether to show a feature or not" implies that the data is retained in memory, but just not shown. Replaced "show" by "include" to try to make it clearer that the filtered out data is _lost_ (not retained at all within the group). Also took the opportunity to add a note about changing the `filter` option dynamically (no re-evaluation of child layers, whether they meet the new filter conditions or not).
This commit is contained in:
parent
837d190933
commit
bc01b2b30b
@ -53,13 +53,15 @@ L.GeoJSON = L.FeatureGroup.extend({
|
||||
* ```
|
||||
*
|
||||
* @option filter: Function = *
|
||||
* A `Function` that will be used to decide whether to show a feature or not.
|
||||
* The default is to show all features:
|
||||
* A `Function` that will be used to decide whether to include a feature or not.
|
||||
* The default is to include all features:
|
||||
* ```js
|
||||
* function (geoJsonFeature) {
|
||||
* return true;
|
||||
* }
|
||||
* ```
|
||||
* Note: dynamically changing the `filter` option will have effect only on newly
|
||||
* added data. It will _not_ re-evaluate already included features.
|
||||
*
|
||||
* @option coordsToLatLng: Function = *
|
||||
* A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s.
|
||||
|
Loading…
Reference in New Issue
Block a user