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()
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 = HTTPTileManager( min_level=0, max_level=15, server='d.tiles.mapbox.com', url='/v3/mapbox.mapbox-streets/%(zoom)d/%(row)d/%(col)d.png') canvas = MappingCanvas(tile_cache=manager) nyc = Office(city="New York City", location=(40.7546423, -73.9748948)) austin = Office(city="Austin", location=(30.267651, -97.7424769)) cambridge = Office(city="Cambridge", location=(52.2098683, 0.0904441)) mumbai = Office(city="Mumbai", location=(19.1125289, 72.9081059)) singapore = Office(city="Singapore", location=(1.352083, 103.819836)) model = MultiMap(canvas=canvas, offices=[nyc, austin, cambridge, mumbai]) import enaml with enaml.imports(): from office_view import Main window = Main(model=model) window.show()
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()