Sha256: 7f37d99bea8529ed4c8cab457eee445c771fdda6a0e91657677bd915feee54a6
Contents?: true
Size: 1.3 KB
Versions: 29
Compression:
Stored size: 1.3 KB
Contents
//= require geoblacklight/viewers/esri GeoBlacklight.Viewer.TiledMapLayer = GeoBlacklight.Viewer.Esri.extend({ getPreviewLayer: function() { // set layer url this.options.url = this.data.url; // check if this is a tile map and layer and for correct spatial reference if (this.layerInfo.singleFusedMapCache === true && this.layerInfo.spatialReference.wkid === 102100) { /** * TODO: allow non-mercator projections and custom scales * - use Proj4Leaflet */ var esriTiledMapLayer = L.esri.tiledMapLayer(this.options); //setup feature inspection this.setupInspection(esriTiledMapLayer); return esriTiledMapLayer; } }, setupInspection: function(layer) { var _this = this; this.map.on('click', function(e) { _this.appendLoadingMessage(); // query layer at click location L.esri.Tasks.identifyFeatures({ url: layer.options.url, useCors: true }) .tolerance(0) .returnGeometry(false) .on(_this.map) .at(e.latlng) .run(function(error, featureCollection, response) { if (error) { _this.appendErrorMessage(); } else { _this.populateAttributeTable(featureCollection.features[0]); } }); }); } });
Version data entries
29 entries across 29 versions & 1 rubygems