Commit Graph

3466 Commits

Author SHA1 Message Date
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
Vladimir Agafonkin
06d354e9cd Merge pull request #3173 from Leaflet/locate-options
Don't mutate this._defaultLocateOptions. Fixes #3160
2015-01-26 03:10:31 +02:00
Tom MacWright
a28c9508be Don't mutate this._defaultLocateOptions. 2015-01-25 19:27:24 -05:00
Vladimir Agafonkin
165bc298e0 Merge pull request #3168 from Starefossen/patch-6
Update year in copyright.js
2015-01-24 17:43:20 +02:00
Vladimir Agafonkin
0602136da7 Merge pull request #3169 from Starefossen/patch-8
Use SVG version of Travis build status badge
2015-01-24 17:43:05 +02:00
Hans Kristian Flaatten
46d5992279 Use SVG version of Travis build status badge 2015-01-24 11:23:23 +01:00
Hans Kristian Flaatten
73147bc9e6 Update year in copyright.js 2015-01-24 11:20:01 +01:00
Vladimir Agafonkin
461f82b710 Merge pull request #3154 from stsydow/master
preserve marker dragable state on layer deactivation
2015-01-21 00:09:32 +02:00
Stefan Sydow
4c46abe781 preserve dragable state on layer deactivation 2015-01-19 19:07:04 +01:00
Vladimir Agafonkin
9c10141cc9 Merge pull request #3153 from bb-generation/options-undefined-fix
fixed error in _tryAnimatedPan when options is undefined
2015-01-19 02:17:33 +02: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
Vladimir Agafonkin
59d9dcff4f Merge pull request #3147 from cmlaidlaw/fix-early-return-bug-due-to-bad-return-value-from-_tryAnimationPan
BUG: ._tryAnimatedPan() lies...
2015-01-16 01:58:46 +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
Vladimir Agafonkin
e6796fadb8 Merge pull request #3129 from Leaflet/tile-reloading
Clean up tile loading
2015-01-13 13:14:40 +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
John Firebaugh
2ee1aa2c23 jshint 2015-01-12 11:03:42 -08:00
Vladimir Agafonkin
a06ea76d1a Merge pull request #3115 from snkashis/popup_text_color
provide a default popup text color of #333
2015-01-07 01:40:02 +02:00
Steve Kashishian
1d174cd502 provide a default popup text color of #333 2015-01-06 16:34:35 -06:00
Vladimir Agafonkin
2e3d4ae020 Merge pull request #3113 from batphil/patch-1
Happy new year :o)
2015-01-02 14:17:42 +02:00
batphil
b7dbdade9e Happy new year :o) 2015-01-02 01:23:44 +01:00
Vladimir Agafonkin
dfbd0fa309 Merge pull request #3106 from sam-at-github/patch-1
Update CONTRIBUTING.md
2014-12-29 13:13:12 +02:00
sam-at-github
5dc36142f7 Update CONTRIBUTING.md
Add link to Jakejs.com and slightly more verbose description of build set up. Useful to Node newbs like myself.
2014-12-28 12:39:18 +11:00
Vladimir Agafonkin
f02767308d Merge pull request #3093 from cebence/no-single-base-layer-in-layers-control
Hide single base layer in the Layers control
2014-12-18 16:42:23 +02: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
Vladimir Agafonkin
6e37720f3e Merge pull request #3091 from markjszy/docupdates
Revisions to CONTRIBUTING.md
2014-12-18 13:54:20 +02:00
Mark Szymanski
1b8f4aa88d Revisions to CONTRIBUTING.md 2014-12-17 20:03:58 -06:00
Vladimir Agafonkin
2e04b302d0 try out the new fast Travis build thingy 2014-12-17 21:09:10 +02:00
Vladimir Agafonkin
72feb7005d Merge pull request #3084 from miroslavraska/patch-1
Properly unsubscribe Layer events
2014-12-08 15:56:22 -05: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
Vladimir Agafonkin
6ae848b7ef Merge pull request #3080 from lonelyelk/latlng-no-error
L.latLng factory not to throw error on empty array parameter
2014-12-06 10:54:24 -05: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
Vladimir Agafonkin
7cafaa6346 Merge pull request #3070 from lonelyelk/latlng-factory-altitude
Factory L.latLng to accept altitude
2014-12-01 08:20:28 -05: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
Vladimir Agafonkin
69e0d0233d Merge pull request #3052 from kshepard/fix-async-initialize
Initialize _sizeChanged to true to prevent async map initialization issues
2014-11-22 11:47:07 +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