-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
399 additions
and
509 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,32 @@ | ||
const _ = require('lodash') | ||
const leaflet = require('leaflet') | ||
|
||
const _ = require('lodash'); | ||
const leaflet = require('leaflet'); | ||
|
||
import draw_base_map from './base_map'; | ||
import draw_base_map from './base_map' | ||
|
||
/** | ||
* Render a map with the airspace, etc around a given set of coords | ||
* e.g, the airport map | ||
* @param opts | ||
*/ | ||
export default (opts) => { | ||
opts = _.defaults(opts, { | ||
render_elem: 'map', | ||
overlay_elem: '', | ||
lat: 0, | ||
lon: 0, | ||
zoom: 12, | ||
layers: [], | ||
set_marker: false, | ||
}); | ||
opts = _.defaults(opts, { | ||
render_elem: 'map', | ||
overlay_elem: '', | ||
lat: 0, | ||
lon: 0, | ||
zoom: 12, | ||
layers: [], | ||
set_marker: false, | ||
}) | ||
|
||
let map = draw_base_map(opts); | ||
const coords = [opts.lat, opts.lon]; | ||
console.log('Applying coords', coords); | ||
let map = draw_base_map(opts) | ||
const coords = [opts.lat, opts.lon] | ||
console.log('Applying coords', coords) | ||
|
||
map.setView(coords, opts.zoom); | ||
if (opts.set_marker === true) { | ||
leaflet.marker(coords).addTo(map); | ||
} | ||
map.setView(coords, opts.zoom) | ||
if (opts.set_marker === true) { | ||
leaflet.marker(coords).addTo(map) | ||
} | ||
|
||
return map; | ||
return map | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,71 @@ | ||
const _ = require('lodash'); | ||
const leaflet = require('leaflet'); | ||
const _ = require('lodash') | ||
const leaflet = require('leaflet') | ||
|
||
export default (opts) => { | ||
|
||
opts = _.defaults(opts, { | ||
render_elem: 'map', | ||
center: [29.98139, -95.33374], | ||
zoom: 5, | ||
maxZoom: 10, | ||
layers: [], | ||
set_marker: false, | ||
}); | ||
opts = _.defaults(opts, { | ||
render_elem: 'map', | ||
center: [29.98139, -95.33374], | ||
zoom: 5, | ||
maxZoom: 10, | ||
layers: [], | ||
set_marker: false, | ||
}) | ||
|
||
let feature_groups = []; | ||
/*var openaip_airspace_labels = new leaflet.TileLayer.WMS( | ||
"http://{s}.tile.maps.openaip.net/geowebcache/service/wms", { | ||
maxZoom: 14, | ||
minZoom: 12, | ||
layers: 'openaip_approved_airspaces_labels', | ||
tileSize: 1024, | ||
detectRetina: true, | ||
subdomains: '12', | ||
format: 'image/png', | ||
transparent: true | ||
}); | ||
let feature_groups = [] | ||
/*var openaip_airspace_labels = new leaflet.TileLayer.WMS( | ||
"http://{s}.tile.maps.openaip.net/geowebcache/service/wms", { | ||
maxZoom: 14, | ||
minZoom: 12, | ||
layers: 'openaip_approved_airspaces_labels', | ||
tileSize: 1024, | ||
detectRetina: true, | ||
subdomains: '12', | ||
format: 'image/png', | ||
transparent: true | ||
}); | ||
openaip_airspace_labels.addTo(map);*/ | ||
openaip_airspace_labels.addTo(map);*/ | ||
|
||
const opencyclemap_phys_osm = new leaflet.TileLayer( | ||
'http://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=f09a38fa87514de4890fc96e7fe8ecb1', { | ||
maxZoom: 14, | ||
minZoom: 4, | ||
format: 'image/png', | ||
transparent: true | ||
}); | ||
const opencyclemap_phys_osm = new leaflet.TileLayer( | ||
'http://{s}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=f09a38fa87514de4890fc96e7fe8ecb1', { | ||
maxZoom: 14, | ||
minZoom: 4, | ||
format: 'image/png', | ||
transparent: true | ||
}) | ||
|
||
feature_groups.push(opencyclemap_phys_osm); | ||
feature_groups.push(opencyclemap_phys_osm) | ||
|
||
/*const openaip_cached_basemap = new leaflet.TileLayer("http://{s}.tile.maps.openaip.net/geowebcache/service/tms/1.0.0/openaip_basemap@EPSG%3A900913@png/{z}/{x}/{y}.png", { | ||
maxZoom: 14, | ||
minZoom: 4, | ||
tms: true, | ||
detectRetina: true, | ||
subdomains: '12', | ||
format: 'image/png', | ||
transparent: true | ||
}); | ||
/*const openaip_cached_basemap = new leaflet.TileLayer("http://{s}.tile.maps.openaip.net/geowebcache/service/tms/1.0.0/openaip_basemap@EPSG%3A900913@png/{z}/{x}/{y}.png", { | ||
maxZoom: 14, | ||
minZoom: 4, | ||
tms: true, | ||
detectRetina: true, | ||
subdomains: '12', | ||
format: 'image/png', | ||
transparent: true | ||
}); | ||
feature_groups.push(openaip_cached_basemap); | ||
*/ | ||
feature_groups.push(openaip_cached_basemap); | ||
*/ | ||
|
||
const openaip_basemap_phys_osm = leaflet.featureGroup(feature_groups); | ||
const openaip_basemap_phys_osm = leaflet.featureGroup(feature_groups) | ||
|
||
let map = leaflet.map('map', { | ||
layers: [openaip_basemap_phys_osm], | ||
center: opts.center, | ||
zoom: opts.zoom, | ||
scrollWheelZoom: false, | ||
}); | ||
let map = leaflet.map('map', { | ||
layers: [openaip_basemap_phys_osm], | ||
center: opts.center, | ||
zoom: opts.zoom, | ||
scrollWheelZoom: false, | ||
}) | ||
|
||
const attrib = leaflet.control.attribution({position: 'bottomleft'}); | ||
attrib.addAttribution("<a href=\"https://www.thunderforest.com\" target=\"_blank\" style=\"\">Thunderforest</a>"); | ||
attrib.addAttribution("<a href=\"https://www.openaip.net\" target=\"_blank\" style=\"\">openAIP</a>"); | ||
attrib.addAttribution("<a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\" style=\"\">OpenStreetMap</a> contributors"); | ||
attrib.addAttribution("<a href=\"https://www.openweathermap.org\" target=\"_blank\" style=\"\">OpenWeatherMap</a>"); | ||
const attrib = leaflet.control.attribution({position: 'bottomleft'}) | ||
attrib.addAttribution('<a href="https://www.thunderforest.com" target="_blank" style="">Thunderforest</a>') | ||
attrib.addAttribution('<a href="https://www.openaip.net" target="_blank" style="">openAIP</a>') | ||
attrib.addAttribution('<a href="https://www.openstreetmap.org/copyright" target="_blank" style="">OpenStreetMap</a> contributors') | ||
attrib.addAttribution('<a href="https://www.openweathermap.org" target="_blank" style="">OpenWeatherMap</a>') | ||
|
||
attrib.addTo(map); | ||
attrib.addTo(map) | ||
|
||
return map; | ||
return map | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
export let | ||
PLAN_ROUTE_COLOR = '#36b123', | ||
ACTUAL_ROUTE_COLOR = '#172aea'; | ||
PLAN_ROUTE_COLOR = '#36b123', | ||
ACTUAL_ROUTE_COLOR = '#172aea' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.