NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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%


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
12.5k23128153
accept rate: 28%

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

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

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:

×440
×362
×230
×122

question asked: 15 Oct '19, 08:55

question was seen: 3,727 times

last updated: 16 Oct '19, 16:46

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum