Skip to content

Commit

Permalink
add auth to clustered feature layer
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickarlt committed Jan 6, 2014
1 parent 4b84934 commit d23ddd9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/Layers/ClusteredFeatureLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
onEachMarker: undefined
},
initialize: function(url, options){
L.Util.setOptions(this, options);
this.url = L.esri.Util.cleanUrl(url);
L.Util.setOptions(this, options);

var requestOptions = {};

if(this.options.token){
requestOptions.token = this.options.token;
}

L.esri.get(this.url, {}, function(response){
L.esri.get(this.url, requestOptions, function(response){
this.fire("metadata", { metadata: response });
}, this);

Expand Down
10 changes: 8 additions & 2 deletions src/Layers/FeatureLayer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* globals Terraformer, L */
/* globals Terraformer, L */
(function(L){

// toggles the visibility of a layer. Used to
Expand Down Expand Up @@ -36,7 +36,13 @@
this.url = L.esri.Util.cleanUrl(url);
L.Util.setOptions(this, options);

L.esri.get(this.url, {}, function(response){
var requestOptions = {};

if(this.options.token){
requestOptions.token = this.options.token;
}

L.esri.get(this.url, requestOptions, function(response){
this.fire("metadata", { metadata: response });
}, this);

Expand Down

0 comments on commit d23ddd9

Please sign in to comment.