简体   繁体   中英

Openlayers point not in same location over WMS map and WMTS map

I've been trying to get openlayers 3 working with two different Tiles, WMTS and WMS with a point at (69.69, 18.95) which is a coordinate in Tromsø, Norway. The tiles for the maps are using a projection of EPSG:32633 and therefore I found out that i had to include proj4, cause OL3 does not support that projection (?). Anyways, here are the jsfiddle of it. The first link: https://jsfiddle.net/larsimann8/xo8nk8qL/4/ : . is with the WMS which actually the point is at the right place, but with the second link which is with WMTS: https://jsfiddle.net/larsimann8/6y566j31/ . its not.

I can't really see what is wrong here, so if anyone knows please help :)

Your fiddles are not working properly, I can't see anything at the moment.

However, the problem is related with the ol.tilegrid.WMTS params.

You are setting the origin at -20037508.342789244, 20037508.342789244 , while the WMTS origin for EPSG:32633 is -2500000.0 9045984.0

Check the capabilities document to configure the layer correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM