POST
|
Can you tell me what value to change in v2 beta 5 that will cause esri leaflet to default to JSONP instead of CORS?
Our SSO setup returns a '302 found' when using the default CORS requests. If I make the change below, everything works fine.
https://github.com/Esri/esri-leaflet/blob/master/src/Support.js#L1
export var cors = ((window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest()));
export var cors = false;
The docs show that the old way to turn off default CORS is:
If you cannot or do not want to enable CORS on your server the following code will make all requests utilize JSONP.
L.esri.get = L.esri.Request.get.JSONP;
But release notes for Beta 2 say:
L.esri.Request has been removed. Please use L.esri.get , L.esri.get.CORS , L.esri.get.JSONP , L.esri.post or L.esri.request directly.
What is the new way to do this in beta 2?
... View more
09-15-2015
12:40 PM
|
0
|
1
|
3559
|
POST
|
I'll try to get one together, it may take a day or two to get to it. I'm thinking that if there is a problem, it's more related to requirejs than angular or the angular-leaflet-directive. I'll keep looking into it and post here when I have a working example or have tracked down the issue. Thanks again for your quick help.
... View more
08-25-2015
02:02 PM
|
0
|
4
|
685
|
POST
|
That worked to get the local website running, thanks. The point of getting the local website running was so that I could confirm that 2.0.0-beta.5 was working with leaflet 1b and I see that it is. So, the real problem I'm trying to solve is that we've built an app using the latest version of leaflet (0.8 at the time) and esri leaflet 1.0 branch (now deleted). The app is angularjs and requirejs plus the angular-leaflet-directive. If I use the old esri-leaflet 1.0 branch build, L.esri is defined but if I load a build of 2b5, L.esri is not defined. I can step through the esri-leaflet initialization code and know it's loaded along with leaflet 1beta2. Did a change take place when moving to esri-leaflet 2 that would cause problems when using requirejs? It looks like somehow it's not being initialized to L.esri. I'm wanting to move to latest because I want to use panes for control of layer zindex and it looks like that was added a while back.
... View more
08-25-2015
11:58 AM
|
0
|
6
|
685
|
POST
|
Thanks for your quick help on this John. Before posting and after trying to get this working for a few hours, I removed my node/npm install (it was working no problem in other projects) and reinstalled. Before I posted the question, I was running npm install but was not running 'npm run build'. Leaflet 1 beta has been loaded in all attempts. I can also change out 2.0.0-beta.5 for the previous 1.0 branch in our app and L.esri is defined. I just ran npm cache clean, npm install and npm run build. After that, grunt and go to http://localhost:8001/examples/simple-dynamic-map-layer.html and see that it can't find esri-leaflet.js The sample files tries to load the esri-leaflet.js file but cannot find it: <script src="../js/esri-leaflet.js"></script> I see a built file in /dist/ The built js file has this at the top and when building, during npm run build and grunt there are no console warnings or errors: /* esri-leaflet - v2.0.0-beta.5 - Mon Aug 24 2015 16:09:34 GMT-0500 (CDT) * Copyright (c) 2015 Environmental Systems Research Institute, Inc. * Apache-2.0 */ Any ideas?
... View more
08-24-2015
02:23 PM
|
0
|
8
|
685
|
POST
|
Our app was using the 1.0 branch of esri-leaflet that has been removed (we still have a fork of it) and I'm trying to upgrade everything to latest. I'm having problems getting a build of 2.0.0-beta.5 to load into leaflet. I can build (by running the grunt task) on a branch created from the 2.0.0-beta.5 tag. The esri-leaflet.js loads into the app, the file contains the correct build date and version, but it won't load into the L object. L.esri is always undefined. It happens both in my app and in the sample pages. I followed the 'Development Instructions' and also tried the npm packages with the same results. Are there some instructions that I'm missing or maybe a problem with 2.0.0-beta.5? Any help is appreciated.
... View more
08-24-2015
01:21 PM
|
0
|
10
|
4705
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|