Skip to content

Online OSM 3D buildings

Nutiteq edited this page Mar 5, 2014 · 8 revisions

HelloMap includes a layer Polygon3DOSMLayer which downloads OpenStreetMap buildings in 3D from a server. It is very basic 3D: it takes height value of buildings which have it set, and uses some average height for all the other buildings.

The popular OSM Simple 3D Building roof shape and color tags are also added to the same layer code. OSM does not have texture information, so this will be more distant future.

Application code:

        // OSM 3D building layer, visible from zoom 15
        Polygon3DStyle polygon3DStyle = Polygon3DStyle.builder().setColor(Color.BLACK | 0x40ffffff).build();
        StyleSet<Polygon3DStyle> polygon3DStyleSet = new StyleSet<Polygon3DStyle>(null);
        polygon3DStyleSet.setZoomStyle(15, polygon3DStyle);

        Polygon3DOSMLayer osm3dLayer = new Polygon3DOSMLayer(new EPSG3857(), 0.500f, 200, polygon3DStyleSet);
        mapView.getLayers().addLayer(osm3dLayer);

OSM in Coburg, Germany

OSM in San Francisco

OSM 3D Petronas towers

Clone this wiki locally