Select to view content in your preferred language

Updating an esri-leaftlet app

4082
2
Jump to solution
08-25-2015 09:37 PM
joepublic
Deactivated User

I'm tring to update an app I created with esri-leaflet and esri-leaflet-related. 

Based on what I've read in the notes on the releases for both esri-leaflet and esri-leaft-related.

 

I've updated my app to point to the cdn versions of (see below):

 

leaflet: version 0.7.3

esri-leaflet: version 1.0..0

esri-leatlet-related:  version 1.0.2

 

<script src="//cdn.jsdelivr.net/leaflet/0.7.3/leaflet.js"></script>

<script src="//cdn.jsdelivr.net/leaflet.esri/1.0.0/esri-leaflet.js"></script>

<script src="//cdn.jsdelivr.net/leaflet.esri.related/1.0.2/esri-leaflet-related.js"></script>

 

but I am getting the following error:

 

TypeError: a is undefined

http://cdn.jsdelivr.net/leaflet.esri/1.0.0/esri-leaflet.js

Line 20

 

Note: I'm clicking on a button that triggers following (partial script):

 

$('#NSM').click(function(){

buttonPicked = 'NSM';

buttonType = document.getElementById('NSM');

 

var query = L.esri.Tasks.query(tableURL).where("type like '" + buttonType.value + "'");

var rquery = L.esri.Tasks.queryRelated(tableURL).relationshipId("0");

query.ids(function(error, ids, response)

{ ......

 

any ideas as to what's happening would be appreciated

Regards

Chris

P.S Please let me know if need to  a copy of my script uploaded

Tags (1)
1 Solution

Accepted Solutions
JohnGravois
Deactivated User

as explained in the esri-leaflet 1.0.0 release notes, we introduced the breaking change that tasks and layers constructors now expect the url of the corresponding resource to be provided within an options object

L.esri.Tasks.query(yourUrl)
// becomes
L.esri.Tasks.query({ url: yourUrl })

the API reference for L.esri.Tasks.query reflects this change as well.

you can find information about an equivalent change in the release notes for esri-leaflet-related 0.0.1-beta.2.

View solution in original post

0 Kudos
2 Replies
JohnGravois
Deactivated User

as explained in the esri-leaflet 1.0.0 release notes, we introduced the breaking change that tasks and layers constructors now expect the url of the corresponding resource to be provided within an options object

L.esri.Tasks.query(yourUrl)
// becomes
L.esri.Tasks.query({ url: yourUrl })

the API reference for L.esri.Tasks.query reflects this change as well.

you can find information about an equivalent change in the release notes for esri-leaflet-related 0.0.1-beta.2.

0 Kudos
joepublic
Deactivated User

Thanks John!!

I re-read the documentation after reading your reply and everything is working again

Chris

0 Kudos