Skip to content

Commit

Permalink
html-code: spaces instead of tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
ppete2 committed Jun 15, 2018
1 parent bf95d29 commit 7990f73
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 107 deletions.
36 changes: 18 additions & 18 deletions Leaflet.PolylineMeasure.css
@@ -1,49 +1,49 @@
.leaflet-control {
cursor: pointer;
cursor: pointer;
}

a.polyline-measure-controlOnBgColor, a.polyline-measure-controlOnBgColor:hover {
background-color: #8f8;
background-color: #8f8;
}

.polyline-measure-unicode-icon {
font-size: 19px;
font-weight: bold;
font-size: 19px;
font-weight: bold;
}

a.polyline-measure-clearControl:active {
background-color: #f88;
background-color: #f88;
}

.polyline-measure-tooltip {
font: 10px Arial, Helvetica, sans-serif;
font: 10px Arial, Helvetica, sans-serif;
line-height: 10px;
background-color: rgba(255, 255, 170, 0.7);
background-color: rgba(255, 255, 170, 0.7);
border-radius: 3px;
box-shadow: 1px 1px 4px #888;
margin: 0;
padding: 2px;
width: auto !important;
height: auto !important;
white-space: nowrap;
box-shadow: 1px 1px 4px #888;
margin: 0;
padding: 2px;
width: auto !important;
height: auto !important;
white-space: nowrap;
text-align: right;
}

.polyline-measure-tooltip-end {
background-color: rgba(255, 255, 40, 0.7);
background-color: rgba(255, 255, 40, 0.7);
}

.polyline-measure-tooltip-total {
color: #006;
color: #006;
font-weight: bold;
}

.polyline-measure-tooltip-difference {
color: #060;
font-style: italic;
color: #060;
font-style: italic;
}

.polyline-measure-popupTooltip {
font: 11px Arial, Helvetica, sans-serif;
font: 11px Arial, Helvetica, sans-serif;
line-height: 11px;
}
56 changes: 28 additions & 28 deletions Leaflet.PolylineMeasure.js
@@ -1,8 +1,8 @@
/*********************************************************
** **
** **
** Leaflet Plugin "Leaflet.PolylineMeasure" **
** Version: 2018-06-15 **
** **
** **
*********************************************************/


Expand Down Expand Up @@ -34,12 +34,12 @@
* @type {Object}
*/
options: {
/**
/**
* Position to show the control. Possible values are: 'topright', 'topleft', 'bottomright', 'bottomleft'
* @type {String}
* @default
*/
position: 'topleft',
position: 'topleft',
/**
* Which units the distances are displayed in. Possible values are: 'metres', 'landmiles', 'nauticalmiles'
* @type {String}
Expand All @@ -52,13 +52,13 @@
* @default
*/
clearMeasurementsOnStop: true,
/**
/**
* Whether bearings are displayed within the tooltips
* @type {Boolean}
* @default
*/
showBearings: false,
/**
/**
* Text for the bearing In
* @type {String}
* @default
Expand Down Expand Up @@ -130,30 +130,30 @@
* @default
*/
showUnitControl: false,
/**
/**
* Title texts to show on the Unit Control button
* @type {Object}
* @default
*/
unitControlTitle: {
text: 'Change Units',
metres: 'metres',
landmiles: 'land miles',
nauticalmiles: 'nautical miles'
},
/**
metres: 'metres',
landmiles: 'land miles',
nauticalmiles: 'nautical miles'
},
/**
* Lable symbols to show in the Unit Control button
* @type {Object}
* @default
*/
unitControlLabel: {
unitControlLabel: {
metres: 'm',
kilometres: 'km',
feet: 'ft',
landmiles: 'mi',
nauticalmiles: 'nm'
},
/**
kilometres: 'km',
feet: 'ft',
landmiles: 'mi',
nauticalmiles: 'nm'
},
/**
* Styling settings for the temporary dashed rubberline
* @type {Object}
*/
Expand Down Expand Up @@ -377,7 +377,7 @@
// initialize state
this._arrPolylines = [];
this._measureControl = this._createControl (label, title, classes, this._container, this._toggleMeasure, this);
this._measureControl.setAttribute('id', _measureControlId);
this._measureControl.setAttribute('id', _measureControlId);
if (this.options.showClearControl) {
var title = this.options.clearControlTitle;
var label = this.options.clearControlLabel;
Expand All @@ -391,13 +391,13 @@
if (this.options.showUnitControl) {
if (this.options.unit == "metres") {
var label = this.options.unitControlLabel.metres;
var title = this.options.unitControlTitle.text + " [" + this.options.unitControlTitle.metres + "]";
var title = this.options.unitControlTitle.text + " [" + this.options.unitControlTitle.metres + "]";
} else if (this.options.unit == "landmiles") {
var label = this.options.unitControlLabel.landmiles;
var title = this.options.unitControlTitle.text + " [" + this.options.unitControlTitle.landmiles + "]";
var title = this.options.unitControlTitle.text + " [" + this.options.unitControlTitle.landmiles + "]";
} else {
var label = this.options.unitControlLabel.nauticalmiles;
var title = this.options.unitControlTitle.text + " [" + this.options.unitControlTitle.nauticalmiles + "]";
var title = this.options.unitControlTitle.text + " [" + this.options.unitControlTitle.nauticalmiles + "]";
}
var classes = [];
this._unitControl = this._createControl (label, title, classes, this._container, this._changeUnit, this);
Expand All @@ -422,7 +422,7 @@
_toggleMeasure: function () {
this._measuring = !this._measuring;
if (this._measuring) { // if measuring is going to be switched on
this._measureControl.classList.add ('polyline-measure-controlOnBgColor');
this._measureControl.classList.add ('polyline-measure-controlOnBgColor');
this._measureControl.title = this.options.measureControlTitleOff;
this._oldCursor = this._map._container.style.cursor; // save former cursor type
this._map._container.style.cursor = 'crosshair';
Expand Down Expand Up @@ -473,15 +473,15 @@
if (this.options.unit == "metres") {
this.options.unit = "landmiles";
document.getElementById("unitControlId").innerHTML = this.options.unitControlLabel.landmiles;
this._unitControl.title = this.options.unitControlTitle.text +" [" + this.options.unitControlTitle.landmiles + "]";
this._unitControl.title = this.options.unitControlTitle.text +" [" + this.options.unitControlTitle.landmiles + "]";
} else if (this.options.unit == "landmiles") {
this.options.unit = "nauticalmiles";
document.getElementById("unitControlId").innerHTML = this.options.unitControlLabel.nauticalmiles;
this._unitControl.title = this.options.unitControlTitle.text +" [" + this.options.unitControlTitle.nauticalmiles + "]";
this._unitControl.title = this.options.unitControlTitle.text +" [" + this.options.unitControlTitle.nauticalmiles + "]";
} else {
this.options.unit = "metres";
document.getElementById("unitControlId").innerHTML = this.options.unitControlLabel.metres;
this._unitControl.title = this.options.unitControlTitle.text +" [" + this.options.unitControlTitle.metres + "]";
this._unitControl.title = this.options.unitControlTitle.text +" [" + this.options.unitControlTitle.metres + "]";
}
this._arrPolylines.map (function(line) {
var totalDistance = 0;
Expand Down Expand Up @@ -724,7 +724,7 @@
dashArray: '8,8'
}).addTo(this._layerPaint).bringToBack();

var polylineState = this;
var polylineState = this;
this._currentLine = {
id: 0,
circleCoords: [],
Expand Down
38 changes: 19 additions & 19 deletions README.md
Expand Up @@ -37,34 +37,34 @@ It's possible to install and update this plugin using package managers like "npn
```js
options = {
position: 'topleft', // Position to show the control. Possible values are: 'topright', 'topleft', 'bottomright', 'bottomleft'
unit: 'metres', // Show imperial or metric distances. Values: 'metres', 'landmiles', 'nauticalmiles'
clearMeasurementsOnStop: true, // Clear all the measurements when the control is unselected
showBearings: false, // Whether bearings are displayed within the tooltips
bearingTextIn: 'In' // language dependend label for inbound bearings
unit: 'metres', // Show imperial or metric distances. Values: 'metres', 'landmiles', 'nauticalmiles'
clearMeasurementsOnStop: true, // Clear all the measurements when the control is unselected
showBearings: false, // Whether bearings are displayed within the tooltips
bearingTextIn: 'In' // language dependend label for inbound bearings
bearingTextOut: 'Out', // language dependend label for outbound bearings
tooltipText: 'Click and drag to <b>move point</b><br>Press CTRL-key and click to <b>resume line</b>', // language dependend label for last point's tooltip
measureControlTitleOn: 'Turn on PolylineMeasure', // Title for the control going to be switched on
measureControlTitleOff: 'Turn off PolylineMeasure', // Title for the control going to be switched off
measureControlLabel: '&#8614;', // Label of the Measure control (maybe a unicode symbol)
measureControlClasses: [], // Classes to apply to the Measure control
showClearControl: false, // Show a control to clear all the measurements
showClearControl: false, // Show a control to clear all the measurements
clearControlTitle: 'Clear Measurements',// Title text to show on the clear measurements control button
clearControlLabel: '&times', // Label of the Clear control (maybe a unicode symbol)
clearControlClasses: [], // Classes to apply to clear control button
showUnitControl: false, // Show a control to change the units of measurements
unitControlTitle: { // Title texts to show on the Unit Control button
text: 'Change Units',
metres: 'metres',
landmiles: 'land miles',
nauticalmiles: 'nautical miles'
},
unitControlLabel: { // Lable symbols to show in the Unit Control button
metres: 'm',
kilometres: 'km',
feet: 'ft',
landmiles: 'mi',
nauticalmiles: 'nm'
},
showUnitControl: false, // Show a control to change the units of measurements
unitControlTitle: { // Title texts to show on the Unit Control button
text: 'Change Units',
metres: 'metres',
landmiles: 'land miles',
nauticalmiles: 'nautical miles'
},
unitControlLabel: { // Lable symbols to show in the Unit Control button
metres: 'm',
kilometres: 'km',
feet: 'ft',
landmiles: 'mi',
nauticalmiles: 'nm'
},
tempLine: { // Styling settings for the temporary dashed line
color: '#00f', // Dashed line color
weight: 2 // Dashed line weight
Expand Down
28 changes: 14 additions & 14 deletions demo1.html
@@ -1,26 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Demo 1 of Leaflet.PolylineMeasure</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="Leaflet.PolylineMeasure.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="Leaflet.PolylineMeasure.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script src="Leaflet.PolylineMeasure.js"></script>
<style>
<style>
body {padding: 0; margin: 0;}
html, body, #map {height: 100%;}
</style>
</head>
<body>
<div id="map"></div>
<script>
</style>
</head>
<body>
<div id="map"></div>
<script>
var layerOsm = new L.TileLayer('https://{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {subdomains:['server','services'], maxZoom:19, noWrap:false, attribution:'<a href="https://www.arcgis.com/">ArcGIS</a>' });
var map = new L.Map('map').addLayer(layerOsm).setView(new L.LatLng(48, 0), 4);
var map = new L.Map('map').addLayer(layerOsm).setView(new L.LatLng(48, 0), 4);
L.control.scale({maxWidth:240, metric:true, imperial:false, position: 'bottomleft'}).addTo(map);
L.control.polylineMeasure({position:'topleft', unit:'metres', showBearings:true, clearMeasurementsOnStop: false, showClearControl: true, showUnitControl: true}).addTo(map);
</script>
</body>
</script>
</body>
</html>
28 changes: 14 additions & 14 deletions demo2.html
@@ -1,26 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Demo 2 of Leaflet.PolylineMeasure</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="Leaflet.PolylineMeasure.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="Leaflet.PolylineMeasure.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script src="Leaflet.PolylineMeasure.js"></script>
<style>
<style>
body {padding: 0; margin: 0;}
html, body, #map {height: 100%;}
</style>
</head>
<body>
<div id="map"></div>
<script>
</style>
</head>
<body>
<div id="map"></div>
<script>
var layerOsm = new L.TileLayer('https://{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {subdomains:['server','services'], maxZoom:19, noWrap:false, attribution:'<a href="https://www.arcgis.com/">ArcGIS</a>' });
var map = new L.Map('map').addLayer(layerOsm).setView(new L.LatLng(48, 0), 4);
var map = new L.Map('map').addLayer(layerOsm).setView(new L.LatLng(48, 0), 4);
L.control.scale({maxWidth:240, metric:false, imperial:true, position: 'bottomleft'}).addTo(map);
L.control.polylineMeasure({position:'topleft', unit:'landmiles', clearMeasurementsOnStop: false, showMeasurementsClearControl: true, showUnitControl: false}).addTo(map);
</script>
</body>
</script>
</body>
</html>
28 changes: 14 additions & 14 deletions demo3.html
@@ -1,26 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Demo 3 of Leaflet.PolylineMeasure</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="Leaflet.PolylineMeasure.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="Leaflet.PolylineMeasure.css" />
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script src="Leaflet.PolylineMeasure.js"></script>
<style>
<style>
body {padding: 0; margin: 0;}
html, body, #map {height: 100%;}
</style>
</head>
<body>
<div id="map"></div>
<script>
</style>
</head>
<body>
<div id="map"></div>
<script>
var layerOsm = new L.TileLayer('https://{s}.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {subdomains:['server','services'], maxZoom:19, noWrap:true, attribution:'<a href="https://www.arcgis.com/">ArcGIS</a>' });
var map = new L.Map('map').addLayer(layerOsm).setView(new L.LatLng(48, 0), 4);
var map = new L.Map('map').addLayer(layerOsm).setView(new L.LatLng(48, 0), 4);
L.control.scale({maxWidth:240, metric:false, imperial:true, position: 'bottomleft'}).addTo(map);
L.control.polylineMeasure({position:'topleft', unit:'nauticalmiles', showBearings:true, clearMeasurementsOnStop: false, showMeasurementsClearControl: false, showUnitControl: false}).addTo(map);
</script>
</body>
</script>
</body>
</html>

0 comments on commit 7990f73

Please sign in to comment.