Skip to content

Commit

Permalink
Update DynamicMapLayer to support layer specific argument
Browse files Browse the repository at this point in the history
Fixes #715 - New specific layer argument format fixes zero-result javascript errors. Out of layer clicks will now also return the "Could not find that feature" message instead of a JS error. Bumping the default tolerance to 2 helps return results from very small layer markers.
  • Loading branch information
Eric Larson committed Oct 9, 2018
1 parent d19179a commit 0efe4ba
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ GeoBlacklight.Viewer.DynamicMapLayer = GeoBlacklight.Viewer.Esri.extend({
url: layer.options.url,
useCors: true
})
.tolerance(0)
.tolerance(2)
.returnGeometry(false)
.on(_this.map)
.at(e.latlng);

// query specific layer if dynamicLayerId is set
if (_this.dynamicLayerId) {
identify.layers('ID: ' + _this.dynamicLayerId);
identify.layers('all: ' + _this.dynamicLayerId);
}

identify.run(function(error, featureCollection, response){
if (error) {
if (error || response['results'] < 1) {
_this.appendErrorMessage();
} else {
_this.populateAttributeTable(featureCollection.features[0]);
Expand Down

0 comments on commit 0efe4ba

Please sign in to comment.