Commit Graph

1313 Commits

Author SHA1 Message Date
Roemer Vlasveld
109fd06ae6 hasLayer not checking for null
Return false when checking for a null object in L.Map.hasLayer, in
response to issue #1282.
2013-01-21 23:22:01 +01:00
Roemer Vlasveld
75fa5b087f Fix js typo 2013-01-21 22:46:18 +01:00
Roemer Vlasveld
82d4535180 Add hasLayer to LayerGroup
Add the method hasLayer to LayerGroup, return false when not present or checking for a null layer.
2013-01-21 22:36:24 +01:00
snkashis
5524db2816 condition on one line 2013-01-21 10:14:42 -05:00
Vladimir Agafonkin
57c0ac408e rename top/bottom to first/last in control classes, thanks @yohanboniface 2013-01-21 17:04:58 +02:00
snkashis
65aad99297 Revert "whitespace fix?"
This reverts commit 9856a66864.
2013-01-20 20:18:48 -05:00
Steve
9856a66864 whitespace fix? 2013-01-20 20:06:52 -05:00
Steve
c0210009df whitespace again 2013-01-20 19:39:01 -05:00
Steve
03a775c69b Trying to fix whitespace 2013-01-20 19:38:12 -05:00
Steve
52b445a36d Simplify features check 2013-01-20 19:35:18 -05:00
snkashis
c43e72da16 Handle arrays of feature collections 2013-01-20 19:13:43 -05:00
Calvin Metcalf
f26da9f9be only mention the path, and ternery 2013-01-18 13:35:07 -05:00
Calvin Metcalf
c3cb132463 we want it reletive not from the base 2013-01-18 12:46:16 -05:00
Calvin Metcalf
82869206e2 ie7 fix 2013-01-18 12:41:11 -05:00
Vladimir Agafonkin
292d2b3633 merge snkashis polygon fix 2013-01-18 17:43:31 +02:00
Vladimir Agafonkin
10bd63a6a6 update changelog, bump version 2013-01-18 17:30:53 +02:00
Vladimir Agafonkin
76f8d0762d Merge pull request #1287 from jieter/master
TileLayer.Canvas now returns this.
2013-01-18 07:25:37 -08:00
Vladimir Agafonkin
5fccd34a54 Merge pull request #1286 from calvinmetcalf/layerControlEvents
Layer control events for overlays
2013-01-18 07:25:22 -08:00
Yohan Boniface
44a7c6e0d8 Typo in Polyline docstring 2013-01-18 12:48:43 +01:00
Vladimir Agafonkin
eed2c8a12b fix FF minus key, close #869, update changelog and build 2013-01-17 11:51:52 +02:00
Jan Pieter Waagmeester
12d04f5c59 TileLayer.Canvas.redraw() now returns this. 2013-01-17 09:39:06 +01:00
Calvin Metcalf
c0e4241f36 rename events 2013-01-16 22:00:55 -05:00
Calvin Metcalf
88f1e121ee overlay events 2013-01-16 18:20:20 -05:00
Vladimir Agafonkin
8facf33896 fix whitespace, update build 2013-01-16 17:08:57 +02:00
Vladimir Agafonkin
e3528c2d22 update zoom control styles, extract general toolbar classes, fix #1209 2013-01-16 17:08:06 +02:00
Vladimir Agafonkin
11e74ccab9 minor cleanup 2013-01-15 16:19:04 +02:00
Vladimir Agafonkin
405bf0c05d Merge pull request #1279 from oslek/isArray
Robust array type check for cross-frame support
2013-01-14 15:11:41 -08:00
oslek
7dd7e4f699 Robust array type check for cross-frame support
In a multi-frame DOM environment, if setView is called with an array for
the first parameter, a subsequent call to getBounds raises "Invalid
LatLng object" exception. This is the case if the array passed to
setView was created outside the iFrame that contains the map. It causes
the array test using "instanceof" in L.latLng to fail, and
_initialTopLeftPoint to not being properly initialized.

Thank you to Juriy Zaytsev for the full explaination:
http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/
John Resig and Dean Edwards post comments and concur.
2013-01-14 14:04:50 -08:00
danzel
365a5b3b02 Fix jshint unhappiness (Thanks @Guiswa) 2013-01-15 10:51:36 +13:00
Vladimir Agafonkin
dad3996d0e Merge pull request #1097 from calvinmetcalf/GeometryCollection
GeoJSON GeometryCollection passes consisent params to pointToLayer
2013-01-14 06:33:28 -08:00
Calvin Metcalf
0ebbd7553e fixed the whitespace and also removed the quotes in object keys 2013-01-14 07:25:34 -05:00
Vladimir Agafonkin
3f4e890b58 Merge pull request #1174 from danzel/master
Add retina marker icon support and retina-ize the default icon
2013-01-14 02:50:28 -08:00
danzel
6eefa8ad0e Another pass on marker-icon, better grid fitting. 2013-01-14 16:12:58 +13:00
mourner
333899ca51 add Popup zoomAnimation option, fix #999 2013-01-14 00:23:45 +02:00
mourner
5eb4f4686d fix a bug with FeatureGroup bindPopup not accepting options 2013-01-14 00:23:04 +02:00
snkashis
b3a7f2ffb7 Remove click handler with onRemove 2013-01-12 16:55:13 -05:00
Vladimir Agafonkin
eb518f33ac Merge branch 'master' of github.com:Leaflet/Leaflet 2013-01-11 18:50:44 +02:00
Vladimir Agafonkin
4ebfeb9d18 udpate copyright to be more precise 2013-01-11 18:50:21 +02:00
Vladimir Agafonkin
116671fa55 Merge pull request #1013 from fdlk/set-radius-in-style
radius is part of CircleMarker style so should be changeable in using setStyle();
2013-01-11 08:43:18 -08:00
Vladimir Agafonkin
bc4104c708 fix TileLayer.brintToFront/Back on IE6-8, close #1168 2013-01-11 18:33:17 +02:00
Vladimir Agafonkin
64ca0af124 attempt to fix Android 4.1 zoom freeze, #1182 2013-01-11 18:20:40 +02:00
Vladimir Agafonkin
6dd0dea1aa double quotes to single 2013-01-11 18:19:50 +02:00
Vladimir Agafonkin
80d0da1bdf fix iOS vectir zoom anim regression, close #1259 2013-01-08 12:18:10 +02:00
Aaron King
c2869cee5d Fix issue 1226: IE10 "Invalid argument" error in version 0.5 defining retina
https://github.com/CloudMade/Leaflet/issues/1226

Credit to dreamfall for the fix.
2012-12-31 10:39:24 -08:00
Vladimir Agafonkin
590bbd9ba7 Merge pull request #1245 from danzel/ie
Re-add L.Browser.ie as it is used in debug\vector\geojson.html(113).
2012-12-28 04:49:46 -08:00
Vladimir Agafonkin
733666bcab Merge pull request #1240 from brianherbert/allow-null-geojson
Allow null GeoJSON geometries.
2012-12-28 04:49:31 -08:00
Brian Herbert
971e55b911 Simplifying condition for null geojson geometries.
Used feedback from @mourner to make the change from the pull request
#1240
2012-12-28 11:56:19 +09:00
danzel
f57e2eadcb Re-add L.Browser.ie as it is used in debug\vector\geojson.html(113). Fixes #1242 2012-12-28 11:21:23 +13:00
Vladimir Agafonkin
e825b32cf8 Merge pull request #1244 from danzel/fix-events
Change marker click tracking. Only care if the map has been dragged if we are not draggable.
2012-12-27 13:53:55 -08:00
snkashis
b2e3f16b54 pass the clicked obj, not the map. 2012-12-27 15:37:57 -05:00
Vladimir Agafonkin
5109492a35 Merge pull request #1231 from snkashis/fix_wms_params
handle existing query strings for WMS urls , #973
2012-12-27 11:42:31 -08:00
snkashis
6b4f5c4cf7 handling no existingUrl scenario 2012-12-27 14:39:19 -05:00
jerel
c63e3721cb This modifies the Android WebView phantom click workaround.
Previously it was blocking when an element had multiple click listeners
because those events were fired rapidly. Since Android fires its second
click at approximately 300ms after the first we do a check to make sure
that at least 100ms has elapsed but not more than 400ms.
2012-12-27 00:40:41 -06:00
Brian Herbert
2a38a809d3 Allow null GeoJSON geometries.
This change checks if a geometry/ies in GeoJSON are set as null, in
which case it will skip it.
2012-12-27 12:15:08 +09:00
snkashis
8d442b1630 cleanup to match convention 2012-12-26 10:33:11 -05:00
Mehmet Alkanlar
f2b9a3a32e Fixed issue with Polyline.Edit remove hook. 2012-12-24 17:35:33 -08:00
snkashis
8c7c06431a handle existing query strings for WMS urls , #973 2012-12-22 17:47:38 -05:00
Yohan Boniface
952f9289c3 Eventlistener is Path._openPopup not Path.openPopup 2012-12-21 18:13:45 +01:00
jerel
0919b25cd6 This makes sure we only do the Android duplicate click workaround on Android 2012-12-21 08:37:13 -06:00
jerel
cf94612f6b Fixes #1041, Android WebView triggers two clicks at once. This calls
L.DomEvent.stop(event) on the second if two clicks are triggered within 400ms
of each other. Double click is unaffected however.

There are other workarounds that focus on _fireMouseEvent(), however I had to
resolve it at the click event level as my map, markers, controls, were all
affected.
2012-12-21 01:54:15 -06:00
danzel
73dd7371d0 Change marker click tracking. Only care if the map has been dragged if we are not draggable.
If we are draggable and we get a possible click then we don't need to care if the map was dragged as we would have been handling the drag.

Fixes #1223
2012-12-21 14:40:09 +13:00
Vladimir Agafonkin
b9727d9190 made up my mind about comment format, add some more comments 2012-12-20 12:37:40 +02:00
Vladimir Agafonkin
b0e5c817a9 more comments and cleanup 2012-12-19 18:47:28 +02:00
Vladimir Agafonkin
d4432882ba use lightweight classes for LatLngBounds and Bounds 2012-12-19 18:46:44 +02:00
Vladimir Agafonkin
51aa31fa8a cleanup keyboard maxbounds 2012-12-19 16:41:13 +02:00
Vladimir Agafonkin
7abf1a24ef Merge pull request #1221 from snkashis/keypress_bounds
Check bounds when navigating with keyboard. #989
2012-12-19 06:31:50 -08:00
Vladimir Agafonkin
7cfafe6012 Merge pull request #1222 from jacobtoye/aopfix
Fix callInitHooks so child initHooks aren't called for parent classes
2012-12-19 03:27:28 -08:00
snkashis
38c4d9dd56 Check bounds when navigating with keyboard. #989 2012-12-18 14:17:18 -05:00
jacobtoye
7b05307304 Change method for calling an objects initHooks to crawl up parents. 2012-12-18 17:05:39 +13:00
Vladimir Agafonkin
c6caf93c00 refactor build scripts, cleanup 2012-12-17 19:15:19 +02:00
Vladimir Agafonkin
6134a41554 jshint fixes and cleanup for uglifyjs2 2012-12-12 19:09:47 +02:00
Vladimir Agafonkin
5f467337f6 move editing stuff out of Polyline.js into Polyline.Edit.js 2012-12-12 18:24:44 +02:00
Vladimir Agafonkin
dea6a349c0 add Path add event 2012-12-12 18:24:05 +02:00
Vladimir Agafonkin
406ff71013 add missing semicolon 2012-12-12 18:23:35 +02:00
Vladimir Agafonkin
40b59b2a85 add ability to call init hooks manually in the constructor 2012-12-12 17:48:30 +02:00
Vladimir Agafonkin
1c14bf7b97 make Transformation class more lightweight 2012-12-12 17:46:21 +02:00
Vladimir Agafonkin
a089cd4337 fix regression in GeoJSON resetStyle, close #1112 2012-12-12 15:42:21 +02:00
Vladimir Agafonkin
9f50141e8a update build 2012-12-12 14:20:08 +02:00
Vladimir Agafonkin
58a82d09fa fix WMS tile wrapping regression, close #970 2012-12-12 13:19:24 +02:00
Vladimir Agafonkin
782e8e7dcf implement hooks for Class constructors (AOP-style), close #1123 2012-12-12 12:26:33 +02:00
danzel
e22a7c5ef0 Another pass at the icon. Moved the mid point of the circle down half a pixel to improve the roundness. Tweaked the size of the white circle to better match the old one. 2012-12-12 09:54:23 +13:00
Vladimir Agafonkin
30a3edb393 simplify zoom animation calculations a bit 2012-12-11 20:19:16 +02:00
Vladimir Agafonkin
b4770906b3 tweak simple projection, add debug file 2012-12-11 20:18:54 +02:00
Vladimir Agafonkin
3051b22a88 add Bounds getSize method 2012-12-11 20:14:17 +02:00
Vladimir Agafonkin
edeea11919 fix GeoJSON resetStyle not fully resetting, close #1112 2012-12-11 17:16:39 +02:00
Vladimir Agafonkin
df03016f0c fix infinite recursion in latLngBounds factory, close #933 2012-12-11 17:03:33 +02:00
Vladimir Agafonkin
f5cfab73a1 remove LatLng coords wrapping/clamping, add explicit LatLng wrap method 2012-12-11 15:02:47 +02:00
Vladimir Agafonkin
b9d0d60a04 disable worldCopyJump by default, minor cleanup 2012-12-11 15:02:15 +02:00
Vladimir Agafonkin
f203c244d4 fix text selection regression, #1193, #892 2012-12-11 11:44:06 +02:00
danzel
217a0d5148 Move marker svg to src/images/marker.svg 2012-12-11 14:53:14 +13:00
danzel
946a9df5f9 Add iconRetinaUrl and shadowRetinaUrl to set urls for retina icons. Add a retina version of the default icon and use it. 2012-12-11 14:49:45 +13:00
Vladimir Agafonkin
c05e15f956 fix chaining in marker methods, close #1176 2012-12-10 18:22:19 +02:00
Vladimir Agafonkin
236b8fbbf0 Merge pull request #1205 from mohlendo/master
Fixes Issue 1204: Adds the border width to the viewport offset calculation
2012-12-10 08:06:24 -08:00
Vladimir Agafonkin
96e4c80c75 revert clearing map div contents, fix positioning, close #278 again 2012-12-10 17:57:04 +02:00
Vladimir Agafonkin
7ae4459dd3 Fix rectangle having duplicate last point, close #1185 2012-12-10 17:42:43 +02:00
Manuel Ohlendorf
cf883a036d fix indentation: use tabs instead of spaces 2012-12-07 11:05:38 +01:00
Manuel Ohlendorf
94a8b19f11 fixes Issue 1204: border width is now added to viewpoint offset calculation 2012-12-06 13:25:17 +01:00
Jon Stevens
4ba1bbcdd7 fix for issue #892 , second time around. 2012-11-30 12:03:20 -08:00
Vladimir Agafonkin
7f44313fad Merge pull request #1189 from danzel/canvas-fixes
Always set canvas alpha. Fixes #1186
2012-11-29 15:01:19 -08:00
danzel
3b2393bd93 Always set canvas alpha. Fixes #1186 2012-11-30 11:31:22 +13:00
danzel
babbbe829e Re-order zoom end so we completely stop the zoom before getting people to redraw. Otherwise firefox will animate the canvas redrawing which is totally weird. Fixes #1187 2012-11-30 11:27:12 +13:00
mourner
1d14b0c50d fix code style issues #1159, update build 2012-11-29 22:43:40 +02:00
Vladimir Agafonkin
0c5f401220 Merge pull request #1159 from moonlite/master
First stab at a fix for Issue 623
2012-11-29 06:44:25 -08:00
Vladimir Agafonkin
e2daa349b1 Merge pull request #1169 from tomhughes/layers
Update the Layers control when layers are added or removed
2012-11-23 17:18:42 -08:00
Tom Hughes
0b2a31c1fe Update the Layers control when layers are added or removed 2012-11-24 00:33:57 +00:00
dreamfall
56f3f7ca07 fix error in initializing map on hidden iframe in Firefox 2012-11-23 18:23:59 +03:00
Yohan Boniface
944d197690 Return created HTML element in Control.Layers._addItem
Goal is to make easier and DRYer to customize layer HTML item
when extending Control.Layers class
2012-11-21 16:06:20 +01:00
OriginalSin
43794a3ea9 Update src/layer/tile/TileLayer.js
this should solve first problem in #1089 (http://jsfiddle.net/Q3SFZ/1/)
2012-11-21 16:11:51 +04:00
jfgirard
d23af35310 fix undefined error use cases 2012-11-20 06:38:11 -05:00
danzel
0033496b58 jshint happy 2012-11-20 09:38:14 +13:00
danzel
63ad64cb7a Use invoke to make this code smaller. 2012-11-20 09:36:23 +13:00
Mattias Bengtsson
c0135a219d Added a bunch of tests and fixed some bugs those exposed.
Also don't try to automatically adjust zoom. Leave that to the
layer control for now and wait for a setBaseLayer / switchLayer
or something instead.
2012-11-19 04:36:13 +01:00
Mattias Bengtsson
6f1532f402 Fix for https://github.com/CloudMade/Leaflet/pull/623
There seems to be a timing bug though.
2012-11-18 22:07:27 +01:00
danzel
b28b6da924 Add setZIndex to LayerGroup to allow LayerGroups to work better with the layers control. Fixes #1096 2012-11-19 09:58:28 +13:00
Vladimir Agafonkin
07eb3b4c8d fix dashArray in IE, closes #1091 2012-11-18 17:55:28 +04:00
snkashis
7a6f2c2e7c filter out the last point of a polygon to account for GeoJSON compatibility 2012-11-16 19:33:41 -05:00
danzel
5e35553361 Code tidyups from mourners feedback. 2012-11-16 11:28:01 +13:00
danzel
0efa63500c Fix up 2 places where L.Draggable.START hadn't been updated for it being an array (thanks mourner) 2012-11-16 10:57:29 +13:00
danzel
41a85b0128 Only wire move/end listeners for the thing we want to listen to.
Stops potential bug:
User touches on device, user moves mouse. These mouse move events would have panned the map, now they won't.
2012-11-16 10:57:28 +13:00
danzel
04908cee8d Always enable scrollWheelZoom (fixes scroll wheel zoom on mouse+touch devices) 2012-11-16 10:57:28 +13:00
danzel
46b7d97298 Get doubleclick on touch&mouse devices working. We need to add a touch doubletap emulator and a normal doubleclick listener 2012-11-16 10:57:27 +13:00
danzel
cb9407ffee Sort of working Draggable support for touch+mouse devices. 2012-11-16 10:57:26 +13:00
Vladimir Agafonkin
c37e755832 stop mousewheel propagation in layers control, related to #845 2012-11-14 16:50:04 +02:00
Vladimir Agafonkin
b2d6575445 update build 2012-11-14 15:13:08 +02:00
Vladimir Agafonkin
c33a4013a2 make zoom buttons disabled when reaching min/max, closes #917 2012-11-14 15:12:31 +02:00
Vladimir Agafonkin
469211d0cf fix slight scrolling zoom bug, closes #1039 2012-11-14 14:46:17 +02:00
Vladimir Agafonkin
10c0a63b3d fixed non-rounded panBy, closes #1085 2012-11-14 14:39:59 +02:00
Vladimir Agafonkin
91aecd376b add Marker contextmenu event 2012-11-14 14:07:59 +02:00
Vladimir Agafonkin
eba4eb0a5c fix shift-click on the map 2012-11-14 14:07:36 +02:00
Vladimir Agafonkin
b3826358d5 add Point equals method 2012-11-14 14:07:17 +02:00
Vladimir Agafonkin
9770054240 update build 2012-11-13 16:50:00 +02:00
Vladimir Agafonkin
8c6c3fd9e7 Merge branch 'master' of github.com:CloudMade/Leaflet 2012-11-13 16:48:42 +02:00
Vladimir Agafonkin
2fadc94ec3 new zoom control look, various style fixes and cleanup 2012-11-13 16:48:25 +02:00
jfgirard
60d0d439f1 code convention 2012-11-12 13:34:31 -05:00
jfgirard
471816120b use a property for index length because its slow to get the first property or get the length of a hash. 2012-11-12 13:22:28 -05:00
jfgirard
ab85108836 Path CANVAS adds a click event if clickable but do not clear it on remove. This adds the necessary remove listener. 2012-11-12 11:11:16 -05:00
jfgirard
db8056df45 store the event listeners using a hash if the context have a leaflet_id.
When removing a layer,the slowest part was to remove the event from the map.  For each event, the removeEventListener method had to loop the whole list.  With thousand of layers, it become very slow to do.  With a hash used has an index to find event listeners for a given leaflet id, its no more an issue.
2012-11-12 11:10:03 -05:00
Pascal Borreli
9546599520 Fixed typos 2012-11-09 23:15:48 +00:00
Vladimir Agafonkin
9e37766c96 update version to 0.5 2012-11-09 23:52:11 +02:00
Vladimir Agafonkin
e4ec9a8967 fix bug in #1131, update build 2012-11-09 16:27:56 +02:00
danzel
6fbf2a21bf Move reflow into PosAnimation.stop so users don't have to implement it themselves. 2012-11-09 16:13:52 +13:00
Vladimir Agafonkin
d37680735f rewrite and tweak inertia easing to make it smoother 2012-11-08 19:20:40 +02:00
danzel
128b615a08 Force a reflow when stopping a PanAnimation to start a ZoomAnimation so that the svg animation works correctly. Fixes #1125 2012-11-08 15:49:39 +13:00
Vladimir Agafonkin
dbd4da6255 add shortcuts for extend, bind, stamp and setOptions 2012-11-07 20:30:56 +02:00
Vladimir Agafonkin
7517cbcd53 fix typos and regression in #1122 2012-11-07 19:21:21 +02:00
Vladimir Agafonkin
ed0686996a and some more whitespace fixes 2012-11-07 19:14:25 +02:00
Vladimir Agafonkin
2b225cc3a8 more whitespace fixes 2012-11-07 18:46:59 +02:00
Vladimir Agafonkin
9e70816030 Merge branch 'master' of github.com:CloudMade/Leaflet 2012-11-07 14:13:33 +02:00
Vladimir Agafonkin
a293f52e80 different whitespace fixes (smart tabs, lines no longer than 100) 2012-11-07 14:13:06 +02:00
jacobtoye
6c4221fe04 Added 'layeradd' and 'layerremove' events to LayerGroup. 2012-11-06 15:37:36 +13:00