View Single Post
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#59
Originally Posted by rinigus View Post
Its possible to provide location for a click since we can calculate lat/lon for any pixel. However, due to the map object living in another thread, the communication would be via request and signal back:

onClickEvent: you ask for coordinate via async mechanism. Something like "map.getCoordinates(my_tag_as_string, qpoint)

you get reply via signal:

onCoordinatesRequest: point

Then you could implement adding of other widgets on the top which will allow you to interact. Tricky with panning/rotating/tilting though. Maybe the map programs would just remove widget on rotation,tilting and follow panning signals to move it around.
Yeah, that's what I've been thinking as well - hide all the elements you put on top when user starts interacting with the map itself (drag, pinch, rotation) or if the map widget animates (switching to a new center, induced zoom/rotation/pitch change).
Still might not be always doable, for example if centering is enabled & centering is animated. That way there would basically be no time as which to show the custom widgets as the Open GL widget would be animating & asynchronously changing to arbitrary coordinates all the time.

There could still be workaround but I'll likely just try to use the polyline/polygon/marker API where possible.


Originally Posted by rinigus View Post
I would prefer to keep out from GeoJSON parsing and figuring out what did you add there. Maybe widget-added POIs could get extra support, but let's see when we get there (later this week?).
That's a good point - it should be fine to just handle the GeoJSON internally as long as there is an API that can be used to add/remove objects from the map.

A rough outline what would enable modRana support it's current map overlay feature set:

* position indicator API
- show current position & the direction of travel
- turn position display on/off

This is how the modRana position indicator looks like:



* POI marker API
usecase: show POI on the map
- add/remove markers given as a lat/lon coordinate with a label
- each marker should likely have an unique id (app provided/returned by function call ?)
- would it be possible to make the marker label clickable ? (eq. a markerClicked signal returning the id of the marker if callback registration would be too complicated)
- in general the markers & labels should be drawn on top of any polylines or polygons if possible

BTW, this is how modRana created POI markers look at the moment:



* polyline API
usecases: show tracklogs, navigation routes, live logging trace
- add/remove polylines given as ordered lists of lat/lon coordinates
- again they should have unique IDs
- for drawing routes it would he handy to be able to supply also a second list of points that would be highlighted on top of the polyline (turn points)
- alternatively this could be emulated by drawing POIs without labels for the turn points, requiring a bit extra map object management code on the application side
- for the specific use case of drawing on map trace/live logging trace (eq. basically a live trail of last visited points) an appendable polyline would be nice, if possible, as removing/adding a new polyline every location update would likely not work very well
- or there could be a special built-in "trail" polyline that would automatically track current location and could be turned on/off - that way it should be possible to avoid the trail lagging behind the position indicator

ModRana currently draws routes like this:

The yellow points are turn points and the red/green circles are start/destination designators. Tracklogs & logging traces look similar, but don't have the turn points and start/destination designators.


* polygon API
use cases: show areas of interest, map area selection
- add/remove polygons given as ordered lists of lat/lon coordinates
- again they should have unique IDs
- color selection would likely by handy to tell polygons apart
- labels are likely not needed - one can just place a labeled marker inside the polygon

ModRana currently does not draw polygons on the map.

This is just a rough outline and feedback from other potential users of the widget is certainly welcome!


Originally Posted by rinigus View Post
I suspect that by the time we will get to adding tiles into the widget, noone will want to use them. Except checking traffic in google maps layer . Probably easier to keep the tiled versions around for old hardware (if we cannot make it work on J1 and similar) or other occasional use and focus on getting vector maps supported the best.
Definitely! I guess it would be different if there were some widely available aerial/satellite map layers as that's something one can't really render from map data. But that's unfortunately not the case (unless some of the emerging small-sat constellations help with that) and we should be basically able to draw anything else.
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)
 

The Following 3 Users Say Thank You to MartinK For This Useful Post: