how to overlay the map with shapes..

60 views
Skip to first unread message

Herms

unread,
Aug 13, 2011, 12:20:03 PM8/13/11
to osm-gps-map
i am exploring the capabilities of the osm-gps-map, and so far, i've
been very impressed. now i am finding a way to draw something on top
of the map [actually, i was trying to implement a selection
rectangle]. can you help me with this? how do i create a layer on top
of the map, and allow me to draw a shape? thanks

--herms.
Message has been deleted

Serge Noiraud

unread,
Jun 26, 2012, 3:50:38 AM6/26/12
to osm-g...@googlegroups.com, Eero af Heurlin
Hi Eero,

I already done this in python.
If you can read it, you can found the examples in src/plugins/lib/maps
This is in the module selectionlayer.py
another example is in lifewaylayer.py

you can see this on : http://www.gramps-project.org/wiki/index.php?title=Geography

the svn is : https://gramps.svn.sourceforge.net/svnroot/gramps/trunk


Le 26/06/2012 00:15, Eero af Heurlin a écrit :
rectangle]. can you help me with this? how do i create a layer on top
of the map, and allow me to draw a shape? thanks

Resurrecting this thread since I need to do something similar but different. For the selection rectangle I guess you can make a layer that is normal GTK canvas on top and then draw on it, I had some old code but it turned out it was PyQT not GTK...

Anyway on to my problem, I need to draw circle markers of a given area (so they must scale with the zoom), now I know I could do this by removing and regenerating the pixbuffs for each zoom event (I should be able to calculate [I think...] the real world radius->pixel radius based on the viewport data) but that's more than a little wasteful, is there a better way ?

/Eero



-- 
Serge Noiraud

Linux, c'est mieux surtout Debian. Firefox, c'est mieux. LibreOffice, c'est mieux.
Toute la vérité, rien que la vérité.

Développeur projet gramps : http://www.gramps-project.org/

Eero af Heurlin

unread,
Jun 26, 2012, 4:00:18 AM6/26/12
to Serge Noiraud, osm-g...@googlegroups.com
On 2012.06.26 10:50 , Serge Noiraud wrote:
> Hi Eero,
>
> I already done this in python.

super cool.

> If you can read it, you can found the examples in src/plugins/lib/maps
> This is in the module selectionlayer.py
> another example is in lifewaylayer.py
>

These look very understable, I'll try these myself later.
heh, just about exactly what I'm looking for :) The project itself looks
interesting too.
Thanks.

/Eero

Eero af Heurlin

unread,
Jun 26, 2012, 6:04:43 PM6/26/12
to osm-g...@googlegroups.com


On Tuesday, 26 June 2012 10:50:38 UTC+3, S.Noiraud wrote:
Hi Eero,

I already done this in python.
If you can read it, you can found the examples in src/plugins/lib/maps

The example was indeed good in understanding the layer handling (thanks for that), however radius in degrees would no work for me (up north the ellipse gets seriously warped), so I did a bit of tweaking: https://github.com/HelsinkiHacklab/FuzzyWaypointRace/blob/master/pocclient/pocclient.py#L88
 
/Eero

Reply all
Reply to author
Forward
0 new messages