How to use GTK Champlain with local .osm tiles in my computer?
<p>I'm trying to make a GPS application in python, and I'm using GTK-Champlain as a widget using also Clutter. But right now I'm having problems trying to use a local tiles file I downloaded from OpenStreetMaps. Watch this:</p>

<pre><code> class LauncherGTK:

       def __init__(self):
        self.window = Gtk.Window()
        self.window.set_border_width(10)
        self.window.set_title("GPS")
        self.window.connect("destroy", Gtk.main_quit)

        vbox = Gtk.VBox(False, 10)

        embed = GtkChamplain.Embed()

        self.view = embed.get_view()
        self.view.set_reactive(True)
        self.view.connect('button-release-event', self.mouse_click_cb, self.view)

        projector = Champlain.MapProjection.MAP_PROJECTION_MERCATOR
        renderer = Champlain.ImageRenderer()

        map_new = Champlain.FileTileSource.new_full('1','Colombia','OSM','Champlain',10,15,256, projector, renderer)
        map_source = Champlain.FileTileSource.load_map_data(map_new,'Utilidades/map.osm')

        self.view.set_property('kinetic-mode', True)
        self.view.set_property('map-source', map_source)

        #...

        self.window.add(vbox)
        self.window.show_all()
</code></pre>

<p>When I'm trying to run the code, the next error appears:</p>

<blockquote>
  <blockquote>
    <p>Traceback (most recent call last):   File "GUI.py", line 125, in 
        LauncherGTK()   File "GUI.py", line 33, in <strong>init</strong>
        projector = Champlain.MapProjection.MAP_PROJECTION_MERCATOR  AttributeError: type object 'ChamplainMapProjection' has no attribute
    'MAP_PROJECTION_MERCATOR'      Press any key to continue . . .</p>
  </blockquote>
</blockquote>

<p>Someone has any idea of what I'm doing wrong?</p>

<p>PyGObject-based bindings <a href="https://lazka.github.io/pgi-docs/Champlain-0.12/enums.html" rel="nofollow">drop the enum name from the enum values themselves</a>. In your case, your code should be using <code>Champlain.MapProjection.MERCATOR</code>, not <code>Champlain.MapProjection.MAP_PROJECTION_MERCATOR</code>.</p>

python widget gtk openstreetmap