Skip to content

Show drawing on the map in the examples - #121

Merged
johnny-bit merged 29 commits into
nzjrs:masterfrom
johnny-bit:explore-drawable
Aug 29, 2026
Merged

Show drawing on the map in the examples#121
johnny-bit merged 29 commits into
nzjrs:masterfrom
johnny-bit:explore-drawable

Conversation

@johnny-bit

Copy link
Copy Markdown
Collaborator

Issues #67 and #71 expressed lack of docs/examples regarding drawing on map leading to problem assumptions. The DummyLayer in mapviewer.py example did nothing so didn't help there. I've turned it into DrawLayer to show drawing and worked on examples:

  • C mapviewer got the same DrawLayer overlay
  • Python right-click actually calls track_add (it was pass)
  • GPS double-click was eating the event (button masks) and auto-center jumped the map; both fixed
  • Tooltips: convert_screen_to_geographic returns the MapPoint GI gives us
  • Python Load Map URI was dropping OSD and the overlay; it keeps them now
  • C paints a cairo star if poi.png is missing
  • polygon.c and editable_track.c use new_degrees

GTK2 name. cr is the widget cairo_t already passed in.
Was pass, so the advertised custom-layer demo drew nothing.
point_new_degrees is the C symbol; GI exposes MapPoint.new_degrees.
Default 0,0 hid the DummyLayer circle until Home was clicked.
People were creating an ImageSurface to match the map. Do not.
Handler was pass; C demo already adds points on right-double.
Radians were unexplained magic. Also ship mapviewer.py in dist.
GI module has no __file__; demo died before DummyLayer ran.
Demo only loaded poi.png; nzjrs#71 asked for images built at runtime.
DummyLayer, track_add, image_add, gps_add were not documented as a set.
Out-arg is returned, not passed in. Tooltip still uses the C calling style.
GI takes x,y and returns MapPoint; passing a point was TypeError.
track_remove dropped it; later add_point wrote to an undrawn object.
2BUTTON_PRESS often has BUTTON1_MASK so gps_add never ran.
gps_add jumped the blob under the OSD crosshair.
Blue circle hid poi.png. Uncheck the box for the programmatic pixbuf path.
OSMF tile policy. Match C demo's "mapviewer.c".
Overlay Home is Timaru. Old C start 0,0 / Christchurch
would hide it.
C demo had no live cairo overlay. Match the Python
house at Home so both mapviewers show the same how-to.
@johnny-bit johnny-bit added this to the 1.2.2 milestone Aug 29, 2026
GCC turns same-angle sin+cos into sincos, which needs -lm on the
mapviewer link line. Rotate in cairo instead so the example does not
reference libm.
This was referenced Aug 29, 2026
This was linked to issues Aug 29, 2026
@johnny-bit
johnny-bit merged commit b78ec5a into nzjrs:master Aug 29, 2026
1 check passed
@johnny-bit
johnny-bit deleted the explore-drawable branch August 29, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drawing on top of map. drawable area cairo

1 participant