Commit c60aefd0 authored by Eric Duminil's avatar Eric Duminil
Browse files

Different color, hopefully suitable to multiple layers

parent e99b059a
...@@ -9,9 +9,9 @@ const regionChooser = (function () { ...@@ -9,9 +9,9 @@ const regionChooser = (function () {
const styles = {}; const styles = {};
styles.original = utils.polygon_style('#447744', 0.2); styles.original = utils.polygon_style("#ee4266", 0.2);
styles.highlighted = utils.polygon_style("#ff44a2", 0.7); styles.highlighted = utils.polygon_style("#540d6e", 0.5, 5);
styles.selected = utils.polygon_style("#ffff00", 0.8); styles.selected = utils.polygon_style("#540d6e", 0.7, 5);
publicScope.init = function () { publicScope.init = function () {
//NOTE: Only called from JavaFX. At startup, or when Repo has been changed. //NOTE: Only called from JavaFX. At startup, or when Repo has been changed.
...@@ -41,7 +41,6 @@ const regionChooser = (function () { ...@@ -41,7 +41,6 @@ const regionChooser = (function () {
}); });
var arcgis_satellite = new ol.layer.Tile({ var arcgis_satellite = new ol.layer.Tile({
// TODO: Change polygon color when selected
source: new ol.source.XYZ({ source: new ol.source.XYZ({
attributions: "", attributions: "",
url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
......
...@@ -54,14 +54,14 @@ utils.is_polygon = function (geom) { ...@@ -54,14 +54,14 @@ utils.is_polygon = function (geom) {
return ('getType' in geom) && (geom.getType() === 'Polygon'); return ('getType' in geom) && (geom.getType() === 'Polygon');
} }
utils.polygon_style = function (color, alpha) { utils.polygon_style = function (color, alpha, width=3) {
return new ol.style.Style({ return new ol.style.Style({
fill: new ol.style.Fill({ fill: new ol.style.Fill({
color: 'rgba(255, 255, 255,' + alpha + ')' color: 'rgba(255, 255, 255,' + alpha + ')'
}), }),
stroke: new ol.style.Stroke({ stroke: new ol.style.Stroke({
color: color, color: color,
width: 2, width: width,
lineDash: [5, 10] lineDash: [5, 10]
}), }),
}); });
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment