diff --git a/spec/Layers/ImageMapLayerSpec.js b/spec/Layers/ImageMapLayerSpec.js index 2b469f447..c68447001 100644 --- a/spec/Layers/ImageMapLayerSpec.js +++ b/spec/Layers/ImageMapLayerSpec.js @@ -421,7 +421,9 @@ describe('L.esri.Layers.ImageMapLayer', function () { }); it('should be able to request an image directly from the export service', function(){ - layer = L.esri.imageMapLayer(url); + layer = L.esri.imageMapLayer(url, { + f: 'image' + }); var spy = sinon.spy(layer, '_renderImage'); layer.addTo(map); expect(spy.getCall(0).args[0]).to.match(new RegExp(/http:\/\/services.arcgis.com\/mock\/arcgis\/rest\/services\/MockImageService\/ImageServer\/exportImage\?bbox=-?\d+\.\d+%2C-?\d+\.\d+%2C-?\d+\.\d+%2C-?\d+\.\d+&size=500%2C500&format=jpgpng&transparent=true&bboxSR=3857&imageSR=3857&f=image/)); @@ -438,4 +440,4 @@ describe('L.esri.Layers.ImageMapLayer', function () { server.respond(); }); -}); \ No newline at end of file +}); diff --git a/src/Layers/DynamicMapLayer.js b/src/Layers/DynamicMapLayer.js index b6a085b77..1012a98ed 100644 --- a/src/Layers/DynamicMapLayer.js +++ b/src/Layers/DynamicMapLayer.js @@ -148,7 +148,7 @@ EsriLeaflet.Layers.DynamicMapLayer = EsriLeaflet.Layers.RasterLayer.extend({ _requestExport: function (params, bounds) { if(this.options.f === 'json'){ - this._service.get('export', params, function(error, response){ + this._service.request('export', params, function(error, response){ this._renderImage(response.href, bounds); }, this); } else { @@ -166,4 +166,4 @@ EsriLeaflet.Layers.dynamicMapLayer = function(url, options){ EsriLeaflet.dynamicMapLayer = function(url, options){ return new EsriLeaflet.Layers.DynamicMapLayer(url, options); -}; \ No newline at end of file +}; diff --git a/src/Layers/ImageMapLayer.js b/src/Layers/ImageMapLayer.js index 3b674a4e2..6cb46e791 100644 --- a/src/Layers/ImageMapLayer.js +++ b/src/Layers/ImageMapLayer.js @@ -3,7 +3,8 @@ EsriLeaflet.Layers.ImageMapLayer = EsriLeaflet.Layers.RasterLayer.extend({ options: { updateInterval: 150, format: 'jpgpng', - transparent: true + transparent: true, + f: 'json' }, query: function(){ @@ -173,7 +174,7 @@ EsriLeaflet.Layers.ImageMapLayer = EsriLeaflet.Layers.RasterLayer.extend({ _requestExport: function (params, bounds) { if (this.options.f === 'json') { - this._service.get('exportImage', params, function(error, response){ + this._service.request('exportImage', params, function(error, response){ this._renderImage(response.href, bounds); }, this); } else {