arnold-c
arnold-c

Reputation: 357

Blogdown - How to use OSMap Tiles in Hugo Academic

I'm wondering if anyone knows how to change the OS Map tiles using the Hugo Academic theme in Blogdown, as the contact map uses Leaflet so it should be possible to change the tile URL, but I just can't find where that is located. The only method of changing the map type I have found are the standard options available in config/_default/params.toml, but I can't figure out where they are directing instructions to.

Thanks,

Edit:

This is the tile server I was hoping on using.

http://a.tile.openstreetmap.fr/hot/${z}/${x}/${y}.png

Upvotes: 0

Views: 395

Answers (1)

crnm
crnm

Reputation: 486

The openstreetmap tiles are defined here:

https://github.com/gcushen/hugo-academic/blob/master/assets/js/academic.js#L276

Around those lines you'll see some examples for other map tile providers as well.

Tell us the provider you want to use so that we can show you a code example for intergrating that one.

Edit: To use the HOT style by the openstreetmap.fr tile provider add the following between the lines 274 and 275 in the academic.js:

} else if(map_provider == 4) { L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>' }).addTo(map); }

and in your params.toml on line 262 set engine = 4.

Upvotes: 1

Related Questions