mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
mapbg
This commit is contained in:
@@ -40,7 +40,7 @@ def prepare_venv(c):
|
|||||||
permissions='755',
|
permissions='755',
|
||||||
owner='ofm',
|
owner='ofm',
|
||||||
)
|
)
|
||||||
sudo_cmd(c, f'cd {OFM_DIR} && source prepare-virtualenv.sh', user='ofm')
|
sudo_cmd(c, f'cd {OFM_DIR} && source prepare-virtualenv.sh')
|
||||||
|
|
||||||
|
|
||||||
def prepare_tile_gen(c):
|
def prepare_tile_gen(c):
|
||||||
|
|||||||
@@ -1,22 +1,30 @@
|
|||||||
const map = new maplibregl.Map({
|
function initMap(div) {
|
||||||
style: 'https://tiles.openfreemap.org/styles/liberty',
|
const map = new maplibregl.Map({
|
||||||
center: [-0.114, 51.506],
|
style: 'https://tiles.openfreemap.org/styles/liberty',
|
||||||
zoom: 14.2,
|
center: [-0.114, 51.506],
|
||||||
bearing: 55.2,
|
zoom: 14.2,
|
||||||
pitch: 60,
|
bearing: 55.2,
|
||||||
container: 'map',
|
pitch: 60,
|
||||||
boxZoom: false,
|
container: div,
|
||||||
doubleClickZoom: false,
|
// boxZoom: false,
|
||||||
scrollZoom: false,
|
// doubleClickZoom: false,
|
||||||
})
|
// scrollZoom: false,
|
||||||
|
})
|
||||||
|
window.map = map
|
||||||
|
|
||||||
let nav = new maplibregl.NavigationControl({ showCompass: false })
|
let nav = new maplibregl.NavigationControl({ showCompass: false })
|
||||||
map.addControl(nav, 'top-right')
|
map.addControl(nav, 'top-right')
|
||||||
|
|
||||||
let scale = new maplibregl.ScaleControl()
|
let scale = new maplibregl.ScaleControl()
|
||||||
map.addControl(scale)
|
map.addControl(scale)
|
||||||
|
|
||||||
new maplibregl.Marker().setLngLat([-0.119, 51.507]).addTo(map)
|
new maplibregl.Marker().setLngLat([-0.119, 51.507]).addTo(map)
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapDiv = document.getElementById('map')
|
||||||
|
mapDiv.onclick = function () {
|
||||||
|
initMap(mapDiv)
|
||||||
|
}
|
||||||
|
|
||||||
function selectStyle(style) {
|
function selectStyle(style) {
|
||||||
const styleUrl = 'https://tiles.openfreemap.org/styles/' + style
|
const styleUrl = 'https://tiles.openfreemap.org/styles/' + style
|
||||||
|
|||||||
BIN
website/assets/mapbg.jpg
Normal file
BIN
website/assets/mapbg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 295 KiB |
@@ -162,6 +162,14 @@ code {
|
|||||||
margin-bottom: 2em;
|
margin-bottom: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#map:not(.maplibregl-map) {
|
||||||
|
background-image: url('mapbg.jpg');
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ def copy_assets():
|
|||||||
'favicon.ico',
|
'favicon.ico',
|
||||||
'github.svg',
|
'github.svg',
|
||||||
'x.svg',
|
'x.svg',
|
||||||
|
'mapbg.jpg',
|
||||||
]:
|
]:
|
||||||
shutil.copyfile(ASSETS_DIR / file, OUT_DIR / file)
|
shutil.copyfile(ASSETS_DIR / file, OUT_DIR / file)
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
<title>OpenFreeMap subscribe</title>
|
<title>OpenFreeMap subscribe</title>
|
||||||
<link rel="stylesheet" href="style.css" />
|
<link rel="stylesheet" href="style.css" />
|
||||||
<script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script>
|
<script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user