Commit Graph

3601 Commits

Author SHA1 Message Date
Steve Kashishian
1d174cd502 provide a default popup text color of #333 2015-01-06 16:34:35 -06: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
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
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
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
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
Vladimir Agafonkin
9128193e5b Merge pull request #3044 from kerryarts/vml-bringtofront-fix
Fix _bringToFront/Back implementation for VML renderer
2014-11-21 01:16:47 +02: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
Vladimir Agafonkin
2bd788a7da Merge pull request #3038 from flemenach/worldcopy-inertia
Fix inertia animation with worldCopyJump enabled
2014-11-18 16:47:41 +02:00
flemenach
8c606358cc Fix inertia animation with worldCopyJump enabled 2014-11-18 09:32:46 +01:00
John Firebaugh
e0a75093dc Merge pull request #3028 from tomhughes/jshint
Don't require jshint as it is not used
2014-11-17 13:54:31 -08:00
Tom Hughes
8f5fe4defc Don't require jshint as it is not used 2014-11-15 14:43:57 +00:00
Vladimir Agafonkin
3318f8d424 Merge pull request #3024 from yohanboniface/shift-zoom
Implement fast zoom on minus/plus keydown with shiftKey
2014-11-14 18:17:51 +02: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
Vladimir Agafonkin
37c5433e5b Merge pull request #3022 from Leaflet/3020
Remove control from existing map in onAdd (fixes #3020)
2014-11-13 20:57:55 +02:00