-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow override of 'isModern' #935
allow override of 'isModern' #935
Conversation
Add an option to let users decide to not use geoJSON, even if the underlying service supports it. Occasionally handy when ArcGIS Server has geoJSON geometry problems.
thanks so much for this! it's not a good idea to set my first instinct is to just include a conditional check within the metadata response handler and skip setting the property for users 'if' they already set it themselves. hope that makes sense. |
It does make more sense; let me got back and change the behavior. |
Keep the default for “isModern” to be optimistically true, to preserve back compatibility. Fix the test to allow metadata to disable geoJSON.
I updated PR #935; for back-compatibility, I think the option needs to be left explicit & set to 'true'. The metadata check will explicitly set isModern correctly if there isn't server support (older servers). |
why exactly? i see two distinct benefits to not assuming that a feature service endpoint supports geojson.
|
The submitted PR does exactly what you're asking; it'll cheerfully ask for The current behavior will always use If instead we change the default behavior to use I'm happy to change the default value - but opting out of geoJSON seemed a better choice than forcing people to change their code to opt-in. Regardless, if the service doesn't support geoJSON, the requests will use |
i ran a quick test using your branch and confirmed that this is not true. // 10.01 ArcGIS Server instance that doesn't support f=geojson
var fl = L.esri.featureLayer({
url:'http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5'
}).addTo(map); because the initial queries are executed before the metadata response is retrieved, the fact that you are setting |
Gaaah. IDK why I didn't see that here, but ... I get it. Thanks for your patience; update in the works. |
Fix tests for ‘isModern’ to not require a default value; update ‘isModern’ as part of the tests for geoJSON support, allowing for a user override.
Explicit test for false is sufficient.
Yay. Tests pass. Thanks for your patience - I didn't fully grok the startup process when a new layer is created & added (honestly, probably still don't.) |
thanks for your contribution! it may have been intentional on your part, but the actual commits you pushed are associated with @ahwarren and not @spoilsportmotors. |
* allow override of 'isModern' Add an option to let users decide to not use geoJSON, even if the underlying service supports it. Occasionally handy when ArcGIS Server has geoJSON geometry problems. * Explicitly set isModern properly Keep the default for “isModern” to be optimistically true, to preserve back compatibility. Fix the test to allow metadata to disable geoJSON. * Remove default value for 'isModern' Fix tests for ‘isModern’ to not require a default value; update ‘isModern’ as part of the tests for geoJSON support, allowing for a user override. * Kill useless test for undefined Explicit test for false is sufficient.
Add an option to let users decide to not use geoJSON, even if the
underlying service supports it. Occasionally handy when ArcGIS Server
has geoJSON geometry problems.