Commit Graph

164 Commits

Author SHA1 Message Date
Dave Leaver
5603a87c70 Remove marker.dragging when not on the map (#5295)
* Add some tests for #5293

* Fix enabling marker dragging while markers aren't on the map by removing the dragging object when not on the map.

This is a change of behavior (.dragging is only defined when a marker is on the map).

* Docs for dragging change
2017-02-02 10:14:39 +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
Iván Sánchez Ortega
b8b7281ee8 Added unit test for #5202 2016-12-21 14:49:47 +01:00
Gert Van Gool
9d6e6fcdf4 Fixes Layer.isPopupOpen when no popup is bound (#5106)
* Adds initial tests for L.Layer#popup

* Fixes Layer.isPopupOpen when no popup is bound

This fixes uncaught exception when checking whether a popup isOpen(),
when the layer has no popup bound to it.
2016-11-29 10:33:54 +01:00
Julio Garcia
d303a7b681 Adding Unit Tests for minNativeZoom and maxNativeZoom 2016-11-18 15:45:23 +01:00
Iván Sánchez Ortega
fd78560036 L.GeoJSON.asFeature should pass through FeatureCollections (#5049)
* L.GeoJSON.asFeature should pass through FeatureCollections

* Add unit test to verify FeatureCollection toGeoJSON
2016-11-10 13:53:38 +01:00
ghybs
34dca3cfd9 Fix #5011 (canvas remove+add) (#5024)
Bug when using map option `preferCanvas: true` (canvas renderer for paths) and removing then adding back a vector within the same animation frame (typically in the same sequence, as done by Leaflet.markercluster at `"zoomend"` event, to remove layers and clusters outside visible bounds).
This commit clears the `_removed` flag from paths when they are added to the canvas.
Also added corresponding test suites.
2016-10-20 15:50:15 +03:00
Vladimir Agafonkin
fd8c2599ef fix icon url warnings in tests 2016-09-27 17:58:08 +03:00
Yohan Boniface
e28f7ae984 Do not fail when closing an interactive tooltip not yet added to the map (#4937) 2016-09-26 16:40:51 +03:00
Iván Sánchez Ortega
63fd4edc76 wrap tileBounds if noWrap is false by @fyeah (#4908) 2016-09-12 16:59:21 +02:00
Per Liedman
ed1a612e6f Make paths insensitive to the order of its map's moveend handlers (#4855)
* Make Paths always update after renderer updates

Close #4851

* Add test

* Add docs for update event

* Remove listener when layer is removed
2016-08-31 17:58:46 +03:00
Yohan Boniface
7927708b40 Allow to create and open a tooltip without source (fix #4827) (#4836) 2016-08-25 15:29:20 +02:00
Iván Sánchez Ortega
e9957cfa02 Detect L.Icon.Default.imagePath using CSS. #4604, #3696, #4579 (#4605)
* CSS-based paths for L.Icon.Default. #4604, #3696, #4579

* Unit tests for default icons

* Make CSS icon path detection IE8-friendly

* Backwards compatibility for L.Icon.Default.imagePath override.

* Don't overwrite options
2016-08-22 16:40:03 +02:00
Steve
92baa9c73f Throw error on call to L.Polygon getCenter before map add (#4820)
* Throw error on call to L.Polygon getCenter before map add

References #4740

* add polyline handling, tests, and docstring
2016-08-15 17:01:41 +02:00
Yohan Boniface
a0ee68558f Close non permanent tooltip on map click on touch (fix #4741) 2016-08-02 16:55:17 +02:00
Yohan Boniface
e746211be7 Better tooltip offset handling (fix #4772) (#4773)
- default offset is now [0, 0]
- both offset.x and offset.y are always honoured
- positive x always move the tooltip on the right
- positive y always move the tooltip on the bottom
2016-08-02 17:51:22 +03:00
Yohan Boniface
fc1dc96638 Allow to call bindTooltip on a layer not yet added to a map (fix #4778) (#4779) 2016-08-02 17:50:53 +03:00
Yohan Boniface
64ba1f7f95 Rename Label in Tooltip, PopupBase in DivOverlay 2016-07-08 13:51:18 +02:00
Yohan Boniface
fe3649f032 Default L.Label border and tip to white 2016-07-08 11:33:53 +02:00
Yohan Boniface
f8221e09f7 We now load CSS in Phantom, so no need to skip those tests 2016-07-08 11:08:25 +02:00
Yohan Boniface
0dd58bd01f Merge branch 'master' into label 2016-07-08 11:07:22 +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
Yohan Boniface
d18d661837 More label tests
431579ce4a
needed to make them pass on Phantom
2016-07-02 23:02:48 +02:00
Yohan Boniface
2f4b97de19 Add support for "center" Label position 2016-07-02 10:52:04 +02:00
Yohan Boniface
14bfedf7ff Merge branch 'master' into label 2016-07-02 10:36:42 +02:00
Iván Sánchez Ortega
8cb745ce0a L.Evented.listens() returns false on removed event handlers, #4474 (#4476)
* Fix L.Evented.listens() on removed event handlers, #4474

* Fix bad unit tests for marker events

* Only check for listerners.length if listerners is actually defined
2016-07-01 11:14:22 +02:00
Iván Sánchez Ortega
b2d7cf110b Fix #4039: Use different L.Bounds for "marking as prunable" and loading tiles (#4650)
* Fix #4039: Use different L.Bounds for "marking as prunable" and loading tiles.

* configurable tile pruning tests

* using spy for testing load did not happen
2016-06-21 15:27:44 +02:00
Yohan Boniface
d8a6ad4010 Use proper Hand onStop callback instead of setTimeout in popup spec 2016-06-16 15:34:16 +02:00
Yohan Boniface
d1de37aa88 Fix broken sizeOption when L.point instance (#4636) 2016-06-10 15:36:07 +02:00
Yohan Boniface
95d5b59c5f Fix canvas not filtering click event after drag (#4493)
* Fix preclick not fired in canvas
* Do not add canvas layers to click event targets if just dragged (fix #4458)
2016-06-01 17:43:32 +03:00
Ray Hammond
72c4f986b1 Icon size x can now be initialised with a number (#4608)
Icon size x can now be initialised with a number. Fixes #3185
2016-06-01 17:24:24 +03:00
Jon Woyame
878a022897 Prevent map click when layer has popup (#4603)
* prevent map click when layer has popup

* add test cases for click events on Paths

* update test for Path popups to check popup is open
2016-05-29 22:01:16 +02:00
Yohan Boniface
4a9140e6b1 Add L.Label related documentation 2016-05-06 15:00:01 +02:00
Yohan Boniface
737137634e Rename Label clickable option to interactive 2016-05-06 13:39:09 +02:00
Yohan Boniface
8a2255afc3 Merge branch 'master' into label 2016-04-30 14:36:48 +02:00
Per Liedman
593a553e64 Pass layer on when calling _updateDashArray
Add specs to verify intialization and setStyle with dashArray.
Close #4401.
2016-04-08 16:43:21 +02:00
Iván Sánchez Ortega
4b38a7165a rm spurious check, fixes #4068 2016-04-02 18:32:31 +02:00
Yohan Boniface
5795f37fe4 Make sure a failing test will not leave the node in place 2016-03-29 10:39:05 +02:00
Yohan Boniface
6bc6e599a0 Increase timeout for "should not be closen when dragging map" test 2016-03-29 10:38:47 +02:00
Yohan Boniface
61da775379 Replace happen.drag by prosthetic-hand in specs 2016-03-28 21:51:27 +02:00
Jan Pieter Waagmeester
ccaf632268 Do not calculate inverted y coords for CRSes with infinite: true
Fixes #4338
2016-03-22 14:10:24 +01:00
Jan Pieter Waagmeester
34075a893a Unit tests for TileLayer getTileUrl replacements 2016-03-21 15:00:13 +01: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
Knut Hühne
df19ec7c30 Add test for throwing error if circle radius is NaN 2016-02-15 11:51:27 +01:00
Iván Sánchez Ortega
c6e2a2021a Unit tests for flyTo and TileLayers. 2016-02-05 16:30:29 +01:00
Iván Sánchez Ortega
efdc626262 Fix tile pruning on fade-in, pass all unit tests now :-D 2016-02-04 15:19:35 +01:00
Iván Sánchez Ortega
f777f42c6b More GridLayer unit tests; Grid zoom calculation changed during zoom anims 2016-02-03 17:35:52 +01:00
Iván Sánchez Ortega
bf37a9106c Change the way GridLayer is reset on a map viewreset 2016-02-02 16:56:18 +01:00
Iván Sánchez Ortega
ed05d4ac1e Unit tests for GridLayer loading logic 2016-02-02 14:56:02 +01:00
Yohan Boniface
5e6ef5ce12 Consistent GeoJSON casing
I've made the choice to:
- switch API and method to upper case version (GeoJSON, geoJSON, toGeoJSON)
- keep internal variable all lower case (geojson), because we usually do not
  uppercase variables

Fix #2444
2015-12-25 14:00:21 +01:00