Skip to content

Commit

Permalink
Merge pull request #13 from sauevald/feature/hooldustase
Browse files Browse the repository at this point in the history
Add maintained bike paths
  • Loading branch information
tormi authored Mar 14, 2024
2 parents 5c93817 + e02e891 commit 537b7ef
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<script src="https://unpkg.com/[email protected]/Control.FullScreen.js"></script>
<script src="https://unpkg.com/[email protected]/dist/proj4.js"></script>
<script src="https://unpkg.com/[email protected]/src/proj4leaflet.js"></script>
<script src="https://unpkg.com/[email protected]/dist/esri-leaflet.js"></script>
<script src="js/hash.js"></script>
<script src="js/slider.js"></script>
<script src="js/script.js"></script>
Expand Down
25 changes: 22 additions & 3 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const kataster = L.tileLayer.wms('https://kaart.maaamet.ee/wms/alus-geo?', {
})

// Create a custom CRS for EPSG:3301
var crs = new L.Proj.CRS(
const epsg3301 = new L.Proj.CRS(
'EPSG:3301',
'+proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.51755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
{
Expand All @@ -54,7 +54,7 @@ const yp_mk = L.tileLayer.wms('https://planeeringud.ee/plank/wms?', {
format: 'image/png',
transparent: true,
layers: 'yp_maakasutus',
crs: crs, // Set the custom CRS for EPSG:3301
crs: epsg3301, // Set the custom CRS for EPSG:3301
attribution:
'Kiht: <a href="https://planeeringud.ee/plank-web/#/planning/detail/20100625" target="_blank">Saue valla ÜP maakasutus</a>',
})
Expand All @@ -64,11 +64,28 @@ const yp_tr = L.tileLayer.wms('https://planeeringud.ee/plank/wms?', {
format: 'image/png',
transparent: true,
layers: 'yp_transport',
crs: crs, // Set the custom CRS for EPSG:3301
crs: epsg3301, // Set the custom CRS for EPSG:3301
attribution:
'Kiht: <a href="https://planeeringud.ee/plank-web/#/planning/detail/20100625" target="_blank">Saue valla ÜP transport</a>',
})

const rattateed = L.esri.featureLayer({
url: 'https://gis.sauevald.ee/arcgis/rest/services/Hosted/Hooldatavad_kergteed/FeatureServer/0',
style: function (feature) {
// Customize the style based on the "tase" attribute value
const tase = feature.properties.tase
if (tase === 'III') {
return { color: '#c8102e', weight: 4 }
} else if (tase === 'II') {
return { color: '#f73c4d', weight: 3 }
} else {
return { color: '#fea3a7', weight: 2 }
}
},
attribution:
'Kiht: <a href="https://gis.sauevald.ee/portal/apps/webappviewer/index.html?id=4997acde0cde4d7eaae3b39d36b601e5" target="_blank">Saue valla hooldatavad JJT-d</a>',
})

// Create a custom tile layer for the Vanamõisa development area
const vanamoisa = L.tileLayer(
'https://mapwarper.net/maps/tile/80329/{z}/{x}/{y}.png',
Expand All @@ -89,6 +106,7 @@ const overlayMaps = {
Kataster: kataster,
'ÜP maakasutus': yp_mk,
'ÜP transport': yp_tr,
'JJT hooldustasemed': rattateed,
'Vanamõisa eskiis': vanamoisa,
}

Expand Down Expand Up @@ -121,5 +139,6 @@ const layers = {
yk: yp_mk,
yt: yp_tr,
va: vanamoisa,
rt: rattateed,
}
L.myHash(map, layers)

0 comments on commit 537b7ef

Please sign in to comment.