Skip to content
This repository was archived by the owner on Dec 6, 2019. It is now read-only.

Commit 2210d6b

Browse files
Nabeel Shahzadnabeelio
authored andcommitted
Scrollwheel enabled by default and use MAP_ZOOM_LEVEL
1 parent 9b6b099 commit 2210d6b

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

core/app.config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
Config::Set('MAP_LINE_COLOR', '#ff0000');
105105
Config::Set('MAP_CENTER_LAT', '45.484400');
106106
Config::Set('MAP_CENTER_LNG', '-62.334821');
107-
Config::Set('MAP_ZOOM_LEVEL', 12);
107+
Config::Set('MAP_ZOOM_LEVEL', 5);
108108

109109
# ACARS options
110110
# Minutes, flights to show on the ACARS

core/templates/acarsmap.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ const opts = {
152152
render_elem: 'acarsmap',
153153
provider: '<?php echo Config::Get("MAP_TYPE"); ?>',
154154
autozoom: true,
155-
zoom: 5,
155+
zoom: <?php echo Config::Get('MAP_ZOOM_LEVEL'); ?>,
156156
center: L.latLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"),
157157
refreshTime: 10000
158158
};

lib/js/base_map.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ const MapFeatures = {
2121
};
2222

2323
/**
24-
* Create a new map onto a given element
25-
* @param {} opts
24+
* Create a new map onto a given element. If you have or want to add
25+
* any Leaflet plugins, just apply them here above the return statement
26+
* They'll be applied to both the ACARS and PIREP maps
27+
* @param {} opts Options to override
2628
*/
2729
const createMap = (opts) => {
2830
opts = Object.assign({
@@ -38,7 +40,7 @@ const createMap = (opts) => {
3840
let map = L.map(opts.render_elem, {
3941
center: opts.center,
4042
zoom: opts.zoom,
41-
scrollWheelZoom: false,
43+
scrollWheelZoom: true,
4244
});
4345

4446
// Want to customizer the basemap? Look at the leaflet-providers page:
@@ -47,5 +49,5 @@ const createMap = (opts) => {
4749
// Some providers require an API key, so just look out for that
4850
L.tileLayer.provider(opts.provider).addTo(map);
4951

50-
return map
52+
return map;
5153
};

0 commit comments

Comments
 (0)