Re: Markers and Popovers



On Thu, May 22, 2014 at 12:45:32PM -0300, Damián Nohales wrote:
4) What is the positioning algorithm?


Yeah, I have the same question. We should always have access to the lat and lon
right? So positioning should just be a matter of getting the x and y through
the ChamplainView and creating a rect?

The thing is, mostly all markers are positioned using the
ChamplainMarker::set_location method, then I saw the Rishi POIRenderer
class and he use raw positions (using ClutterActor::set_position
method), relative to tile position.

See https://github.com/rishirajsinghjhelumi/GNOME-Maps/blob/poi-testing/src/poiRenderer.js

Maybe this case, POIRenderer should set position by hand or using a
callback to set the marker position (by default this callback calls
set_location), I called this callback positioningAlgorithm, an
optional construction parameter. How to deal with this?


Why is it important that the ChamplainMarker has correct latitude and
longitude properties? The markers from the poiRenderer will have the correct
placement on the map since they are placed relative to the tiles.

And if we do need lat/lon badly, we can get them from the place location
property, right?
We could override the latitude/longitude properties to take them from the
place poperty.

Or if we want we could probably convert the x/y to lat/lon in the
_init of the marker class with a vfunc_set_position that sets the
latitude/longitude properties of Champlain.Marker using the mapView's
view property.

/Jonas 


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