Commit Graph

56 Commits

Author SHA1 Message Date
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
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
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
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
Vladimir Agafonkin
d145b1fdba fix a bunch of eslint warnings in the spec suite 2015-01-28 19:32:27 +02:00
John Firebaugh
2ee1aa2c23 jshint 2015-01-12 11:03:42 -08: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
Vladimir Agafonkin
760c730f92 fix LatLng.distanceTo race condition, close #2705 2014-05-28 17:26:41 +03:00
Antoine Pultier
63e22f0ed0 Manage empty L.LatLngBounds objects 2014-02-27 19:03:00 +02:00
Vladimir Agafonkin
dab0cbfc14 update tests to reflect no clamping near poles 2014-01-03 17:37:28 +02:00
Vladimir Agafonkin
dd313e6930 better CRS test coverage 2013-12-02 19:18:07 +02:00
Vladimir Agafonkin
49af3fda5c merge spherical mercator / epsg3857 changes with some fixes
closes #2062
2013-12-02 19:18:07 +02:00
Vladimir Agafonkin
7e20997e40 remove LatLng wrap and fix wrap tests 2013-12-02 19:16:01 +02:00
Vladimir Agafonkin
a03bfb753e add CRS & Map wrapLatLng, fix GridLayer bounding 2013-12-02 19:16:01 +02:00
Vladimir Agafonkin
00166b9c4f proper EPSG:4326 with 2x1 root, fixes #1207 2013-12-02 19:16:00 +02:00
Per Liedman
294a7250d0 Added tests to verify size of EPSG3857 and 4326 2013-12-02 19:16:00 +02:00
Calvin Metcalf
87520df2e2 Spherical Radius is used in Spherical Mercator 2013-12-02 19:15:18 +02:00
Vladimir Agafonkin
91c039b7aa jshinting and major clean up of specs code, ref #2151 2013-11-07 23:54:33 +02:00
Vladimir Agafonkin
5d6641360b merge GeoJSON altitude pull with some tweaks #1822 2013-11-06 23:17:14 +02:00
Seb Emonet
16f9c9a302 Accept simple objects in L.latLngBounds(). Fixes #1915. 2013-09-13 00:22:19 +02:00
Alexander Parshin
df320c3b06 Add test specifications for CRS classes. 2013-09-10 11:40:48 +04:00
Hans Kristian Flaatten
8e98e52b88 Renames L.LatLng property .altitude to .alt 2013-07-03 15:44:57 +02:00
Hans Kristian Flaatten
46885de00d Adds support for altitude and 3D GeoJSON
This commit adds a third parameter to the L.LatLon class for specifying
altitude. This is in turn stored in the `.latitude` property for the LatLng
instance. Latitude property will only be set if the latitude parameter is not
undefined, this is done in order to ensure backwards compability.

```javascript
var latlng = new L.LatLng(10, 20, 30);
console.log(latlng.altitude); // prints '30' to the console
```

Similar functionality has been added to L.GeoJSON coordsToLatLng() and
latLngToCoords() methods in order to handle import and export of 3D GeoJSON.

```javascript
var geoJSON = {
  type: 'Feature'
  ,properties: {}
  ,geometry: {
    type: 'Point'
    ,coordinates: [20, 10, 30]
  }
}
var layer = new L.GeoJSON();
layer.addData(geoJSON);
console.log(layer.getLayers()[0].getLatLng().altitude);
```

`NB` It is important to notice that no logic has been added in order to prevent
latitude and longitude to change without appropirate change in altitude – this
must be handled by the application.
2013-07-03 10:13:00 +02:00
Vladimir Agafonkin
54befc9203 fix True Mercator projection calculations, close #1578 2013-06-24 10:42:15 -04:00
Andrii Korzh
d1aa0f3b7e Update LatLngBoundsSpec.js 2013-05-18 13:27:45 +03:00
Tom MacWright
8691889d49 Proper default for delta 2013-04-03 14:50:10 -07:00
Tom MacWright
bf99fdb70e Tighter tolerance for point-near check 2013-04-03 14:50:10 -07:00
Tom MacWright
a3ab4b1095 Fix mercator tests, these are broken in Leaflet master. 2013-04-03 14:50:10 -07:00
Tom MacWright
a2f7d7e834 Use mocha 2013-04-03 14:50:09 -07:00
John Firebaugh
01332ebead Omit "should" in spec descriptions
The rationale is this: the spec string describes the expected
behavior unconditionally. The code examples, on the other hand,
set up an expectation that is tested with the call to the expect
method. The code examples can violate the expectation, but the
spec string does not. The value of the spec string is as clearly
as possible describing the behavior. Including “should” in that
description adds no value. (From http://rubyspec.org/style_guide/)
2013-02-19 12:41:48 -08:00
Tom MacWright
0a2000166a Fix semicolons, breaking, whitespace, duplicate var statements. 2013-02-19 11:18:15 -05:00
Vladimir Agafonkin
a0dd4a60e9 accept coordinates in form of simple objects, close #1412 2013-02-19 18:01:53 +02:00
Vladimir Agafonkin
5e05068478 complete LatLng and LatLngBounds tests, #1347 2013-02-05 15:21:40 +02:00
Yohan Boniface
4f59140253 Eat our own food 2013-01-28 01:09:26 +01:00
Yohan Boniface
4b5746ffbc Use getWest/South/East/North instead of getLeft/Bottom/Right/Top 2013-01-28 01:04:09 +01:00
Yohan Boniface
69b925b057 Add LatLngBounds.getLeft/getBottom/getRight/getTop 2013-01-27 12:12:02 +01:00
Vladimir Agafonkin
8350bb1e08 update LatLng specs after removing default clamping/wrapping 2012-12-12 12:04:54 +02:00
Pascal Borreli
9546599520 Fixed typos 2012-11-09 23:15:48 +00:00
John Firebaugh
2cca6586dc Test the right class 2012-10-11 08:54:04 -07:00
Dominik Moritz
f8d6e7052e Implemented isValid() function for Bounds and LatLngBounds. Fixes issue #966. Added specification. 2012-09-11 12:43:16 +01:00
Alex Graul
57f44bc423 fix issue with 180 longs being clamped to -180 2011-12-21 13:22:07 +00:00