geoserver geomesa timeline
2023-05-30 本文已影响0人
hehehehe
将 GEOMESA_HBASE_HOME/dist/gs-plugins/geomesa-hbase-gs-plugin_2.11-$VERSION-install.tar.gz解压到geoserver WBE-INF/lib路径下;
<body>
<div id="map">
<div class="tools">
<span id="year">1</span>
<input type="range" min="1" max="10" step="1" value="1" oninput="changeFn(this)">
</div>
</div>
<script>
var center = [116, 39], zoom = 6;
var wmsSource = new ol.source.TileWMS({
url: 'http://localhost:8080/geoserver/ne/wms',
params: {
'LAYERS': 'ne:hn',
'CQL_FILTER':'dtg DURING 2020-01-01T00:00:00.000Z/2020-01-28T00:00:00.000Z'
}
})
var wms = new ol.layer.Tile({
source: wmsSource
})
var map = new ol.Map({
controls: ol.control.defaults({
attribution: false
}),
target: 'map',
layers: [ wms],
view: new ol.View({
minZoom: 0,
maxZoom: 18,
center: ol.proj.fromLonLat(center),
zoom: zoom
})
});
function changeFn(obj) {
let a = obj.value
let c = `dtg DURING 2020-01-01T00:00:00.000Z/2020-0${a}-28T00:00:00.000Z`
console.log(c)
wmsSource.updateParams({'CQL_FILTER': c})
document.getElementById('year').innerText = obj.value
}
</script>
</body>
</html>