ynunokawa / L.esri.WebMap

A leaflet plugin to display ArcGIS Web Map.
MIT License
22 stars 21 forks source link

The risk to conflict between L.esri.WebMap and esri-leaflet-renderers #17

Closed ynunokawa closed 8 years ago

ynunokawa commented 8 years ago

esri-leaflet-renderers https://github.com/Esri/esri-leaflet-renderers

ynunokawa commented 8 years ago

It should apply esri-leaflet-renderers for accurately rendering FeatureLayer without drawingInfo. However esri-leaflet-renderers automatically hook layers, no matter whether they have drawingInfo or not. https://github.com/Esri/esri-leaflet-renderers/blob/master/src/FeatureLayerHook.js

It should be implemented in either way?

  1. Customized esri-leaflet-renderer without FeatureLayerHook
  2. Get drawingInfo from Feature Server using L.esri.FeatureLayer.metadata method(https://github.com/Esri/esri-leaflet/blob/master/src/Layers/FeatureLayer/FeatureManager.js#L430)
ynunokawa commented 8 years ago

I'd like to adopt no.2 and request to capacitate esri-leaflet-renderer for selecting whether hook or not.

jgravois commented 8 years ago

we haven't tagged an esri-leaflet-renderers release since the functionality was added, but in master you can now specify ignoreRenderer: true in individual esri.featureLayer constructors to not use the symbology defined in the service.

Esri/esri-leaflet-renderers#110

would it be helpful to you if we tagged a new release and pushed it to our cdn?

ynunokawa commented 8 years ago

This is exactly the functionality that I was looking for!

would it be helpful to you if we tagged a new release and pushed it to our cdn?

Yes, I'd gladly adopt ignoreRenderer to a feature layer with drawingInfo in Web Map JSON if you do it.

jgravois commented 8 years ago

i have one last pesky bug to resolve before i can tag 2.0.2, but i should be able to get it fixed soon.

ynunokawa commented 8 years ago

OK, I can wait. :+1:

jgravois commented 8 years ago

2.0.2 https://github.com/Esri/esri-leaflet-renderers/releases/tag/v2.0.2

sample: http://esri.github.io/esri-leaflet/examples/renderers-plugin.html

//renderer type: unique value
L.esri.featureLayer({
  url: 'https://services.arcgis.com/rOo16HdIMeOBI4Mb/arcgis/rest/services/Trimet%20Transit%20Stops%20In%20Portland%20Neighborhoods/FeatureServer/0',
  ignoreRenderer: true
}).addTo(map);
ynunokawa commented 8 years ago

@jgravois Thank you for your awesome work! :+1:

I have applied 2.0.2 for a test app and new ignoreRenderer option for a feature layer with drawingInfo in L.esri.WebMap. It looks good to me as the below :eyes: .

ignorerenderer

left: WITHOUT esri-leaflet-renderers center: WITH esri-leaflet-renderers v2.0.1 right: WITH esri-leaflet-renderers v2.0.2 + ignoreRenderer