Code Monkey home page Code Monkey logo

Comments (7)

kneemer avatar kneemer commented on June 11, 2024 1

The advantage of putting it in a separate plugin is that it can be built and maintained separate from either esri-leaflet or this plugin. Then when we decide which one it belongs in we just include it in the build process so that the user only needs to worry about one plugin. I like the idea of 'micro' plugins as it keeps the core functionality of the original plugin cleaner.

from esri-leaflet-renderers.

kneemer avatar kneemer commented on June 11, 2024

That seems reasonable, I had intended to keep this plugin confined to the Drawing Info in the metadata but it does feel like a 'renderer' type of thing. I think it should be similar to the styles where it would only be applied if the user did not define a min/maxZoom.

from esri-leaflet-renderers.

jgravois avatar jgravois commented on June 11, 2024

i like the sound of that. but on the other hand, i could also just write a demo app in esri-leaflet that shows how to interrogate your own layer and set the properties dynamically.

any thoughts @patrickarlt?

from esri-leaflet-renderers.

patrickarlt avatar patrickarlt commented on June 11, 2024

The code is so minimal I'm in favor of leaving min/max scale in this plugin (allowing you to override on the layer options) and just having @jgravois do an example.

from esri-leaflet-renderers.

kneemer avatar kneemer commented on June 11, 2024

I'm closing this in favor of Esri/esri-leaflet#426 as the code is not as minimal as initially expected.

from esri-leaflet-renderers.

alaframboise avatar alaframboise commented on June 11, 2024

Hey guys, sorry for chiming in late here, but here's a few additional thoughts. If a user takes the time to set the renderer symbology for a FeatureLayer (most likely by using the Map Viewer) then they mostly likely took time to set the zoom levels too. There's definitely a solid usability relationship between the two and it's definitely frustrating when client apis don't respect those meta settings. I just went through this whole exercise on a recent project and ran into the zoom level limitation with esri-leaflet. Therefore, it definitely feels a little strange that this functionality 1) wouldn't be built into core as an optional setting (true by default), or 2) it wouldn't be built into this repo since symbols and zoom levels are so closely related. A whole plugin just to toggle layers on and off?

from esri-leaflet-renderers.

patrickarlt avatar patrickarlt commented on June 11, 2024

I think we are all talking around 2 different problems here.

  1. Automatically using min/max zoom from the service metadata for FeatureLayers this is what @kneemer and @jgravois have been discussing
  2. Automatically using min/max zoom from the service metadata for TileLayers this is the problem that @alaframboise had (since Esri Leaflet only updated the dark gray basemap yesterday)

Building this into the base of the library seems problematic because it adds a lot of complexity, mostly because layer drawing is controlled based on min/max zoom and we have to check if its with range before drawing. Its another request and adds a decent amount of complexity and it means we have to delay drawing for another round trip.

Leaflet also doesn't support dynamically setting the min/max zoom after the fact. It only checks it at the time you add the layer to the map. So in addition to having to alter the drawing code we also have to use some of the internal methods to update the zoom range which seems a bit messy.

Maybe a better way around this is to wrap creating the proper options object from the metadata as a helper method for users.

// the getOptions comes from a plugin
L.esri.FeatureLayer.getOptions(url, function(error, options){
  L.esri.featureLayer(url, options).addTo(map);
});

from esri-leaflet-renderers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.