different whitespace fixes (smart tabs, lines no longer than 100)

This commit is contained in:
Vladimir Agafonkin 2012-11-07 14:13:06 +02:00
parent 4080a64adc
commit a293f52e80
10 changed files with 128 additions and 120 deletions

View File

@ -288,7 +288,10 @@ L.Map = L.Class.extend({
zoom++; zoom++;
nePoint = this.project(ne, zoom); nePoint = this.project(ne, zoom);
swPoint = this.project(sw, zoom); swPoint = this.project(sw, zoom);
boundsSize = new L.Point(Math.abs(nePoint.x - swPoint.x), Math.abs(swPoint.y - nePoint.y));
boundsSize = new L.Point(
Math.abs(nePoint.x - swPoint.x),
Math.abs(swPoint.y - nePoint.y));
if (!inside) { if (!inside) {
zoomNotFound = boundsSize.x <= size.x && boundsSize.y <= size.y; zoomNotFound = boundsSize.x <= size.x && boundsSize.y <= size.y;
@ -442,8 +445,7 @@ L.Map = L.Class.extend({
this._mapPane = panes.mapPane = this._createPane('leaflet-map-pane', this._container); this._mapPane = panes.mapPane = this._createPane('leaflet-map-pane', this._container);
this._tilePane = panes.tilePane = this._createPane('leaflet-tile-pane', this._mapPane); this._tilePane = panes.tilePane = this._createPane('leaflet-tile-pane', this._mapPane);
this._objectsPane = panes.objectsPane = this._createPane('leaflet-objects-pane', this._mapPane); panes.objectsPane = this._createPane('leaflet-objects-pane', this._mapPane);
panes.shadowPane = this._createPane('leaflet-shadow-pane'); panes.shadowPane = this._createPane('leaflet-shadow-pane');
panes.overlayPane = this._createPane('leaflet-overlay-pane'); panes.overlayPane = this._createPane('leaflet-overlay-pane');
panes.markerPane = this._createPane('leaflet-marker-pane'); panes.markerPane = this._createPane('leaflet-marker-pane');
@ -459,7 +461,7 @@ L.Map = L.Class.extend({
}, },
_createPane: function (className, container) { _createPane: function (className, container) {
return L.DomUtil.create('div', className, container || this._objectsPane); return L.DomUtil.create('div', className, container || this._panes.objectsPane);
}, },
_initializers: [], _initializers: [],
@ -541,7 +543,8 @@ L.Map = L.Class.extend({
L.DomEvent.on(this._container, 'click', this._onMouseClick, this); L.DomEvent.on(this._container, 'click', this._onMouseClick, this);
var events = ['dblclick', 'mousedown', 'mouseup', 'mouseenter', 'mouseleave', 'mousemove', 'contextmenu'], var events = ['dblclick', 'mousedown', 'mouseup', 'mouseenter',
'mouseleave', 'mousemove', 'contextmenu'],
i, len; i, len;
for (i = 0, len = events.length; i < len; i++) { for (i = 0, len = events.length; i < len; i++) {
@ -555,7 +558,8 @@ L.Map = L.Class.extend({
_onResize: function () { _onResize: function () {
L.Util.cancelAnimFrame(this._resizeRequest); L.Util.cancelAnimFrame(this._resizeRequest);
this._resizeRequest = L.Util.requestAnimFrame(this.invalidateSize, this, false, this._container); this._resizeRequest = L.Util.requestAnimFrame(
this.invalidateSize, this, false, this._container);
}, },
_onMouseClick: function (e) { _onMouseClick: function (e) {

View File

@ -18,8 +18,7 @@ L.Map.include({
function createCorner(vSide, hSide) { function createCorner(vSide, hSide) {
var className = l + vSide + ' ' + l + hSide; var className = l + vSide + ' ' + l + hSide;
corners[vSide + hSide] = corners[vSide + hSide] = L.DomUtil.create('div', className, container);
L.DomUtil.create('div', className, container);
} }
createCorner('top', 'left'); createCorner('top', 'left');

View File

@ -28,7 +28,8 @@ L.Map.include({
onError = L.Util.bind(this._handleGeolocationError, this); onError = L.Util.bind(this._handleGeolocationError, this);
if (options.watch) { if (options.watch) {
this._locationWatchId = navigator.geolocation.watchPosition(onResponse, onError, options); this._locationWatchId =
navigator.geolocation.watchPosition(onResponse, onError, options);
} else { } else {
navigator.geolocation.getCurrentPosition(onResponse, onError, options); navigator.geolocation.getCurrentPosition(onResponse, onError, options);
} }

View File

@ -71,9 +71,9 @@ L.Map.BoxZoom = L.Handler.extend({
.off(document, 'mouseup', this._onMouseUp); .off(document, 'mouseup', this._onMouseUp);
var map = this._map, var map = this._map,
layerPoint = map.mouseEventToLayerPoint(e); layerPoint = map.mouseEventToLayerPoint(e),
var bounds = new L.LatLngBounds( bounds = new L.LatLngBounds(
map.layerPointToLatLng(this._startLayerPoint), map.layerPointToLatLng(this._startLayerPoint),
map.layerPointToLatLng(layerPoint)); map.layerPointToLatLng(layerPoint));

View File

@ -19,9 +19,9 @@ L.Map.mergeOptions({
L.Map.Drag = L.Handler.extend({ L.Map.Drag = L.Handler.extend({
addHooks: function () { addHooks: function () {
if (!this._draggable) { if (!this._draggable) {
var options = this._map.options; var map = this._map;
this._draggable = new L.Draggable(this._map._mapPane, this._map._container, options.longPress); this._draggable = new L.Draggable(map._mapPane, map._container, map.options.longPress);
this._draggable.on({ this._draggable.on({
'dragstart': this._onDragStart, 'dragstart': this._onDragStart,
@ -29,9 +29,9 @@ L.Map.Drag = L.Handler.extend({
'dragend': this._onDragEnd 'dragend': this._onDragEnd
}, this); }, this);
if (options.worldCopyJump) { if (map.options.worldCopyJump) {
this._draggable.on('predrag', this._onPreDrag, this); this._draggable.on('predrag', this._onPreDrag, this);
this._map.on('viewreset', this._onViewReset, this); map.on('viewreset', this._onViewReset, this);
} }
} }
this._draggable.enable(); this._draggable.enable();
@ -110,7 +110,7 @@ L.Map.Drag = L.Handler.extend({
noInertia = !options.inertia || noInertia = !options.inertia ||
delay > options.inertiaThreshold || delay > options.inertiaThreshold ||
this._positions[0] === undefined; !this._positions[0];
if (noInertia) { if (noInertia) {
map.fire('moveend'); map.fire('moveend');
@ -129,9 +129,9 @@ L.Map.Drag = L.Handler.extend({
decelerationDuration = limitedSpeed / options.inertiaDeceleration, decelerationDuration = limitedSpeed / options.inertiaDeceleration,
offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round(); offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round();
L.Util.requestAnimFrame(L.Util.bind(function () { L.Util.requestAnimFrame(function () {
this._map.panBy(offset, decelerationDuration); map.panBy(offset, decelerationDuration);
}, this)); });
} }
map.fire('dragend'); map.fire('dragend');

View File

@ -45,6 +45,7 @@ L.Map.Keyboard = L.Handler.extend({
this._removeHooks(); this._removeHooks();
var container = this._map._container; var container = this._map._container;
L.DomEvent L.DomEvent
.removeListener(container, 'focus', this._onFocus, this) .removeListener(container, 'focus', this._onFocus, this)
.removeListener(container, 'blur', this._onBlur, this) .removeListener(container, 'blur', this._onBlur, this)

View File

@ -1,5 +1,5 @@
/* /*
* L.Handler.ScrollWheelZoom is used internally by L.Map to enable mouse scroll wheel zooming on the map. * L.Handler.ScrollWheelZoom is used by L.Map to enable mouse scroll wheel zoom on the map.
*/ */
L.Map.mergeOptions({ L.Map.mergeOptions({

View File

@ -1,5 +1,5 @@
/* /*
* L.Handler.TouchZoom is used internally by L.Map to add touch-zooming on Webkit-powered mobile browsers. * L.Handler.TouchZoom is used by L.Map to add pinch zoom on supported mobile browsers.
*/ */
L.Map.mergeOptions({ L.Map.mergeOptions({
@ -68,7 +68,8 @@ L.Map.TouchZoom = L.Handler.extend({
} }
L.Util.cancelAnimFrame(this._animRequest); L.Util.cancelAnimFrame(this._animRequest);
this._animRequest = L.Util.requestAnimFrame(this._updateOnMove, this, true, this._map._container); this._animRequest = L.Util.requestAnimFrame(
this._updateOnMove, this, true, this._map._container);
L.DomEvent.preventDefault(e); L.DomEvent.preventDefault(e);
}, },
@ -108,7 +109,9 @@ L.Map.TouchZoom = L.Handler.extend({
oldZoom = map.getZoom(), oldZoom = map.getZoom(),
floatZoomDelta = map.getScaleZoom(this._scale) - oldZoom, floatZoomDelta = map.getScaleZoom(this._scale) - oldZoom,
roundZoomDelta = (floatZoomDelta > 0 ? Math.ceil(floatZoomDelta) : Math.floor(floatZoomDelta)), roundZoomDelta = (floatZoomDelta > 0 ?
Math.ceil(floatZoomDelta) : Math.floor(floatZoomDelta)),
zoom = map._limitZoom(oldZoom + roundZoomDelta); zoom = map._limitZoom(oldZoom + roundZoomDelta);
map.fire('zoomanim', { map.fire('zoomanim', {