You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a conversation with @jgravois about this today so I will attempt to transcribe the notes here.
Initializing Tasks and Services with the (url, options) pattern is starting to cause problems that look like horrible kludges in downstream plugins like the geocoder.
In short we shouldn't have to write code like this. Its much cleaner to make url an option that can be passed in. This means that the first parameter is always either
an options object with url, or no url to use a default URL
a service, in which case we only need to check for the presence of request and switch accordingly
This is a major breaking change but we are still in a release candidate stage of Esri Leaflet now is the time to do this to simplify downstream plugins that want to use a default for URL.
The text was updated successfully, but these errors were encountered:
I had a conversation with @jgravois about this today so I will attempt to transcribe the notes here.
Initializing Tasks and Services with the
(url, options)
pattern is starting to cause problems that look like horrible kludges in downstream plugins like the geocoder.This proposed code by @jgravois is pretty indicative of the problem. https://github.com/jgravois/esri-leaflet-geocoder/blob/empty-constructor/src/Tasks/Geocode.js#L28-L41. That code has to check for:
url
andoptions
options
and using the default URLIn short we shouldn't have to write code like this. Its much cleaner to make
url
an option that can be passed in. This means that the first parameter is always eitherurl
, or nourl
to use a default URLrequest
and switch accordinglyThis is a major breaking change but we are still in a release candidate stage of Esri Leaflet now is the time to do this to simplify downstream plugins that want to use a default for URL.
The text was updated successfully, but these errors were encountered: