Closed
Description
opened on Dec 21, 2014
@mourner I'm going to have some more time over the next 2 weeks (holidays!) to tackle more documentation related tasks and thought I would start by pulling together the various change logs and major issues into a checklist so we can get an idea of what needs to be done to the docs.
I'll work on picking stuff off this list and making PRs into the gh-pages-master
branch.
Vectors refactoring
Currently in progress in #3101
- Added
Renderer
layer (inherited by SVG/Canvas implementations) that handles renderer bounds and zoom animation. -
AddedProbably not worth documenting at this timeSVG
&Canvas
classes that now contain all renderer-specific code for vector layers and can be added as layers to the map. - All vector layer classes (
Path
,Polyline
, etc.) now don't contain any renderer-specific code and instead can be passed a renderer layer to use asrenderer
in options; - Removed
MultiPolyline
andMultiPolygon
classes since multiple rings are now handled byPolyline
andPolygon
classes respectively. Layers with multiple rings now perform much better (since each is now physically a single path object instead of being aFeatureGroup
of layers). -
Added retina support for Canvas layers.Doesn't include API changes that need to be documented - Improved default vector layer styles.
- Added
Polyline
andPolygon
getCenter
for getting centroids. - Changed
Circle
to inherit fromCircleMarker
and not the other way.
Layers refactoring
Some items in progress in #3097 and #3107
- Added
Layer
class which all layers added to a map should inherit from. - Added
add
andremove
events to all layers. - Added
remove
method to layers and controls (marker.remove()
is now equivalent tomap.removeLayer(marker)
). - Added
pane
option to all layers that can be changed (e.g. you can setpane: 'overlayPane'
to a tile layer). - Added
map
createPane
method for custom panes. #1742 - Simplified map panes β removed
objectsPane
, all panes are on the same level now. - Added
shadowPane
option to markers as well. - Added
getEvents
method to all layers that returns an{event: listener, ...}
hash; layers now manage its listeners automatically without having to do this inonAdd
/onRemove
. - Added
togglePopup
,setPopupContent
,getPopup
methods to all layers. #2279 #2292 -
RemovedThis was already removed by someone elseMap
tilelayersload
event. - Removed
Popup
open
andclose
events in favor ofadd
andremove
for consistency.
TileLayer & Projections refactoring
GridLayer + TileLayer
- split
TileLayer
intoGridLayer
(with all the grid / tile positioning logic) and its childTileLayer
(with logic for loading image tiles from tile servers) - remove
TileLayer.Canvas
in favor of a much more flexible and powerfulGridLayer
CRS & Projections
- add
Projection
bounds
property which determines projected coordinates bounds - add
CRS
properties:wrapLng
,wrapLat
(determining whether the world wraps and how) andinfinite
(if true, the layer will not be bounded, with negative tiles etc.) - add
CRS
getProjectedBounds
that returns projected world bounds for zoom and correspondingMap
getPixelWorldBounds
, derived fromProjection
bounds
, used for wrapping/bounding tiles - fix
EPSG:4326
to have 2x1 tiles at zoom 0, EPSG 4326 Support Broken for TileLayersΒ #1207 - fix
Projection.SphericalMercator
to project to meter units - add
CRS
unproject
- remove
LatLng
wrap
and addCRS
andMap
wrapLatLng
that depends on CRS, fix tiles' bounds are not wrapped before being checked against layer's boundsΒ #1618 again
TileLayer-related changes
These changes make implementing custom grid-like layers for Leaflet much easier.
-
Moved most of theInternal logic changes don't need to be documentedTileLayer
logic into the newGridLayer
class (whichTileLayer
now inherits, extending it with logic specific to tile servers). - Removed
TileLayer.Canvas
in favor of the much more flexible and powerfulGridLayer
. -
Improved tile wrapping and bounding logic inNo public API changesTileLayer
to work transparently and completely depent on the CRS used; removed the need forTileLayer
hacks when using custom projections. -
RemovedRemoved by someone elseurl
property intileload
andtileloadstart
events (get it throughtile.src
).
Projections-related changes
- Added
CRS.Earth
which serves as a base for all Earth-based CRS (EPSG3857
etc.). #2345 - Added
Projection
bounds
property that defines bounds for different projections (Mercator
, etc.) in projected coordinates (by @perliedman). - Added
CRS
wrapLat
andwrapLng
properties which define whether the world wraps on a given axis and in what range. Set as[-180, 180]
forEPSG:3857
,EPSG:4326
,EPSG:3395
by default. - Added
CRS
andMap
wrapLatLng
(the latter depends on the chosen CRS). - Added
CRS
infinite
property that disables boundaries (the world can go on infinitely in any direction), default forCRS.Simple
. - Added
CRS
getProjectedBounds
andMap
getPixelWorldBounds
methods that returns world bounds in projected coordinates depending on zoom (derived fromProjection
bounds
) (by @perliedman). - Added
CRS
unproject
method that converts coordinates in CRS-dependent units intoLatLng
coordinates (by @sowelie). - Added
Map
distance(latlng1, latlng2)
method that takes CRS into account and works with flat projections. #2345 #1442 -
Improvednot something that really needs documentationCircle
to be approximated with an ellipse in Earth-based projections. #2345
Other breaking API changes
- Changed
DomUtil
off
to requirecontext
attribute if you remove a listener that was previously added with a particular context. - Removed
DomUtil.getViewportOffset
method as it is no longer necessary. - Removed
DomUtil
getTranslateString
andgetScaleString
methods. - Removed
DomUtil
documentIsLtr
method. - Removed
LatLng
RAD_TO_DEG
,DEG_TO_RAD
andMAX_MARGIN
constants. - Renamed
Util.limitExecByInterval
toUtil.throttle
.
Other API improvements
- Added
Evented
class that now many Leaflet classes inherit from (instead of mixing in events methods in each class), while keeping the oldincludes: L.Mixin.Events
syntax available. #2310 -
ImprovedI don't think this is actually a change that needs to be documented since its internal onlyClass
options
to be prototypically inherited instead of copied over in children classes, which leads to more efficient memory use, faster object construction times and ability to change parent options that get propagated to all children automatically (by @jfirebaugh). #2300 #2294 - Added
{r}
variable toTileLayer
url
for adding"@2x"
prefix on Retina-enabled devices (by @urbaniak). #2296 - Added
Point
ceil
method (by @perliedman). - Added
Util.wrapNum
method for wrapping a number to lie in a certain range. - Improved
L.bind
to use nativeFunction
bind
on modern browsers and prepend real arguments to bound ones. - Added
LatLng
equals
second argumentmaxMargin
. - Added
DomUtil
setClass
andgetClass
methods. - Improve
Marker
move
event to includeoldLatlng
(by @danzel). #2412 - Improved
DomEvent
on
/off
to accept space-separated events and object literals ({type: fn}
). - Added
DomUtil
toFront
andtoBack
methods. - Added
Evented
listens
as a shortcut tohasEventListeners
. - Added optional support for center-oriented scroll for
L.map
optiontouchZoom
(by @mtmail). #2527
Activity