Hi
I’m new to the plugin. I created a GPX file using gpx.studio and it works fine on desktop, route and markers using shortcode [osmap gpx=”/wp-content/uploads/2023/12/Pen-Y-Garn.gpx”]. However, on mobile I see a grey background with route and no markers. Also the map isn’t automatically zooming and centring to show the entire track as I believe it should using GPX files.
Any ideas?
]]>First OSmap on a page will not fullcreen properly if there is a Trackserver plugin map on the same page. It just shows what was on the page up in the top left corner and the tiles don’t load properly if you slide the map around. Subsequent OSmaps on the same page fullscreen fine (even a duplicate of the first). If there’s no Trackserver map on the page the OSmaps fullscreen fine.
Using Troubleshooter eliminated other plugin conflicts. I’ve tried every sort of troubleshooting I know and I’m baffled! No clues in console.
I’ve edited pages to not show both types of map but I’d prefer a solution if possible as I’ve just converted around 150 legacy maps to Trackserver, and category lists may show both. I’d rather not change all the shortcodes again.
Can you spot anything obvious?
Thanks!
Thanks again for this great plugin.
Just wondering whether there is any way of using separate shortcodes for the map and markers? The Leaflet Map plugin for example uses the following:
[leaflet-map]
[leaflet-marker]
The reason for asking is because I would like to pull through the markers dynamically with a custom loop. Using the current shortcode setup within a loop would render multiple maps rather than a single map with multiple markers.
Hope that makes sense!
Also, is there an option to use marker clustering?
Many thanks
]]>I help to maintain a website that has a database of walking routes in South Wales that used OS OpenSpace to display routes on maps. Your excellent OS DataHub Maps plugin will allow me to replicate most of the functionality that was lost when OpenSpace was withdrawn and which we never got around to replacing with OS DataHub. However there are a couple of features that it lacks that I need to workaround or that you may consider adding.
Before I mention them there is a minor niggle. I have always used my mouse wheel on my desktop PC to zoom in/out on a map and default behaviour is to grey out the map with a message to use control + scroll to zoom. I was glad to see that could be removed by a setting called ‘Enable Gesture Handling’. However when switching to Full Screen then back to the web page the greying out is restored – it appears that the setting is ignored when switching back to the web page. It would be nice if that could be fixed.
The first item on my wish list is the ability to display a custom marker, we used to use our distinctive club logo which stands out really well on a map display.
The second item is to do with the popup that appears when clicking on a marker. In OS OpenSpace we used this to popup a window where a list of routes were displayed that started at the map location. The popup window and font size could be specified and was automatically made scrollable when the list of routes was too long. Experimenting with your plugin I found that the font size is small and the popup size adjusts to the length of the list until it is too long for the screen when it is truncated. Have you any suggestions on how I can work around this? I did think of displaying the list of routes in a separate web page but I suppose that would involve intercepting the mouse click.
On looking through the posts on the plugin’s forum I get the impression that map display is handled by the Leaflet plugin – is that the case and would adding the above features involve using or modifying Leaflet?
Anyway many thanks for a superb plugin that we’ll definitely use once I sort out the above problems. You can see an example of use on our staging website at https://www.swldwa.uk/wp/?page_id=4201&walkid=755
Gerry Jackson
]]>I've just installed your WordPress plugin OS DataHub Maps and been trying it. I'm unable to get marker files to work. The original format marker files work correctly but the JSON format files fail.
The shortcode I'm using is:
[osmap markerfile="https://www.swldwa.uk/wp/wp-content/swldwa/test/marker-test4.txt"]
File marker-test4.txt contains:
[
{ "location": "SH6099054380", "desc": "Snowdon"}
]
where the location line is the first line of the example given in your documentation (less the final comma).
When I try to view the map and marker it displays the default page with reported errors:
JQMIGRATE: Migrate is installed, version 3.4.0 jquery-migrate.min.js:2:970
'[' is not a valid position. It must be either a UK grid reference or two decimal numbers separated by a comma. os-datahub-maps.js:500:25
{"LOCATION":"SH6099054380" is not a valid coordinate os-datahub-maps.js:483:21
']' is not a valid position. It must be either a UK grid reference or two decimal numbers separated by a comma.
I've tried different browsers Firefox, MS Edge, Chrome and they all fail.
It looks as if it tries to intepret the initial '[' as a position. Also it looks as if something is converting "location" into HTML "location" before your code processes it. I've checked that the file marker-test4.txt has the ASCII values for " and [.
I can't find any relevant settings for th eplugin or WordPress.
I see that the version of WordPress I'm using has not been tested with the plugin but it was failing before I updated it.
I'm stuck - any idea what's going wrong? My apologies if I'm doing something stupid.
Gerry Jackson
]]>
Hello, thanks for a great plugin. I was wondering if there is a way to change the elevation profile for mobile so it isn’t as dramatic as it looks scrunched and very steep in mobile portrait view. Would I achieve this with a maximum height of the profile on mobile using the shortcode or some other way please?
]]>Thanks so much for adding the Geolocation feature to show the user’s location on the map, looks great! Just wondering whether you were aware of on any privacy/GDPR implications for enabling this feature?
Many thanks
]]>I was wondering if you could kindly add an option for map boundary limitation. This would limit the amount of tiles that people could then use on your API by restriction the viewing area. I see that there is an option extent=”NY200200|NY260220″ but this is used for displaying the maps initial viewing area and does not prevent viewing from outside of this area. I see no way to limit data usage at the OS Open Data website.
]]>Hi
Great plugin.
I have a site with multiple walking routes. I have created a custom post type for the routes. I am trying to add a map to each route, each with a different .gpx file. I have created a custom field on the route post type for the url of the .gpx file.
I have tried many ways to replace the url in the shortcode below with the url in the custom field (the_field, using a variable, putting the entire shortcode in a custom field, etc.) but I cannot get it to work.
echo do_shortcode(‘[osmap gpx=”https://site/file.gpx”%5D’);
What I want to do is add the .gpx file to the custom field of each route and then use the template and shortcode to display the right map on the right page.
My php is limited, so any help would be greatly appreciated.
Many thanks
]]>Small problem when using marker jump links on a layered map. If the marker jumped to is in a layer that is not being displayed, it won’t be seen.
My solution was to insert a one-line patch in os-dathub-maps.js:
map.addLayer( marker );
just before
marker.openPopup();
around line 294.
This reveals the target marker without enabling the whole layer of markers.
]]>Can we have a per-map option to keep the layers control expanded? This makes it more obvious (and saves a click).
I have applied the following CSS to achieve the same effect in the meantime:
.leaflet-control-layers { padding: 6px 10px 6px 6px; }
.leaflet-control-layers-toggle { display: none; }
.leaflet-control-layers-list { display: block; }
]]>
What attribute in the shortcode will override the default “Open Popups on Hover” setting? I have looked in the documentation!
]]>This is a problem I have on all my maps, but is most easily shown on the linked page, which has a simple map: [osmap extent="SP345385|SP365365"]
On Firefox, Chrome and Edge the map initially displays with tiles missing at the right hand edge. The missing tiles appear immediately on resizing the window by dragging any edge.
While the tiles are missing, dragging the map itself to the left brings up some of the missing tiles, but still leaves grey space on the right. However, after resizing the window, tiles are never missing!
Perhaps it is something in my CSS, but do you have any thoughts?
]]>I believe I have followed instructions correctly and linked to a valid API, but my webpage just shows an empty box rather than a map even if I just use the [osmap] taag on its own.
Any clue what I am doing wrong?
On a circular route it can be hard to see the start/finish point.
I know you can add markers but it would be great to have the option of a shortcode attribute to automatically insert a start marker from the first lat lon
One way routes would also benefit as it would show which end was the start. In fact start marker and finish marker options would be even better!
Thanks for a great plugin!
]]>I love the plugin, and it works really well. But I have a concern that the users API Key is exposed in the request URL and so could be subject to abuse by bad actors. Do you have any plans to incorporate oauth2 into the plugin? It seems this would solve that issue
https://osdatahub.os.uk/docs/oauth2/overview
`Using the OAuth 2 API,
You can:
Create time limited access tokens.
<em><u>Hide your API access credentials from end-users.</u></em>
Restrict the available APIs within the project.`
Would be interested in your thoughts on this and whether it is achievable
Many thanks
Simon – not reporting a bug with your brilliant plugin, but I hope you find this to be an interesting use case. I am building a map with many markers that name fields around our village. (Currently showing only about 40 of the 300 names I have). I would like to add an index of names below the map such that clicking on a name scrolls the page back to the map (or pops it up) and zooms in on the relevant marker with its label displayed. Can you offer any tips on how this might be implemented?
]]>Thank you for an excellent (and well documented) plugin.
Running a link checker on a site I am developing has revealed that for 5 URLs in
plugins/os-datahub-maps/css/leaflet-elevation.css?ver=1.2.2
the corresponding svg files do not exist in the /os-datahub-maps/css/images/ folder
They are
plugins/os-datahub-maps/css/images/elevation-lime.svg
plugins/os-datahub-maps/css/images/elevation-purple.svg
plugins/os-datahub-maps/css/images/elevation-steelblue.svg
plugins/os-datahub-maps/css/images/elevation.svg
plugins/os-datahub-maps/css/images/remove.svg
Clearly these svg files may not be needed but I felt I should feed this back.
Regards
Ray
Hi
Firstly thanks for your plugin. It’s excellent. I have a slight issue I’m hoping you might advise on
I’m using an API to pull in data which I’d like to include on a map. The data includes easting and northings which I’ve converted into OS grid refs. I’ve written a basic plugin to call the API, format the data, filter on eastingscand northings to limit data to a specific area and then output as html via a short code function
I’d now like to use those grid refs to put markers on the map.
I could write the markers to a text file and then link to the text file in the osmap ahortcode but wondered if it would be possible to write the same data to a session variable then reference that in the short code instead? Or any other suggestion of how I might interface with the API data? Thanks again for the plugin though
]]>I’m not a wp expert, just a reasonably competent amateur, and I’m trying to create a web page for my walking group using WP
I have installed the OS dataHub plug in onto a fairly clean WP install – the only other installed plug in is JetPack
I can pass the gpx data from a route I recorded myself and the appropriate part of the OS map shows correctly in my post – and I like what I see – so thanks for that
The shortcode I have used is: [osmap gpx=”https://benthamfootpathgroup.org/wp-content/uploads/2021/09/BFG-Delph-Quarry-Aug-21.gpx” color=”red” track=”4″]
This points to the media library in the WP install on my local machine – the site is not publicly accessible yet.
All well and good so far then – the issue I have is that although the right map shows, the route I walked does not – so the track colour and width settings seem not to be being picked up.
The defaults on the Map Defaults setting page are present – again red (picked from the tile under the colour map) and 4px.
I have looked at the gpx data in VScode and it appears good
I have tried other routes with similar results, so I don’t think its a recording issue
Any suggestions gratefully received
Regards,
Bryn
]]>Hello!
I am quite new to this and trying to upload a hiking route to my website. I have followed the guide and managed to start by getting the standard [osmap] to show. I can also get it to show when putting the ‘centre’ code in with grid reference. However, when I try to add a GPXfile it is not showing on the map. It is sometimes showing underneath as’download gpx’ but not on the map itself it is just showing southampton. Is anyone able to help with what may be causing this.
This is what I am putting in:
[osmap gpx=”https://mountainmolls.com/wp-content/uploads/2021/02/trackfile-2.gpx”%5D
Thanks,
Molly
Hi There!
Firstly I would like to say what a great plugin this is. Took some time to get it to work with the API and GPX tracks but it’s there now.
However, there is a small issue and that is with the evelation element, although it gives me the elevation chart, there is no map cursor or icon when you point the mouse over the elevation profile showing you where you are.
Not sure if there is a coding issue with the leaflet evelation extension being implimented via your plugin.
Thanks
]]>Hello.
I used the previous version of the OS Maps plugin and received the information about upgrading. I’ve done and registered the API correctly following the instructions but all my OS Maps are greyed out? I really can’t work out what I’m doing wrong? I have a few on different pages and all are doing the same.
https://crosstheuk.com/cross-the-uk-guide-to-callater-stable-bothy/
https://crosstheuk.com/cross-the-uk-guide-to-mosedale-cottage-bothy/
Any help is greatly appreciated.
Mick
]]>Hi,
Im currently using WPMAps plugin but the map base is open source. I prefer the OS Explorer Map as my project is bridleway based. My question is whether I can integrate the OS maps into WPMAps or if there is the possibility to add pins with links to the OSMaps plugin?
Thank you for a very useful start with OS DataHub.
I’m trying to display multiple boundaries, but I think the plugin only allows a single KML file. I merged the three boundaries into a single kml file but the display does not pick up the polygon border/infill colours defined in the kml file.
Is that a bug or a restriction?
What I’m trying to achieve is this (with the OSM OpenStreetMap plugin)
https://comptonshawford-pc.gov.uk/about/maps/openstreetmap/
where the display of each kml file layer can be toggled on and off.
I have an OpenSpace API version at
https://comptonshawford-pc.gov.uk/ecclesiasticalboundarysg.html
but I’m struggling to convert it to OS Data Hub mapping (because my OpenLayers skills are a bit weak).
Apologies in advance- seems I replied to my own thread by accident!
Here is my issue:
I put in my gpx URL and this displays my walking route on the map. However, I’m trying to put a marker in for the start point. I read in the instructions that this is possible:
“Note that you can display a GPX file and markers on the same map. The auto-zoom will work on the GPX file and not the markers. If your markers are just showing waypoints on the route then this will not be a problem, but if they lie outside the route then you may not see them all.”
So I made an attempt by putting the following with my existing shortcode:
[osmap gpx=”https://charlottesramblings.com/wp-content/uploads/2021/06/Mepal-and-the-Hundred-Foot-Drain.gpx”][osmap markers=”TL4404981313;Start”]
Then:
[osmap gpx=”https://charlottesramblings.com/wp-content/uploads/2021/06/Mepal-and-the-Hundred-Foot-Drain.gpx”osmap markers=”TL4404981313;Start”]
One showed 2 maps- my map with route and no marker; and one below- zoomed in map with marker but no route.
Second attempt showed only the latter map.
All I want is to put a marker on my existing gpx map. What am I doing wrong here? I’ll bet it’s a simple fix, but I’m stumped.
By the way, thank you so very much for your help.`
]]>Hello, I’m a complete newbie. I have a WordPress site and I’m building it using Elementor. I cannot find any usable support guides (or rather ‘idiots guides’) to help me install OS maps onto my website. My website is about walk routes.
I have managed to get as far as installing the plugin and downloading a gpx file of a walk route I recorded on the OS map app. I have also registered with the OS datahub and opened a ‘project’ which gave me an API key, which I pasted into the appropriate box in the plugin info. I haven’t a clue what this means or how to activate any of it.
All the YouTube videos are geared towards Google Maps- there’s no basic step by step instructions for OS.
Please help.
Thanks.
Hello, thanks again for this great plugin.
I’m trying to stick to on an older version of the plugin but it keeps auto-updating even though I’ve disabled auto-updates. Any thoughts? It may well be an issue my end but it doesn’t seem to happen with other plugins where I’ve disabled auto-updates so thought I would check.
In case it helps, the reasons I’m sticking to an older version for now is that there are a couple of MacOS Safari related bugs with the current version. The popup text doesn’t show when you click on a marker. And the elevation profile feature that allows you to hover over and follow the route doesn’t work properly (it does sometimes as long as you keep the cursor within the darker shaded part of the profile but sometimes even that doesn’t seem to work). I’m not seeing any console errors. Both work fine on Chrome.
Thanks
]]>Hi
I’m new to this and have tried to show a map with GPX. I have downloaded the gpx file as instructions into my media files. I have copied the short code into my page but all I get is a blank square with the download link for the gpx file.
I have registered with the oshub as a premium user I have put started a new project got the Api key gone into settings and copied it into the box.
[osmap gpx=”https://www.andiamoamigos.com/wp-content/uploads/2021/05/Pendlehill.gpx”%5D
If I start another project I get a different API key for that project how would that work as I cannot add multiple keys in settings.
I hope you can help
Chris
]]>I’ve been using the WP-GPX-Maps for a while but the possibly of using OS 1:50000 and 1:25000 maps is a big attraction. I’m finding OS DataHub Maps easy to use and like it a lot, but notice that in a shared post the WP-GPX-Maps map stops working. I’m still trying to pin it down, but in the example URL given the shortcodes are:
[sgpx gpx="/wp-content/uploads/gpx/October Odyssey - Day 2 - Dukshouse Woods - Hexham - 2019-10-27_11_19_06.gpx"]
and
[osmap gpx="/wp-content/uploads/gpx/October Odyssey - Day 2 - Dukshouse Woods - Hexham - 2019-10-27_11_19_06.gpx"]
I appreciate the problem may lie with the WP-GPX-Maps plugin but I thought I’d ask here first.
[update]
ok I’ve been having a browse through the support questions for WP-GPX-Maps and see that it hasn’t been updated for the last few WordPress releases. I haven’t actually used it to the extent that it’s a big deal to change them to OS DataHub Maps and that would look a safer bet as it’s more up to date and I prefer the maps. So while it’d be interesting to know if it’s possible to run them both and not worried about it.
]]>