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.
- Fix GeoJSON MultiLineString prop passing
- Use new OSM URLs
- Add Stadia URL to providers list
- Add
dir="ltr"
to map container div.
- Support custom content as children of
<Marker><Icon /></Marker>
- Fix the usage of
<ZoomControl />
buttons inside<form>
tags.
- Add
GeoJson
,GeoJsonLoader
,GeoJsonFeature
by @baldulin #149
- Add
tileComponent
prop, which lets you swap out the default<img />
component for a custom one.
- Improve
<Draggable />
for cases when controlling its location viaonDragMove
.
- Minor change: the default value for
dpr
inprovider
functions now defaults to1
(instead ofundefined
)
- Draggable: Set the cursor to
grab
andgrabbing
by default
- Center align the tiles and overlays when the pre-rendered map is not the same size as on the final rendered page.
- Add
maptiler
to providers
- Add
<Draggable />
overlay
- Support
import { osm, ... } from 'pigeon-maps/providers'
- Remove default export of
Map
. You must now doimport { Map } from 'pigeon-maps'
. - Add
<ZoomControl />
- Add
mapProps
andsetCenterZoom
to the props given to child components - Set the default provider to OSM again (from stamenToner)
- With
metaWheelZoom
you can now also scroll with the CTRL key (#120 by olehmaksym)
- Use a
ResizeObserver
to update the size even when the window doesn't resize (#125 by @mischnic) - Add classes
pigeon-tile-box
,pigeon-tiles
,pigeon-overlays
andpigeon-overlay-warning
to internal divs.
- Fixes faulty types for
Marker
andOverlay
- Add
Marker
andOverlay
components to the pigeon-maps "standard library" - Fix a bug with mousewheel scroll when width & height present (#117 by @roux1max)
- Add empty ALT attribute to map tiles
- Rewritten in TypeScript without changing any functionality
- Attribution links now open in a new tab
- Changed the default tile provider from the broken Wikimedia to OSM
- Add more information about setting up your own tile provider
- Add lazy loading for tiles (#87 by @maxsteenbergen)
- React 16.8 support by removing deprecated componentWillReceiveProps and replacing it with componentDidUpdate. #70 @JoaquimEsteves
- 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