Commit Graph

2913 Commits

Author SHA1 Message Date
Dave Leaver
107859379e Add missing method documentation for ImageOverlay (#5158) 2016-12-02 13:42:54 +01:00
Iván Sánchez Ortega
1f4c1b9c0f Docstrings: second parameter for map.fitBounds is optional 2016-12-01 13:40:00 +01:00
ghybs
a359ac72eb docstring: grid layer use bounds with noWrap (#5156)
Following #5154, added mention about using `bounds` on Grid Layer when `noWrap` is used (i.e. set to `true`), in order to prevent requesting tiles outside the main world (CRS limits).
Looks like behaviour changed compared to Leaflet 0.7, where the CRS limits were still effective.
In order to restore that behaviour, application developer must now specify `bounds`.
Especially visible with CartoDB tiles which do serve tiles outside the main world.
2016-12-01 13:37:20 +01:00
Ernie23
3f8b6b3b28 Vertical lines while moving over canvas elements (#5148)
* Vertical lines while moving over canvas elements

* Vertical lines while moving over canvas elements

* bounds.min._floor(); bounds.max._ceil(); instead

* Rounding bounds in _redraw function instead of _clear function
2016-12-01 10:48:28 +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
Iván Sánchez Ortega
633182a836 Sanity check in LatLngBounds.contains (fixes #5132) (#5135) 2016-11-24 09:36:33 +01:00
geoloep
4f52a36dc1 docstrings: Update bounds property in Projection.leafdoc (#5139)
* Update Projection.leafdoc

To me it appears that the property bounds expects 'Bounds' and not 'LatLngBounds'. All the included projections pass 'Bounds'. Giving the area where the projection is valid in latlng's did not work for me.

* Update Projection.leafdoc
2016-11-23 16:29:06 +01:00
Per Liedman
2253672051 Only collapse layer control if collapsed: true (#5131)
Close #5126
2016-11-23 10:49:59 +01:00
Yuzo Matsuzawa
308ba02d69 Update L.version to 1.0.2 (#5134) 2016-11-23 09:59:32 +01:00
Richard Fairhurst
b90e6685c2 Docs: Use openstreetmap.org, not osm.org (#5130)
* Use openstreetmap.org, not osm.org

osm.org is a convenience redirect for typing into your browser URL bar, and not an officially supported services endpoint (for example, it doesn't have the SSL certificates you might otherwise expect)

* Update reference-1.0.2.html

* Update TileLayer.js
2016-11-22 17:39:48 +01:00
Dave Leaver
941c6a2457 Merge branch 'master' into master 2016-11-22 08:49:45 +13:00
mvl22
9d6a1d3c82 Remove unnecessary gendered text in documentation 2016-11-21 19:28:28 +00:00
Faheel Ahmad
520587d745 Fixed L.LatLng.toBounds docstring (#5127) 2016-11-21 15:22:53 +01:00
Iván Sánchez Ortega
d89271b404 Docstrings: 'x' and 'y' properties for L.Point, closes #5117 2016-11-18 16:35:23 +01:00
Julio Garcia
3875722edf Removing unneeded comment 2016-11-18 15:45:23 +01:00
Julio Garcia
243daa90ef Fixing linting errors 2016-11-18 15:45:23 +01:00
Julio Garcia
4eba3a0973 Adding support for minNativeZoom in TileLayer.js 2016-11-18 15:45:23 +01:00
Per Liedman
4c484462dc Canvas improvements (#5115)
* WIP refactor canvas clear

* Fix clearing bounds, remov unnecessary code

* Refactor redraw logic

* Remove flicker on update

* Fix code style

* Add support for layer ordering with bringToFront/bringToBack

* Fix redraw when layer moves

* Add example for moving canvas layers

* Fix code style

* Use layer ordering for mouse events

* Fix removing first or last layer
2016-11-18 15:22:35 +01:00
Per Liedman
9cb7274001 Make click on canvas fire for only one layer (#5100)
Close #5091.
2016-11-17 16:51:59 +01:00
Iván Sánchez Ortega
4e979514c3 Add a 'sortLayers' option to L.Control.Layers (#4711)
* Add a 'sortLayers' option to L.Control.Layers

* Add a sortFunction option to L.Control.Layers

* Fix default sort function; modify test
2016-11-17 12:52:29 +01:00
Aleksey Shmigelski
feb716401a round tooltip position (#5089) 2016-11-13 18:33:17 +01:00
Patrick Arlt
ab31976c75 A11y fixes from #3210 (#5092) 2016-11-11 17:17:49 -08:00
Yohan Boniface
88d107ca96 Merge pull request #5087 from Leaflet/layers-collapse-alt
Always create L.Control.Layers as collapsed; expand if collapse option not set
2016-11-11 16:15:49 +01:00
Iván Sánchez Ortega
df0a81e365 Finish drags when a L.Draggable is removed, fix #5063. (#5065)
* Finish drags when a L.Draggable is removed, fix #5063.

* Use L.Draggable._dragging to check if we should stop the drag

* Add Draggable.finishDrag to allow finishing drag programmaticaly

Out of any event.
2016-11-11 15:34:03 +01:00
Per Liedman
a4bbec5924 Make sure mouseout for previous hovered layer before mouseover for new (#5090)
Close #5082
2016-11-11 12:04:03 +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
Per Liedman
d2f91e39bd Always create as collapsed; expand if collapse option not set
Close #5073.
2016-11-10 17:30:31 +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
Iván Sánchez Ortega
26cce79170 Mention TMS tile scheme for EPSG:4326 proj, fixes #5072 2016-11-03 16:28:21 +01:00
Per Liedman
957659fcd0 Move attribution option and getAttribution to L.Layer (#5070)
Close #5051.
2016-11-03 09:32:56 +01:00
ghybs
9d91ab06ff docstrings: correct GeoJSON methods returns (#5064)
`addData`, `resetStyle` and `setStyle` methods of `L.GeoJSON` actually return `this` (the current GeoJSON Layer Group), not any Layer.
Can be especially confusing in the case of `resetStyle`, where we pass a layer as argument, and with `addData`, which can accept a single GeoJSON feature, hence we could (mistakenly) think that it returns the newly created layer.
2016-10-30 11:02:24 +01:00
ghybs
aa6aa49f56 docstring: improve default icon customization text (#5058)
detailed that modifying `L.Icon.Default.prototype.options` only customizes the icon, but it remains an image-based icon.

Added a paragraph about completely replacing the default icon, so that it can now be anything (including a divIcon).
2016-10-28 15:21:42 +03:00
Iván Sánchez Ortega
7b3c673a16 docstrings: L.Control inherits from L.Class 2016-10-28 12:38:43 +02:00
ghybs
edbcff4386 Changed of L.LatLngBounds arg names to corners (#5059)
as proposed in a recent issue.
This change should not affect the code, it is only for consistency with docstrings.
docstrings: replaced southWest and northEast argument names by corner1 and corner2, to try to prevent confusion that Leaflet will keep these corners at those places, whereas it actually "re-orders" them to keep lowest values West-most / South-most, as if they were just corners.
2016-10-28 09:38:09 +02:00
Iván Sánchez Ortega
4b8762edf9 Refactor L.Path _update and _project into L.Renderer so that no event handling is needed (#5054)
* Refactor L.Path _update and _project into L.Renderer so that no event handling is needed

* Refactor away L.Path's _update event logic
2016-10-27 09:38:28 +02:00
Per Liedman
670662e718 Fix canvas redraw when style updates fill and/or weight (#5034)
Close #5031.
2016-10-21 16:09:26 +02:00
Per Liedman
fa7accacef Prevent canvas from firing multiple mouseover for same layer. (#5033)
Also, fire mouseover for at most one layer for every mousemove,
preventing overlapping features from firing multiple
mouseover/mouseout (#4495).

Close #5028. Close #4495.
2016-10-21 16:57:59 +03: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
Per Liedman
a97b87d033 Remove extra word from doc string 2016-10-20 08:22:50 +02:00
Yohan Boniface
bc82976430 Remove duplicated test in Draggable (#5021)
We already are testing for this._enabled some lines before.
2016-10-18 08:00:44 +02:00
erick
d2add3dd5c docstrings: add clarification for projection; closes #4817 (#5010)
* Fix doc: add clarification for projection; closes #4817

Adds clarification in the documentation that specifies that the
`project` and `unproject` methods cannot take in arrays, but only
actual instances of `L.LatLng` and `L.Point`, respectively.

* Fix doc: add clarification for transform methods

Changes the word "real" for the word "actual" so that people don't
confuse actual instances of `L.Point` with coordinates using real
numbers.
2016-10-12 09:22:05 +02:00
Per Liedman
b144d2f13e Fix docs typo: extend MyClass, not L.Class; close #5009 2016-10-10 12:49:19 +02:00
Iván Sánchez Ortega
16e04741a2 Docstrings: Marker.toGeoJSON 2016-10-06 09:15:05 +02:00
Per Liedman
350919b2ff Use all four corners when projecting ImageOverlay during animation (#4993)
Close #4886.
2016-10-02 22:07:05 +03:00
John Muccigrosso
7f350e4442 docstrings: Better description for easelinearity (#4994) 2016-10-02 16:23:11 +02:00
Vladimir Agafonkin
863cf74461 move zoom animation code into Map.js 2016-09-30 19:51:01 +03:00
Vladimir Agafonkin
ff73971294 move pan animation code into Map.js 2016-09-30 19:51:01 +03:00
Vladimir Agafonkin
5110298c45 get rid of separate Layer.Popup.js and Layer.Tooltip.js 2016-09-30 19:51:01 +03:00
Vladimir Agafonkin
88b593b7ab move flyTo to Map.js 2016-09-30 19:51:01 +03:00
Vladimir Agafonkin
d0879e14af move geolocation methods to Map.js 2016-09-30 19:51:01 +03:00
Vladimir Agafonkin
e3545bc9b9 move marker extensions to Marker.js 2016-09-30 19:51:01 +03:00
Iván Sánchez Ortega
9a1d786075 Version bump to 1.0.1 2016-09-30 14:19:56 +02:00
ghybs
d0ffe8a1ab docstrings: L.GeoJSON functions to methods
Corrected docstrings of L.GeoJSON for methods (addData, resetStyle, setStyle) to be really counted as "methods" instead of static "functions" (geometryToLayer, coordsToLatLng, coordsToLatLngs, latLngToCoords, latLngsToCoords, asFeature)
2016-09-30 13:59:58 +03:00
ghybs
bc01b2b30b docstrings: explicit effect of L.GeoJSON filter
Following https://stackoverflow.com/questions/39776919/how-to-reference-the-data-of-an-existing-geojson-leaflet-object/39787583#39787583, sounds like the current definition "decide whether to show a feature or not" implies that the data is retained in memory, but just not shown.

Replaced "show" by "include" to try to make it clearer that the filtered out data is _lost_ (not retained at all within the group).

Also took the opportunity to add a note about changing the `filter` option dynamically (no re-evaluation of child layers, whether they meet the new filter conditions or not).
2016-09-30 13:59:58 +03:00
Jeff Barnes
837d190933 Fix webpack using valid image file for default icon path (#4849) (#4979) 2016-09-30 13:11:52 +03:00
Babajide Fowotade
6b0808d6f0 Don't load class leaflet-tile-loaded in case of error (#4980) 2016-09-30 09:28:42 +02:00
ghybs
628fc04333 docstrings: update L.circle example to match new syntax (#4974)
docstrings: update L.circle example to match new syntax
2016-09-29 13:21:11 +02:00
Matthew Brener
9bb516970e docstrings: its to it's where appropriate in GridLayer.js (#4963)
Very nitpicky I know.
2016-09-28 10:53:33 +02:00
Per Liedman
d10077e13e Fire update event from VML renderer (#4956)
Close #4950.
2016-09-27 19:59:40 +02:00
Vladimir Agafonkin
11533003c0 update version to 1.0.0 2016-09-27 13:32:00 +03:00
Edgard Lorraine Messias
6bb703ca7c docstrings: Removed incorrect semicolon (#4943) 2016-09-27 10:05:17 +02:00
Edgard Lorraine Messias
db7482a561 docstrings: Removed incorrect semicolon (#4942) 2016-09-26 19:06:54 +02: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
ghybs
695b81f2fa docstrings: L.geoJson → L.geoJSON (#4933)
Replaced factory example `L.geoJson` (from Leaflet 0.7) by `L.geoJSON` for consistency with the new factory signature rendered just below in the generated docs.
2016-09-23 10:14:56 +02:00
Iván Sánchez Ortega
c931d330fe Delay firing the 'update' event on renderers (should fix #4928) (#4929) 2016-09-21 19:20:59 +03:00
Iván Sánchez Ortega
6e08ae427d Improve docs for keypress events, local refs from leafdoc templates (#4907) 2016-09-21 17:38:23 +03:00
Alejandro Sánchez
cdbf4d5057 docstrings: return type of GridLayer.getContainer in (#4904) 2016-09-16 09:27:35 +02:00
Alejandro Sánchez
45775be981 docstrings: CRS.getProjectedBounds and CRS.distance (#4918) 2016-09-15 21:29:48 +02: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
63fd4edc76 wrap tileBounds if noWrap is false by @fyeah (#4908) 2016-09-12 16:59:21 +02:00
Alejandro Sánchez
55ef437723 Add opacity param to setOpacity jsdoc (#4903) 2016-09-10 23:05:08 +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
Iván Sánchez Ortega
2ced69db12 docstrings: Expanded FeatureGroup docs. (#4862) 2016-08-31 17:57:03 +03:00
Baku
61513c9209 Update year (#4850) 2016-08-26 12:37:04 +02:00
Per Liedman
017d29c4eb Just store array of listeners, count is no longer needed. (#4842)
* Just store array of listeners, count is no longer needed.

* Remove unused code
2016-08-25 17:23:58 +02:00
Yohan Boniface
7927708b40 Allow to create and open a tooltip without source (fix #4827) (#4836) 2016-08-25 15:29:20 +02:00
Vladimir Agafonkin
db823b6967 Merge pull request #4841 from Leaflet/popup-remove-zoomanimation
Remove zoomAnimation from popup and divoverlay
2016-08-25 15:28:52 +02:00
Per Liedman
cee8edeaf2 Fix listener removal even if an event is firing
Close #4840.
2016-08-25 15:20:51 +02:00
Iván Sánchez Ortega
32084ddbd8 Remove zoomanimation option from divOverlay, related to #4699 2016-08-25 15:20:12 +02:00
Iván Sánchez Ortega
eb82d4ee42 Removed Popup's _zoomanimated option from @fnicollet's changes from #4699 2016-08-25 15:10:04 +02:00
Per Liedman
0c6dc2ce1e Make event firing reentrant
Close #4833
2016-08-24 09:26:53 +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
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
Iván Sánchez Ortega
e1e121c746 Docstrings: minor typo 2016-08-10 15:48:01 +02:00
Vladimir Agafonkin
35c30a1bcf upgrade deps 2016-08-09 17:51:17 +03:00
Yohan Boniface
833340752c Bump version; changelog (#4786) 2016-08-05 12:25:56 +03:00
Iván Sánchez Ortega
5dda4f4e0e Docstrings: clarifications about noWrap and wrapLng 2016-08-04 16:27:10 +02:00
Lou Huang
03a72717fc Fix option misnamed snapZoom instead of zoomSnap (#4764) 2016-08-04 14:10:28 +02:00
Yohan Boniface
a1d64678f2 Do not call zoomIn/zoomOut on zoomControl click if already at zoom limit (#4791)
fix #4790
2016-08-04 10:56:08 +02:00
Yohan Boniface
c07f43825b Only stop "preclick" on popup open for markers (#4788)
We actually do not toggle the popup on click for L.Path.
2016-08-03 21:37:29 +03:00
Steve
3d2b92af82 Provide oldLatLng during marker dragging (#4752)
* Provide oldLatLng during dragging

References #4736

* Store temporary _oldLatLng on MarkerDrag not _marker
2016-08-02 18:40:28 +03: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
71d3bc02e5 Move closePopupOnClick from DivOverlay to Popup
This option is only used by popup.
2016-08-02 16:55:17 +02:00
Yohan Boniface
8047b0b7a9 Make sure we call event listeners in the order they are registered (fix #4743) (#4769) 2016-08-02 17:53:06 +03:00
Yohan Boniface
450ef3ec77 Take the popup container margin-bottom into account to compute autopan (#4768)
Fix #4759
2016-08-02 17:52:09 +03: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
6dec6660b2 Fix tooltip zoomanimation (fix #4744) (#4765)
Actually something I forgot to port from umap-project/Leaflet.Label
2016-08-02 17:38:08 +03:00
Yohan Boniface
406e1f660a Bump version 2016-07-15 12:15:46 +02:00