Skip to content
Permalink
Browse files

New worldmap option 'worldmap_tiles_saturate' - dim colors of OpenStr…

…eetMap
  • Loading branch information...
vpithart authored and LarsMichelsen committed Jul 4, 2019
1 parent 8a1054a commit c20dfd2a83c43a7bdd485345825bcb93985a71cb
@@ -49,6 +49,7 @@ <h2>The first call</h2>
sources=worldmap
worldmap_center=50.86837814203458,10.21728515625
worldmap_zoom=6
worldmap_tiles_saturate=33
}</pre>

<p>Only the last three attributes are worldmap specific definitions, all of them are mandatory for
@@ -63,6 +64,8 @@ <h2>The first call</h2>
<p>The <code>worldmap_zoom=6</code> specifies the initial zoom level to be used when rendering the worldmap.
NagVis allows zoom levels from 2 to 18.</p>

<p>The <code>worldmap_tiles_saturate=33</code> dims the colors of default OpenStreetMap so that red motorways or
large green forests don't interfere with actual map objects. Possible values are 0 (no colors, grayscale) through 100 (full colors).</p>

<h2>Create your own worldmap</h2>

@@ -6,6 +6,7 @@ define global {
backend_id=demo
worldmap_center=50.86837814203458,10.21728515625
worldmap_zoom=6
worldmap_tiles_saturate=33
iconset=std_geo
icon_size=32
}
@@ -80,6 +80,12 @@ var ViewWorldmap = ViewMap.extend({
if (typeof checkHideMenu !== "undefined")
g_map.on('mousedown', checkHideMenu);
g_map.on('mousedown', context_handle_global_mousedown);

// dim the colors of map background so that red motorways don't distract
let saturate_percentage = getViewParam('worldmap_tiles_saturate')
let ltp = document.getElementsByClassName('leaflet-tile-pane');
if (ltp && saturate_percentage !== '')
ltp[0].style.filter = `saturate(${saturate_percentage}%)`
},

handleMoveStart: function(lEvent) {
@@ -32,6 +32,11 @@ class WorldmapError extends MapSourceError {}
'default' => 6,
'match' => MATCH_WORLDMAP_ZOOM,
),
'worldmap_tiles_saturate' => array(
'must' => false,
'default' => '',
'match' => MATCH_INTEGER_EMPTY,
),
/*** OBJECT OPTIONS ***/
'min_zoom' => array(
@@ -53,6 +58,7 @@ class WorldmapError extends MapSourceError {}
'worldmap' => array(
'worldmap_center' => null,
'worldmap_zoom' => null,
'worldmap_tiles_saturate' => null,
),
),
);

0 comments on commit c20dfd2

Please sign in to comment.
You can’t perform that action at this time.