From 60339ea771a791d6d8b79fb6d74dae883dd6452e Mon Sep 17 00:00:00 2001 From: Sean Eidemiller Date: Mon, 5 Feb 2024 19:45:08 -0800 Subject: [PATCH 1/5] Map stays roughly centered when zooming in and out. --- common/scripts/map_actions.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/common/scripts/map_actions.js b/common/scripts/map_actions.js index f896052..796d4bf 100644 --- a/common/scripts/map_actions.js +++ b/common/scripts/map_actions.js @@ -1324,6 +1324,29 @@ function scaleView(zoom) { var dim_str = dimension.toString() + "px"; var scale = properties.zoom / last_zoom; + var scroll_element = document.scrollingElement; + var scroll_top = scroll_element.scrollTop; + var scroll_left = scroll_element.scrollLeft; + var scroll_height = scroll_element.scrollHeight; + var scroll_width = scroll_element.scrollWidth; + var client_height = scroll_element.clientHeight; + var client_width = scroll_element.clientWidth; + var scroll_left_ratio = scroll_left / scroll_width; + var scroll_top_ratio = scroll_top / scroll_height; + var offset_right = scroll_width - (scroll_left + client_width); + var offset_bottom = scroll_height - (scroll_top + client_height); + + setTimeout(function() { + scroll_element.scrollTop = scroll_element.scrollHeight * scroll_top_ratio; + scroll_element.scrollLeft = scroll_element.scrollWidth * scroll_left_ratio; + var new_offset_right = scroll_element.scrollWidth - (scroll_element.scrollLeft + client_width); + var new_offset_bottom = scroll_element.scrollHeight - (scroll_element.scrollTop + client_height); + var diff_right = offset_right - new_offset_right; + var diff_bottom = offset_bottom - new_offset_bottom; + scroll_element.scrollLeft = scroll_element.scrollLeft - (diff_right / 2) / 2; + scroll_element.scrollTop = scroll_element.scrollTop - (diff_bottom / 2) / 2; + }, 0); + var base_map = document.getElementById('map'); base_map.style.height = dim_str; base_map.style.width = dim_str; From 2cfa0b07f8a5517d21963b5a9e6e53edc2cf1980 Mon Sep 17 00:00:00 2001 From: Sean Eidemiller <157770408+rsedevnet@users.noreply.github.com> Date: Tue, 6 Feb 2024 19:38:25 -0800 Subject: [PATCH 2/5] Scroll compensation on zoom now happening in the same event loop. (#22) Fix flicker and better centering - Scroll compensation on zoom now happening in the same event loop (no flickering). - Removed vi swap files added accidentally. - Added .gitignore with vi swap files. --------- Co-authored-by: Sean Eidemiller --- .gitignore | 3 +++ common/scripts/map_actions.js | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c756c3c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# vi swap files +*.swo +*.swp diff --git a/common/scripts/map_actions.js b/common/scripts/map_actions.js index 796d4bf..aa4520a 100644 --- a/common/scripts/map_actions.js +++ b/common/scripts/map_actions.js @@ -1336,16 +1336,16 @@ function scaleView(zoom) { var offset_right = scroll_width - (scroll_left + client_width); var offset_bottom = scroll_height - (scroll_top + client_height); - setTimeout(function() { - scroll_element.scrollTop = scroll_element.scrollHeight * scroll_top_ratio; - scroll_element.scrollLeft = scroll_element.scrollWidth * scroll_left_ratio; - var new_offset_right = scroll_element.scrollWidth - (scroll_element.scrollLeft + client_width); - var new_offset_bottom = scroll_element.scrollHeight - (scroll_element.scrollTop + client_height); - var diff_right = offset_right - new_offset_right; - var diff_bottom = offset_bottom - new_offset_bottom; - scroll_element.scrollLeft = scroll_element.scrollLeft - (diff_right / 2) / 2; - scroll_element.scrollTop = scroll_element.scrollTop - (diff_bottom / 2) / 2; - }, 0); + scroll_element.scrollTop = scroll_height * scroll_top_ratio * scale; + scroll_element.scrollLeft = scroll_width * scroll_left_ratio * scale; + + var new_offset_right = scroll_element.scrollWidth * scale - (scroll_element.scrollLeft + client_width); + var new_offset_bottom = scroll_element.scrollHeight * scale - (scroll_element.scrollTop + client_height); + var diff_right = offset_right - new_offset_right; + var diff_bottom = offset_bottom - new_offset_bottom; + + scroll_element.scrollTop = scroll_element.scrollTop - (diff_bottom / 2) / 2; + scroll_element.scrollLeft = scroll_element.scrollLeft - (diff_right / 2) / 2; var base_map = document.getElementById('map'); base_map.style.height = dim_str; From ab5c93e22e6f6b41c86e14f4141cb23053491012 Mon Sep 17 00:00:00 2001 From: Onno Hommes Date: Tue, 27 Feb 2024 00:17:15 -0800 Subject: [PATCH 3/5] Add scroll wheel zoom This patch adds the ability to zoom with the scroll wheel like in BMS. Also the zoom can now go from 50% to 200% so greater range with a default of 100%. Issue: #5 --- common/scripts/map_actions.js | 36 +++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/common/scripts/map_actions.js b/common/scripts/map_actions.js index aa4520a..bdfb97d 100644 --- a/common/scripts/map_actions.js +++ b/common/scripts/map_actions.js @@ -97,6 +97,12 @@ var properties = { } }; +const limits = { + zoom_max: 2.0, + zoom_min: 0.5, + wheel_rate_hz: 20 +} + // Toolbar Icons for actions const toolbar = { icon: { @@ -827,13 +833,13 @@ function button(e) { break; case "zoom1": - if (id == "zoom1" && properties.zoom > 0.55) { - if (e.shiftKey) properties.zoom = 0.55; + if (id == "zoom1" && properties.zoom > limits.zoom_min) { + if (e.shiftKey) properties.zoom = limits.zoom_min; else properties.zoom -= 0.05; } case "zoom2": - if (id == "zoom2" && properties.zoom < 1.0) { - if (e.shiftKey) properties.zoom = 1; + if (id == "zoom2" && properties.zoom < limits.zoom_max) { + if (e.shiftKey) properties.zoom = limits.zoom_max; else properties.zoom += 0.05; } scaleView(properties.zoom); @@ -1222,6 +1228,26 @@ var pointer_end = function(e) { properties.ctrl = false; } +var wheel_enabled = true; +function enable_wheel() { + wheel_enabled = true; +} + +// Allow zooming with the mouse but limit it to a set wheel rate +// See Limiters (20 hz) +var mouse_zoom = function(e) { + e.preventDefault(); + var zoom = properties.zoom - (e.deltaY/200); + if ( wheel_enabled && zoom >= limits.zoom_min && zoom <= limits.zoom_max ) { + properties.zoom = zoom; + scaleView(properties.zoom); + saveSettings(); + refreshCanvas(); + wheel_enabled = false; + setTimeout(enable_wheel, (1 / limits.wheel_rate_hz) * 1000); + } +} + // // Canvas and Layer Routines // @@ -1640,6 +1666,7 @@ window.onload = function(e) { this.addEventListener('mousedown', pointer_start); this.addEventListener('mousemove', pointer_drag); this.addEventListener('mouseup', pointer_end); + this.addEventListener("wheel", mouse_zoom, {passive:false} ); // Trigger a Render updateToolbar(); @@ -1648,6 +1675,7 @@ window.onload = function(e) { window.scrollTo(bullseye.x-window.innerWidth/2,bullseye.y-window.innerHeight/2); // Draw the Layers + enable_wheel(); scaleView(properties.zoom); refreshCanvas(); } From fbaeae83e7edcf552f9a8b34df1f13d4138d976c Mon Sep 17 00:00:00 2001 From: Onno Hommes Date: Tue, 27 Feb 2024 20:30:02 -0800 Subject: [PATCH 4/5] Sync dev branch with main (#27) * Add scroll wheel zoom in and out (#25) * Map stays roughly centered when zooming in and out. * Scroll compensation on zoom now happening in the same event loop. (#22) Fix flicker and better centering - Scroll compensation on zoom now happening in the same event loop (no flickering). - Removed vi swap files added accidentally. - Added .gitignore with vi swap files. --------- Co-authored-by: Sean Eidemiller * Add scroll wheel zoom This patch adds the ability to zoom with the scroll wheel like in BMS. Also the zoom can now go from 50% to 200% so greater range with a default of 100%. Issue: #5 --------- Co-authored-by: Sean Eidemiller Co-authored-by: MaxWaldorf Co-authored-by: Sean Eidemiller <157770408+rsedevnet@users.noreply.github.com> * Fix Issue #17 repeated rescaling of image map. Repeated scaling of image map will after a while make the image map coordinates diverge from the location of the airport on the map. To fix this the coordinates of the image map will be cached and used for calculating the new image map coordinates when scaling is applie. This patch also now resizes the airport locator circle so it is not a tiny circle when zoomed to 200%. --------- Co-authored-by: Sean Eidemiller Co-authored-by: MaxWaldorf Co-authored-by: Sean Eidemiller <157770408+rsedevnet@users.noreply.github.com> --- common/scripts/map_actions.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/common/scripts/map_actions.js b/common/scripts/map_actions.js index bdfb97d..5907557 100644 --- a/common/scripts/map_actions.js +++ b/common/scripts/map_actions.js @@ -221,7 +221,7 @@ function locateAirport(list) { refreshCanvas(); x = parseInt(coords[0]); y = parseInt(coords[1]); - drawHighlight(context,x,y,radius); + drawHighlight(context,x,y,radius * properties.zoom); // Make the airport the focus window.scrollTo(x-window.innerWidth/2,y-window.innerHeight/2); @@ -538,14 +538,21 @@ function selectVisibility(list) { refreshCanvas(); } +var hotspots; +function storeMapCoordinates() { + var imgMap = document.getElementById("imgMap"); + hotspots = []; + for (area of imgMap.children) hotspots.push(area); +} // Scale the image map coordinates to match the airport overlay image function scaleMap(scale) { var imageMap = document.getElementById("imgMap"); var areas = imageMap.children; + i = 0; for (area of areas) { - area.coordArr = area.coords.split(','); - area.coords = area.coordArr.map(coord => Math.round(coord * scale)).join(','); + var coordArr = hotspots[i++].coords.split(','); + area.coords = coordArr.map(coord => Math.round(coord * scale)).join(','); if (area.alt == "Legend") properties.legend = area.coords; if (area.alt == "Bullseye") bullseye.coords = area.coords; } @@ -1641,7 +1648,9 @@ window.onload = function(e) { // Adjust map to used scale // Safari will slow beyond 3840 canvas size + storeMapCoordinates(); scaleMap(3840/4096); + storeMapCoordinates(); // Setup the Layers to be rendered on the main canvas setupLayer(layer.mission, canvas.width, canvas.height ); From a13db8afe38565b49512dce51a97e7a588c2bb86 Mon Sep 17 00:00:00 2001 From: Onno Hommes Date: Thu, 3 Jul 2025 01:03:48 -0700 Subject: [PATCH 5/5] Prepare for 4.38 Maps New landing page and under construction for 4.38 Maps. --- index.html | 182 +++++++++++++++++++++++++++++------------------------ 1 file changed, 100 insertions(+), 82 deletions(-) diff --git a/index.html b/index.html index ce59b3a..67068bb 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,14 @@ -Falcon BMS - Interactive Maps (BMS 4.37) +Falcon BMS - Interactive Maps -
-
- -
+
+
+ + +
+
+
-

Falcon BMS 4.37 - Interactive Maps


- You find here Interactive Maps providing access to airbase and airstrip information for the respective theater of operations. The maps provide the following features: -
    -
  • Locate airports and navigation beacons and request their information by hovering over them
  • -
  • Move map, zoom in/out and measure distances on map
  • -
  • Mission.ini or Pilot.ini drag and drop to show route on map and more.
  • -
  • Full whiteboard collaboration using collaboration server
  • -
  • Save Whiteboard(.png) and restore with drag and drop
  • -
  • MIL-STD-2525D symbology
  • -
  • Weather import (fmap drop) for weather charts (Temperature, Doppler, Winds, Isobars)
  • -
  • Route Waypoint dialog (actions, heading, distance and duration updates, etc)
  • -
  • Computed Mission Flight Info, Mission Radio Frequencies and Mission Objectives
  • -
  • Show Lat/Long on map and x,y of image map
  • -
  • Aerodrome Weather Report (METAR) as tooltips and on route dialog (uses) fmap
  • -
  • Add notes on Whiteboard
  • -
  • Bullseye placement
  • -
  • Download and Import GFS data and files
  • -
-
Change log  |  Manual (PDF)
-
+

Falcon BMS - Interactive Maps


+

Theater Maps 4.37

+ @@ -193,7 +142,76 @@
Korea Theater
UNDER CONSTRUCTION +
+ + + + + + + + + + + + +
Korea Theater
Rev: 26 JUNE 2023
Balkans Theater
Rev: 26 JUNE 2023
Israel Theater
Rev: 26 JUNE 2023
Balkans Theater
UNDER CONSTRUCTION
Israel Theater
UNDER CONSTRUCTION
Hellenic Theater
UNDER CONSTRUCTION
+
+
+ Korea Theater +
+ +
+
+
+
+ Balkans Theater +
+ +
+
+
+
+ Israel Theater +
+ +
+
+
+
+ Hellenic Theater +
+ +
+
+
+

Map Features

+ The maps provide the following features: +
    +
  • Locate airports and navigation beacons and request their information by hovering over them
  • +
  • Move map, zoom in/out and measure distances on map
  • +
  • Mission.ini or Pilot.ini drag and drop to show route on map and more.
  • +
  • Full whiteboard collaboration using collaboration server
  • +
  • Save Whiteboard(.png) and restore with drag and drop
  • +
  • MIL-STD-2525D symbology
  • +
  • Weather import (fmap drop) for weather charts (Temperature, Doppler, Winds, Isobars)
  • +
  • Route Waypoint dialog (actions, heading, distance and duration updates, etc)
  • +
  • Computed Mission Flight Info, Mission Radio Frequencies and Mission Objectives
  • +
  • Show Lat/Long on map and x,y of image map
  • +
  • Aerodrome Weather Report (METAR) as tooltips and on route dialog (uses) fmap
  • +
  • Download and Import GFS data and files
  • +
  • Bullseye placement
  • +
+
Change log  |  Manual (PDF)
+
- \ No newline at end of file +