* Fix final position after dragging
1. For unclear reason `_startPos` was set wrong (increasing it for offset of first move event),
so we fix that, like it was in initial implementation (no idea why it was ever changed).
(2d2fc74110 (diff-d8f00e9d1726fd6483110dc44c93d9f8R84))
2. Make sure that final position is set always, even after cancelAnimFrame.
* Prevent false map click after fast dragging of marker
To solve this we have to ensure that draggable final position is already set on the time
of mouseup/touchend. Thus we have only option - reject using of requestAnimationFrame,
which was originally introduced to fix performance issues of map panning, see
c93d91bfad (diff-46eca63ac2c5237cbd2d45c8a60f6ee28ce34231aef53669247ead03f012dff2)
Perhaps browsers evolved since then.
* Adapt test to expect exact position values
(as we do not depend on timings anymore)
* CanvasSpec: fix a test
* Replaced checks with `nearLatLng`
* Add missing brackets
Co-authored-by: falke-design <design.falke@gmail.com>
* Tooltip: process pointer events itself
Now it's possible to attach listeners to tooltip
* DivOverlay: inherit from Interactive Layer
* DivOverlay: process 'interactive' option
Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
* Refactor openPopup/Tooltip to use common functions [Map/Layer]\_initOverlay
* DivOverlay: common functions openOn/close
Refactor [Map\Layer] open/close-Popup/Tooltip to use DivOverlay's openOn/close
* DivOverlay: new public method `toggle`
Refactor Layer\ togglePopup/Tooltip: use common method DivOverlay\toggle
Popup: do not clear map._popup on close as it's redundant
* Break the reference to the options of the Class prototype
* Refactor test and .setOptions
* Revert: Merge https://github.com/Leaflet/Leaflet into class_options
* Fixes bug: if tooltip is sticky and permanent it was not following the mouse
* Add tests
* Use fastframe
* fix whitespace
Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
* Add check if map container has the leaflet_id
* Fix lint
* Use private _container
* Add test for _handleGeolocationError
* Update test text
* Change text of test
* Fix overlapping permanent tooltip on bindTooltip
Fix overlapping permanent tooltip on bindTooltip
* Update test
* Fix lint errors
* Using sinon.spy on a function of layer
* unwrap spy in the test
* move spy restore
* Improve panInside doc and add arg check
* Removed unwanted parameter check.
* Throw when padding value is not a point, plus test
* New padding options docs and error checking
* Update src/map/Map.js
Co-authored-by: johnd0e <johnd0e@mail.ua>
* Error checking for fitBounds and flyToBounds
* Separate padding options tests
* Comment update on padding tests
* Revert padding checks and associated tests
* Remove extra blank line
Co-authored-by: johnd0e <johnd0e@mail.ua>
Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
* Change color of close button #7539
* Add role=button and aria-label #7399
* Add aria-hidden to `times` / `x` #7472
* remove bold on close button
Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
undefined/null/false are not considered as special case anymore,
`layer` argument is always required, as per docs.
Previous excessive tolerance may lead to real errors get masked.
* Evented:_off: get rid of redundant condition
* Evented:_off: minor optimization of case when remove happens in fire
* Evented:_off: prevent removing all listeners when false fn argument specified (by mistake)
* Evented:_on,_off: ignore non-function listeners passed
* Evented:_on,_off: throw on wrong types passed
* Evented: console.warn on common errors
* Class.extend: do not modify source props.options
`extend` method had side effects:
- (if parent prototype has options) props.options got rewritten
- (if parent does not have options) props.options object was used directly
that behavior was undesirable, as it prevented to reuse props.
E.g. this case had unexpected behavior:
var props = {
// ...
// some useful props and methods
}
var MyLine = L.Polyline.extend(props);
var MyGon = L.Polygon.extend(props);
var line = new MyLine([]);
var gon = new MyGon([]);
console.log(line.options.fill, gon.options.fill);
// Output expected: false, true
// Output before fix: false, false
* Class.extend: do not modify source props object
Previously 'statics' and 'includes' were removed,
that prevented source props reusing
* GeoJSON.latLngToCoords: do not force default precision value
Rely on default value defined in `formatNum` itself.
Specify all related docs.
Document `precision` argument of `latLngsToCoords` function.
* Util.formatNum: allow to skip processing specifying `false` as precision
This is most necessary for cases where `formatNum` is called indirectly,
e.g. by GeoJSON functions.