All notable changes to this project will be documented in this file.
As we're at the 0.x phase, deprecations and breaking changes will still happen. They will be documented here.
Once we reach 1.0 all deprecations will be removed and the project will switch to SemVer.
- Add the
dprs
parameter to<Map />
anddpr
as the 4th argument for theprovider
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.
- Fix 100% height issue. #48 and #4
- Removed inferno support, which reportedly didn't even work (#39).
- Started using rollup and babel loose mode to reduce the size even more. #59 @markusenglund (a ~8% reduction!)
- Fix wheel/touchpad scrolling on Chrome 73+, which requires non-passive event handlers for wheel events. See also this.
- Another edge case bug with animation and changing the center before the animation had time to finish.
- Bug when animating between screens and forced to jump to a far away screen, it would freeze instead of jumping.
- The
pigeon-drag-block
class also works with touch events
- Fixes "0 0 0 0" appearing if the map has no size. #46 @PofMagicfingers
- Added an undocumented feature
limitBounds
. If defaults tocenter
, but if set toedge
, we will try show as much map as possible. See issue #45 for details.
- Added a polyfill for
window.requestAnimationFrame
- Updated attribution URL to https://pigeon-maps.js.org/
- Added
boxClassname
props allowing you to apply css for the tiles div only #43 @sgerin
- Fix bug zoom position when browser loses focus #41 @benrampon
- Explicitly set touch event listeners to use non-passive mode. Fixes iOS 11.3 dragging issue. #40 @Jercik
- Added
minZoom
andmaxZoom
to limit the zoom range - Several small bugfixes
width
andheight
can now be omitted to force the component to 100% of the parent containerdefaultWidth
anddefaultHeight
are added to specify a placeholder width/height for the initial render and server renderingmouseEvents
andtouchEvents
can be used to enable/disable mouse and touch events completelyanimateMaxScreens
specifies how far must a change tocenter
be before we stop smoothly animating to ittwoFingerDrag
andtwoFingerDragWarning
can be used to block dragging the map with one fingeronAnimationStart
andonAnimationEnd
callbacks notify us if the map is moving or not
zoomSnap
is now enabled by defaultmetaWheelZoom
replaceszoomOnMouseWheel
and is reversed (previousfalse
is nowtrue
)metaWheelZoomWarning
replacesmouseWheelMetaText
- There have been numerous bug fixes since the
0.9
series, too many to mention all now