Commit Graph

2546 Commits

Author SHA1 Message Date
Iván Sánchez Ortega
3b183f01bb Gridlayer prunes all tiles when zooming out of minzoom/maxzoom. 2015-06-02 12:58:38 +02:00
Iván Sánchez Ortega
c0384bbe21 Implement 'overlaps' spatial operator on bounds and use it on gridlayers 2015-06-02 12:35:31 +02:00
Taro Matsuzawa
4399b8f935 restore minZoom and maxZoom check on _update 2015-06-02 13:01:50 +09:00
vingiarrusso
376820ff63 use existing method on popup 2015-05-27 16:59:54 -07:00
vingiarrusso
fd1b295b95 add isPopupOpen method to layer 2015-05-27 16:34:06 -07:00
Alex Fedosov
9313733d3f make panInsideBounds accept array 2015-05-25 17:45:53 +06:00
Iván Sánchez Ortega
db8a790ae3 Persist marker dragging when removing/readding it. 2015-05-22 10:19:39 +02:00
Vladimir Agafonkin
8ffbb707c6 add layer getElement methods 2015-05-21 19:57:12 +03:00
Rik Vanmechelen
c4b6e79fa4 fix inertia when only moving on one axis, close #3432 2015-05-20 22:35:57 +03:00
Iván Sánchez Ortega
555c80f20e Wrap all SVG paths inside a <g> 2015-05-12 10:38:12 +02:00
Iván Sánchez Ortega
9274ee2b5f Graceful degradation of zoom-pan animations, fixes #3272. 2015-05-11 16:54:46 +02:00
Yohan Boniface
298a27fbe4 Add Polyline/Polygon.isEmpty method 2015-05-09 23:03:22 +02:00
Yohan Boniface
426f331874 Fix polygon.addTo(map) failing when latlngs was empty.
Since #3279 an empty polygon as a nested array [[]] as latlngs,
so _latlngs.length returns true.
2015-05-09 22:04:46 +02:00
Vladimir Agafonkin
b170695fe5 bump version to clear up confusion 2015-05-08 17:55:19 +03:00
Iván Sánchez Ortega
b849568ca0 Merge pull request #3233 from juliensoret/grabbingCursor
Fix cursor when dragging is set to false.
2015-05-08 16:32:24 +02:00
Vladimir Agafonkin
7603010f8b Merge pull request #3279 from Leaflet/nested-polygons
Ensure polygons latlngs are never flat (cf #2618)
2015-05-08 16:01:56 +03:00
Yohan Boniface
6aca7ef3c2 Add back L.Polyline.addLatLng 2015-05-08 14:53:21 +02:00
i.taratuhin
57d7dff81f fix vector in ie8 2015-05-08 18:03:24 +06:00
Yohan Boniface
2408cf2bb6 _flat is now a static method 2015-05-08 13:11:58 +02:00
Yohan Boniface
8b97b905e8 Merge branch 'master' into nested-polygons 2015-05-08 13:10:49 +02:00
Yohan Boniface
d53d958e81 Simpler approach for static method 2015-05-08 12:01:22 +02:00
Yohan Boniface
19d6008dfc Make L.Polyline._flat a static method 2015-05-08 11:52:00 +02:00
Vladimir Agafonkin
6c0557c868 Merge pull request #3386 from Leaflet/polyline-flat
Fix L.Polyline._flat returning true for a nested empty array
2015-05-07 11:08:37 +03:00
Vladimir Agafonkin
bb68b7342f Merge pull request #3390 from Leaflet/latlng-clone
Add LatLng.clone
2015-05-07 11:07:21 +03:00
Iván Sánchez Ortega
8f3a353d84 LatLng.wrap shall not drop altitude, closes #3420 2015-04-30 16:38:48 +02:00
Iván Sánchez Ortega
ea680ce21a Detect Firefox for Android as L.Browser.mobile 2015-04-30 13:20:19 +02:00
Vladimir Agafonkin
24ce6b3e8e Merge pull request #3410 from IvanSanchez/multiple-maxbounds
Prevent recursion on map.setMaxBounds
2015-04-29 13:52:25 +03:00
Iván Sánchez Ortega
286f192ca9 Prevent recursion on map.setMaxBounds 2015-04-29 11:07:45 +02:00
Iván Sánchez Ortega
71f93c44ef Fix leaflet/Leaflet#3404 2015-04-27 09:42:54 +02:00
Iván Sánchez Ortega
c3575be344 Implement options in L.Map.flyTo() 2015-04-23 09:18:59 +02:00
Iván Sánchez Ortega
4d70fe09a7 Implement L.Map.flyToBounds(), #3391 2015-04-22 01:27:25 +02:00
Yohan Boniface
8938754bd5 Merge branch 'master' into nested-polygons
Conflicts:
	spec/suites/layer/vector/PolygonSpec.js
2015-04-21 15:57:24 +02:00
Yohan Boniface
097128cfa7 Add LatLng.clone 2015-04-21 15:52:44 +02:00
Yohan Boniface
003e94ae11 Fix L.Polyline._flat returning true for a nested empty array 2015-04-18 17:41:36 +02:00
Nathan Cahill
91fe187ee7 add return statements to allow chaining 2015-04-17 00:49:49 -05:00
Nathan Cahill
794e64df41 add map.setMinZoom() and map.setMaxZoom() closes #3380 2015-04-16 18:39:40 -05:00
Yohan Boniface
3336bcbbe9 Fix Polygon.getCenter returning invalid LatLng when all points in same pixel 2015-04-12 18:43:04 +02:00
Yohan Boniface
a82c80ecd9 Fix Polyline.getCenter returning undefined with very small line 2015-04-12 11:25:46 +02:00
Yohan Boniface
7523aaafa0 Never try to run _updateOpacity if this._map is undefined 2015-04-11 15:09:33 +02:00
Yohan Boniface
37b87b4b21 Loop through parents when event src element is not in targets
For example, when using a DivIcon, we often add DOM elements in it,
which can then be the actual target of DOM events.
2015-04-10 07:59:59 +02:00
Vladimir Agafonkin
78d8a4d9f3 fix zoom out on azerty keyboard, close #3362 2015-04-09 21:53:12 +03:00
Stéphan Kochen
03c888c20f Add isLoading to GridLayer 2015-04-08 10:23:50 +02:00
Mstislav Zhivodkov
b6b4c07375 add opera12 to any3d 2015-04-07 10:43:12 +06:00
Mstislav Zhivodkov
4b757fe2cd change translate3d detection 2015-04-06 18:05:11 +06:00
Vladimir Agafonkin
cac1494f64 Merge pull request #2574 from tohaocean/patch-1
Opera does not support translate3d property
2015-04-06 13:21:40 +03:00
Alex Fedosov
56733af488 fix tile freeze in ie8 2015-04-01 16:42:46 +06:00
Iván Sánchez Ortega
558f8c3a06 Fix #3333 by catching the onScroll event on the map container 2015-03-30 16:31:18 +02:00
Vladimir Agafonkin
205575c932 Merge pull request #3303 from Trufi/panby-return
Map panBy always return map object
2015-03-18 18:52:23 +02:00
Vladimir Agafonkin
21a748123f Revert "e.button === 0 is the left mouse button."
This reverts commit 0d1716d796.
2015-03-18 13:09:04 +02:00
Patrick Arlt
6917733750 restore toggling marker popups, pass ESLint 2015-03-14 12:13:44 -07:00
Patrick Arlt
6ed939422c Merge branch 'group-popup' of github.com:Leaflet/Leaflet into popup-debugging 2015-03-14 10:23:50 -07:00
Patrick Arlt
52be81b18b Merge branch 'master' of github.com:Leaflet/Leaflet into popup-debugging 2015-03-14 10:22:25 -07:00
Mstislav Zhivodkov
b93d42880e map panBy always return map 2015-03-12 12:10:53 +06:00
Vladimir Agafonkin
7db3473727 fix typo, thanks @uniphil 2015-03-10 20:38:13 -07:00
Vladimir Agafonkin
a92c8a3c21 Merge pull request #3287 from Szunti/mousebutton
e.button === 0 is the left mouse button.
2015-03-08 00:15:12 +02:00
Yohan Boniface
250f03339b Fix popupAnchor not taken into account when passing L.Popup to bindPopup 2015-03-07 19:00:27 +01:00
Szunti
0d1716d796 e.button === 0 is the left mouse button. 2015-03-06 20:25:04 +01:00
Yohan Boniface
0d0269ac15 Remove Polyline.addLatLng and Polyline.spliceLatLngs
Those method are not consistent (or too complexe) among
the supported Polygon/Polyline (cf #3279)
2015-03-06 09:05:50 +01:00
Vladimir Agafonkin
bba39b3eba Merge pull request #3275 from Jakobud/bug/keyboard-event-prevent-map-refocus
Prevent map refocus if control click event is from the keyboard
2015-03-05 18:48:15 +02:00
Jake Wilson
aae1df5d49 Fixed typo in comment 2015-03-04 19:00:52 -07:00
Jake Wilson
39425924ac Added truthy check to the event. 2015-03-04 18:58:51 -07:00
Yohan Boniface
602cff077f Ensure polygons latlngs are never flat (cf #2648) 2015-03-04 18:14:51 +01:00
Vladimir Agafonkin
455fbb087b fix maxNativeZoom regression, close #3096 2015-03-04 11:46:03 +02:00
Jake Wilson
8842385c37 Prevent map refocus if control click event is from the keyboard, which is determined/assumed by the click X,Y being at 0,0. 2015-03-03 22:17:24 -07:00
Vladimir Agafonkin
4dc3a18217 Merge pull request #3270 from Leaflet/fix-freeze
Fix zoom animation freeze race condition
2015-03-03 15:07:44 +02:00
Vladimir Agafonkin
142e0661b1 fix touch zoom regression 2015-03-03 15:04:03 +02:00
Vladimir Agafonkin
f27ead251a Merge pull request #3264 from yohanboniface/drag-original-event
Forward original event on drag
2015-03-02 21:38:51 +02:00
Vladimir Agafonkin
35860a0213 fix marker event data 2015-03-02 19:15:52 +02:00
John Firebaugh
a865d2b649 CSS-based outline prevention 2015-03-02 19:03:39 +02:00
Vladimir Agafonkin
63753d8564 prevent focus outline when dragging objects 2015-03-02 19:03:38 +02:00
Vladimir Agafonkin
0a68b25ce5 fix Canvas vector events 2015-03-02 19:03:38 +02:00
Vladimir Agafonkin
43c3f01a1a cleaner DOM event handling in Map 2015-03-02 19:03:38 +02:00
Vladimir Agafonkin
34bc7fa4ea switch markers to event delegation API 2015-03-02 19:03:38 +02:00
Vladimir Agafonkin
22c97d1b33 use new event delegation API in ImageOverlay 2015-03-02 19:03:38 +02:00
Vladimir Agafonkin
8e7bbff6d8 switch SVG paths to new delegation API 2015-03-02 19:03:38 +02:00
Vladimir Agafonkin
b149f2d754 Layer add/removeInteractiveTarget methods
registers DOM elements for event delegation
2015-03-02 19:03:37 +02:00
Vladimir Agafonkin
bbc3f2fab1 fix zoom anim freeze race condition, close #2693, close #2478 2015-03-02 15:26:05 +02:00
Vladimir Agafonkin
4c8ffadf30 don't animate negligible touch movements, close #2519 2015-03-02 14:48:09 +02:00
Vladimir Agafonkin
bb230d0ac2 fix race condition in tests 2015-03-02 13:35:02 +02:00
Vladimir Agafonkin
954ef1cc10 add indent eslint rule and fix some whitespace 2015-03-01 12:01:28 +02:00
Jake Wilson
d0b5aada79 Code consistency changes 2015-02-28 21:26:20 -07:00
Jake Wilson
8c30707e56 Fixed some code style issues. 2015-02-28 21:21:45 -07:00
Jake Wilson
721cf6a689 Added ability to specify pane for vector layer creation, which will automatically create a renderer for that pane if one does not already exists. 2015-02-28 20:48:14 -07:00
Yohan Boniface
1e4b82b990 Cleaner syntax for event forwarding 2015-02-27 17:57:46 +01:00
Yohan Boniface
66654b94eb Forward original event on drag 2015-02-27 17:27:19 +01:00
Jan Pieter Waagmeester
a7d7bedda7 Add a space to make comments look consistant
And now back to real work.
2015-02-27 15:15:16 +01:00
Julien SORET
03fb73ed22 Fix cursor when dragging is set to false. 2015-02-15 21:18:44 +01:00
Yohan Boniface
5b3ba078bf Do not try to remove drag class if marker as no icon
Since 4c46abe781 it's possible
to have a marker off the map with dragging still enabled.
We want to be able to disable it in this situation too.
2015-02-13 17:53:23 +01:00
Asko Kauppi
a7fc9c9a5f two small typos I spotted during code read-through 2015-02-08 17:06:16 +02:00
John Firebaugh
71c11987b5 Ensure tiles have 0 opacity when first painted
Fixes #3206
2015-02-06 15:54:13 -08:00
John Firebaugh
875ec02e5f Remove obsolete unloadInvisibleTiles option 2015-02-06 15:51:20 -08:00
Vladimir Agafonkin
54c712cf2b Merge pull request #2926 from aparshin/clip-round
Add optional parameter for result rounding in L.PolyUtil.clipPolygon and L.LineUtil.clipSegment
2015-02-06 17:42:53 +02:00
Vladimir Agafonkin
1d7c492bdd discard unneeded tile buffers 2015-02-06 12:17:26 +02:00
John Firebaugh
8d96505527 Remove src reset on removed tiles
This is a performance hit on Chrome; no evidence it ever
solved a real issue. (Ref #107)
2015-02-06 03:13:49 +02:00
John Firebaugh
a0ebbef007 Don't adjust opacity for non-current tiles 2015-02-06 03:13:49 +02:00
Jared
ff679aa7dc Do not render the stroke if the weight is explicitly set to 0
When rendering to SVG, if the weight is 0 the outline is not displayed.
However, when rendering to canvas it will still display the outline.
This change makes the behaviour consistent when rendering to either.
2015-02-06 11:41:40 +13:00
John Firebaugh
fc70a21884 Go back to non-incremental tile pruning algorithm 2015-02-03 14:06:49 -08:00
Vladimir Agafonkin
ddcfa5265a less redundant opacity-changing frames 2015-02-03 15:25:22 +02:00
John Firebaugh
602648111f Use rounded zoom level when calculating tile bounds 2015-02-02 13:46:24 -08:00
John Firebaugh
4d119c9cdb Don't prune tiles during animated zoom
Tiles around the border will not be necessary when the zoom
completes, but need to be retained during the zoom.
2015-02-02 12:31:46 -08:00
John Firebaugh
16b1b26116 Adjust retention logic
Continue to retain loaded-but-still-fading-in tiles,
but also continue to look for loaded-and-active tiles.

This reduces flicker on multiple rapid zoom actions.
2015-02-02 12:29:53 -08:00
Vladimir Agafonkin
cbfbc88370 optimize DomUtil.setOpacity
V8 can’t optimize functions with try/catch inside
2015-02-02 10:50:18 -08:00
Vladimir Agafonkin
fb6eda1fbe don't request redundant fade in frames 2015-02-02 10:50:18 -08:00
John Firebaugh
465cfbad29 Remove opacity resetting on zoom of pre-existing tiles
Now that we are fading during the zoom animation, this
is no longer necessary. The zoom animation itself provides
enough of a transition, and resetting the opacity can lead
to more flickering than it solves.
2015-02-02 10:50:18 -08:00
John Firebaugh
7d90dc152e Clean up pixel bounds calculations 2015-02-02 10:50:18 -08:00
John Firebaugh
bb19fc1bf8 Deterministic tile pruning
Do not throttle _pruneTiles. Instead, when adding new tiles,
prune tiles that are no longer needed immediately, and when
a new tile finishes its fade animation, immediately prune
just its parents/children.
2015-01-29 16:26:32 -08:00
Vladimir Agafonkin
e7a7bfc9ea fix build 2015-01-28 19:45:56 +02:00
John Firebaugh
bbf32ebfcd Begin tile loading and fading during zoom animation 2015-01-28 19:44:15 +02:00
John Firebaugh
22cfd12956 Fade tiles with requestAnimationFrame rather than CSS 2015-01-28 19:44:14 +02:00
Vladimir Agafonkin
aeb5083170 complete the switch to ESLint 2015-01-28 19:33:45 +02:00
Vladimir Agafonkin
e749d1915b add ESLint rules; various code style fixes 2015-01-28 17:27:31 +02:00
Vladimir Agafonkin
65efd30567 minor chaining fixes 2015-01-28 17:17:26 +02:00
Vladimir Agafonkin
93f3304f22 fix zoom control regression 2015-01-27 23:15:07 +02:00
Vladimir Agafonkin
aace5b278e add Control.Zoom disable/enable methods, close #3172 2015-01-27 19:09:49 +02:00
Tom MacWright
a28c9508be Don't mutate this._defaultLocateOptions. 2015-01-25 19:27:24 -05:00
Hans Kristian Flaatten
73147bc9e6 Update year in copyright.js 2015-01-24 11:20:01 +01:00
Stefan Sydow
4c46abe781 preserve dragable state on layer deactivation 2015-01-19 19:07:04 +01:00
Bernhard Eder
cc750d43ae fixed error in _tryAnimatedPan when options is undefined 2015-01-18 23:45:38 +01:00
Vladimir Agafonkin
e653cbe864 Merge pull request #3143 from bcamper/flyto-3139
flyTo: convert targetCenter to latLng
2015-01-18 11:18:53 +02:00
Chris Laidlaw
48a374db05 BUG: _tryAnimatedPan lies to setView about whether or not an animation was initiated. 2015-01-15 15:42:54 -08:00
Brett Camper
c656e3f993 flyTo: convert targetCenter to latLng
see #3139
2015-01-14 19:47:46 -05:00
Vladimir Agafonkin
c3a39f50cf fix accidentally broken build 2015-01-13 13:31:46 +02:00
Vladimir Agafonkin
4dfbcc46dd remove inertiaThreshold option, ref #3063 2015-01-13 13:31:11 +02:00
Vladimir Agafonkin
646d83608f Merge pull request #3063 from RickMohr/improve-inertial-scrolling
Improve inertial scrolling
2015-01-13 13:29:41 +02:00
Vladimir Agafonkin
b76caf0f3c don't count how many tiles to load, ref #3129 2015-01-13 13:22:19 +02:00
John Firebaugh
d08bdc8e78 Calculate _tilesToLoad
Avoids cached _tilesToLoad value getting out of sync with
actual loading tiles, e.g. if _removeOtherTiles or _abortLoading
removes tiles that are loading.
2015-01-12 17:40:28 -08:00
John Firebaugh
99a21117a0 Merge _tiles, _loaded, and _retain into a single map 2015-01-12 17:40:28 -08:00
John Firebaugh
c8fca59b51 Move _pruneTiles up to _update
_update is the only place _addTiles is called from,
makes more sense to call _add then _prune than for
_add to call _prune itself.
2015-01-12 13:03:51 -08:00
Vladimir Agafonkin
7650eaef52 simplify group popup changes, cleanup 2015-01-12 18:56:17 +02:00
Patrick Arlt
ff8023a460 fix passing latlng to openPopup, fix build 2015-01-07 09:50:06 -08:00
Patrick Arlt
428095cf51 allow popups with functions to return strings or dom nodes 2015-01-06 10:49:26 -08:00
Patrick Arlt
ed4b4e70c0 cleanup logic 2015-01-06 10:34:19 -08:00
Patrick Arlt
ef0ee1483d consistant failing test 2015-01-02 07:39:00 -08:00
Patrick Arlt
8285e9dfb5 whitespace 2015-01-02 07:35:58 -08:00
Patrick Arlt
775a8e0c3a refactor everything to Layer.Popup 2015-01-02 07:34:16 -08:00
Patrick Arlt
95596c78a0 fix whitespace 2015-01-02 06:47:07 -08:00
Patrick Arlt
2d709141a8 fix tests, misc cleanup 2014-12-29 13:50:23 -08:00
Patrick Arlt
940452ace0 fix lint 2014-12-29 13:22:58 -08:00
Patrick Arlt
1c3b1889ec debug for regular layers 2014-12-29 12:58:23 -08:00
Patrick Arlt
ff470d5861 popup improvements for FeatureGroup 2014-12-29 12:14:41 -08:00
cebence
bea51fdf4f Disabled by default so it doesn't break existing apps. 2014-12-18 14:28:51 +01:00
cebence
5066ecf043 Hide single base layers in the Layers control. 2014-12-18 13:20:09 +01:00
Miroslav Raska
44a56b3a79 Properly unsubscribe Layer events
I've just bumped into this while browsing the source code. It's not tested in any way and I didn't look for similar issues in other files neither. But I hope it helps anyway.
2014-12-08 21:30:44 +01:00
Sergey Kruk
65cc3c813b Refactoring: L.latLng factory to call constructor with explicit arguments number 2014-12-06 15:32:22 +03:00
Sergey Kruk
c8e5d7c61b L.latLng factory not to throw error on empty array parameter 2014-12-05 20:36:35 +03:00
Sergey Kruk
c5ebd534b2 Factory L.latLng to accept altitude as third parameter or an object's 'alt' property 2014-12-01 16:02:43 +03:00
Rick Mohr
08d828f519 Improve inertial scrolling
[This post](http://stackoverflow.com/a/3628949/362702) claims that in Apple's kinetic scrolling, "The velocity of the touch is measured at the exact moment that the finger is lifted."

I tried both this "final velocity" approach and the "max velocity" approach proposed in #2987. Both allow a stronger "fling" than the current "average velocity" approach, but "max velocity" can feel wrong if you slow down at the end of your swipe.

But because the "final velocity" approach uses just one data point it can be unstable, occasionally giving a too-large velocity from a small time delta.

Best is to stabilize that by averaging a few data points, so we're back to "average velocity" but using a shorter time period. Averaging over 50 ms instead of 100 ms gives good results, usually 4 data points on both my iPhone 4s and Chrome on my Windows laptop.

Another reason the current code has a weak fling is that the velocity was being calculated incorrectly. Because `delay` was added to the time delta, time was computed from n+1 points but distance from n points.

I also changed the default value of `inertiaThreshold` (intended to prevent unwanted additional movement if you stop dragging and then lift your finger) to `Infinity`, for two reasons:

1) A fling gesture often failed on my iPhone because the measured `delay` was higher than `inertiaThreshold` (current default 32), sometimes by hundreds of ms.
2) With the updated velocity code I don't see unwanted additional movement when I stop dragging and then lift my finger.

There is a remaining issue (with both the original and updated code). If you fling the map and try to fling it again before it stops moving, no drag events are generated for the second fling so it has no effect. I don't see this problem with e.g. Google or Apple maps. Entered as #3062.

Fixes #2987
2014-11-26 11:34:28 -05:00
Vladimir Agafonkin
1ec89d2fdc Merge pull request #3043 from kerryarts/ie8-zindex-fix
Default zIndex to be a valid value to fix exception in ie8
2014-11-24 15:48:42 +02:00
Kenny Shepard
86a3e0cc8c Initialize _sizeChanged to prevent async issues
When asynchronously initializing a map, the series of events can
create a scenario where _size is incorrectly initialized, and
therefore calls to getSize will not cause a new value to be generated.

This fix sets _sizeChanged to true upon map initialization, which
allows the following first call to getSize to work properly.

Closes #3031
2014-11-21 17:54:46 -05:00
Vladimir Agafonkin
76440b9df2 Merge pull request #3050 from kdeloach/topic/disable-zoom-scrolling
Remove global variable that disables dragging for all maps during zoom
2014-11-21 21:52:42 +02:00
kdeloach
c97c48325a Remove global variable that disables dragging for all maps during zoom
Starting a zoom animation will disable dragging for all maps on the
page. Only the map that is being zoomed should have dragging disabled.

This fix removes a global static variable which is redundant since
the map pane already has a css class assigned to it for the duration of
the zoom animation.

Fixes #2539
2014-11-21 14:41:00 -05:00
Vladimir Agafonkin
e5ee31d6b5 Merge pull request #3048 from CloudNiner/feature/fix-2318
Closes #2318: getMaxZoom returns prev layer on baselayerchange
2014-11-21 21:01:21 +02:00
CloudNiner
703f9a47d9 Closes #2318: getMaxZoom returns prev layer on baselayerchange
Remove all old layers before adding new ones to avoid
the old properties being returned in the baselayerchange handler.
2014-11-21 13:49:10 -05:00
kerryarts
ff10d00297 Check for null before setting the zindex, and instead keep it null initially. This way calls to setZIndex() wont fail if passed null. 2014-11-21 17:11:10 +13:00
kerryarts
0daf28fb4f Fix _bringToFront/Back implementation for VML renderer 2014-11-21 09:41:02 +13:00
kerryarts
756888cee7 default zIndex to be a valid value to fix exception in ie8 2014-11-20 17:11:02 +13:00
flemenach
8c606358cc Fix inertia animation with worldCopyJump enabled 2014-11-18 09:32:46 +01:00
Yohan Boniface
f41f37c9c0 More compact code 2014-11-14 17:12:15 +01:00
Yohan Boniface
86de51ed9e We don't need an option for the zoom factor 2014-11-14 14:16:41 +01:00
Yohan Boniface
44a10690a7 Implement fast zoom on minus/plus keydown with shiftKey 2014-11-14 12:38:09 +01:00
John Firebaugh
87c7d1d563 No-op Control#remove if not on a map (fixes #2877) 2014-11-13 11:25:49 -08:00
John Firebaugh
0b86fa3266 Remove control from existing map in onAdd (fixes #3020) 2014-11-13 10:49:43 -08:00
John Firebaugh
ef96884021 Ensure parent init hooks are called (fixes #2545) 2014-11-12 14:49:46 -08:00
John Firebaugh
bad49e7612 Add autoClose option to Popup
Fixes #2716
Fixes #1853
2014-11-12 12:52:50 -08:00
John Firebaugh
ad12e33dd9 Fix trailing whitespace 2014-11-12 11:30:43 -08:00
John Firebaugh
82934f95d9 Merge pull request #3008 from snkashis/imgoverlay_style
allow for setStyle option re: opacity on FeatureGroup to reach ImageOverlays
2014-11-12 10:50:11 -08:00
John Firebaugh
269700925a Merge pull request #3009 from snkashis/img_overlay_evt
add interactive option for events on ImageOverlay
2014-11-12 10:41:10 -08:00
Vladimir Agafonkin
de868d6a83 don't require DomEvent for attrib & markers, close #2854 2014-11-12 12:21:39 +02:00
John Firebaugh
aa8be54513 stopPropagation of click event following drag operation (fixes #2930) 2014-11-11 17:08:27 -08:00
Vladimir Agafonkin
d9a327007b Merge pull request #3014 from Leaflet/tile-loading
More tile loading fixes
2014-11-12 00:46:14 +02:00
Vladimir Agafonkin
c6bcdb031b fix ImageOverlay anim in weird projections, close #3011 2014-11-11 16:55:12 +02:00
Vladimir Agafonkin
d0f5b51ad5 fix awesome bug regression, close #3013 2014-11-11 12:38:42 +02:00
Vladimir Agafonkin
48677f2243 fix maxNativeZoom = 0 race condition, close #3004 2014-11-10 17:53:37 +02:00
Steve Kashishian
ca2f1171b7 add interactive option on ImageOverlay 2014-11-09 13:23:19 -06:00
Steve Kashishian
4317a10fc9 allow for setStyle option regarding opacity calls on FeatureGroup to reach ImageOverlays contained inside
Brought from @opie implementation in #2246
2014-11-09 11:57:01 -06:00
David Leaver
8682511e2c Move locally declared methods out. 2014-11-09 18:08:53 +13:00
John Firebaugh
68f86d85d3 Better fix for tile pruning
Need to always prune in _addTiles, otherwise tiles can
get stranded.
2014-11-07 16:27:42 -08:00
David Leaver
2dad982a6e Remove unused e parameter 2014-11-08 09:44:43 +13:00
David Leaver
e41c131dbb Remove touch tracking from DoubleTap and improve DomEvent.Pointer e.touches emulation to provide a suitable replacement.
Refs #2820
2014-11-08 09:40:01 +13:00
John Firebaugh
bfdb7d08c7 Don't delay tile updates triggered by moveend 2014-11-07 12:11:59 -08:00
John Firebaugh
7b5168acec Ensure that added tiles are retained
Previously, quickly zooming out and then back in sometimes left
only overzoomed tiles for the lower zoom level visible. The
problem was a race condition with deferred pruning:

1. Start at z15. Zoom in. This triggers loading of z14 tiles. As each
tile loads, _pruneTiles (throttled) is called. This results in deferred
removal of z15 tiles (250ms setTimeout). The deferral is done to avoid
flicker while the z14 tiles are faded in.
2. During the 250ms, zoom in. This triggers `_addTiles`, but since the
deferred pruning of the z15 tiles hasn't happened yet, the tiles are
still present in `this._tiles`. Therefore no tiles are queued for
loading, triggering an early return in `_addTiles`, before `_pruneTiles`
is called.
3. Deferred pruning of the z15 tiles happens. Since `_pruneTiles` was
short-circuited at z15, these tiles were never retained, nor were the
z14 tiles scheduled for pruning. End result is that the z15 tiles are
removed from the DOM while the z14 tiles remain, scaled 2x.
2014-11-06 16:27:47 -08:00
John Firebaugh
78463e826b jshint 2014-11-06 16:27:47 -08:00
Vladimir Agafonkin
5f9321bac0 Merge pull request #3001 from snkashis/latlng_bounds_conversion
extract bounds conversion from Map.Geolocation.Also fix geolocation test...
2014-11-06 21:55:57 +02:00
Steve Kashishian
f3b132e414 extract bounds conversion from Map.Geolocation.Also fix geolocation test page. 2014-11-06 13:23:14 -06:00
Steve Kashishian
1eae1719bb no map._popup check needed 2014-11-06 13:02:21 -06:00
Steve Kashishian
ead96e500e closes an open popup with escape key 2014-11-06 12:48:13 -06:00
Fabian Zeindl
4f06ac30b0 Don't append/remove the SVG container
Tested this on IOS7, which has 85% adoption and I see no flicker.
Reduces layout and paint-times.
2014-11-05 18:19:35 -08:00
Jeff Smale
c6dea37d86 Preserve marker draggability on setIcon (fixes #2578) 2014-11-05 18:12:21 -08:00
John Firebaugh
e6d857eb70 jshint 2014-11-05 15:22:49 -08:00
John Firebaugh
ea2c397523 No-op bringToFront/Back when Path is not on a map (fixes #2439) 2014-11-05 15:13:28 -08:00
Vladimir Agafonkin
40376dc3be simpler retina detection fallback, close #2258 2014-11-04 13:46:53 +02:00
Vladimir Agafonkin
f10512f836 fix map.fitBounds race condition, close #2957
Fixes a situation where map.fitBounds(map.getBounds()) sometimes zoomed
out.
2014-10-31 13:57:23 +02:00
Vladimir Agafonkin
d4354bc370 fix TileLayer tms option regression 2014-10-29 18:27:55 +02:00
Vladimir Agafonkin
36b958cad0 fix WMS passing all options as WMS params, close #2972 2014-10-29 18:22:28 +02:00
Vladimir Agafonkin
f75133a482 fix blurry map after stopping inertia, close #2979 2014-10-29 17:28:50 +02:00
Vladimir Agafonkin
11b39edfa1 fix TileLayer loading event after setUrl 2014-10-29 17:19:54 +02:00
Vladimir Agafonkin
9923e4bb91 Merge pull request #2977 from yohanboniface/geojson-edge-case
Fix array of array of LatLngs toGeoJSON edge case
2014-10-27 10:40:55 +02:00
Yohan Boniface
1ddac9361a Fix array of array of LatLngs toGeoJSON edge case 2014-10-26 21:00:56 +01:00
Bernhard Eder
9707648550 fixed GridLayer not showing up after removing and adding the same instance 2014-10-26 15:45:15 +01:00
Vladimir Agafonkin
72707e3e30 fix GridLayer.redraw regression, close #2966 2014-10-23 14:27:05 +03:00
Vladimir Agafonkin
eacc499199 fix GridLayer tile loading edge case 2014-10-23 13:23:37 +03:00
Vladimir Agafonkin
2ff2c42847 move some GridLayer tests, add createTile stub 2014-10-23 12:58:29 +03:00
Alex Jeng
2f6ce64cc4 Minor change in comments for better consistency 2014-10-21 23:22:11 -07:00
Vladimir Agafonkin
d93e828935 stop panning/fly animations when necessary 2014-10-21 12:21:32 +03:00
Vladimir Agafonkin
23998c1f9c ditch transition stopping code 2014-10-21 12:21:32 +03:00
Vladimir Agafonkin
70923e6604 rename zoomPanTo to flyTo 2014-10-21 12:21:32 +03:00
Vladimir Agafonkin
7a75d07d89 update inertia settings 2014-10-21 12:21:32 +03:00
Vladimir Agafonkin
468e195ba1 rename PosAnimation.Timer to PosAnimation 2014-10-21 12:21:32 +03:00
Vladimir Agafonkin
a33eff73f0 replace CSS transitions in pan animations with frames 2014-10-21 12:21:32 +03:00
Vladimir Agafonkin
66c13bc94c fix tile loading regression after rebase 2014-10-21 12:21:32 +03:00
Vladimir Agafonkin
8b26a7399a fix build and cleanup tile pruning 2014-10-21 12:21:32 +03:00
Vladimir Agafonkin
a4e8f4e1a8 improve tile pruning 2014-10-21 12:21:31 +03:00
Vladimir Agafonkin
ad0cf365e7 fix world wrapping 2014-10-21 12:21:31 +03:00
Vladimir Agafonkin
44f16b2d9e much better tile pruning; add coords to tile events, ref #2378 2014-10-21 12:21:31 +03:00
Vladimir Agafonkin
fbe23087fa add prune lower res tiles algorithm 2014-10-21 12:21:31 +03:00
Vladimir Agafonkin
b0ce42f270 minor tile code cleanup 2014-10-21 12:21:31 +03:00
Vladimir Agafonkin
9b752757ef more flexible tile remove method 2014-10-21 12:21:31 +03:00
Vladimir Agafonkin
683cc4534c cleanup tile removal, make unloadInvisibleTiles work again 2014-10-21 12:21:31 +03:00
Vladimir Agafonkin
29a0eaef0f include zoom in tile coords, simplify parsing tile keys 2014-10-21 12:21:31 +03:00
Tom MacWright
fefe4b78eb Initialize tilesToLoad variable on GridLayer creation 2014-10-21 12:21:31 +03:00
Dave Leaver
b42500b48a Only stop the pan animation within pan animation. If there is a zoom animation going on we don't want to stop it. Otherwise big mouse wheel zooms are broken. 2014-10-21 12:21:31 +03:00
Dave Leaver
0f0d66f3df Support matrix3d as used in IE11 2014-10-21 12:21:31 +03:00
John Firebaugh
a34810cb85 Use Map#stop to stop all animations 2014-10-21 12:21:30 +03:00
Dave Leaver
a071f489a5 Removing comment out code and not needed todos 2014-10-21 12:21:30 +03:00
Dave Leaver
498aef4c31 Push getTransform up to L.DomUtil.getTransform rather than having it in ZoomAnimation and PosAnimation 2014-10-21 12:21:30 +03:00
Dave Leaver
b6c4ebdbca Move the proxy in to Map.ZoomAnimation as it is the only place that uses it. Use it to detect zoom animation finishing. 2014-10-21 12:21:30 +03:00
Dave Leaver
97598d4241 Move animated zoom stopping in to the place it belongs 2014-10-21 12:21:30 +03:00
Dave Leaver
a5552f4ed4 listen to moveend instead so we know where we are after a map drag 2014-10-21 12:21:30 +03:00
Dave Leaver
7aa9d95e9a Getting closer. project and unproject based on the current zoom seems to work in most cases. 2014-10-21 12:21:30 +03:00
Dave Leaver
c1bea627b0 stopAnimation -> stop 2014-10-21 12:21:30 +03:00
Dave Leaver
a0bc81cba8 Stop animating before starting a ZoomPan, otherwise they both run at the same time. 2014-10-21 12:21:30 +03:00
Dave Leaver
00a66b4731 Add an element for tracking zoom animations. Use it for trying to stop a map zoom. Still doesn't quite work right. Stopping a zoomPan or PanAnimation does work however. Code is all cludgy :)
refs #2560
2014-10-21 12:21:30 +03:00
Vladimir Agafonkin
acaea1c855 code cleanup; don't reload tile level that's already loaded 2014-10-21 12:21:29 +03:00
Vladimir Agafonkin
5912c365b7 zoom to the nearest round zoom with pinch or dblclick 2014-10-21 12:21:29 +03:00
Vladimir Agafonkin
fc655e45c7 manage tile pyramid levels; always animate tile fade 2014-10-21 12:21:29 +03:00
Vladimir Agafonkin
169b6a0e77 adjust zoomPan options, add a debug page 2014-10-21 12:21:29 +03:00
Vladimir Agafonkin
983a4ec261 implement pyramid animations (no tile removal yet) 2014-10-21 12:21:29 +03:00
Vladimir Agafonkin
454552e694 fix zoomPan logic, cleaner code 2014-10-21 12:21:29 +03:00
Vladimir Agafonkin
e093979297 fix GridLayer to not reset if tile zoom didn't change 2014-10-21 12:21:29 +03:00
Vladimir Agafonkin
dc04b9dbe2 add fromZoom arg to Map getZoomScale and getScaleZoom 2014-10-21 12:21:29 +03:00
Vladimir Agafonkin
1b8f68d806 simpler zoom anim calculations 2014-10-21 12:21:29 +03:00
Vladimir Agafonkin
bbb5a5a956 fix some positioning bugs 2014-10-21 12:21:28 +03:00
Vladimir Agafonkin
e26d148516 cleaner reset logic for GridLayer 2014-10-21 12:21:28 +03:00
Vladimir Agafonkin
790acad011 clean up zoomPanTo 2014-10-21 12:21:28 +03:00
Vladimir Agafonkin
4a344ae021 working zoomPanTo implementation 2014-10-21 12:21:28 +03:00
Vladimir Agafonkin
de4910f407 use offset when animating transform to avoid dividing by zero 2014-10-21 12:21:28 +03:00
Vladimir Agafonkin
c1b2c5c37c round grid layer scaling transform 2014-10-21 12:21:28 +03:00
Vladimir Agafonkin
e41d65fe66 fractional zoom code clean up an fixes 2014-10-21 12:21:28 +03:00
Vladimir Agafonkin
5d58aa4f3f initial fractional zoom implementation for grid layers 2014-10-21 12:21:28 +03:00
Vladimir Agafonkin
2be2cca49a basic linear zoomPanTo without intermediary tile loading 2014-10-21 12:21:28 +03:00