-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
belgiumuwh iframe map first try (#95)
For #93 add an iframe map. So far in the same style as the hockey tourist map.
- Loading branch information
1 parent
aebfc27
commit f0f13eb
Showing
3 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE HTML> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Clubs in Belgium - Infogram</title> | ||
<script src='//api.mapbox.com/mapbox.js/v3.1.1/mapbox.js'></script> | ||
<link href='//api.mapbox.com/mapbox.js/v3.1.1/mapbox.css' rel='stylesheet' /> | ||
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js'></script> | ||
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css' rel='stylesheet' /> | ||
</head> | ||
<body> | ||
|
||
<div id='map' style="height: 800px; width: 100%" ></div> | ||
|
||
|
||
<script> | ||
mapboxgl.accessToken = '{{ mapbox_access_token }}'; | ||
|
||
|
||
var map = new mapboxgl.Map({ | ||
container: 'map', | ||
style: 'mapbox://styles/mapbox/light-v9', | ||
}); | ||
|
||
map.on('load', function() { | ||
var sw = new mapboxgl.LngLat(2.8, 49.3846); | ||
var ne = new mapboxgl.LngLat(6.1, 51.6242); | ||
var bounds = new mapboxgl.LngLatBounds(sw, ne); | ||
var camera = map.cameraForBounds(bounds); | ||
map.jumpTo(camera); | ||
|
||
map.loadImage('/static/crosssticks60.png', function(error, image) { | ||
if (error) throw error; | ||
map.addImage('crosssticks', image); | ||
map.addLayer({ | ||
'id': 'placegeojson', | ||
'source': { | ||
'type': 'geojson', | ||
'data': '/tourist/data/place/be.geojson', | ||
}, | ||
'type': 'symbol', | ||
'layout': { | ||
'icon-image': 'crosssticks', | ||
'icon-padding': 0, | ||
'icon-size': 0.5, | ||
'icon-allow-overlap':true, | ||
'text-font': ['Open Sans Semibold', 'Arial Unicode MS Bold'], | ||
'text-field': '{title}', | ||
'text-optional': false, | ||
'text-allow-overlap': true, | ||
'text-offset': [0, 0.6], | ||
'text-anchor': 'top' | ||
} | ||
}); | ||
}); | ||
}); | ||
</script> | ||
|
||
</body> |