Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eslint, leaflet lock, code cleaning, bugfixes #200

Merged
merged 13 commits into from
Sep 20, 2018
Merged
32 changes: 32 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
jest: true
},
globals: {
L: true
},
parserOptions: {
parser: 'babel-eslint'
},
extends: [
'plugin:vue/recommended',
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
camelcase: 0,
"indent": ["error", 2],
"arrow-parens": 0,
"one-var": 0,
semi: ["warn", "always"],
"eol-last": ["error", "always"]
}
}
2 changes: 1 addition & 1 deletion dist/vue2-leaflet.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue2-leaflet.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue2-leaflet.min.js.map

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions examples/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
jest: true
},
globals: {
L: true
},
parserOptions: {
parser: 'babel-eslint'
},
extends: [
'plugin:vue/recommended',
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
camelcase: 0,
"indent": ["error", 2],
"arrow-parens": 0,
"one-var": 0,
semi: ["warn", "always"],
"eol-last": ["error", "always"]
}
}
188 changes: 188 additions & 0 deletions examples/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<template>
<div>
<ul id="side">
<li>
<a
href="#"
@click="currentView='simple'">Simple map</a>
</li>
<li>
<a
href="#"
@click="currentView='marker-popup-example'">Custom Component</a>
</li>
<li>
<a
href="#"
@click="currentView='multi-map'">Two maps</a>
</li>
<li>
<a
href="#"
@click="currentView='custom-path'">Custom path</a>
</li>
<li>
<a
href="#"
@click="currentView='custom-url-params'">Custom Url Params</a>
</li>
<li>
<a
href="#"
@click="currentView='set-bounds'">Set bounds</a>
</li>
<li>
<a
href="#"
@click="currentView='example'">Some examples</a>
</li>
<li>
<a
href="#"
@click="currentView='geometry-test'">Geometry</a>
</li>
<li>
<a
href="#"
@click="currentView='popup-on-geometry-test'">Popup on Geometry</a>
</li>
<li>
<a
href="#"
@click="currentView='world-copy-jump'">Jump on World Copy</a>
</li>
<li>
<a
href="#"
@click="currentView='geo-json'">GeoJSON</a>
</li>
<li>
<a
href="#"
@click="currentView='geo-json2'">GeoJSON 2</a>
</li>
<li>
<a
href="#"
@click="currentView='wms-layers'">WMS Tile Layers</a>
</li>
<li>
<a
href="#"
@click="currentView='crs'">CRS and Image Overlay</a>
</li>
</ul>
<component
id="full_div"
:is="currentView"/>
</div>
</template>

<script>
import 'leaflet.icon.glyph';

import CRSAndImageOverlay from './components/CRSAndImageOverlay';
import CustomPath from './components/CustomPath';
import CustomUrlParams from './components/CustomUrlParams';
import Example from './components/Example';
import GeoJSON from './components/GeoJSON';
import GeoJSON2 from './components/GeoJSON2';
import GeometryTest from './components/GeometryTest';
import MarkerPopupExample from './components/MarkerPopupExample';
import MultiMap from './components/MultiMap';
import PopupOnGeometryTest from './components/PopupOnGeometryTest';
import SetBounds from './components/SetBounds';
import Simple from './components/Simple';
import WMSLayers from './components/WMSLayers';
import WorldCopyJump from './components/WorldCopyJump';

export default {
name: 'App',
components: {
CustomPath,
CustomUrlParams,
Example,
GeometryTest,
MarkerPopupExample,
MultiMap,
PopupOnGeometryTest,
SetBounds,
Simple,
WorldCopyJump,
'geo-json': GeoJSON,
'geo-json2': GeoJSON2,
'wms-layers': WMSLayers,
'crs': CRSAndImageOverlay
},
data () {
return {
currentView: 'simple'
};
}
};
</script>

<style>
.leaflet-fake-icon-image-2x {
background-image: url(../node_modules/leaflet/dist/images/marker-icon-2x.png);
}
.leaflet-fake-icon-shadow {
background-image: url(../node_modules/leaflet/dist/images/marker-shadow.png);
}
@import "../node_modules/leaflet/dist/leaflet.css";

body {
margin: 0px;
font-family: Helvetica, Verdana, sans-serif;
}

#side {
float:left;
width:208px;
}

#full_div {
position: absolute;
overflow-x: auto;
top: 0;
right: 0;
left: 208px;
bottom: 0;
padding-left: 8px;
border-left: 1px solid #ccc;
}

ul {
list-style-type: none;
margin: 0;
padding: 0;
}

li {
font: 200 15px/1.5 Helvetica, Verdana, sans-serif;
border-bottom: 1px solid #ccc;
}

li:last-child {
border: none;
}

li a {
font-size: 15px;
padding-left: 8px;
text-decoration: none;
color: #000;
display: block;

-webkit-transition: font-size 0.3s ease, background-color 0.3s ease;
-moz-transition: font-size 0.3s ease, background-color 0.3s ease;
-o-transition: font-size 0.3s ease, background-color 0.3s ease;
-ms-transition: font-size 0.3s ease, background-color 0.3s ease;
transition: font-size 0.3s ease, background-color 0.3s ease;
}

li a:hover {
font-size: 20px;
background: #f6f6f6;
}
</style>
3 changes: 3 additions & 0 deletions examples/assets/geojson/france.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"type":"FeatureCollection","features":[
{"type":"Feature","id":"FRA","properties":{"name":"France"},"geometry":{"type":"MultiPolygon","coordinates":[[[[9.560016,42.152492],[9.229752,41.380007],[8.775723,41.583612],[8.544213,42.256517],[8.746009,42.628122],[9.390001,43.009985],[9.560016,42.152492]]],[[[3.588184,50.378992],[4.286023,49.907497],[4.799222,49.985373],[5.674052,49.529484],[5.897759,49.442667],[6.18632,49.463803],[6.65823,49.201958],[8.099279,49.017784],[7.593676,48.333019],[7.466759,47.620582],[7.192202,47.449766],[6.736571,47.541801],[6.768714,47.287708],[6.037389,46.725779],[6.022609,46.27299],[6.5001,46.429673],[6.843593,45.991147],[6.802355,45.70858],[7.096652,45.333099],[6.749955,45.028518],[7.007562,44.254767],[7.549596,44.127901],[7.435185,43.693845],[6.529245,43.128892],[4.556963,43.399651],[3.100411,43.075201],[2.985999,42.473015],[1.826793,42.343385],[0.701591,42.795734],[0.338047,42.579546],[-1.502771,43.034014],[-1.901351,43.422802],[-1.384225,44.02261],[-1.193798,46.014918],[-2.225724,47.064363],[-2.963276,47.570327],[-4.491555,47.954954],[-4.59235,48.68416],[-3.295814,48.901692],[-1.616511,48.644421],[-1.933494,49.776342],[-0.989469,49.347376],[1.338761,50.127173],[1.639001,50.946606],[2.513573,51.148506],[2.658422,50.796848],[3.123252,50.780363],[3.588184,50.378992]]]]}}
]}
Loading