Commit Graph

155 Commits

Author SHA1 Message Date
Jussi Mattas
f0c31c1691 Use more stable form of Haversine formula. (#5935)
* Use more stable form of Haversine formula.

The new form does not give a non-zero distance from a point to itself.

* Pre-compute sines which are used twice.
2017-12-05 09:11:23 +01:00
iH8
f6e1a9be91 Removed trailing spaces (#5890)
Removed trailing spaces
2017-10-30 16:30:12 +02:00
Per Liedman
ca6aff0295 Add notes to classes which don't inherit Class (#5878)
* Add note about LatLng not inheriting Class

Fixes #3301.

* Add note about LatLngBounds, Bounds, Point, CRSs and projections not inheriting Class
2017-10-27 08:27:41 +02:00
Lois
8a433a2272 Update documentation to change Haversines Formula to Spherical Law of… (#5791)
* Update documentation to change Haversines Formula to Spherical Law of Cosines

* update distance to

* reverse prior change
2017-09-24 12:51:14 +02:00
Calvin Williams
b0e216aa54 Updated documentation for pad method to accurately reflect the function. (#5748) 2017-09-01 00:27:20 +02:00
Vladimir Agafonkin
88dd22cfe8 upgrade deps, fix indenting (#5743) 2017-08-31 08:58:42 +02:00
Andris Nolendorfs
64992d233e Fixed a couple of issues with spelling in documentation 2017-08-11 10:15:12 +03:00
Javier Jimenez Shaw
4f5fef2a56 docstrings: Typo in Projection.LonLat.js (#5532) 2017-05-26 09:44:14 +02:00
Simon Legner
c5f7dc4ad3 ES2015 modules: Add index.js files to subdirectories/namespace (#5329)
* Add index.js files to subdirectories/namespace

This allows to streamline the import/export in the main file.

* Fix tests by switching to karma-rollup-plugin
2017-02-13 14:14:00 +01:00
Miguel Andrade
ad75456fa5 add margin to LatLngBounds.equals method (#5071)
* add margin to LatLngBounds equals method

* add tests
2017-02-02 16:55:30 +01:00
Vladimir Agafonkin
703ae02aa8 ES6 modules & Rollup (#4989)
* WIP ES6 modules & rollup

* WIP ES6 modules & rollup 2

* WIP ES6 modules & rollup 3

* WIP ES6 modules Browser

* WIP ES6 module fixes

* WIP ES6 modules: simpler browser exports

* WIP ES6: refactor CRS/Projection modules, CRS obj -> CRS.Base

* get rid of unnecessary index.js

* WIP ES6 modules, dom events and stuff

* Make linter happy, rollup to dist/

* revert to CRS namespace/class for now

* WIP rollup: export more stuff

* export controls

* rollup: export Layer

* rollup: export DomEvent

* rollup: export more layer types

* rollup: export Popup/Tooltip

* WIP: ES6-ify marker, icon, domutil, draggable.

* ES6-ify gridlayer, tilelayer.

* ES6-ify: Tweak imports-exports, code is now runnable!!

* ES6-ify: Fix scope in some DomUtils

* ES6-ify: Path, fix Popup

* ES6-ify: Lint & cleanup

* ES6-ify map handlers, more linting

* ES6-ify: Icon.Default namespacing

* ES6-ify: Renderers, CircleMarker

* ES6-ify: Circle, Polyline, LineUtil

* ES6-ify: Polygon, Rectangle, LineUtil, PolyUtil, linting

* ES6-ify: SVG.VML

* ES6-ify: DomEvent.Pointer, DomEvent.DoubleTap

* ES6-ify: Linting, make Karma play nice with Rollup

* ES6-ify: More work on fixing bits breaking some unit tests.

* ES6-ify: rollup the version number, fiddled with build scripts

* ES6-ify: Fiddle with test scripts

* ES6-ify: cleanup (refs to global L, imports from (DOM)Util), prevent cyclic loop on Map imports

* ES6-ify: More cleanup of (DOM)Util/Browser/DomEvent imports

* ES6ify: Use rollup's "legacy" option for ES3 (IE8) builds

* ES6-ify: Clean up build scripts, fix CONTRIBUTING.md instructions

* Typo

* ES6-ify: minor fixes and lefovers after rebasing on top of 1.0.2

* ES6-ify: upgrade to rollup 0.38 for proper IE8 builds, fix L.SVG.VML

* Make linter happy.

* ES6: Fixing typos and sxrew-ups after big rebase

* Fix symlink for debugging scripts

* ES6: Cleanup old build scripts

* ES6-ify: Update build system to include git rev in L.version

* ES6-ify: re-enable unit tests replacing L.Path with L.Polyline

* Export Path

* ES6ify: cleanup old banner file

* ES6-ify: whitespace in var declarations

* ES6-ify: Export toTransformation as L.transformation

* ES6-ify: cleanup L.transform exports

* ES6-ify: "import Util" in Transformation and SVG.VML
2017-01-30 11:35:16 +01:00
Markus
3ac37c29a4 Add L.transformation factory, allow creation from array (#5282)
* added transformation getter

* fixed lint, added editorconfig

* added CRS.Simple transformation values again

* removed editorconfig
2017-01-30 09:43:50 +01:00
Iván Sánchez Ortega
059a722b5b Implement wrapLatLngBounds (to fix #5149) (#5166)
* Implement wrapLatLngBounds (to fix #5149)

* Unit tests for wrapLatLngBounds
2017-01-13 16:39:01 +01:00
Iván Sánchez Ortega
633182a836 Sanity check in LatLngBounds.contains (fixes #5132) (#5135) 2016-11-24 09:36:33 +01:00
geoloep
4f52a36dc1 docstrings: Update bounds property in Projection.leafdoc (#5139)
* Update Projection.leafdoc

To me it appears that the property bounds expects 'Bounds' and not 'LatLngBounds'. All the included projections pass 'Bounds'. Giving the area where the projection is valid in latlng's did not work for me.

* Update Projection.leafdoc
2016-11-23 16:29:06 +01:00
Faheel Ahmad
520587d745 Fixed L.LatLng.toBounds docstring (#5127) 2016-11-21 15:22:53 +01:00
Iván Sánchez Ortega
26cce79170 Mention TMS tile scheme for EPSG:4326 proj, fixes #5072 2016-11-03 16:28:21 +01:00
ghybs
edbcff4386 Changed of L.LatLngBounds arg names to corners (#5059)
as proposed in a recent issue.
This change should not affect the code, it is only for consistency with docstrings.
docstrings: replaced southWest and northEast argument names by corner1 and corner2, to try to prevent confusion that Leaflet will keep these corners at those places, whereas it actually "re-orders" them to keep lowest values West-most / South-most, as if they were just corners.
2016-10-28 09:38:09 +02:00
erick
d2add3dd5c docstrings: add clarification for projection; closes #4817 (#5010)
* Fix doc: add clarification for projection; closes #4817

Adds clarification in the documentation that specifies that the
`project` and `unproject` methods cannot take in arrays, but only
actual instances of `L.LatLng` and `L.Point`, respectively.

* Fix doc: add clarification for transform methods

Changes the word "real" for the word "actual" so that people don't
confuse actual instances of `L.Point` with coordinates using real
numbers.
2016-10-12 09:22:05 +02:00
Alejandro Sánchez
45775be981 docstrings: CRS.getProjectedBounds and CRS.distance (#4918) 2016-09-15 21:29:48 +02:00
Andris Nolendorfs
62fdf6f642 Fix handling of NaN in getScaleZoom (#4914)
* Fixed an issue when crs.zoom returns NaN in getScaleZoom

* Small documentation fixes
2016-09-15 09:46:53 +02:00
Iván Sánchez Ortega
5dda4f4e0e Docstrings: clarifications about noWrap and wrapLng 2016-08-04 16:27:10 +02:00
Alexander Myshov
1a3f56701b Add links onto wikipedia page about WMS 2016-06-02 16:29:52 +06:00
Nathan Cahill
2b52369fac Add CRS.distance docstring (#4466)
* add CRS.distance docstring

* add CRS.distance return values
2016-04-20 20:57:06 +02:00
Nathan Cahill
1964f35ea4 correct return type in docstring of LatLngBounds.extend (#4430) 2016-04-15 09:30:21 +02:00
Yohan Boniface
9560b28515 Merge pull request #3916 from Leaflet/leafdoc
🍂doc
2016-04-02 16:18:41 +02:00
Yohan Boniface
1b1d21b1bf Let's say I'm @IvanSanchez for once 2016-04-02 15:59:54 +02:00
Iván Sánchez Ortega
560e73bac5 Trying out Leafdoc comments in L.Marker
Added Leafdoc comments to Layer.js

Leafdoc comments for Popup, Layer

Leafdoc comments: L.Evented, inheritances, minor tilelayer

Leafdoc comments: gridlayer & tilelayer options

Leafdoc comments: tilelayer, marker drag

Typos

Leafdoc: switch to shorthand method params

Leafdoc: Switch to shorthands in marker drag, WMS.

Leafdoc: Vector layers

Leafdoc: Layer group, feature group, geojson

Leafdoc: LatLng, Point, Bounds, Icons.

Leafdoc: Controls.

Leafdoc: DOM & utils.

Leafdoc: "jake docs" now builds the documentation

Leafdoc: Commit actual templates instead of symlinks

Leafdoc: Fix broken build, have jake print out uglifyjs errors

Leafdoc: Several L.Map bits.

Leafdoc: Map handlers

Leafdoc: Map events, L.CRS, misc. fixes

Leafdoc: Fixed ordering of classes by using new leafdoc features

Leafdoc: Misc bits at the bottom of the docs

🍂doc: Map panes

🍂doc: CRSs, projections and their templates

🍂doc: miniclasses for map methods' options

Leafdoc: Cleanup L.Class, mark uninheritable sections, use Leafdoc 0.3.0

🍂doc: miniclasses for event types, bump to Leafdoc 1.0.0

🍂doc: Make linter happy after branch rebase

🍂doc: Tweaked headers for inherited stuff.

🍂doc: Tweaking section headers (white, padding, triangles)

Leafdoc: upgrade to 1.2, document SVG&Canvas, and misc bits

🍂doc: minor CSS tweaks, version in filename, typo.

Add missing bits - supersedes #4105, #4065, #4031

🍂doc: moved sections around, minor typos & fixes

Typo about LocationEvent
2016-04-02 15:59:39 +02:00
Yohan Boniface
b7b409bd07 Merge pull request #4369 from Leaflet/use-mean-earth-radius
Use mean earth radius for distance calculation in L.CRS.Earth.
2016-04-02 15:51:40 +02:00
Per Liedman
868c102a86 Use mean earth radius for distance calculation in L.CRS.Earth.
Close #4184.
2016-04-02 12:01:01 +02:00
Yohan Boniface
446c02f2e7 Make latLngBounds factory return an empty bounds with not argument
Just like the constructor.

Fix #3408
2016-04-02 11:27:56 +02:00
Vladimir Agafonkin
8c8d0ac7ee fix whitespace in comments 2015-09-25 15:37:07 +03:00
Vladimir Agafonkin
301473ad4d more strict eslinting 2015-09-25 13:40:21 +03:00
Coen Mulders
bcde047f09 Added zoom for the custom scale in L.CRS.Simple
Fixes #3867
2015-09-25 13:16:52 +03:00
javimolla
76868ad3f4 Extract logic from getScaleZoom to CRS
Added tests for custom crs with zooms not power of two related
2015-09-15 17:58:19 +02:00
Per Liedman
fecd412209 Truncate high/low latitudes for Spherical Mercator like previous versions.
Close #3700.
2015-08-03 21:26:56 +02:00
Iván Sánchez Ortega
c0384bbe21 Implement 'overlaps' spatial operator on bounds and use it on gridlayers 2015-06-02 12:35:31 +02:00
Vladimir Agafonkin
bb68b7342f Merge pull request #3390 from Leaflet/latlng-clone
Add LatLng.clone
2015-05-07 11:07:21 +03:00
Iván Sánchez Ortega
8f3a353d84 LatLng.wrap shall not drop altitude, closes #3420 2015-04-30 16:38:48 +02:00
Yohan Boniface
097128cfa7 Add LatLng.clone 2015-04-21 15:52:44 +02:00
Asko Kauppi
a7fc9c9a5f two small typos I spotted during code read-through 2015-02-08 17:06:16 +02:00
Vladimir Agafonkin
e749d1915b add ESLint rules; various code style fixes 2015-01-28 17:27:31 +02:00
Sergey Kruk
65cc3c813b Refactoring: L.latLng factory to call constructor with explicit arguments number 2014-12-06 15:32:22 +03:00
Sergey Kruk
c8e5d7c61b L.latLng factory not to throw error on empty array parameter 2014-12-05 20:36:35 +03:00
Sergey Kruk
c5ebd534b2 Factory L.latLng to accept altitude as third parameter or an object's 'alt' property 2014-12-01 16:02:43 +03:00
John Firebaugh
78463e826b jshint 2014-11-06 16:27:47 -08:00
Steve Kashishian
f3b132e414 extract bounds conversion from Map.Geolocation.Also fix geolocation test page. 2014-11-06 13:23:14 -06:00
Vladimir Agafonkin
760c730f92 fix LatLng.distanceTo race condition, close #2705 2014-05-28 17:26:41 +03:00
Vladimir Agafonkin
665e766608 simplify optimized LatLngBounds extend 2014-02-27 19:03:00 +02:00
Antoine Pultier
63e22f0ed0 Manage empty L.LatLngBounds objects 2014-02-27 19:03:00 +02:00