pigeon-maps
Advanced tools
Changelog
0.17.2 - 2021-03-16
ResizeObserver
to update the size even when the window doesn't resize (#125 by @mischnic)pigeon-tile-box
, pigeon-tiles
, pigeon-overlays
and pigeon-overlay-warning
to internal divs.Changelog
0.17.1 - 2021-02-13
Marker
and Overlay
Changelog
0.17.0 - 2020-12-03
Marker
and Overlay
components to the pigeon-maps "standard library"Changelog
0.16.1 - 2020-08-28
Changelog
0.16.0 - 2020-08-10
Changelog
0.15.0 - 2020-03-03
Changelog
0.14.0 - 2019-08-31
Changelog
0.13.0 - 2019-05-09
dprs
parameter to <Map />
and dpr
as the 4th argument for the provider
functions.Previously if you wanted to support HiDPI screens your provider
function looked something like this:
function wikimedia (x, y, z) {
const retina = typeof window !== 'undefined' && window.devicePixelRatio >= 2
return `https://maps.wikimedia.org/osm-intl/${z}/${x}/${y}${retina ? '@2x' : ''}.png`
}
This works fine and will continue to work in 0.13
. However this had some issues with server rendering. The code on your server would always render the non-retina image and later React would hydrate it with the real retina image. This lead to a bit of flickering and to the loading of an excessive amount of map tiles.
Now you can pass <Map dprs={[1, 2]} />
and update your provider function to:
function wikimedia (x, y, z, dpr) {
return `https://maps.wikimedia.org/osm-intl/${z}/${x}/${y}${dpr >= 2 ? '@2x' : ''}.png`
}
... and pigeon-maps will call the provider twice to create a <img srcset>
for both resolutions.
The value of dpr
will be undefined
for the default tile (<img src>
) which acts as a backup for older browsers.
If you don't need server rendering, then the old approach of having no dprs
array and figuring out the dpr
from the window
inside provider
will continue to work fine.
Changelog
0.12.0 - 2019-03-26