Sha256: 5bb67d23517f984c1250d7377fbfa10753fd6b13bfe1d123ed2759400478f6cf
Contents?: true
Size: 1.3 KB
Versions: 28
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.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
28 entries across 28 versions & 1 rubygems