Vuelayers投影问题(OpenLayers中不存在)
Vuelayers projection problem (inexistant in OpenLayers)
我制作了一个 CodePen,它显示了我正在尝试做的事情,但我的 Vuelayers 代码生成了正确数据的压缩版本。我玩过比率和投影,但尽管看起来有问题,但我无法修复它。我最好的猜测是有一些我看不到或无法操作的默认值。
<template>
<div>
<v-container>
<v-card>
<vl-map
style="height: 650px"
:load-tiles-while-animating="true"
:load-tiles-while-interacting="true"
>
<vl-view
:zoom="zoom"
:center="center"
/>
<vl-layer-tile>
<vl-source-osm/>
</vl-layer-tile>
<vl-layer-image>
<vl-source-image-wms
:url.sync='baseURL'
:layers.sync='layer'
:projection='projection'
:crossOrigin='crossOrigin'
:ratio='ratio'
:serverType='serverType'
:attributions='customAttributions'
>
</vl-source-image-wms>
</vl-layer-image>
</vl-map>
</v-container>
</div>
</template>
<script>
export default {
data () {
return {
baseURL: 'https://firms.modaps.eosdis.nasa.gov/wms/key/X/?BBOX=-180,-90,180,90',
layer: "fires_viirs_24",
serverType: 'geoserver',
crossOrigin: 'anonymous',
ratio:1,
params: {'LAYERS': 'fires_viirs_24','VERSION' : '1.0.0'},
zoom: 2,
opacity: 0.5,
center: [-75,45],
projection: "EPSG:4326",
}
}
}
</script>
我遗漏了几个字段,这里是工作示例。
<vl-map
style="height: 650px"
:load-tiles-while-animating="true"
:load-tiles-while-interacting="true"
>
<vl-view
:zoom.sync="zoom"
:center.sync="center"
/>
<vl-layer-tile>
<vl-source-osm/>
</vl-layer-tile>
<vl-layer-image>
<vl-source-image-wms
:url.sync='baseURL'
:layers.sync='layer'
:version.sync='version'
:projection='projection'
:cross-origin='crossOrigin'
:ratio='ratio'
:server-type='serverType'
:attributions='customAttributions'
/>
</vl-layer-image>
</vl-map>
baseURL: 'https://firms.modaps.eosdis.nasa.gov/wms/key/X/?BBOX=-180,-90,180,90',
layer: "fires_viirs_24",
serverType: 'geoserver',
version: '1.0.0',
crossOrigin: 'anonymous',
ratio: 1,
zoom: 4,
center: [-10683725, 4240631],
projection: "EPSG:4326",
customAttributions: '<a href="https://firms.modaps.eosdis.nasa.gov/web-services/">NASA\'s WMS hotspots service</a>',
layerNames: [ ... ]
我制作了一个 CodePen,它显示了我正在尝试做的事情,但我的 Vuelayers 代码生成了正确数据的压缩版本。我玩过比率和投影,但尽管看起来有问题,但我无法修复它。我最好的猜测是有一些我看不到或无法操作的默认值。
<template>
<div>
<v-container>
<v-card>
<vl-map
style="height: 650px"
:load-tiles-while-animating="true"
:load-tiles-while-interacting="true"
>
<vl-view
:zoom="zoom"
:center="center"
/>
<vl-layer-tile>
<vl-source-osm/>
</vl-layer-tile>
<vl-layer-image>
<vl-source-image-wms
:url.sync='baseURL'
:layers.sync='layer'
:projection='projection'
:crossOrigin='crossOrigin'
:ratio='ratio'
:serverType='serverType'
:attributions='customAttributions'
>
</vl-source-image-wms>
</vl-layer-image>
</vl-map>
</v-container>
</div>
</template>
<script>
export default {
data () {
return {
baseURL: 'https://firms.modaps.eosdis.nasa.gov/wms/key/X/?BBOX=-180,-90,180,90',
layer: "fires_viirs_24",
serverType: 'geoserver',
crossOrigin: 'anonymous',
ratio:1,
params: {'LAYERS': 'fires_viirs_24','VERSION' : '1.0.0'},
zoom: 2,
opacity: 0.5,
center: [-75,45],
projection: "EPSG:4326",
}
}
}
</script>
我遗漏了几个字段,这里是工作示例。
<vl-map
style="height: 650px"
:load-tiles-while-animating="true"
:load-tiles-while-interacting="true"
>
<vl-view
:zoom.sync="zoom"
:center.sync="center"
/>
<vl-layer-tile>
<vl-source-osm/>
</vl-layer-tile>
<vl-layer-image>
<vl-source-image-wms
:url.sync='baseURL'
:layers.sync='layer'
:version.sync='version'
:projection='projection'
:cross-origin='crossOrigin'
:ratio='ratio'
:server-type='serverType'
:attributions='customAttributions'
/>
</vl-layer-image>
</vl-map>
baseURL: 'https://firms.modaps.eosdis.nasa.gov/wms/key/X/?BBOX=-180,-90,180,90',
layer: "fires_viirs_24",
serverType: 'geoserver',
version: '1.0.0',
crossOrigin: 'anonymous',
ratio: 1,
zoom: 4,
center: [-10683725, 4240631],
projection: "EPSG:4326",
customAttributions: '<a href="https://firms.modaps.eosdis.nasa.gov/web-services/">NASA\'s WMS hotspots service</a>',
layerNames: [ ... ]