ynunokawa / L.esri.WebMap

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

more marker support #32

Closed jgravois closed 8 years ago

jgravois commented 8 years ago

looking at your Renderer support, i just wanted to make sure you aware of this project:

https://github.com/esri/Leaflet.shapeMarkers

ynunokawa commented 8 years ago

I have not taken a deeper look yet. However I just know that esri-leaflet-renderers use it. https://github.com/Esri/esri-leaflet-renderers/blob/master/src/Symbols/PointSymbol.js#L104-L122

I think that L.esri.WebMap should replace a method of creating symbols with esri-leaflet-renderers if a feature layer has drawingInfo in WebMap JSON.

ynunokawa commented 8 years ago

I'd propose to add new option of L.esri.FeatureLayer like metadata to include drawingInfo and geometryType. Because it will be able to render using drawingInfo in WebMap JSON with esri-leaflet-renderers. To perform this idea, L.esri.WebMap must create metadata as geojson and add it into L.esri.FeatureLayer.

https://github.com/Esri/esri-leaflet-renderers/blob/master/src/FeatureLayerHook.js#L16-L24

if (this.options.metadata) {
  // Rendering with drawingInfo in WebMap JSON!
  this._setRenderers(this.options.metadata);
}
else {
  this.metadata(function (error, response) {
    if (error) {
      return;
    } if (response && response.drawingInfo) {
      this._setRenderers(response);
    } if (this._alreadyAdded) {
      this.setStyle(this._originalStyle);
    }
  }, this);
}

@jgravois What do you think about this idea?

ynunokawa commented 8 years ago

I'm looking at similar issues.

esri/esri-leaflet-renderers/issues/51 Esri/esri-leaflet/issues/570

jgravois commented 7 years ago

@jgravois What do you think about this idea?

sorry i just saw this! would adding an optional metadata property to the featureLayer constructor still be helpful to you?

ynunokawa commented 7 years ago

@jgravois Thank you, John. it's all right now! :smiley: