Skip to content

Commit

Permalink
mapbg
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperknot committed Jan 19, 2024
1 parent f2cbfd5 commit 7429a52
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion init-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def prepare_venv(c):
permissions='755',
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):
Expand Down
40 changes: 24 additions & 16 deletions website/assets/map_howto.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
const map = new maplibregl.Map({
style: 'https://tiles.openfreemap.org/styles/liberty',
center: [-0.114, 51.506],
zoom: 14.2,
bearing: 55.2,
pitch: 60,
container: 'map',
boxZoom: false,
doubleClickZoom: false,
scrollZoom: false,
})
function initMap(div) {
const map = new maplibregl.Map({
style: 'https://tiles.openfreemap.org/styles/liberty',
center: [-0.114, 51.506],
zoom: 14.2,
bearing: 55.2,
pitch: 60,
container: div,
// boxZoom: false,
// doubleClickZoom: false,
// scrollZoom: false,
})
window.map = map

let nav = new maplibregl.NavigationControl({ showCompass: false })
map.addControl(nav, 'top-right')
let nav = new maplibregl.NavigationControl({ showCompass: false })
map.addControl(nav, 'top-right')

let scale = new maplibregl.ScaleControl()
map.addControl(scale)
let scale = new maplibregl.ScaleControl()
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) {
const styleUrl = 'https://tiles.openfreemap.org/styles/' + style
Expand Down
Binary file added website/assets/mapbg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions website/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ code {
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 {
border: 0;
border-radius: 0.25rem;
Expand Down
1 change: 1 addition & 0 deletions website/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def copy_assets():
'favicon.ico',
'github.svg',
'x.svg',
'mapbg.jpg',
]:
shutil.copyfile(ASSETS_DIR / file, OUT_DIR / file)

Expand Down
1 change: 0 additions & 1 deletion website/subscribe.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<title>OpenFreeMap subscribe</title>
<link rel="stylesheet" href="style.css" />
<script src="https://cdn.paddle.com/paddle/v2/paddle.js"></script>

</head>

<body>
Expand Down

0 comments on commit 7429a52

Please sign in to comment.