summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <yuval@y3xz.com>2015-11-07 02:05:58 +0200
committerYuval Adam <yuval@y3xz.com>2015-11-08 14:26:15 +0200
commit8ec1cf0656747e6fa5bd46c5fba582a264247d9c (patch)
treee197d43adad0b439521565d4a69cbb8da9f0928d
parent343b05af04557aaaa68a627ad1bd8cd990aa6b4e (diff)
Add both 140 and 280 layers
-rw-r--r--templates/index.html50
1 files changed, 30 insertions, 20 deletions
diff --git a/templates/index.html b/templates/index.html
index 1b7e034..614c8f1 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -22,21 +22,6 @@
<div id='map'></div>
<script>
-var RASTER_COORDS_140 = [
- [33.35317413, 33.27232471],
- [36.32243686, 33.27232471],
- [36.32243686, 30.72293428],
- [33.35317413, 30.72293428]
-];
-
-var RASTER_COORDS_280 = [
- [31.93095218, 34.5156862],
- [37.86644267, 34.5156862],
- [37.86644267, 29.42911589],
- [31.93095218, 29.42911589]
-];
-
-
mapboxgl.accessToken = 'pk.eyJ1IjoieXV2YWRtIiwiYSI6InlKdW56cVEifQ.Kp9mM9JFtja5dKeZxHg0DA';
var mapStyle = {
"version": 8,
@@ -46,10 +31,25 @@ var mapStyle = {
"type": "vector",
"url": "mapbox://mapbox.mapbox-streets-v6"
},
- "overlay": {
+ "radar_140": {
+ "type": "image",
+ "url": "/static/140.png",
+ "coordinates": [
+ [33.35317413, 33.27232471],
+ [36.32243686, 33.27232471],
+ [36.32243686, 30.72293428],
+ [33.35317413, 30.72293428]
+ ]
+ },
+ "radar_280": {
"type": "image",
"url": "/static/{{ latest_280 }}_280.png",
- "coordinates": RASTER_COORDS_280
+ "coordinates": [
+ [31.93095218, 34.5156862],
+ [37.86644267, 34.5156862],
+ [37.86644267, 29.42911589],
+ [31.93095218, 29.42911589]
+ ]
}
},
"sprite": "mapbox://sprites/mapbox/dark-v8",
@@ -83,10 +83,20 @@ var mapStyle = {
"paint": {"fill-color": "#111122"}
},
{
- "id": "overlay",
- "source": "overlay",
+ "id": "radar_140",
+ "source": "radar_140",
+ "type": "raster",
+ "paint": {
+ "raster-opacity": 0.85
+ }
+ },
+ {
+ "id": "radar_280",
+ "source": "radar_280",
"type": "raster",
- "paint": {"raster-opacity": 0.85}
+ "paint": {
+ "raster-opacity": 0.85
+ }
},
{
"id": "cities",