1.0.0
This represents the stable release of Esri Leaflet compatible with Leaflet 0.7.3. All future 1.0.X releases will be compatible with Leaflet 0.7.3 and contain only bug fixes. New features will only be added in Esri Leaflet 2.0.0 which will require Leaflet 1.0.0.
As this is a major release there are a number of breaking changes.
Also see the Esri Leaflet 1.0 announcement.
Breaking Changes
L.esri.Services.FeatureLayer
has been renamed toL.esri.Services.FeatureLayerService
. It should be initialized withL.esri.Services.featureLayerService(options)
.- All layers and tasks now have constructors that mimic service classes. this means they expect
url
s to supplied within an options object as opposed to being supplied as a raw string. ie.L.esri.featureLayer(yourUrl)
will now beL.esri.featureLayer({url: yourUrl}})
. This does not affectL.esri.basemapLayer
which still accepts akey
as it's first parameter. - Request callbacks across Esri Leaflet now can handle authentication errors by calling
error.authenticate(newToken)
as opposed to listening toauthenticationrequired
event and callinge.target.authenticate(newToken)
. This means that your callbacks may be called multiple times, once with an authentication failure and once with an authentication success. To avoid any side affects of this you shouldreturn
as early as possible after handling errors. It is recommended you adapt techniques from http://blog.timoxley.com/post/47041269194/avoid-else-return-early to handle these cases.
L.esri.Services.service({
url: 'http://logistics.arcgis.com/arcgis/rest/services/World/ServiceAreas/GPServer/GenerateServiceAreas',
token: 'badtoken'
}).metadata(function(error, response){
if(error && error.authenticate) {
// handle an authentication error, returning to stop execution of the rest of the function
error.authenticate('good token');
return;
}
if(error) {
// handle any other errors, returning to stop execution of the rest of the function
return;
}
// if you get here you are successful!
console.log(metadata);
});
Changes
- Added support for the
dynamicLayers
option toL.esri.DynamicMapLayer
#566 - Restored
bringToBack
andbringToFront
toL.esri.FeatureLayer
#479 load
event onL.esri.FeatureLayer
now fires at the proper time #545L.esri.DynamicMapLayer
andL.esri.ImageMapLayer
will now automatically use POST for large requests. #574L.esri.ImageMapLayer
now defaults to requestingjson
as opposed to an image to better handle authentication and large requests #574. If your Image Service does not support CORS you should set{f:'image'}
in your options.