Commit Graph

269 Commits

Author SHA1 Message Date
danzel
8cc7404f53 This should be oldLatLng, even if latlng is wrong, let's have this be right. refs #2412 #1423 2014-01-29 14:51:55 +13:00
danzel
e2d9a97836 Add oldLatlng parameter to Marker move event, will allow MarkerCluster to support moving markers. 2014-01-29 11:33:08 +13:00
Vladimir Agafonkin
dab0cbfc14 update tests to reflect no clamping near poles 2014-01-03 17:37:28 +02:00
Vladimir Agafonkin
7ff0fa9c72 approximate Circle with ellipse 2014-01-03 00:37:34 +02:00
Vladimir Agafonkin
2b96ea5aba make Leaflet.js requirable for version, remove noConflict test
Currently tests don’t account for wrapper function around Leaflet
source, so the noConflict one failed — removing for now.
2013-12-26 18:29:46 +02:00
Vladimir Agafonkin
47783821f7 rename limitExecByInterval to throttle, better implementation 2013-12-21 01:49:25 -05:00
Vladimir Agafonkin
1dfec0a021 shortcut hasEventListeners as listens 2013-12-19 17:09:32 -05:00
Vladimir Agafonkin
6d1142a978 only propagate events if given true to fire, #2311 2013-12-18 23:23:22 -05:00
Vladimir Agafonkin
ce4a031d40 faster on/off, add private non-sugary versions 2013-12-18 23:07:39 -05:00
Vladimir Agafonkin
9f09f50812 remove Util invokeEach since on/off are hot functions 2013-12-18 22:05:47 -05:00
Vladimir Agafonkin
5d4e77627a fix PolyUtil spec (we now round poly clipping) 2013-12-18 14:56:23 -05:00
Vladimir Agafonkin
33e23a69e7 fix specs for polygon holes 2013-12-18 12:03:22 -05:00
Vladimir Agafonkin
dc5151b81a fix GeoJSON roundtripping 2013-12-18 12:03:22 -05:00
Vladimir Agafonkin
0876b51bc9 remove DomUtil.getViewportOffset as unnecessary 2013-12-18 00:51:01 -05:00
Vladimir Agafonkin
21cfd7f3d9 replace Events mixin with Evented inheritance 2013-12-17 14:07:21 -05:00
John Firebaugh
ad9d0f8c7f Make options object prototype-inherited
Fixes #2294
2013-12-15 13:30:30 -08:00
John Firebaugh
af9302ce19 Make GridLayer methods safe to call pre-setView 2013-12-13 18:01:06 -05:00
John Firebaugh
c1654c4626 Add hasLayer tests 2013-12-13 17:51:37 -05:00
Vladimir Agafonkin
4011a6199f move add/removeLayer logic to Layer; ditch tilelayersload event 2013-12-06 15:10:28 +02:00
Vladimir Agafonkin
04c95e1af9 basic GridLayer spec, move TileLayer spec 2013-12-02 19:18:08 +02:00
Vladimir Agafonkin
dd313e6930 better CRS test coverage 2013-12-02 19:18:07 +02:00
Vladimir Agafonkin
49af3fda5c merge spherical mercator / epsg3857 changes with some fixes
closes #2062
2013-12-02 19:18:07 +02:00
Vladimir Agafonkin
7e20997e40 remove LatLng wrap and fix wrap tests 2013-12-02 19:16:01 +02:00
Vladimir Agafonkin
a03bfb753e add CRS & Map wrapLatLng, fix GridLayer bounding 2013-12-02 19:16:01 +02:00
Vladimir Agafonkin
00166b9c4f proper EPSG:4326 with 2x1 root, fixes #1207 2013-12-02 19:16:00 +02:00
Vladimir Agafonkin
88f21d01af better bind, use native fn.bind if available 2013-12-02 19:16:00 +02:00
Per Liedman
294a7250d0 Added tests to verify size of EPSG3857 and 4326 2013-12-02 19:16:00 +02:00
Calvin Metcalf
87520df2e2 Spherical Radius is used in Spherical Mercator 2013-12-02 19:15:18 +02:00
Calvin Metcalf
4a0beebde3 Revert "'#1968 compiled interpolation'" 2013-11-20 15:42:06 -05:00
Vladimir Agafonkin
80607c6044 reimplement max bounds with proper zooming 2013-11-14 17:45:47 +02:00
Vladimir Agafonkin
be42f7a3b6 Merge branch 'patch-1' of https://github.com/kapouer/Leaflet into maxbounds
* 'patch-1' of https://github.com/kapouer/Leaflet:
  test Map#setMaxBounds and Map#panInsideBounds
  panInsideBounds: fit or center, pass options, remove boundsMinZoom
2013-11-14 14:13:45 +02:00
Vladimir Agafonkin
977fb99b6a fix specs after messy merge 2013-11-13 21:56:48 +02:00
Vladimir Agafonkin
3618f404f5 Merge branch 'invalidateSize' 2013-11-13 21:50:02 +02:00
John Firebaugh
33263e537d Add debounceMoveend option to invalidateSize 2013-11-13 10:53:34 -08:00
Vladimir Agafonkin
91c039b7aa jshinting and major clean up of specs code, ref #2151 2013-11-07 23:54:33 +02:00
Vladimir Agafonkin
5d6641360b merge GeoJSON altitude pull with some tweaks #1822 2013-11-06 23:17:14 +02:00
Vladimir Agafonkin
77bd10c69d Merge pull request #2149 from danzel/ios7-2122
Work around iOS7 memory trouble
2013-11-04 13:33:54 -08:00
danzel
fa35aba1e9 Improve this test and fix removeEventListener. 2013-11-05 10:29:52 +13:00
danzel
579c044c00 Fix a potential event bug due to bad cleanup. 2013-11-05 10:21:32 +13:00
Vladimir Agafonkin
ec7baabccf merge runner cleanup #2134 2013-11-04 13:18:24 +02:00
danzel
9fce697982 Work around iOS7 memory trouble by not applying the contextId performance optimization when context==this. The optimization does nothing in this case anyway. Fixes #2122 2013-11-04 09:47:55 +13:00
Vladimir Agafonkin
90ce2ab951 Merge pull request #2136 from danzel/rtl
Correct rtl again
2013-11-03 08:23:03 -08:00
danzel
0c7e7eb373 Delete ltr/rtl code as its not needed any more, wtf? 2013-10-30 10:25:28 +13:00
Jan Pieter Waagmeester
99bd248566 Whitespace OCD 2013-10-29 11:49:09 +01:00
Jan Pieter Waagmeester
a7f2d1975f Allow double quotes in template strings fixes #2120 2013-10-23 15:14:59 +02:00
Jérémy Lal
d7bf010f0b test Map#setMaxBounds and Map#panInsideBounds 2013-10-14 15:27:11 +02:00
Alexander Parshin
f5de36e229 Add holes support to L.Polygon.setLatLngs(). Fixes #1518 2013-10-13 20:17:12 +04:00
Vladimir Agafonkin
361c9cab6d fix isArray not working IE9 in rare cases, close #2077 2013-10-08 16:59:42 +03:00
Vladimir Agafonkin
2250cee6ec allow setZoom before setView, make setView zoom optional, close #2056, close #1449 2013-09-30 15:00:46 +03:00
Tom MacWright
befc5eb992 Add support for layers lacking Events mixin. Fixes #1962 2013-09-17 17:36:05 -04:00
Vladimir Agafonkin
5841579bb8 Merge pull request #2025 from Gnurfos/issue-1915
Accept simple objects in L.latLngBounds(). Fixes #1915.
2013-09-13 02:14:03 -07:00
Seb Emonet
16f9c9a302 Accept simple objects in L.latLngBounds(). Fixes #1915. 2013-09-13 00:22:19 +02:00
Vladimir Agafonkin
a086b336b2 fix images 404 warnings in specs 2013-09-12 13:14:00 +03:00
Alexander Parshin
df320c3b06 Add test specifications for CRS classes. 2013-09-10 11:40:48 +04:00
Vladimir Agafonkin
5e30c51f85 add GeoJSON rountripping of GeometryCollection and MultiPoint, close #1956 2013-08-28 12:43:04 +03:00
Vladimir Agafonkin
21d8bde0b7 fix tempate interpolation test and build 2013-08-27 22:06:01 +03:00
Vladimir Agafonkin
1581a94fc3 Merge branch 'interpolation' of https://github.com/calvinmetcalf/Leaflet
* 'interpolation' of https://github.com/calvinmetcalf/Leaflet:
  '#1968 compiled interpolation'
2013-08-27 21:28:38 +03:00
Calvin Metcalf
b2b25c8941 '#1968 compiled interpolation' 2013-08-27 13:03:07 -04:00
fastrde
a8a8ebe309 added a spec test for worldCopyJump set Center and Zoom fix #1982 2013-08-18 03:18:21 +02:00
Vladimir Agafonkin
e18b7eded6 Merge pull request #1931 from russelldavis/fix-invalidate-size
Fix rounding issues in Map::invalidateSize
2013-08-06 02:43:40 -07:00
John Firebaugh
a0c6363bb6 Invalidate _initialCenter along with size (fixes #1919) 2013-08-05 14:09:09 -07:00
Russell Davis
f568768142 Fix rounding issues in Map::invalidateSize 2013-08-01 23:14:11 -07:00
Vladimir Agafonkin
7c744d06e6 add getMinZoom test for #1866
[skip ci]
2013-07-25 12:44:55 +03:00
Vladimir Agafonkin
75c133082c fix Map min/maxZoom not overriding TileLayer-derived min/max, close #1848 2013-07-12 15:05:59 +03:00
danzel
ec3b9e0ff2 Add a few more featuregroup tests and fix regression of removeLayer. 2013-07-12 10:13:25 +12:00
Aaron Rutkovsky
0e34b8caf2 PosAnimation tests 2013-07-11 12:30:15 -05:00
John Firebaugh
4839c44509 Fire layerremove after removing the layer
This is consistent with 0.5.x and seems more useful. Updating
the state of a layer switcher using map.hasLayer in response
to layeradd and layerremove events is my use case.
2013-07-08 16:53:04 -07:00
Hans Kristian Flaatten
8e98e52b88 Renames L.LatLng property .altitude to .alt 2013-07-03 15:44:57 +02:00
Hans Kristian Flaatten
46885de00d Adds support for altitude and 3D GeoJSON
This commit adds a third parameter to the L.LatLon class for specifying
altitude. This is in turn stored in the `.latitude` property for the LatLng
instance. Latitude property will only be set if the latitude parameter is not
undefined, this is done in order to ensure backwards compability.

```javascript
var latlng = new L.LatLng(10, 20, 30);
console.log(latlng.altitude); // prints '30' to the console
```

Similar functionality has been added to L.GeoJSON coordsToLatLng() and
latLngToCoords() methods in order to handle import and export of 3D GeoJSON.

```javascript
var geoJSON = {
  type: 'Feature'
  ,properties: {}
  ,geometry: {
    type: 'Point'
    ,coordinates: [20, 10, 30]
  }
}
var layer = new L.GeoJSON();
layer.addData(geoJSON);
console.log(layer.getLayers()[0].getLatLng().altitude);
```

`NB` It is important to notice that no logic has been added in order to prevent
latitude and longitude to change without appropirate change in altitude – this
must be handled by the application.
2013-07-03 10:13:00 +02:00
John Firebaugh
475e736346 Revert "Consistent mouse event propagation in Marker and Path"
This reverts commit 4015f49615.
2013-06-28 16:22:20 -04:00
John Firebaugh
4015f49615 Consistent mouse event propagation in Marker and Path
Marker was missing mouseup and mousemove.
Path was missing mouseup.
2013-06-28 14:44:10 -04:00
Vladimir Agafonkin
cdc65c6c6b add Circle & CircleMarker toGeoJSON 2013-06-25 12:43:22 -04:00
John Firebaugh
2c22d13ab8 Fix test 2013-06-24 14:39:23 -04:00
John Firebaugh
e7d0fb1b37 Normalize all toGeoJSON output to Features 2013-06-24 14:30:24 -04:00
Vladimir Agafonkin
54befc9203 fix True Mercator projection calculations, close #1578 2013-06-24 10:42:15 -04:00
danzel
19d49e027f Add another test for marker/shadow reuse 2013-06-24 08:54:40 +12:00
Paul Bonaud
1af9769ed0 Toggle the display of a marker s popup on click 2013-06-16 22:13:31 +02:00
danzel
1a1cfb2e60 Make Marker setIcon unit tests better. 2013-06-12 16:18:20 +12:00
danzel
fa45913505 Make Icon/DivIcon reuse not try reuse the wrong dom element type. 2013-06-12 16:05:42 +12:00
danzel
7f2eff363b Add support to DivIcon for reusing a div. Fixes #1753. Still issues remain (Can't change a marker with a DivIcon to have an image Icon or vice versa) 2013-06-12 15:55:03 +12:00
John Firebaugh
4802561e0e Don't fire layerremove if layeradd was never fired 2013-06-01 22:16:53 -07:00
John Firebaugh
51fccc80fe Don't call Layer#onAdd on a layer that has been removed 2013-06-01 22:11:42 -07:00
John Firebaugh
055b3393da Don't call Layer#onRemove if Layer#onAdd was never called 2013-06-01 21:50:18 -07:00
Andrii Korzh
d1aa0f3b7e Update LatLngBoundsSpec.js 2013-05-18 13:27:45 +03:00
John Firebaugh
ade9c943ff Popup-specific closeOnClick option 2013-05-10 15:22:03 -07:00
Vladimir Agafonkin
0849d06c1b fix whitespace in event spec, #1661 2013-05-08 12:58:50 +03:00
R. Merkert
bbb7acb3f4 Make sure events don't fire after listener is removed.
This patch fixes a problem with a dangling  event listener, which is
called even after it has been removed. This situation can occur when a
listener is removed during an even dispatch.

To fix this problem, the old action is replaced with a NOOP, so that
when the listener is being fired, it is not the old listener but the
NOOP.
2013-05-07 20:16:25 -04:00
John Firebaugh
c9e2453eed Bounds-check array access in Polygon#initialize 2013-05-02 16:17:04 -07:00
Daan Mortier
c6620859e4 Updated patch for issue #1631 based on feedback 2013-04-29 13:03:05 +02:00
Daan Mortier
52498f1ef9 Issue #1631: Fixed a bug on removeEventListener
Bugfix for issue #1631 where removeEventListener would throw when no event listeners are registered on the object.
2013-04-29 11:53:16 +02:00
Vladimir Agafonkin
7cb7993571 simplify popup methods, merge #738 2013-04-20 16:58:42 +03:00
Vladimir Agafonkin
412f047533 Merge pull request #1462 from jfirebaugh/toGeoJSON
Add #toGeoJSON to various layer types (#712)
2013-04-19 09:55:40 -07:00
Vladimir Agafonkin
5647f37ae6 cleanup and merge #1596, adds Events#once 2013-04-19 17:23:45 +03:00
Vladimir Agafonkin
a5e8bc0f49 add Util.invokeEach for hash arguments in event methods 2013-04-19 17:23:14 +03:00
iirvine
84ad7db070 clearEventListeners -> clearAllListeners 2013-04-15 14:09:32 -07:00
iirvine
2d5bf783fe initial commit of #clearEventListeners 2013-04-15 14:09:32 -07:00
iirvine
031086681f fix our context to the object that's registering this listener 2013-04-14 20:49:57 -07:00
iirvine
a469a387a1 back to first implementation to fix event leak 2013-04-13 22:11:01 -07:00
iirvine
e25f730b04 better implementation, more tests 2013-04-12 17:03:14 -07:00
iirvine
e41e8a886a initial implementation of events#once 2013-04-12 15:21:48 -07:00