Skip to content

Commit

Permalink
remove interactive property and make all layers interactive
Browse files Browse the repository at this point in the history
fix #1479
  • Loading branch information
ansis committed Feb 13, 2016
1 parent e814424 commit da423d9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion js/data/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ function Bucket(options) {
this.features = [];
this.id = this.layer.id;
this['source-layer'] = this.layer['source-layer'];
this.interactive = this.layer.interactive;
this.minZoom = this.layer.minzoom;
this.maxZoom = this.layer.maxzoom;
this.filter = featureFilter(this.layer.filter);
Expand Down
2 changes: 1 addition & 1 deletion js/source/worker_tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ WorkerTile.prototype.parse = function(data, layers, actor, callback) {
bucket.addFeatures(collisionTile, stacks, icons);
var time = Date.now() - now;

if (bucket.interactive && bucket.type !== 'symbol') {
if (bucket.type !== 'symbol') {
for (var i = 0; i < bucket.features.length; i++) {
var feature = bucket.features[i];
tile.featureTree.insert(feature.bbox(), bucket.layerIDs, feature);
Expand Down
4 changes: 1 addition & 3 deletions js/style/style_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ function StyleLayer(layer, refLayer) {
this.minzoom = (refLayer || layer).minzoom;
this.maxzoom = (refLayer || layer).maxzoom;
this.filter = (refLayer || layer).filter;
this.interactive = (refLayer || layer).interactive;

this._paintSpecifications = StyleSpecification['paint_' + this.type];
this._layoutSpecifications = StyleSpecification['layout_' + this.type];
Expand Down Expand Up @@ -220,8 +219,7 @@ StyleLayer.prototype = {
'ref': this.ref,
'metadata': this.metadata,
'minzoom': this.minzoom,
'maxzoom': this.maxzoom,
'interactive': this.interactive
'maxzoom': this.maxzoom
};

for (var klass in this._paintDeclarations) {
Expand Down
4 changes: 0 additions & 4 deletions js/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,6 @@ util.extend(Map.prototype, /** @lends Map.prototype */{
/**
* Query features at a point, or within a certain radius thereof.
*
* To use this method, you must set the style property `"interactive": true` on layers you wish to query.
*
* @param {Array<number>} point [x, y] pixel coordinates
* @param {Object} params
* @param {number} [params.radius=0] Radius in pixels to search in
Expand All @@ -328,8 +326,6 @@ util.extend(Map.prototype, /** @lends Map.prototype */{
/**
* Query features within a rectangle.
*
* To use this method, you must set the style property `"interactive": true` on layers you wish to query.
*
* @param {Array<Point>|Array<Array<number>>} [bounds] Coordinates of opposite corners of bounding rectangle, in pixel coordinates. Optional: use entire viewport if omitted.
* @param {Object} params
* @param {string|Array<string>} [params.layer] Only return features from a given layer or layers
Expand Down

0 comments on commit da423d9

Please sign in to comment.