0

Hi! I am using openlayers to get map with openstreetmap with projection: 'EPSG:4326', but always, In the same position I see the map badly (as you can see in the photo). I am not sure how I can solve this.

alt text

asked 15 Oct '19, 08:55

Marina's gravatar image

Marina
11112
accept rate: 0%


One Answer:
2

It looks like you are displaying in epsg 4326, but using an underlying tile source that is in epsg 3857. OpenLayers is probably choosing whichever tiles require the least distortion or rescaling, and this changes based on the latitude. So your picture shows zoom level 4 tiles in the south, and zoom level 3 tiles further north.

The two solutions are to either display the tiles in their native projection (i.e. change display to 3857) or to find a tile source in your display projection (i.e. tiles in 4326).

permanent link

answered 15 Oct '19, 11:15

Andy%20Allan's gravatar image

Andy Allan
11.9k23121147
accept rate: 29%

Hi,

Thanks for the answer. I thought that openstreetmap has all the kinds of projection or funtions to manage them.

I solved it using useGeometries() function in openlayers(v 6.x), and it gives me other problems as raster render, but It allows to see the map correctly

(16 Oct '19, 16:46) Marina

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×396
×294
×201
×117

question asked: 15 Oct '19, 08:55

question was seen: 611 times

last updated: 16 Oct '19, 16:46

powered by OSQA