rob-murray / os-leaflet

A Leafletjs TileLayer using Ordnance Survey OpenSpace web map service
http://rob-murray.github.io/os-leaflet/
MIT License
24 stars 8 forks source link

https #15

Closed saturdaywalkers closed 7 years ago

saturdaywalkers commented 7 years ago

Change the hardcoded OS tile url to '//openspace.ordnancesurvey.co.uk/osmapapi/ts', so it works with both http and https websites

JimBacon commented 7 years ago

I think this is important as browsers are moving towards a requirement for apps sending location information to run on https and they don't like pages that mix https and http. If the simple change suggested above is all it takes then +1 from me.

rob-murray commented 7 years ago

Same here, I think when I first did this OpenSpace HTTPS was only available on the Pro version

JimBacon commented 7 years ago

I just checked for myself and OS are responding on both http and https.

I did a little bit of research and discovered that protocol relative urls, as suggested above, have been around for years but I just haven't come across them. However, it is suggested that they have had their day and that, if a resource is available as https, then that is how it should be requested.

Moreover, using the protocol relative url breaks the demo where the protocol is file://

Therefore I suggest hardcoding the url as https is the best way to resolve the issue of working on both http and https sites.