-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added another example for publishing OGC API - Tiles with elastic
- added Indian centric datasets
- Loading branch information
doublebyte1
committed
Dec 6, 2023
1 parent
9a25d72
commit 22b9520
Showing
9 changed files
with
392 additions
and
113 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
157 changes: 157 additions & 0 deletions
157
.../exercises/data/greater_hyderabad_municipal_corporation_ward_Boundaries.geojson
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,48 @@ | ||
<html> | ||
<head><title>OGC API - Tiles exercise</title></head> | ||
<body> | ||
<div id="map" style="width:100vw;height:100vh;"></div> | ||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" /> | ||
<script type="text/javascript" src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script> | ||
<script type="text/javascript" src="https://unpkg.com/leaflet.vectorgrid@1.2.0"></script> | ||
<script> | ||
map = L.map('map').setView({ lat: 43.79, lng: 11.25 }, 12); | ||
map.addLayer( | ||
new L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.{ext}', { | ||
attribution: 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', | ||
subdomains: 'abcd', | ||
minZoom: 1, | ||
maxZoom: 16, | ||
ext: 'jpg' | ||
})); | ||
map.addLayer(new L.vectorGrid.protobuf( | ||
'http://localhost:5000/collections/Cycle/tiles/WorldCRS84Quad/{z}/{x}/{y}?f=mvt', | ||
{ rendererFactory: L.canvas.tile })); | ||
</script> | ||
</body> | ||
</html> | ||
<html> | ||
<head><title>OGC API - Tiles exercise</title></head> | ||
<body> | ||
<div id="map" style="width:100vw;height:100vh;"></div> | ||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" /> | ||
<script type="text/javascript" src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script> | ||
<script type="text/javascript" src="https://unpkg.com/leaflet.vectorgrid@1.3.0/dist/Leaflet.VectorGrid.bundled.js"></script> | ||
<script> | ||
map = L.map('map').setView({ lat: 17.425181, lng: 78.5493906 }, 11); | ||
map.addLayer( | ||
new L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}', { | ||
attribution: 'Tiles © Esri — National Geographic, Esri, DeLorme, NAVTEQ, UNEP-WCMC, USGS, NASA, ESA, METI, NRCAN, GEBCO, NOAA, iPC', | ||
minZoom: 1, | ||
maxZoom: 16, | ||
})); | ||
function getColor(val){ | ||
if (val < 40) {return "#f2e6c7"} | ||
else if (val < 80) {return "#8fa37e"} | ||
else if (val < 100) {return "#f0d17d"} | ||
else if (val < 120) {return "#d7ded1"} | ||
else return "#c2d0d9"; | ||
} | ||
var vectorTileStyling = { | ||
greater_hyderabad_municipal_corporation_ward_Boundaries: function(properties) { | ||
return ({ | ||
fill: true, | ||
fillColor: getColor(properties.objectid), | ||
color: "#ffffff", | ||
fillOpacity: 1.0, | ||
weight: 5, | ||
//color: "#ffffff", | ||
opacity: 1.0, | ||
}); | ||
} | ||
} | ||
var mapVectorTileOptions = { | ||
rendererFactory: L.canvas.tile, | ||
interactive: true, | ||
vectorTileLayerStyles: vectorTileStyling, | ||
}; | ||
var pbfURL='http://localhost:5000/collections/Hyderabad/tiles/WorldCRS84Quad/{z}/{x}/{y}?f=mvt'; | ||
var pbfLayer=L.vectorGrid.protobuf(pbfURL,mapVectorTileOptions).on('click',function(e) { | ||
console.log(e.layer); | ||
L.DomEvent.stop(e); | ||
}).addTo(map); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters