示例#1
0
def main():
    tile_layer = MBTileManager(filename = 'map.mbtiles',
                               min_level = 2,
                               max_level = 4)

    tile_layer = HTTPTileManager(min_level=0, max_level=15,
                              server='d.tiles.mapbox.com',
                              url='/v3/mapbox.mapbox-simple/%(zoom)d/%(row)d/%(col)d.png')

    canvas = MappingCanvas(tile_cache = tile_layer)
    canvas.overlays.append(GeoJSONOverlay(component=canvas,
                                          geojs_filename='counties.geojs'))

    viewport = MappingViewport(component=canvas, zoom_level=2,
                               geoposition=(37.09024, -95.712891))
    viewport.tools.append(ViewportPanTool(viewport))

    model = SingleMap(canvas=canvas,
                      viewport=viewport)

    import enaml
    with enaml.imports():
        from simple_view import Map
    window = Map(model=model)
    window.show()
示例#2
0
def main():
    manager = MBTileManager(filename='map.mbtiles', min_level=0, max_level=3)

    canvas = MappingCanvas(tile_cache=manager)

    viewport = MappingViewport(component=canvas)
    viewport.tools.append(ViewportPanTool(viewport))

    model = Model(canvas=canvas, viewport=viewport)

    import enaml
    with enaml.imports():
        from simple_view import Map
    window = Map(model=model)
    window.show()
示例#3
0
def main():
    manager = MBTileManager(filename = 'example/map.mbtiles',
                              min_level = 0,
                              max_level = 3)

    canvas = MappingCanvas(tile_cache = manager)

    viewport = MappingViewport(component=canvas)
    viewport.tools.append(ViewportPanTool(viewport))

    model = Model(canvas=canvas, viewport=viewport)

    import enaml
    with enaml.imports():
        from simple_view import Map
    window = Map(model=model)
    window.show()
示例#4
0
def main():
    tiles_path = pth.join(HERE, "..", "data", "map.mbtiles")
    tile_layer = MBTileManager(filename=tiles_path,
                              min_level = 0,
                              max_level = 3)

    canvas = MappingCanvas(tile_cache=tile_layer)

    viewport = MappingViewport(component=canvas)
    viewport.tools.append(ViewportPanTool(viewport))

    model = Model(canvas=canvas, viewport=viewport)

    import enaml
    with enaml.imports():
        from simple_view import Map
    window = Map(model=model)
    window.show()
示例#5
0
def main():
    tile_layer = MBTileManager(filename=get_builtin_mbtiles_path(),
                               min_level=0,
                               max_level=3)

    canvas = MappingCanvas(tile_cache=tile_layer)

    viewport = MappingViewport(component=canvas)
    viewport.tools.append(ViewportPanTool(viewport))

    model = Model(canvas=canvas, viewport=viewport)

    with enaml.imports():
        from simple_view import Map

    app = QtApplication()
    window = Map(model=model)
    window.show()
    app.start()
示例#6
0
def main():
    manager = MBTileManager(filename='map.mbtiles', min_level=0, max_level=3)

    canvas = MappingCanvas(tile_cache=manager)

    canvas.add(
        GeoMarker(filename='enthought-marker.png',
                  geoposition=(40.7546423, -73.9748948)))

    viewport = MappingViewport(component=canvas)
    viewport.tools.append(ViewportPanTool(viewport))

    model = Model(canvas=canvas, viewport=viewport)

    import enaml
    with enaml.imports():
        from simple_view import Map
    window = Map(model=model)
    window.show()
def main():
    manager = MBTileManager(filename = 'map.mbtiles',
                              min_level = 0,
                              max_level = 3)

    canvas = MappingCanvas(tile_cache = manager)

    canvas.add(GeoMarker(filename='enthought-marker.png',
                         geoposition = (40.7546423, -73.9748948)))

    viewport = MappingViewport(component=canvas)
    viewport.tools.append(ViewportPanTool(viewport))

    model = Model(canvas=canvas, viewport=viewport)

    import enaml
    with enaml.imports():
        from simple_view import Map
    window = Map(model=model)
    window.show()
示例#8
0
def main():
    tile_layer = MBTileManager(filename = 'map.mbtiles',
                               min_level = 2,
                               max_level = 4)

    canvas = MappingCanvas(tile_cache = tile_layer)
    canvas.overlays.append(GeoJSONOverlay(component=canvas,
                                          geojs_filename='states.geojs'))

    viewport = MappingViewport(component=canvas, zoom_level=3,
                               geoposition=(37.09024, -95.712891))
    viewport.tools.append(ViewportPanTool(viewport))

    model = SingleMap(canvas=canvas,
                      viewport=viewport)

    import enaml
    with enaml.imports():
        from simple_view import Map
    window = Map(model=model)
    window.show()
示例#9
0
def main():
    tile_layer = MBTileManager(filename = 'map.mbtiles',
                               min_level = 2,
                               max_level = 4)

    canvas = MappingCanvas(tile_cache = tile_layer)
    canvas.overlays.append(GeoJSONOverlay(component=canvas,
                                          geojs_filename='world.geojs'))

    viewport = MappingViewport(component=canvas, zoom_level=2,
                               geoposition=(37.09024, -95.712891))
    viewport.tools.append(ViewportPanTool(viewport))

    model = SingleMap(canvas=canvas,
                      viewport=viewport)

    import enaml
    with enaml.imports():
        from simple_view import Map
    window = Map(model=model)
    window.show()
def main():
    tile_layer = MBTileManager(filename=get_builtin_mbtiles_path(),
                               min_level=0, max_level=3)

    canvas = MappingCanvas(tile_cache=tile_layer)

    marker_path = pth.join(HERE, 'enthought-marker.png')
    canvas.add(GeoMarker(filename=marker_path,
                         geoposition=(40.7546423, -73.9748948)))

    viewport = MappingViewport(component=canvas)
    viewport.tools.append(ViewportPanTool(viewport))

    model = Model(canvas=canvas, viewport=viewport)

    with enaml.imports():
        from simple_view import Map

    app = QtApplication()
    window = Map(model=model)
    window.show()
    app.start()
示例#11
0
def main():
    tile_layer = MBTileManager(filename=get_builtin_mbtiles_path(),
                               min_level=2, max_level=4)

    canvas = MappingCanvas(tile_cache=tile_layer)
    counties_path = pth.join(HERE, 'counties.geojs')
    canvas.overlays.append(GeoJSONOverlay(component=canvas,
                                          geojs_filename=counties_path))

    viewport = MappingViewport(component=canvas, zoom_level=2,
                               geoposition=(37.09024, -95.712891))
    viewport.tools.append(ViewportPanTool(viewport))

    model = SingleMap(canvas=canvas,
                      viewport=viewport)

    with enaml.imports():
        from simple_view import Map

    app = QtApplication()
    window = Map(model=model)
    window.show()
    app.start()