Retina Tiles

Door Support@MapTilesApi | Bijgewerkt vor 2 Tagen | Mapping

9.7 / 10





Health Check


Terug naar alle discussies

How to integrate with leaflet?

Rapid account: Joshr JHA Tykb WI
vor 2 Jahren

I can’t find any examples of how to integrate with leafletjs online. can someone please show me a way to add a TileLayer from this api?

Rapid account: Map Tiles Api
MapTilesApi Commented vor 2 Jahren

Hi Josh,

have you seen our tutorial here: ?

As a TileLayer URL in Leaflet you would need:{r}/v1/{z}/{x}/{y}.png?rapidapi-key=YOUR-RAPIDAPI-KEY

if you want Leaflet to choose between standard and retina tiles (Leaflet will then fill the {r}var with either @2xto retrieve retina tiles for high resolution displays or `` for displays without high resolution).

Otherwise you can use:{z}/{x}/{y}.png?rapidapi-key=YOUR-RAPIDAPI-KEY

to always get retina tiles or{z}/{x}/{y}.png?rapidapi-key=YOUR-RAPIDAPI-KEY

to always get standard tiles.

In each case you’ll just have to replace YOUR-RAPIDAPI-KEY with your X-RapidAPI-Key and then you are good to go.

Doe mee aan de discussie - voeg hieronder een opmerking toe

Log in / Schrij u in om nieuwe opmerkingen te plaatsen