Commit Graph

2954 Commits

Author SHA1 Message Date
Vladimir Agafonkin
957f05da23 fix non-extendable objects regression of 1.1.0
Closes #5650 until we figure out a less hacky solution.
2017-07-27 11:03:51 +03:00
Yohan Boniface
eb9572800d Make L.Draggable._dragging "public" again (#5659)
To make Leaflet.Editable happy

See https://github.com/Leaflet/Leaflet.Editable/issues/130
2017-07-24 16:46:32 +03:00
Tim
54a87e0902 addTo() can be called with a map or layer group. (#5600) 2017-07-03 11:18:02 +02:00
Tim
44122b632e LayerGroup parameter is optional (#5599) 2017-07-03 11:10:14 +02:00
jelhan
7a73e1d140 Fix(DomEvent): DomEvent.off should return this (#5601)
Was broken by 14c5f1602c.
2017-07-03 10:47:11 +02:00
ghybs
241fb56701 Docstring(GridLayer): more explicit updateWhenIdle option (#5577)
* Docs(GridLayer): more explicit updateWhenIdle option

description, because "for better performance" is quite generic and might be understood in very different manners depending on the reader's point of view.

* Docs(GridLayer): improve updateWhenIdle option explanation

as per Perliedman's proposal.
2017-06-30 00:28:03 +02:00
Arne Schubert
748f65f119 Prevent using functions from the global scope with es6 (#5596)
* Prevent using functions from the global scope with es6

* check against static _dragging as requested by perliedman
2017-06-29 22:29:03 +02:00
Egon Steiner
d30f7aad35 return this instead of addOne in disableScrollPropagation (#5595) 2017-06-29 11:55:16 +02:00
ghybs
4a0bfb6e5e Docs(Popup+Tooltip): fix typo in bindPopup & bindTooltip (#5578)
methods description.
2017-06-27 14:17:24 +02:00
Iván Sánchez Ortega
3fae3befd3 Actually assign the replaced path for the default icon (#5580) 2017-06-26 12:03:51 +02:00
ghybs
d6fc47d70e Fix(DivIcon): revert #5517 to avoid appending a single node instead of generating content (#5574)
* Docs(Marker): explain checks for re-using icon element

when the marker is modified with an icon of the same type (i.e. an image icon with an image icon, or a DivIcon with a DivIcon), or checks for NOT re-using the icon element when modifying with an icon of a different type (i.e. an image icon with a DivIcon, or the reverse).

* Revert "Div icon accept node element as option (#5517)"

This reverts commit ba7bfb5011.

Conflicts:
	spec/suites/layer/marker/MarkerSpec.js
2017-06-25 14:11:57 +02:00
Per Liedman
a3ec8047b3 Add className option for ImageOverlay (#5555) 2017-06-22 16:25:15 +02:00
ghybs
6bfa764cb0 Docstrings(Map/Grid+TileLayer): improve minZoom and maxZoom explanations (#5573)
* Docs(Map/Grid+TileLayer): improve minZoom and maxZoom explanations

so that it is more explicit how Map's options may get automatically computed from its Grid/Tile layers, and what is the exact effect of these options on Grid/Tile layers.

* Docs(Map/Grid+TileLayer): use "inclusive"

instead of "included".
https://en.wiktionary.org/wiki/inclusive
2017-06-22 09:14:32 +02:00
Raymond Berger
bbd74eda12 Docstrincs: bad link in Control.Layers.js (#5568)
Fixed link from http://leafletjs.com/examples/layers-control.html to http://leafletjs.com/examples/layers-control/
See:
https://github.com/Leaflet/Leaflet/issues/5567#issuecomment-309739782
2017-06-20 14:52:02 +02:00
Per Liedman
2fee08b234 Icon doesn't really inherit from Layer 2017-06-08 15:18:08 +02:00
Damian Moore
60e1965e33 Use minus character instead of hyphen in the zoom control (#5501)
* Using proper minus character in the zoom control which means CSS workaround isn't needed

* Using HTML escaping of unicode minus character for added browser support
2017-06-04 12:56:23 +02:00
Per Liedman
b23d83f464 Don't turn enter keypress into clicks on map (#5507)
* Don't turn enter keypress into clicks on map

But still preserve functionality to open marker's popup through
enter keypress when focused.

Fixes #5499.

* Clean code

Thanks @egoroof

* Change name of keypress handler to _onKeyPress

* Add unit test
2017-06-02 11:18:46 +02:00
Chris Williams
0b9464f017 Fixes #5534 by adding a check for null. (#5535) 2017-06-01 17:20:08 +02:00
iZucken
da2c8ef2db Fix for issue #5116 (#5544)
* Fix for issue #5116

As this filters out custom inputs created from property names (supposedly using innerHTML), they still will become unusable whenever _update() is fired on control.
I believe that this is a different issue coming from design of a module.

* Followup fix for #5116
2017-06-01 16:26:19 +02:00
Matt Grande
1120c46ed9 Add precision parameter to all toGeoJSON functions (#5444)
* Add precision parameter to all toGeoJSON functions

* Replace usage of toPrecision with Utils.formatNum

* Always default to six decimal places

* Fix docs

* Allow precision of 0
2017-05-31 14:06:58 +02:00
Javier Jimenez Shaw
4f5fef2a56 docstrings: Typo in Projection.LonLat.js (#5532) 2017-05-26 09:44:14 +02:00
ghybs
f66d13976a Docs(Marker): modify icon option description (#5529)
* Docs(Marker): modify icon option description

To explain that a _common_ / generic instance of `L.Icon.Default` is used, instead of leaving room to think that a _new instance_ of `L.Icon.Default` is created for every Marker without specified `icon` option.

See https://github.com/Leaflet/Leaflet.markercluster/issues/786#issuecomment-302893446

* Docs(Marker): replace icon class by instance

it actually needs a proper _instance_ of `L.Icon`, not a "class".
2017-05-24 11:03:00 +02:00
MGMsystems
ba7bfb5011 Div icon accept node element as option (#5517)
* Added option to allow DOM elements inside a DIV icon

* Removed white line

* Adapted so that the dom element can be passed with the html option

* Update DivIcon.js

Changed documentation to state HTMLElement
2017-05-22 09:57:21 +02:00
Iván Sánchez Ortega
7a068122c7 Turn nonBubblingEvents into a documented boolean option (#4883)
* Turn nonBubblingEvents into a documented boolean option

* Update var names after rebase
2017-05-18 11:14:27 +02:00
Per Liedman
942e1df2b8 Always export window.L; fixes #5489 (#5504) 2017-05-18 10:28:14 +02:00
Iván Sánchez Ortega
873d4cab31 Handle edge case of empty bounds on _getBoundsCenterZoom (#5157)
* Handle edge case of empty bounds on _getBoundsCenterZoom

* Unit test for map._getBoundsCenterZoom
2017-05-11 22:33:46 +02:00
ghybs
f677f9c6d2 Feat(Bounds): add new methods for 2 missing corners (#5488)
* Feat(Bounds): add getTopLeft & getBottomRight methods

as suggested in #5475, for consistency with `LatLngBounds` methods which already provide methods for the 4 possible corners.
Also include the docstrings.

* Docs(Bounds): add comments to identify corners

in BoundsSpec.

* Test(Bounds): add tests for existing corner methods

namely getBottomLeft and getTopRight.
Checked that expecting different values make the tests fail.

* Test(Bounds): add spec for 2 new corner methods

namely getTopLeft and getBottomRight.
Closes #5475 together with previous PR #5487.

* Refactor(Bounds): return this.min(max) instead of new Point

as TopLeft corner is tha same as this.min (BottomRight same as this.max).

* Docs(Bounds): add links to this.min(max)

to make it clearer that these methods are just shorthands to already available properties.
Furthermore, it implies that they output those properties directly, making a clue for the app developer that if he/she wants to modify them, they should be cloned before doing so in order to prevent unintentional behaviour.
2017-05-11 22:24:15 +02:00
ghybs
2ff69debc6 Docs(Bounds): change topLeft/bottomRight to corner1/2 (#5487)
as suggested in issue #5475.
The actual relative position of the given corners do not matter for the factory / constructor current functionality: it just determines the min/max coordinate values.
2017-05-11 22:22:00 +02:00
Per Liedman
222bc47a0d Handle Polylines with empty array of LatLngs (#5498)
Fixes #5497
2017-05-04 10:05:15 +02:00
Iván Sánchez Ortega
66cf6a0ea1 Take devicePixelRatio into account for scrollwheel zoom in win10+chrome (#5480) 2017-04-27 16:47:11 +02:00
Iván Sánchez Ortega
b19893c9ba Add hook points to allow for a proper NoGap plugin (#5476) 2017-04-27 15:38:55 +02:00
Iván Sánchez Ortega
7e1740ecdf Better sanity checks for avoiding loading infinite tiles (#5479)
* Sanity check to prevent loading tiles when bounds are `Infinity`

* Make linter happy

* Better sanity checks for avoiding loading infinite tiles

* typo
2017-04-25 15:00:47 +02:00
Iván Sánchez Ortega
6d6b07612e Sanity check to prevent loading tiles when bounds are Infinity (#5478)
* Sanity check to prevent loading tiles when bounds are `Infinity`

* Make linter happy
2017-04-25 14:31:27 +02:00
Patrick Paskaris
8e96ac476d Fix box zoom race condition (#5452)
* Fix box zoom race condition

The deferred call to `_resetState` can interrupt the next box zoom if
the user initiates it before the timeout fires. This causes the mouse
move handler to create a second box zoom element, orphaning the first
one and leaving it in the DOM.

* Extract duplicate code into private method
2017-04-20 15:57:17 +02:00
Oliver Heilig
1318b999ef On update set current tiles active to avoid pruning (#5381) (#5431)
* On update set current tiles active to avoid pruning (#5381)

* fix for missing tiles - without flickering (#5381)
2017-04-20 14:19:26 +02:00
Luis Camacho
b9df865730 make L.Mixin.Events a simple object instead of a prototype so it doesn't have a 'constructor' property. fixes #5451 (#5453) 2017-04-20 12:45:33 +02:00
Guillaume P
ac05f68a39 Canvas: call ctx.setLineDash in _fillStroke (#5454)
* Canvas: call ctx.setLineDash in _fillStroke

This make dashArray working properly for cirles.

fix #5182

* Debug: add dashed circle example

* Debug: add simple example reproducing #5182
2017-04-20 12:41:26 +02:00
Luis Camacho
ff72181b52 Fix __super__ by not copying it from the parent when subclassing (#5456) 2017-04-20 12:39:49 +02:00
Mstislav Zhivodkov
cbaf02034c Remove global L usage (#5463) 2017-04-20 12:38:28 +02:00
Per Liedman
da4e6c1c5e Only rearrange DOM in toFront/toBack if needed (#5465)
Addresses problem where Internet Explorer re-fires mouseover if
the element is re-appended to the DOM.

Fixes #4050.
2017-04-18 16:09:19 +02:00
Mirodil
458b7177b2 Push back keyboard navigation order of L.Popup's close button (#5461)
* Web accessibility

so tabbing through the page make the link(in the popup) to the first entry focussed before the 'x' for close

* remove spaces
2017-04-18 15:12:00 +02:00
gatsbimantico
cc4dce13d0 Issue #5118 Fix documentation for method setZoom 2017-04-17 19:17:33 +01:00
qjas
3e000fbe9d Remove spurious check in DomUtil.preventOutline (#5435)
The codes first execute "element.tabIndex"(show that element is not
NULL), then execute "!element" in the condition of if stmt(check whether
the element is NULL or not). It is a contradiction.
I think since the element must not be NULL(otherwise the execution of
"element.tabIndex" would be wrong) when the while stmt finishes, the
next if stmt doesn't need to check the element like "!element" again.
Checking the element.style is already enough. So remove the "!element".
2017-04-05 12:12:56 +02:00
Iván Sánchez Ortega
61ff641951 Add new class L.VideoOverlay (#4988)
* Add VideoOverlay class based on ImageOverlay

* Make linter happy

* Move VideoOverlay include to layer/index

* Fix mapbox tokens
2017-04-04 22:45:09 +02:00
john gravois
48a76bc6fd jsdoc DomUtil.TRANSITION_END 2017-03-30 17:34:51 -07:00
Iván Sánchez Ortega
28a0adc132 Ensure renderer's container is init'ed when a path is added to map (#5404) 2017-03-29 09:52:43 +02:00
Dave Leaver
27263b7afa Control.Layers: Only add layer events to layers when we are on the map. Fixes #5421 (#5422) 2017-03-28 23:10:29 +02:00
Tom Salisbury
96cfdd3a3d Added z-index support to ImageOverlay (#5418) 2017-03-28 10:54:24 +02:00
Tom Salisbury
8278ed393d Added error event to ImageOverlay layer and added tests for the new (#5416)
event and existing error handling. Also added missing
documentation for the load event.
2017-03-28 08:54:26 +02:00
ghybs
06ed42ad2c Docstrings: LayerGroup.hasLayer add method call with id (#5411)
With the current `hasLayer` code, we can call this method by passing the `_leaflet_id` and get the same result as passing the corresponding layer object.
Added the alternative method call, as done for `removeLayer` method.
2017-03-27 09:35:05 +02:00