Maps Openlayers标记偏移(不在正确的位置)
我正在使用Web功能服务(WFS),我想在OpenLayers地图上显示一个标记。 WFS回应摘录:Maps Openlayers标记偏移(不在正确的位置),maps,openlayers,angular-openlayers,openlayers-6,web-feature-service,Maps,Openlayers,Angular Openlayers,Openlayers 6,Web Feature Service,我正在使用Web功能服务(WFS),我想在OpenLayers地图上显示一个标记。 WFS回应摘录: <?xml version="1.0" encoding="ISO-8859-1"?> <wfs:FeatureCollection> <gml:boundedBy> <gml:Envelope srsName="EPSG:900913"> <gml:lowerCorner>-89132.
<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:FeatureCollection>
<gml:boundedBy>
<gml:Envelope srsName="EPSG:900913">
<gml:lowerCorner>-89132.899298 5581504.864113</gml:lowerCorner>
<gml:upperCorner>-51735.101149 5625545.655457</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<gml:featureMember>
<bm:TB_ARRET_P gml:id="TB_ARRET_P.3473">
<gml:boundedBy>
<gml:Envelope srsName="EPSG:900913">
<gml:lowerCorner>-75379.857910 5601410.987374</gml:lowerCorner>
<gml:upperCorner>-75379.857910 5601410.987374</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<bm:geometry>
<gml:Point srsName="EPSG:900913">
<gml:pos>-75379.857910 5601410.987374</gml:pos>
</gml:Point>
</bm:geometry>
<bm:LIGNEDES>Citéis 72/Lianes 3</bm:LIGNEDES>
<bm:MOBILIE1>Poteau</bm:MOBILIE1>
<bm:NOMARRET>Mairie du Haillan</bm:NOMARRET>
<bm:VILLE>LE HAILLAN</bm:VILLE>
</bm:TB_ARRET_P>
<bm:TB_ARRET_P>
...
</bm:TB_ARRET_P>
</gml:featureMember>
</wfs:FeatureCollection>
结果如下:
因此,标记已显示,但位置不好。
我错过了什么?如何将标记置于“Mairie”汽车站的中心
谢谢你的回答 如果我将OpenStreetMap放在-75379.857910、5601410.987374的中心位置,它会将Mairie显示在与标记相同的位置,因此OpenStreetMap和WFS数据都是错误的,或者基础地图将Mairie显示在错误的位置 Google Streetview确认站点位于同一位置,因此您的标记是正确的,而底图是错误的
也许这是一个解决问题。地图分辨率是否会影响标记的精度?不,Mairie公共汽车站位于欧洲全境以南。街景摄像机证实了这一点。显示它位于欧洲大陆北部的底图是错误的。这是位于整个欧洲北部的Mairie大楼。
const f = new Feature({geometry: new Point([-75379.857910, 5601410.987374])});
const orangePoint = new Style({
image: new CircleStyle({
radius: 5,
fill: new Fill({color: 'red'}),
stroke: new Stroke({color: 'red', width: 3})
})
});
f.setStyle(orangePoint);
const map = new Map({
layers: [
new TileLayer({ source: new XYZ({ url: this.mapboxTile }) }),
new VectorLayer({
source: new VectorSource({
features: [f]
})
})
],
target: this.idMaps$,
view: new View({
projection: 'EPSG:3857', // OpenLayers' default project and alias of 900913
center: [-64436.414844, 5595687.311159],
zoom: 12
})
});