Opened 8 years ago

Closed 7 years ago

#985 closed defect/bug (fixed)

Scale goes wrong then zoom-out a lot

Reported by: me.yahoo.com/a/t8pxanggmzrce9fscf2wgwk_ozmtbyifgarr#f3b4e Owned by: KaZeR
Priority: major Milestone:
Component: core Version: git master
Severity: Keywords: scale zoom
Cc: sebastian.leske@…

Description

  • Navit version: navit-svn-4863
  • Device: Samsung Galaxy Tab P1000
  • OS: Android 2.2
  • latest map from map extractor

There is a scale configured on OSD.

<osd enabled="yes" x="0" y="350" w="250" h="60" font_size="400" type="scale" use_overlay="1" background_color="#48852f00" align="1"/>

Following are the scale value displayed when zooming out:

5.0m
10m
20m
50m
100m
200m
500m
1000m
2000m
5000m
10.0km
20.0km
50.0km
100km
200km
500km
50.0km
1000m

Last two values are wrong. Should they be 500km and 1000km ?

Ciprian.

Attachments (6)

device-2011-12-24-101431.png (169.4 KB) - added by zoff99 8 years ago.
device-2011-12-24-101502.png (169.6 KB) - added by zoff99 8 years ago.
device-2011-12-24-101517.png (211.9 KB) - added by zoff99 8 years ago.
device-2011-12-24-101529.png (236.6 KB) - added by zoff99 8 years ago.
device-2011-12-24-101550.png (236.1 KB) - added by zoff99 8 years ago.
device-2011-12-24-101651.png (214.7 KB) - added by zoff99 8 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 follow-up: Changed 8 years ago by sleske

I can (almost) replicate the problem (Linux, rev.4865).

My scale in navit.xml:

<osd enabled="yes" x="30" y="-100" w="150" h="40" 
font_size="200" type="scale" use_overlay="1"/>

I also get decreasing scale values when zooming out, just different values. The sequence starts as above, but the last values are:

100km
200km
200km (again, even though I zoomed out)
500km
200km
50km
2000m

I'll investigate this...

comment:2 Changed 8 years ago by sleske

  • Cc sebastian.leske@… added

comment:3 Changed 8 years ago by zoff99

also the scale value changes when you turn (but dont change the zoom level)

try turning a full circle on the same position, and watch the scale

Last edited 8 years ago by zoff99 (previous) (diff)

comment:4 in reply to: ↑ 1 Changed 8 years ago by me.yahoo.com/a/t8pxanggmzrce9fscf2wgwk_ozmtbyifgarr#f3b4e

Scale number not changing is not a problem. I have seen it too. But I noticed that the segment size is getting smaller.

The problem is with the last two values in your list. 50 km and 2000m are not correct.

Ciprian.

Replying to http://sleske.myopenid.com/:

I can (almost) replicate the problem (Linux, rev.4865).

My scale in navit.xml:

<osd enabled="yes" x="30" y="-100" w="150" h="40" 
font_size="200" type="scale" use_overlay="1"/>

I also get decreasing scale values when zooming out, just different values. The sequence starts as above, but the last values are:

100km
200km
200km (again, even though I zoomed out)
500km
200km
50km
2000m

I'll investigate this...

comment:5 Changed 8 years ago by zoff99

try to zoom out so that you can see almost the whole world. then stand still, and turn around a few times.

you will see huge changes in scale value. maybe its the projection? maybe x-axis does not have the same scale as the y-axis?

Changed 8 years ago by zoff99

Changed 8 years ago by zoff99

Changed 8 years ago by zoff99

Changed 8 years ago by zoff99

Changed 8 years ago by zoff99

Changed 8 years ago by zoff99

comment:6 Changed 7 years ago by sleske

try to zoom out so that you can see almost the whole world. then stand still, and turn around a few times.

you will see huge changes in scale value. maybe its the projection?

Yes, exactly. Navit uses the spherical Mercator projection, where the scale of the map varies by latitude (areas in high latitude, i.e. close to the poles, are shown bigger). The current implementation of the OSD scale apparently calculates the scale at one corner of the map, so the scale will vary depending on whether this corner shows a point close to the equator or not.

comment:7 Changed 7 years ago by sleske

I'm currently investigating this problem. The incorrect scales at low zoom levels are apparently caused by zooming out so far that the (projected) surface of the earth no longer covers the whole screen. The scale value is calculated for a line positioned in a screen corner (see my answer above); at low zoom levels this line may actually be outside the "world", which messes up the scale calculation.

Arguably, the real bug is that you can zoom (or pan) such that part of the screen is no longer covered by the map. I'll think about how to best fix this.

comment:8 Changed 7 years ago by sleske

This bug is partially fixed in rev. 5240: The map scale is now always calculated in map position corresponding to the center of the screen; before it was calculated in the map position corresponding to the position of the OSD scale on the screen.

Like this, the scale display no longer changes when the map rotates, and it also no longer depends on the position of the OSD scale on the screen. Also, just zooming out no longer produces funny scale values.

The remaining problem is that in high zoom levels you can still pan the map such that the screen center is outside the world map. This still causes funny scale values, because again the scale is calculated for a point outside the world map.

I'm planning on fixing this by restricting zooming out and panning such that the screen center is always inside the world map. It's rather silly anyway that you can completely pan the map off the screen, so that should kill two birds with one stone.

comment:9 Changed 7 years ago by sleske

  • Resolution set to fixed
  • Status changed from new to closed

Panning is now restricted such that the screen center is always covered by the map (rev. 5259).

Now the scale behaves sensibly :-).

Note: See TracTickets for help on using tickets.