Skip to content

1.0.0

Compare
Choose a tag to compare
@patrickarlt patrickarlt released this 10 Jul 18:49
· 901 commits to master since this release

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 to L.esri.Services.FeatureLayerService. It should be initialized with L.esri.Services.featureLayerService(options).
  • All layers and tasks now have constructors that mimic service classes. this means they expect urls to supplied within an options object as opposed to being supplied as a raw string. ie. L.esri.featureLayer(yourUrl) will now be L.esri.featureLayer({url: yourUrl}}). This does not affect L.esri.basemapLayer which still accepts a key as it's first parameter.
  • Request callbacks across Esri Leaflet now can handle authentication errors by calling error.authenticate(newToken) as opposed to listening to authenticationrequired event and calling e.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 should return 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 to L.esri.DynamicMapLayer #566
  • Restored bringToBack and bringToFront to L.esri.FeatureLayer #479
  • load event on L.esri.FeatureLayer now fires at the proper time #545
  • L.esri.DynamicMapLayer and L.esri.ImageMapLayer will now automatically use POST for large requests. #574
  • L.esri.ImageMapLayer now defaults to requesting json 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.