Re: Percision of champlain_view_get_coords_at



On Thu, Nov 25, 2010 at 7:06 PM, Quikee <quikee gmail com> wrote:
> Hi,
>
> I want to put a marker at a position on the map where user clicks for
> which I use champlain_view_get_coords_at to translate between screen
> coordinates and lat, lon of a marker. When doing this i noticed that
> the marker is placed correctly at the center of a map but when you
> click on either side of the map the marker is misplaced by a margin
> depending how far you are from the center. I think that there is a
> rounding error in the calculation somewhere.
>
> Another observation I have made is that champlain_view_get_coords_at
> has x and y parameters as uint. Maybe this should be changed to float
> - the same as in Clutter. Inside the method the x,y coordinates are
> then converted to float anyway. The same should apply to
> champlain_map_source_get_latitude and
> champlain_map_source_get_longitude and maybe some other functions that
> use "screen" x and y coordinates. I will try to sweep through the code
> and search for other such cases and provide patches for this if this
> changes make sense.
>
> regards, Tomaž
>

Hi,

I investigated more about this and found that get_coords_at is working
as expected. The problem is elsewhere - probably in marker placement
code or something like this. I don't know why but setting a marker (in
my scenario) at a specific coordinate is only accurate at the current
center of the map.

Regards, Tomaž


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]