Skip to content

Online OSM 3D buildings

Nutiteq edited this page Jun 21, 2013 · 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.

Update 21.06.13: all the popular OSM Simple 3D Building roof shape and color tags are 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 with Petronas Towers

Clone this wiki locally