Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

prevent glitchy vector rendering onZoom #2840

Benjamin Kingbf2070d01f72
diff --git a/config/default/common/vectorstyles/GRanD_Dams.json b/config/default/common/vectorstyles/GRanD_Dams.json
new file mode 100644
index 000000000..9f3ead3fd
--- /dev/null
+++ b/config/default/common/vectorstyles/GRanD_Dams.json
@@ -0,0 +1,54 @@
+{
+ "version": 8,
+ "name": "SEDAC",
+ "sources": {
+ "GRanD_Dams": {
+ "type": "vector",
+ "tiles": [
+ "https://gibs.earthdata.nasa.gov/wmts/epsg4326/std/GRanD_Dams_v1.01_STD/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.mvt"
+ ]
+ }
+ },
+ "layers": [
+ {
+ "id": "GRanD_Dams_v1.01_STD",
+ "source": "GRanD_Dams",
+ "source-layer": "GRanD_Dams_v1.01_STD",
+ "source-description": "Default",
+ "type": "circle",
+ "paint": {
+ "circle-radius":[
+ "step",
+ [
+ "zoom"
+ ],
+ 1,
+ 17,
+ 2,
+ 19,
+ 3,
+ 22,
+ 7
+ ],
+ "circle-color": ["match",
+ ["get", "MAIN_USE"],
+ "Fisheries",
+ "rgb(152, 230, 0)",
+ "Flood control",
+ "rgb(168, 0, 0)",
+ "Hydroelectricity",
+ "rgb(230, 230, 0)",
+ "Navigation",
+ "rgb(230, 152, 0)",
+ "Other",
+ "rgb(255, 190, 232)",
+ "Recreation",
+ "rgb(132, 0, 168)",
+ "Water supply",
+ "rgb(38, 115, 0)",
+ "rgb(255, 255, 255)"
+ ]
+ }
+ }
+ ]
+}
diff --git a/tasks/buildOptions.sh b/tasks/buildOptions.sh
index ac5df1996..f2d15decd 100755
--- a/tasks/buildOptions.sh
+++ b/tasks/buildOptions.sh
@@ -71,7 +71,7 @@ if [ -e "$BUILD_DIR/config.json" ] ; then
"$BUILD_DIR/_wmts"
fi
-# # Run processVectorStyles.py and move vectorstyles where we want them
+# # Run copyVectorStyles.py and move vectorstyles where we want them
if [ -e "$BUILD_DIR/vectorstyles" ] ; then
mkdir -p "$BUILD_DIR"/config/vectorstyles
if [ -d "$BUILD_DIR"/gc/vectorstyles ] ; then
@@ -82,14 +82,14 @@ if [ -e "$BUILD_DIR/vectorstyles" ] ; then
"$BUILD_DIR/config/vectorstyles"
fi
-# Run processVectorData.py and move vectordata where we want them
+# Run processVectorStyles.py and move vectordata where we want them
if [ -e "$BUILD_DIR/vectorstyles" ] ; then
mkdir -p "$BUILD_DIR"/config/wv.json/vectorstyles
if [ -d "$BUILD_DIR"/gc/vectorstyles ] ; then
cp -r "$BUILD_DIR"/gc/vectorstyles "$BUILD_DIR"
fi
"$PYTHON_SCRIPTS_DIR/processVectorStyles.py" "$OPT_DIR/$OPT_SUBDIR/config.json" \
- "$BUILD_DIR/vectorstyles" \
+ "$BUILD_DIR/config/vectorstyles" \
"$BUILD_DIR/config/wv.json/vectorstyles"
fi
diff --git a/tasks/python3/copyVectorStyles.py b/tasks/python3/copyVectorStyles.py
index 456ce0ba3..50ea56652 100755
--- a/tasks/python3/copyVectorStyles.py
+++ b/tasks/python3/copyVectorStyles.py
@@ -43,12 +43,17 @@ def copy_file(file):
# Main
file_count = 0
error_count = 0
+file_list = []
for root, dirs, files in os.walk(vectorstyles_input_dir):
for file in files:
try:
- file_count += 1
- copy_file(file)
+ if file in file_list:
+ print(f'{file} is present in the vectorStyle List')
+ else:
+ file_count += 1
+ copy_file(file)
+ file_list.append(file)
except Exception as e:
sys.stderr.write("%s: ERROR: [%s] %s\n" % (prog, file, str(e)))
error_count += 1
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index 13e1082ae..5400c0a9a 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -436,7 +436,7 @@ export default function mapLayerBuilder(models, config, cache, ui, store) {
const layer = new LayerVectorTile({
extent: layerExtent,
source: sourceOptions,
- renderMode: wrapX ? 'image' : 'hybrid', // Todo: revert to just 'image' when styles are updated
+ renderMode: 'image',
});
if (config.vectorStyles && def.vectorStyle && def.vectorStyle.id) {