Android Question OSM MapsForge Custom Render

Discussion in 'Android Questions' started by jamesnz, May 24, 2019.

  1. jamesnz

    jamesnz Active Member Licensed User

    Hi,
    I'm using OSMDroid 4.1 library from @warwound and the Mapsforge vector tilesource
    everything works fine until I set a render theme, like so
    Code:
    Dim InputStream1 As InputStream
    InputStream1 = 
    File.OpenInput( File.DirAssets    , "osmarender.xml")
    MapsForgeTileSource1.GetMapsForgeTileSourceOptions.SetRenderTheme(InputStream1)
    All I get is a blank grid, no error messages

    The render theme is
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <rendertheme xmlns=
    "http://mapsforge.org/renderTheme" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation=
    "http://mapsforge.org/renderTheme renderTheme.xsd" version="1">

        <!-- matches all ways with a 
    "highway=trunk" or a "highway=motorway" tag -->
        <rule e=
    "way" k="highway" v="trunk|motorway">
            <line stroke=
    "#FF9900" stroke-width="2.5" />
        </rule>

        <!-- matches all closed ways (first 
    node equals last node) with an "amenity=…" tag -->
        <rule e=
    "way" k="amenity" v="*" closed="yes">
            <area fill=
    "#DDEECC" stroke="#006699" stroke-width="0.3" />
        </rule>

        <!-- matches all nodes with a 
    "tourism=hotel" tag on zoom level 16 and above -->
        <rule e=
    "node" k="tourism" v="hotel" zoom-min="16">
            <symbol src=
    "file:/path/to/symbol/icon/hotel.png" />
            <caption k=
    "name" font-style="bold" font-size="10" fill="#4040ff" />
        </rule>
    </rendertheme>
    and comes from https://github.com/mapsforge/mapsforge/blob/master/docs/Rendertheme.md
    I see another thread some years ago having difficulties with a custom render https://www.b4x.com/android/forum/threads/openstreetmap-using-pbf.38596/page-3
    keen to know if it was resolved or anyone has been able to achieve this
     
  2. jamesnz

    jamesnz Active Member Licensed User

    here is the demo with a small map of monaco attached, uncomment line 60
     

    Attached Files:

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice