-
Notifications
You must be signed in to change notification settings - Fork 31
readd support for Cluster.FeatureLayer and fix the plugin #158
Conversation
src/FeatureLayerHook.js
Outdated
| var oldUnbindPopup = Util.bind(this.unbindPopup, this); | ||
| var oldOnRemove = Util.bind(this.onRemove, this); | ||
|
|
||
| L.Util.bind(this.createNewLayer, this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right now this throws an error. fixed by Esri/esri-leaflet-cluster#31.
i couldn't find a layer to test with, but it looks like this.createNewLayer is only really useful for displaying polygon services rendered using proportional marker symbols.
|
Thanks @jgravois! I've merged Esri/esri-leaflet-cluster#31 and released under v2.1.0, will test/merge/release this PR soon. |
gavinr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great - thanks for the additional debug/sample pages. The cluster one is now working after I updated it to use [email protected].
|
very cool! |
|
These fixes were released in https://github.com/Esri/esri-leaflet-renderers/releases/tag/v2.1.1. Thanks again @jgravois |
|
Sorry to reopen this, maybe I should create a bug ? I tried to use v2.1.1 using import style declaration for the plugins : import L from 'leaflet'
import * as esri from 'esri-leaflet'
import * as Cluster from 'esri-leaflet-cluster'
import 'leaflet.markercluster/dist/leaflet.markercluster'
import MarkerClusterCss from 'leaflet.markercluster/dist/MarkerCluster.css'
import DefaultMarkerCss from 'leaflet.markercluster/dist/MarkerCluster.Default.css'
L.esri = esri
L.esri.Cluster = Cluster
import 'esri-leaflet-renderers'But the initHook aren't attached to esri and esri.Cluster featureLayer. It does work with v2.1.0 though. |
off the top of my head no, but if you're using import statements, why not go whole hog and just import the ES Modules you're using? import { map } from 'leaflet'
import { featureLayer } from 'esri-leaflet'either way if you're able to provide a complete, self-contained, simplified, ready to run repro case instead of just a code snippet, it'd speed up the debugging process. |
|
So I reproduced a minimal example of how I build my project. I'm very sorry I disturbed you, my problem seems to rely in the complexity of my project Mea culpa |
relies on Esri/esri-leaflet-cluster#31
resolves #156
while i was in there I also:
/specand into/debugso they'd be easier for folks to find.the only thing i don't like about this approach is that AMD loaders like Dojo and RequireJS now require that the cluster plugin be loaded whether its needed or not.
neither are a popular option outside of JSAPI land these days though. i can live with the extra cruft since folks using modern bundlers or the UMD won't have to worry about it.
the diff is a bit of a mess, so don't be shy if you have any questions.