Skip to content

Commit

Permalink
inverse attributes (a default of true cannot be set to false in html)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhnb committed Jul 18, 2015
1 parent 3b669ed commit a4ce11f
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 118 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
v1.1.0
======
* add support for styling GeoJson (thanks to Ryan Cooper)
* added support for styling GeoJson layers (thanks to Ryan Cooper)
* renamed attributes on leaflet-map: no-dragging, no-touch-zoom, no-scroll-wheel-zoom, no-double-click-zoom, no-box-zoom, no-tap, no-track-resize, no-close-popup-on-click, no-bounce-at-zoom-limits, no-keyboard, no-inertia, no-zoom-control, no-attribution-control
* renamed attributes on leaflet-marker: no-clickable, no-keyboard

v1.0.2
======
Expand Down
7 changes: 3 additions & 4 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -438,18 +438,17 @@ <h2 id="event">Events</h2>

<h2 id="scale">Scale control</h2>

<p>A scale control can be added and configured using &lt;leaflet-scale-control&gt; By default it displays both
metric and imperial units.</p>
<p>A scale control can be added and configured using &lt;leaflet-scale-control&gt;. By default it displays both metric and imperial units.</p>

<leaflet-map latitude="51.505" longitude="-0.09" zoom="6">
<leaflet-scale-control position="topright" metric="true">
<leaflet-scale-control position="topright" metric imperial>
</leaflet-scale-control>
</leaflet-map>

<pre class="html"><code>
&lt;<span class="i">leaflet-map</span> <span class="a">latitude</span>="<span class="v">51.505</span>" <span class="a">longitude</span>="<span class="v">-0.09</span>" <span class="a">zoom</span>="<span class="v">13</span>"&gt;

&lt;<span class="i">leaflet-scale-control</span> <span class="a">position</span>="<span class="v">topright</span>" <span class="a">metric</span>="<span class="v">true</span>"&gt;
&lt;<span class="i">leaflet-scale-control</span> <span class="a">position</span>="<span class="v">topright</span>" <span class="a">metric</span> <span class="a">imperial</span>&gt;
&lt;/<span class="i">leaflet-scale-control</span>&gt;

&lt;/<span class="i">leaflet-map</span>&gt;
Expand Down
10 changes: 5 additions & 5 deletions leaflet-control.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@
*/
metric: {
type: Boolean,
value: true
value: false
},

/**
* The `imperial` attribute sets whether show the imperial scale line (mi/ft).
* The `imperial` attribute sets whether to show the imperial scale line (mi/ft).
*
* @attribute imperial
* @type boolean
*/
imperial: {
type: Boolean,
value: true
value: false
},

/**
Expand All @@ -98,8 +98,8 @@
var control = L.control.scale({
position: this.position,
maxWidth: this.maxWidth,
metric: this.metric,
imperial: this.imperial,
metric: this.metric || !this.imperial,
imperial: this.imperial || !this.metric,
updateWhenIdle: this.updateWhenIdle,
});
this.control = control;
Expand Down
130 changes: 65 additions & 65 deletions leaflet-core.html
Original file line number Diff line number Diff line change
Expand Up @@ -386,69 +386,69 @@
},

/**
* The `dragging` attribute sets whether when he tries to pan outside the view.
* The `no-dragging` attribute disables whether the map is draggable with mouse/touch or not.
*
* @attribute dragging
* @attribute no-dragging
* @type bool
*/
dragging: {
noDragging: {
type: Boolean,
value: true
value: false
},

/**
* The `touch-zoom` attribute sets whether the map can be zoomed by touch-dragging with two fingers.
* The `no-touch-zoom` attribute disables whether the map can be zoomed by touch-dragging with two fingers.
*
* @attribute touch-zoom
* @attribute no-touch-zoom
* @type bool
*/
touchZoom: {
noTouchZoom: {
type: Boolean,
value: true
value: false
},

/**
* The `scrollWheelZoom` attribute sets the whether the map can be zoomed by using the mouse wheel. If passed 'center', it will zoom to the center of the view regardless of where the mouse was.
* The `no-scroll-wheel-zoom` attribute disables whether the map can be zoomed by using the mouse wheel. If passed 'center', it will zoom to the center of the view regardless of where the mouse was.
*
* @attribute scroll-wheel-zoom
* @attribute no-scroll-wheel-zoom
* @type bool
*/
scrollWheelZoom: {
noScrollWheelZoom: {
type: Boolean,
value: true
value: false
},

/**
* The `double-click-zoom` attribute sets the whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift. If passed 'center', double-click zoom will zoom to the center of the view regardless of where the mouse was.
* The `no-double-click-zoom` attribute disables the whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift. If passed 'center', double-click zoom will zoom to the center of the view regardless of where the mouse was.
*
* @attribute double-click-zoom
* @attribute no-double-click-zoom
* @type bool
*/
doubleClickZoom: {
noDoubleClickZoom: {
type: Boolean,
value: true
value: false
},

/**
* The `box-zoom` attribute sets the whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift.
* The `no-box-zoom` attribute disable the whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift.
*
* @attribute box-zoom
* @attribute no-box-zoom
* @type bool
*/
boxZoom: {
noBoxZoom: {
type: Boolean,
value: true
value: false
},

/**
* The `tap` attribute enables mobile hacks for supporting instant taps (fixing 200ms click delay on iOS/Android) and touch holds (fired as contextmenu events).
* The `no-tap` attribute disables mobile hacks for supporting instant taps (fixing 200ms click delay on iOS/Android) and touch holds (fired as contextmenu events).
*
* @attribute tap
* @attribute no-tap
* @type bool
*/
tap: {
noTap: {
type: Boolean,
value: true
value: false
},

/**
Expand All @@ -463,14 +463,14 @@
},

/**
* The `track-resize` attribute sets whether the map automatically handles browser window resize to update itself.
* The `no-track-resize` attribute disables whether the map automatically handles browser window resize to update itself.
*
* @attribute track-resize
* @attribute no-track-resize
* @type bool
*/
trackResize: {
noTrackResize: {
type: Boolean,
value: true
value: false
},

/**
Expand All @@ -485,36 +485,36 @@
},

/**
* The `close-popup-on-click` attribute sets whether popups are closed when user clicks the map.
* The `no-close-popup-on-click` attribute disables whether popups are closed when user clicks the map.
*
* @attribute close-popup-on-click
* @attribute no-close-popup-on-click
* @type bool
*/
closePopupOnClick: {
noClosePopupOnClick: {
type: Boolean,
value: true
value: false
},

/**
* The `bounce-at-zoom-limits` attribute sets whether the map to zoom beyond min/max zoom and then bounce back when pinch-zooming.
* The `no-bounce-at-zoom-limits` attribute disables whether the map to zoom beyond min/max zoom and then bounce back when pinch-zooming.
*
* @attribute bounce-at-zoom-limits
* @attribute no-bounce-at-zoom-limits
* @type bool
*/
bounceAtZoomLimits: {
noBounceAtZoomLimits: {
type: Boolean,
value: true
value: false
},

/**
* The `keyboard` attribute sets whether the map is focusable and allows users to navigate the map with keyboard arrows and +/- keys.
* The `no-keyboard` attribute disables whether the map is focusable and allows users to navigate the map with keyboard arrows and +/- keys.
*
* @attribute keyboard
* @attribute no-keyboard
* @type bool
*/
keyboard: {
noKeyboard: {
type: Boolean,
value: true
value: false
},

/**
Expand All @@ -540,14 +540,14 @@
},

/**
* The `inertia` attribute sets whether panning of the map will have an inertia effect where the map builds momentum while dragging and continues moving in the same direction for some time. Feels especially nice on touch devices.
* The `no-inertia` attribute disables panning of the map will have an inertia effect where the map builds momentum while dragging and continues moving in the same direction for some time. Feels especially nice on touch devices.
*
* @attribute inertia
* @attribute no-inertia
* @type
*/
inertia: {
noInertia: {
type: Boolean,
value: true
value: false
},

/**
Expand All @@ -570,25 +570,25 @@
},

/**
* The `zoom-control` attribute sets whether the zoom control is added to the map by default.
* The `no-zoom-control` attribute disables the zoom control is added to the map by default.
*
* @attribute zoom-control
* @attribute no-zoom-control
* @type bool
*/
zoomControl: {
noZoomControl: {
type: Boolean,
value: true
value: false
},

/**
* The `attribution-control` attribute sets whether the attribution control is added to the map by default.
* The `no-attribution-control` attribute disable the attribution control is added to the map by default.
*
* @attribute attribution-control
* @attribute no-attribution-control
* @type bool
*/
attributionControl: {
noAttributionControl: {
type: Boolean,
value: true
value: false
},

/**
Expand Down Expand Up @@ -659,25 +659,25 @@
zoom: this.zoom,
minZoom: this.minZoom,
maxZoom: this.maxZoom,
dragging: this.dragging,
touchZoom: this.touchZoom,
scrollWheelZoom: this.scrollWheelZoom,
doubleClickZoom: this.doubleClickZoom,
boxZoom: this.boxZoom,
tap: this.tap,
dragging: !this.noDragging,
touchZoom: !this.noTouchZoom,
scrollWheelZoom: !this.noScrollWheelZoom,
doubleClickZoom: !this.noDoubleClickZoom,
boxZoom: !this.noBoxZoom,
tap: !this.noTap,
tapTolerance: this.tapTolerance,
trackResize: this.trackResize,
trackResize: !this.noTrackResize,
worldCopyJump: this.worldCopyJump,
closePopupOnClick: this.closePopupOnClick,
bounceAtZoomLimits: this.bounceAtZoomLimits,
keyboard: this.keyboard,
closePopupOnClick: !this.noClosePopupOnClick,
bounceAtZoomLimits: !this.noBounceAtZoomLimits,
keyboard: !this.noKeyboard,
keyboardPanOffset: this.keyboardPanOffset,
keyboardZoomOffset: this.keyboardZoomOffset,
inertia: this.inertia,
inertia: !this.noInertia,
inertiaDeceleration: this.inertiaDeceleration,
inertiaMaxSpeed: this.inertiaMaxSpeed,
zoomControl: this.zoomControl,
attributionControl: this.attributionControl,
zoomControl: !this.noZoomControl,
attributionControl: !this.noAttributionControl,
zoomAnimationThreshold: this.zoomAnimationThreshold
});
this.map = map;
Expand Down
12 changes: 6 additions & 6 deletions leaflet-draw.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@
* @attribute stroke
* @type boolean
*/
stroke: {
noStroke: {
type: Boolean,
value: true
value: false
},

/**
Expand Down Expand Up @@ -225,9 +225,9 @@
* @attribute clickable
* @type boolean
*/
clickable: {
noClickable: {
type: Boolean,
value: true
value: false
},

/**
Expand Down Expand Up @@ -255,7 +255,7 @@

getPathOptions: function() {
return {
stroke: this.stroke,
stroke: !this.noStroke,
color: this.color,
weight: this.weight,
opacity: this.opacity,
Expand All @@ -265,7 +265,7 @@
dashArray: this.dashArray,
lineCap: this.lineCap,
lineJoin: this.lineJoin,
clickable: this.clickable,
clickable: !this.noClickable,
pointerEvents: this.pointerEvents,
className: this.className,
};
Expand Down
Loading

0 comments on commit a4ce11f

Please sign in to comment.