Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
astridx committed Apr 25, 2022
1 parent 5bfe2d1 commit 40f7a24
Show file tree
Hide file tree
Showing 35 changed files with 6,622 additions and 36 deletions.
3 changes: 3 additions & 0 deletions changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
<version>4.0.6</version>
<note>
<item>Tiding up language files</item>
<item>Add possiblility for layer control with satellite in frontend</item>
<item>Make separators more visible in the backend</item>
<item>Correct Panel Layer</item>
</note>
</changelog>
</changelogs>
54 changes: 38 additions & 16 deletions j4/pkg_aggpxtrack/src/media/plg_fields_aggpxtrack/js/aggpxtrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ document.addEventListener('DOMContentLoaded', function () {
var unique = element.getAttribute('data-unique');
var scrollwheelzoom = element.getAttribute('data-scrollwheelzoom');
var maptype = element.getAttribute('data-maptype');
var layertree = element.getAttribute('data-layertree');

var thunderforestkey = element.getAttribute('data-thunderforestkey');
var mapboxkey = element.getAttribute('data-mapboxkey');
var geoportailfrancekey = element.getAttribute('data-geoportailfrancekey');
Expand Down Expand Up @@ -204,37 +206,42 @@ document.addEventListener('DOMContentLoaded', function () {
}

// Load the correct map
// Base layer url
var tileLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>'
});
if (maptype === "osm")
{
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
tileLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>'
}).addTo(window['mymap' + unique]);
});
} else if (maptype === "osm_bw")
{
L.tileLayer('http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png', {
tileLayer = L.tileLayer('http://{s}.tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>'
}).addTo(window['mymap' + unique]);
});
} else if (maptype === 'thunderforest')
{
L.tileLayer('https://{s}.tile.thunderforest.com/' + thunderforestmaptype + '/{z}/{x}/{y}.png?apikey={apikey}', {
tileLayer = L.tileLayer('https://{s}.tile.thunderforest.com/' + thunderforestmaptype + '/{z}/{x}/{y}.png?apikey={apikey}', {
maxZoom: 22,
apikey: thunderforestkey,
attribution: '&copy; <a href=\"http://www.thunderforest.com/\">Thunderforest</a>, &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>'
}).addTo(window['mymap' + unique]);
});
} else if (maptype === 'mapbox')
{
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=' + mapboxkey, {
tileLayer = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=' + mapboxkey, {
maxZoom: 18,
attribution: 'Map data &copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors, ' +
'<a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, ' +
'Imagery © <a href=\"http://mapbox.com\">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(window['mymap' + unique]);
});
} else if (maptype === 'geoportailfrance')
{
L.tileLayer('https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}', {
tileLayer = L.tileLayer('https://wxs.ign.fr/{apikey}/geoportail/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&STYLE={style}&TILEMATRIXSET=PM&FORMAT={format}&LAYER={variant}&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}', {
attribution: '<a target="_blank" href="https://www.geoportail.gouv.fr/">Geoportail France</a>',
bounds: [[-75, -180], [81, 180]],
minZoom: 2,
Expand All @@ -245,25 +252,40 @@ document.addEventListener('DOMContentLoaded', function () {
format: 'image/png',
style: 'normal',
variant: 'GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2'
}).addTo(window['mymap' + unique]);
});
} else if (maptype === 'opentopomap')
{
L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
tileLayer = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
maxZoom: 17,
attribution: 'Map data: &copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>, <a href=\"http://viewfinderpanoramas.org\">SRTM</a> | Map style: &copy; <a href=\"https://opentopomap.org\">OpenTopoMap</a> (<a href=\"https://creativecommons.org/licenses/by-sa/3.0/\">CC-BY-SA</a>)'
}).addTo(window['mymap' + unique]);
});
} else if (maptype === 'google')
{
L.gridLayer.googleMutant({
tileLayer = L.gridLayer.googleMutant({
type: googlemapstype,
}).addTo(window['mymap' + unique]);
});
} else
{
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
tileLayer = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: ''
}).addTo(window['mymap' + unique]);
});
}
tileLayer.addTo(window['mymap' + unique]);

if (layertree == '1') {
var tileLayer2 = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
maxZoom: 16,
attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
id: ''
});
var baseMaps = {
"Map": tileLayer,
"Satellit": tileLayer2
};
L.control.layers(baseMaps).addTo(window['mymap' + unique]);
}


// KML Overlay
if (show_omnivore === "1")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"globals": {
"define": true,
"module": true,
"L": true
},
"plugins": [
"html"
],
"settings": {
"html/indent": "space",
"html/report-bad-indent": 2
},
"rules": {
"camelcase": "error",
"comma-spacing": ["error", {"after": true}],
"comma-style": "error",
"indent": "error",
"key-spacing": "error",
"keyword-spacing": "error",
"no-console": "error",
"no-constant-condition": "off",
"no-lonely-if": "error",
"no-multi-spaces": "error",
"no-shadow": "off",
"no-trailing-spaces": "error",
"no-underscore-dangle": "off",
"object-curly-spacing": "error",
"quotes": ["error", "single", "avoid-escape"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-in-parens": "error",
"strict": "off"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 14.x ]
working-directory: [ '.', './test-types' ]

steps:
- name: Checkout branch
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.working-directory }}
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
working-directory: ${{ matrix.working-directory }}

- name: Run tests
run: npm run test
working-directory: ${{ matrix.working-directory }}
timeout-minutes: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: npm-publish

on:
push:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Publish if version has been updated
uses: pascalgn/[email protected]
with: # All of theses inputs are optional
tag_name: "v%s"
tag_message: "v%s"
create_tag: "true"
commit_pattern: "^Release (\\S+)"
workspace: "."
publish_command: "yarn"
publish_args: "--non-interactive"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # You need to set this in your repo settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.github
.travis.yml
.vscode
bower.json
examples
test
test-types
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.leaflet-control-layers-toggle.leaflet-layerstree-named-toggle {
margin: 2px 5px;
width: auto;
height: auto;
background-image: none;
}

.leaflet-layerstree-node {
}

.leaflet-layerstree-header input{
margin-left: 0px;
}


.leaflet-layerstree-header {
}

.leaflet-layerstree-header-pointer {
cursor: pointer;
}

.leaflet-layerstree-header label {
display: inline-block;
cursor: pointer;
}

.leaflet-layerstree-header-label {
}

.leaflet-layerstree-header-name {
}

.leaflet-layerstree-header-space {
}

.leaflet-layerstree-children {
padding-left: 10px;
}

.leaflet-layerstree-children-nopad {
padding-left: 0px;
}

.leaflet-layerstree-closed {
}

.leaflet-layerstree-opened {
}

.leaflet-layerstree-hide {
display: none;
}

.leaflet-layerstree-nevershow {
display: none;
}

.leaflet-layerstree-expand-collapse {
cursor: pointer;
}
Loading

0 comments on commit 40f7a24

Please sign in to comment.