Skip to content

1.0 Documentation checklistΒ #3098

Closed
Closed
@patrickarlt

Description

@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.
  • Added SVG & Canvas classes that now contain all renderer-specific code for vector layers and can be added as layers to the map. Probably not worth documenting at this time
  • 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 as renderer in options;
  • Removed MultiPolyline and MultiPolygon classes since multiple rings are now handled by Polyline and Polygon classes respectively. Layers with multiple rings now perform much better (since each is now physically a single path object instead of being a FeatureGroup 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 and Polygon getCenter for getting centroids.
  • Changed Circle to inherit from CircleMarker 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 and remove events to all layers.
  • Added remove method to layers and controls (marker.remove() is now equivalent to map.removeLayer(marker)).
  • Added pane option to all layers that can be changed (e.g. you can set pane: '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 in onAdd/onRemove.
  • Added togglePopup, setPopupContent, getPopup methods to all layers. #2279 #2292
  • Removed Map tilelayersload event. This was already removed by someone else
  • Removed Popup open and close events in favor of add and remove for consistency.

TileLayer & Projections refactoring

GridLayer + TileLayer

  • split TileLayer into GridLayer (with all the grid / tile positioning logic) and its child TileLayer (with logic for loading image tiles from tile servers)
  • remove TileLayer.Canvas in favor of a much more flexible and powerful GridLayer

CRS & Projections

  • add Projection bounds property which determines projected coordinates bounds
  • add CRS properties: wrapLng, wrapLat (determining whether the world wraps and how) and infinite (if true, the layer will not be bounded, with negative tiles etc.)
  • add CRS getProjectedBounds that returns projected world bounds for zoom and corresponding Map getPixelWorldBounds, derived from Projection 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 add CRS and Map 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 the TileLayer logic into the new GridLayer class (which TileLayer now inherits, extending it with logic specific to tile servers). Internal logic changes don't need to be documented
  • Removed TileLayer.Canvas in favor of the much more flexible and powerful GridLayer.
  • Improved tile wrapping and bounding logic in TileLayer to work transparently and completely depent on the CRS used; removed the need for TileLayer hacks when using custom projections. No public API changes
  • Removed url property in tileload and tileloadstart events (get it through tile.src). Removed by someone else

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 and wrapLng properties which define whether the world wraps on a given axis and in what range. Set as [-180, 180] for EPSG:3857, EPSG:4326, EPSG:3395 by default.
  • Added CRS and Map 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 for CRS.Simple.
  • Added CRS getProjectedBounds and Map getPixelWorldBounds methods that returns world bounds in projected coordinates depending on zoom (derived from Projection bounds) (by @perliedman).
  • Added CRS unproject method that converts coordinates in CRS-dependent units into LatLng coordinates (by @sowelie).
  • Added Map distance(latlng1, latlng2) method that takes CRS into account and works with flat projections. #2345 #1442
  • Improved Circle to be approximated with an ellipse in Earth-based projections. #2345 not something that really needs documentation

Other breaking API changes

  • Changed DomUtil off to require context 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 and getScaleString methods.
  • Removed DomUtil documentIsLtr method.
  • Removed LatLng RAD_TO_DEG, DEG_TO_RAD and MAX_MARGIN constants.
  • Renamed Util.limitExecByInterval to Util.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 old includes: L.Mixin.Events syntax available. #2310
  • Improved Class 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 I don't think this is actually a change that needs to be documented since its internal only
  • Added {r} variable to TileLayer 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 native Function bind on modern browsers and prepend real arguments to bound ones.
  • Added LatLng equals second argument maxMargin.
  • Added DomUtil setClass and getClass methods.
  • Improve Marker move event to include oldLatlng (by @danzel). #2412
  • Improved DomEvent on/off to accept space-separated events and object literals ({type: fn}).
  • Added DomUtil toFront and toBack methods.
  • Added Evented listens as a shortcut to hasEventListeners.
  • Added optional support for center-oriented scroll for L.map option touchZoom (by @mtmail). #2527

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentationhelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions