Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 647 Bytes

basic-functions.md

File metadata and controls

17 lines (14 loc) · 647 Bytes

Position, rotation, and zoom

Use the MapzenMap instance returned by getMapAsync(OnMapReadyCallback) to set the position, rotation, and zoom level.

MapFragment mapFragment = (MapFragment) getSupportFragmentManager().findFragmentById(R.id.map_fragment);
mapFragment.getMapAsync(new OnMapReadyCallback() {
    @Override public void onMapReady(MapzenMap map) {
        map.setPosition(new LngLat(-73.9903, 40.74433));
        map.setRotation(0f);
        map.setZoom(17f);
        map.setTilt(0f);
    }
});

For advanced map controls (animation, etc.) you can subclass MapzenMap and access the Tangram MapController directly.