Skip to content

Commit

Permalink
removed interactive property from layer definitions, added displayCon…
Browse files Browse the repository at this point in the history
…trolsDefault config to Draw instance so that it does not create controls on map, replaced remove - add layer methods with new 'moveLayer' method. re #1234
  • Loading branch information
chiatt committed Nov 28, 2016
1 parent f309c3b commit 8a298ea
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 49 deletions.
5 changes: 3 additions & 2 deletions arches/app/media/js/viewmodels/geocoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ define(['knockout', 'mapbox-gl', 'arches'], function(ko, mapboxgl, arches) {
"id": "geocode-point",
"source": "geocode-point",
"type": "circle",
"maxzoom": 20,
"paint": {
"circle-radius": 5,
"circle-color": "red"
"circle-color": "#FF0000"
}
};

Expand Down Expand Up @@ -105,7 +106,7 @@ define(['knockout', 'mapbox-gl', 'arches'], function(ko, mapboxgl, arches) {
if (self.map) {
var cacheLayer = self.map.getLayer('geocode-point');
self.map.removeLayer('geocode-point');
self.map.addLayer(cacheLayer, self.anchorLayerId);
self.map.addLayer(self.pointstyle, self.anchorLayerId);
}
};

Expand Down
6 changes: 3 additions & 3 deletions arches/app/media/js/widgets/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ define([
linewidth: this.resourceLineWidth(),
color: this.resourceColor(),
pointsize: this.resourcePointSize()
})
}),
displayControlsDefault: false
});

this.map = map;
Expand Down Expand Up @@ -301,8 +302,7 @@ define([
source.setData(data)
_.each(['resource-poly', 'resource-line', 'resource-point'], function(layerId) { //clear and add resource layers so that they are on top of map
var cacheLayer = self.map.getLayer(layerId);
self.map.removeLayer(layerId);
self.map.addLayer(cacheLayer, self.anchorLayerId)
self.map.moveLayer(layerId, self.anchorLayerId)
}, self)

} else if (self.reportHeader === false && !ko.isObservable(self.value)) {
Expand Down
30 changes: 10 additions & 20 deletions arches/app/media/js/widgets/map/map-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ define(function() {
"paint": {
"circle-radius": resource.pointsize,
"circle-color": resource.color
},
"interactive": true
}
}, {
"id": "gl-draw-point-active-halo",
"type": "circle",
Expand All @@ -27,8 +26,7 @@ define(function() {
"paint": {
"circle-radius": resource.pointsize,
"circle-color": "#FFF"
},
"interactive": true
}
}, {
"id": "gl-draw-point-active",
"type": "circle",
Expand All @@ -41,8 +39,7 @@ define(function() {
"paint": {
"circle-radius": resource.pointsize * 0.75,
"circle-color": resource.color
},
"interactive": true
}
},{
"id": "gl-draw-line",
"type": "line",
Expand All @@ -57,8 +54,7 @@ define(function() {
"line-color": resource.color,
// "line-dasharray": [0.2, 2],
"line-width": resource.linewidth
},
"interactive": true
}
}, {
"id": "gl-draw-polygon-fill",
"type": "fill",
Expand All @@ -69,8 +65,7 @@ define(function() {
"fill-color": resource.color,
"fill-outline-color": resource.color,
"fill-opacity": 0.1
},
"interactive": true
}
}, {
"id": "gl-draw-polygon-stroke-active",
"type": "line",
Expand All @@ -85,8 +80,7 @@ define(function() {
"line-color": resource.color,
// "line-dasharray": [0.2, 2],
"line-width": resource.linewidth
},
"interactive": true
}
}, {
"id": "gl-draw-polygon-and-line-vertex-halo-active",
"type": "circle",
Expand All @@ -97,8 +91,7 @@ define(function() {
"paint": {
"circle-radius": resource.pointsize,
"circle-color": "#FFF"
},
"interactive": true
}
}, {
"id": "gl-draw-polygon-and-line-vertex-active",
"type": "circle",
Expand All @@ -109,8 +102,7 @@ define(function() {
"paint": {
"circle-radius": resource.pointsize * 0.75,
"circle-color": resource.color,
},
"interactive": true
}
}, {
"id": "gl-draw-polygon-and-line-midpoint-halo-active",
"type": "circle",
Expand All @@ -121,8 +113,7 @@ define(function() {
"paint": {
"circle-radius": resource.pointsize,
"circle-color": "#FFF"
},
"interactive": true
}
}, {
"id": "gl-draw-polygon-and-line-midpoint-active",
"type": "circle",
Expand All @@ -133,8 +124,7 @@ define(function() {
"paint": {
"circle-radius": resource.pointsize * 0.75,
"circle-color": resource.color,
},
"interactive": true
}
}
];
}
Expand Down
29 changes: 5 additions & 24 deletions arches/db/dml/db_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2357,8 +2357,7 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
"paint": {
"fill-color": "#d2edae",
"fill-opacity": 0.75
},
"interactive": true
}
},{
"id": "landuse_park",
"type": "fill",
Expand All @@ -2371,8 +2370,7 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
],
"paint": {
"fill-color": "#d2edae"
},
"interactive": true
}
},{
"id": "waterway",
"type": "line",
Expand Down Expand Up @@ -2407,28 +2405,24 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
]
]
}
},
"interactive": true
}
},{
"id": "water",
"type": "fill",
"source": "mapbox-streets",
"source-layer": "water",
"paint": {
"fill-color": "#a0cfdf"
},
"interactive": true
}
},{
"id": "building",
"type": "fill",
"source": "mapbox-streets",
"source-layer": "building",
"paint": {
"fill-color": "#d6d6d6"
},
"interactive": true
}
},{
"interactive": true,
"layout": {
"line-cap": "butt",
"line-join": "miter"
Expand Down Expand Up @@ -2486,7 +2480,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "road"
},{
"interactive": true,
"layout": {
"line-cap": "butt",
"line-join": "miter"
Expand Down Expand Up @@ -2541,7 +2534,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "road"
},{
"interactive": true,
"layout": {
"line-cap": "round",
"line-join": "round"
Expand Down Expand Up @@ -2596,7 +2588,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "road"
},{
"interactive": true,
"layout": {
"line-cap": "round",
"line-join": "round"
Expand Down Expand Up @@ -2648,7 +2639,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "road"
},{
"interactive": true,
"layout": {
"line-cap": "butt",
"line-join": "miter"
Expand Down Expand Up @@ -2715,7 +2705,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "road"
},{
"interactive": true,
"layout": {
"line-cap": "butt",
"line-join": "miter"
Expand Down Expand Up @@ -2779,7 +2768,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "road"
},{
"interactive": true,
"layout": {
"line-cap": "round",
"line-join": "round"
Expand Down Expand Up @@ -2833,7 +2821,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "road"
},{
"interactive": true,
"layout": {
"line-cap": "round",
"line-join": "round"
Expand Down Expand Up @@ -2884,7 +2871,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "road"
},{
"interactive": true,
"layout": {
"line-cap": "round",
"line-join": "round"
Expand Down Expand Up @@ -2931,7 +2917,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "admin"
},{
"interactive": true,
"minzoom": 5,
"layout": {
"icon-image": "{maki}-11",
Expand Down Expand Up @@ -2981,7 +2966,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "poi_label"
},{
"interactive": true,
"layout": {
"symbol-placement": "line",
"text-field": "{name_en}",
Expand Down Expand Up @@ -3032,7 +3016,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "road_label"
},{
"interactive": true,
"minzoom": 8,
"layout": {
"text-field": "{name_en}",
Expand Down Expand Up @@ -3083,7 +3066,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "place_label"
},{
"interactive": true,
"layout": {
"text-field": "{name_en}",
"text-font": [
Expand Down Expand Up @@ -3129,7 +3111,6 @@ INSERT INTO map_layers(maplayerid, name, layerdefinitions, isoverlay, icon)
},
"source-layer": "place_label"
},{
"interactive": true,
"layout": {
"text-field": "{name_en}",
"text-font": [
Expand Down

0 comments on commit 8a298ea

Please sign in to comment.