Skip to content

Commit 284cda6

Browse files
author
Andy Townsend
committed
Added a "whatpub" button to the svwd01 default map.
1 parent 7e18494 commit 284cda6

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

resources/changelog_svwd01.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
See also the [changelog](https://github.com/SomeoneElseOSM/SomeoneElse-vector-web-display/blob/main/changelog.md) for the scripts here.
33
Except as noted, all changes also apply to the [SVWD06 Android native display style](https://github.com/SomeoneElseOSM/SomeoneElse-vector-web-display/blob/main/resources/README_svwd06.md).
44

5-
## As yet unreleased
5+
## 23/0302025
66
Display `highway=elevator` with names if present.
7+
Added a "whatpub" button to the `svwd01` default map.
78

89
## 22/03/2025
910
Display 4-character National Trail shields as well as shorter ones.

resources/svwd01_index.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<link href='https://unpkg.com/@maplibre/maplibre-gl-inspect@latest/dist/maplibre-gl-inspect.css' rel='stylesheet' />
1111
<style>
1212
body { margin:0; padding:0; }
13-
#map { position:absolute; top:40px; bottom:0; width:100%; }
13+
#map { position:absolute; top:50px; bottom:0; width:100%; }
1414
#refresh { position: absolute; top: 15px; left: 15px; background-color: white; padding: 5px;
1515
border: 1px solid black; font-family: Avenir; cursor: pointer; }
1616
</style>
@@ -23,6 +23,7 @@
2323
<button id="button4" onclick="show_mkgmap();" >mkgmap</button>
2424
<button id="button5" onclick="show_raster();" >raster</button>
2525
<button id="button5" onclick="show_osm();" >OSM</button>
26+
<button id="button5" onclick="show_whatpub();" >Whatpub</button>
2627
</div>
2728
<div id='map'></div>
2829
<!-- <div id='refresh' onclick='reload()'>Reload</div> -->
@@ -51,6 +52,13 @@
5152
window.open ( 'https://osm.org/#map='+zoom+'/'+lat+'/'+lng,'_self',false )
5253
}
5354

55+
function show_whatpub()
56+
{
57+
let zoom = map.getZoom() + 1;
58+
let {lng, lat} = map.getCenter();
59+
window.open ( 'https://whatpub.com/search?q=nearby&t=d&lat='+lat+'&lng='+lng+'&r=10&p=1&features=PubClub&home=1', '_blank' )
60+
}
61+
5462
/* -------------------------------------------------------------------------
5563
* A button to display an about screen.
5664
* ------------------------------------------------------------------------- */

0 commit comments

Comments
 (0)