Commit Graph

78 Commits

Author SHA1 Message Date
Marvin Bredal Lillehaug
884463bb09 Avoid getBoundsZoom return Infinity when using CRS with flipped axis (#5204)
* Create new bounds from projected coordinates rather than subtract in getBoundsZoom to avoid negative scale. Fixes #5195

* Fix unit test mocks

Apparently, mocking `project()` instead of `latLngToPoint()` magically works.

* Expected zoomlevel is 9, not 7
2016-12-19 12:40:22 +01:00
Iván Sánchez Ortega
8c22c4e385 Ensure zoom is within span when adding a layer with min/maxzoom, fixes #4915 (#4916)
* Ensure zoom is within span when adding a layer with min/maxzoom, fixes #4915.

* Add tests written by @theashyster

* Add tests to verify map's zoom is actually adjusted to layer's min/max
2016-11-11 10:46:31 +01: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
09937e39b0 Add a _leaflet_id to the map container to fix #4806 (#4810) 2016-08-11 09:10:46 +02:00
Yohan Boniface
bd2616f901 Do not rely on options.draggable to compute draggableMoved (#4638)
One can enable dragging of a marker after it has been initialized
with draggable=false.
2016-07-08 11:22:54 +02:00
Yohan Boniface
5dfc3364d1 Allow to make screenshots in Phantomjs (#4705)
* Load CSS in PhantomJS

* Allow to take screenshot in PhantomJS while running tests

For that, one need to run this call:

    window.top.callPhantom({'render': 'screenshot.png'});

* Make PhantomJS serve images

* Bonus: those tests now passe in Phantom too

* Add helper to make screenshot in tests

	takeScreenshot();

or

	takeScreenshot('path/to/screenshot.png');
2016-07-08 11:05:12 +02:00
Per Liedman
01790eacda Ignore events if Draggable is disabled, fixing disabling drag on click in IE11 (#4479)
* Ingore events if Draggable is disabled
Close #3666.

* Add test for verifying fix to #3666
2016-06-27 16:16:03 -07:00
Yohan Boniface
6e8ac31993 Fix setMaxBounds not resetting when passing null argument (#4494) 2016-05-09 15:12:51 +02:00
Iván Sánchez Ortega
cc3380f98e Tweaked values of getBoundsZoom unit tests (#4528) 2016-05-09 10:42:19 +02:00
Dian Jin
a6888ab13f getBoundsZoom fix for small size and padding and tests (#4532) 2016-05-09 10:39:14 +02:00
Iván Sánchez Ortega
23890c5fa4 Skip a touch unit test on non-touch browsers 2016-04-19 12:21:01 +02:00
Iván Sánchez Ortega
5389d23e79 Add unit test for drag handler enable/disable bug (#4387) 2016-04-15 15:30:39 +02:00
David Uvenman
864326610a Added click tolerance also for non-touch devices (#4396)
* Added option for click tolerance. This option is used as a threshold to determine if the user event should be considered a click or a drag.

* Updated docs for clickTolerance to state the correct default value.

* Added tests for click threshold
2016-04-15 10:18:50 +02:00
Per Liedman
36b60b7c88 Round scale to avoid float rounding issues in fitBounds
Reverts _round() fix from b511c7bcc8.

Close #4395.
2016-04-06 22:58:00 +02:00
Zsolt Ero
928100f961 Workaround for flyTo bug
* test for flyTo start latlng == end latlng condition
* workaround for flyTo infinite loop
* expect for zoomend values

Close #4226
2016-04-02 21:12:40 +02:00
Per Liedman
b511c7bcc8 Round bounds size.
Bounds size should be in pixels, so round it to avoid
any floating point inaccuracies from projection.

Closes #4255.
2016-04-02 19:55:02 +02:00
Yohan Boniface
4bcc89bc54 Make sure bounds are bounds before testing its validity in fitBounds
Fix #4374
2016-04-02 19:23:58 +02:00
Iván Sánchez Ortega
c6c0e4f484 Switch prosthetic-hand to 1.3.0 and use onStop callback 2016-04-02 17:55:22 +02:00
Iván Sánchez Ortega
8da61993d2 Added four prosthetic-hand tests, checking mouse&touch drag events and touch-zoom 2016-03-18 15:24:42 +01:00
Iván Sánchez Ortega
8dee2d3591 Fix for #4208 with extra unit tests 2016-02-09 10:07:36 +01:00
Iván Sánchez Ortega
afd7959959 Make linter happy. 2016-01-18 10:10:32 +01:00
Iván Sánchez Ortega
65ccc2b36c Fractional zoom controls. 2016-01-18 10:10:32 +01:00
Yohan Boniface
d3198d8d39 Fix duration not passed through from setView to panBy (fix #3300) 2015-10-12 14:02:30 +02:00
Yohan Boniface
0b0989f9f1 Canvas events fixes (fix #3915)
- fix fireEvent called for each layer containing event point
- fix layer not removed from this._layer at remove
- fix L.DomEvent.stop(e) not honoured for canvas because events
  are both listenned on canvas container and map container
2015-10-09 18:28:35 +02:00
Yohan Boniface
7c2ac9f39d Make sure mouse has an external relatedTarget on mouseout/over (fix #3797 #3708) 2015-10-08 14:57:33 +03:00
Vladimir Agafonkin
cfdbd10431 enforce indentation in specs 2015-09-25 13:55:37 +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
Yohan Boniface
50d7121f72 Make _fireDOMEvent accept optional targets
In the case of canvas path, we can't add the canvas element itself
as an interactiveTarget, given that it's big like the path bbox, and
thus would make all this bbox target of events (so also clicking
outside of the path itself, the layer would fire click event, for
example)
2015-07-06 13:55:59 +02:00
Yohan Boniface
f4cc307e70 Add preclick related unitest 2015-07-06 13:55:59 +02:00
Yohan Boniface
0d3448d494 Always fire DOM event on the map too 2015-07-06 13:55:59 +02:00
Iván Sánchez Ortega
ad08a5c874 Unit test for map zoom level limit and zoom-less setView 2015-06-05 20:51:20 +03:00
Nathan Cahill
794e64df41 add map.setMinZoom() and map.setMaxZoom() closes #3380 2015-04-16 18:39:40 -05:00
Yohan Boniface
4e25056703 Typo in test description 2015-03-09 10:13:42 +01:00
Yohan Boniface
c10f81f95d Remove flyTo callback (but keep test refactored) 2015-03-09 10:11:20 +01:00
Yohan Boniface
60df920452 Add optional callback to map.flyTo 2015-03-08 12:21:43 +01:00
John Firebaugh
4825fc05b3 Add test for #1871 2014-11-05 15:44:23 -08:00
Vladimir Agafonkin
e2e1ccb2f0 fix 404 warnings in tests 2014-10-23 13:52:19 +03:00
danzel
d5a3112852 Another break with adding and removing tile layers. 2014-01-30 16:35:08 +13:00
danzel
2396a10282 Fix adding and immediately removing a Layer from the map when the map is never initialized 2014-01-30 16:15:03 +13:00
John Firebaugh
c1654c4626 Add hasLayer tests 2013-12-13 17:51:37 -05:00
Vladimir Agafonkin
4011a6199f move add/removeLayer logic to Layer; ditch tilelayersload event 2013-12-06 15:10:28 +02:00
Vladimir Agafonkin
80607c6044 reimplement max bounds with proper zooming 2013-11-14 17:45:47 +02:00
Vladimir Agafonkin
be42f7a3b6 Merge branch 'patch-1' of https://github.com/kapouer/Leaflet into maxbounds
* 'patch-1' of https://github.com/kapouer/Leaflet:
  test Map#setMaxBounds and Map#panInsideBounds
  panInsideBounds: fit or center, pass options, remove boundsMinZoom
2013-11-14 14:13:45 +02:00
Vladimir Agafonkin
977fb99b6a fix specs after messy merge 2013-11-13 21:56:48 +02:00
Vladimir Agafonkin
3618f404f5 Merge branch 'invalidateSize' 2013-11-13 21:50:02 +02:00
John Firebaugh
33263e537d Add debounceMoveend option to invalidateSize 2013-11-13 10:53:34 -08:00
Vladimir Agafonkin
91c039b7aa jshinting and major clean up of specs code, ref #2151 2013-11-07 23:54:33 +02:00
Jérémy Lal
d7bf010f0b test Map#setMaxBounds and Map#panInsideBounds 2013-10-14 15:27:11 +02:00
Vladimir Agafonkin
2250cee6ec allow setZoom before setView, make setView zoom optional, close #2056, close #1449 2013-09-30 15:00:46 +03:00