Skip to content

Commit

Permalink
Fix withcredentials identify (#1)
Browse files Browse the repository at this point in the history
* pass withCredentials to identify request if applicable

* need to pass it one more place

* remove dummy code

---------

Co-authored-by: dandormont <[email protected]>
  • Loading branch information
dandormont and dandormont authored Oct 7, 2024
1 parent 48cfd69 commit cbf8957
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion spec/Layers/FeatureLayer/FeatureManagerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,8 @@ describe('L.esri.FeatureManager', function () {
'http://gis.example.com/mock/arcgis/rest/services/MockService/MockFeatureServer/0/query?returnGeometry=true&where=1%3D1&outSR=4326&outFields=*&inSR=4326&geometry=%7B%22xmin%22%3A-122.6513671875%2C%22ymin%22%3A45.49094569262732%2C%22xmax%22%3A-122.607421875%2C%22ymax%22%3A45.521743896993634%2C%22spatialReference%22%3A%7B%22wkid%22%3A4326%7D%7D&geometryType=esriGeometryEnvelope&spatialRel=esriSpatialRelIntersects&geometryPrecision=6&resultOffset=0&resultType=tile&f=geojson',
JSON.stringify({
type: 'FeatureCollection',
features: [feature7] })
features: [feature7]
})
);

var layer = new MockLayer({
Expand Down
5 changes: 3 additions & 2 deletions spec/Services/ServiceSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ describe('L.esri.Service', function () {
});

it('should fire a requestend event', function (done) {
server.respondWith('GET', 'http://services.arcgis.com/mock/arcgis/rest/services/MockService/route?foo=bar&f=json', JSON.stringify({ foo: 'bar'
}));
server.respondWith('GET', 'http://services.arcgis.com/mock/arcgis/rest/services/MockService/route?foo=bar&f=json',
JSON.stringify({ foo: 'bar' }
));

service.on('requestend', function (e) {
expect(e.type).to.equal('requestend');
Expand Down
6 changes: 5 additions & 1 deletion src/Layers/DynamicMapLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ export var DynamicMapLayer = RasterLayer.extend({
}
}

identifyRequest.run(callback);
identifyRequest.run(callback, {
options: {
withCredentials: !!this.options.withCredentials
}
});

// set the flags to show the popup
this._shouldRenderPopup = true;
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/FeatureLayer/FeatureManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export var FeatureManager = FeatureGrid.extend({
query = query.offset(offset);
}

query.params['resultType'] = 'tile';
query.params.resultType = 'tile';

if (this.options.requestParams) {
Util.extend(query.params, this.options.requestParams);
Expand Down
5 changes: 3 additions & 2 deletions src/Tasks/IdentifyFeatures.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { latLng } from 'leaflet';
import { Identify } from './Identify';
import { responseToFeatureCollection,
import {
responseToFeatureCollection,
boundsToExtent,
_setGeometry
} from '../Util';
Expand Down Expand Up @@ -67,7 +68,7 @@ export var IdentifyFeatures = Identify.extend({
}
callback.call(context, undefined, featureCollection, response);
}
});
}, context);
},

_setGeometryParams: function (geometry) {
Expand Down

0 comments on commit cbf8957

Please sign in to comment.