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

Version Path
geoblacklight-2.4.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-2.3.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-2.2.1 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-2.2.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-2.1.2 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-2.1.1 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-2.1.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-2.0.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.9.1 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.9.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.8.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.7.1 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.7.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.6.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.5.1 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.5.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.4.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.3.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.2.0 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js
geoblacklight-1.1.2 app/assets/javascripts/geoblacklight/viewers/esri/tiled_map_layer.js