Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L.esri.dynamicMapLayer not using proxy url for export rest call #464

Closed
srikanthkusam opened this issue Feb 27, 2015 · 3 comments · Fixed by #468
Closed

L.esri.dynamicMapLayer not using proxy url for export rest call #464

srikanthkusam opened this issue Feb 27, 2015 · 3 comments · Fixed by #468

Comments

@srikanthkusam
Copy link

Hi Everyone!

I am trying to use a secured map service with proxy. The following is the code for assigning proxy

var gisLayer = L.esri.dynamicMapLayer(mapServiceUrl, {
opacity: 0.8,
proxy: location.pathname + "proxy.ashx",
});

But its not using proxy to get the map image through export rest api.

I understand all the requests are going directly without proxy. Can anyone please help me to resolve this issue?

Thanks,
Srikanth

@patrickarlt
Copy link
Contributor

@srikanth244 can you try this code? I don't think the proxies support proxying images so you need to request the json.

var gisLayer = L.esri.dynamicMapLayer(mapServiceUrl, {
  opacity: 0.8,
  proxy: location.pathname + "proxy.ashx",
  f: 'json'
});

@srikanthkusam
Copy link
Author

Thanks @patrickarlt. That worked.

But now i have one more problem. I am using proxy because i have large layerDef string to apply on each export request. Now its using the "get" request instead of "post". So is there any way or setting that i can use to make all the requests when using proxy as "post"?

Thanks,
Srikanth

@patrickarlt
Copy link
Contributor

It should automatically switch POST if the request length gets over 2000 characters https://github.com/Esri/esri-leaflet/blob/master/src/Request.js#L91-L98. So if you still seeing GET requests you probably are still safe and your layerDef isn't so long as to require a POST.

Leaving this open as a reminder to switch to f:json automatically when using the proxy option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants