Show drawing on the map in the examples - #121
Merged
Merged
Conversation
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.
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
linked to
issues
Aug 29, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues #67 and #71 expressed lack of docs/examples regarding drawing on map leading to problem assumptions. The
DummyLayerinmapviewer.pyexample did nothing so didn't help there. I've turned it intoDrawLayerto show drawing and worked on examples:mapviewergot the sameDrawLayeroverlaytrack_add(it waspass)convert_screen_to_geographicreturns theMapPointGI gives uspoi.pngis missingpolygon.candeditable_track.cusenew_degrees