<map name="SDF demo">

    <options>
        <terrain>
            <lod_method>screen_space</lod_method>
        </terrain>
    </options>

    <tmselevation name="ReadyMap Elevation" open="true">
        <url>https://readymap.org/readymap/tiles/1.0.0/116/</url>
        <vdatum>egm96</vdatum>
    </tmselevation>
    
    <tmsimage name="Natural Earth" open="false">
        <url>https://readymap.org/readymap/tiles/1.0.0/181/</url>
    </tmsimage>

    <TMSImage name="ReadyMap 15m Imagery" opacity="0.3" open="false">
        <url>https://readymap.org/readymap/tiles/1.0.0/7/</url>
    </TMSImage>
    
    <FeatureImage name="OMT Features (shaded)" max_data_level="14" tile_size="512">
        <features>data:osm</features>
        <styles>
            <style type="text/css">
                landcover/farmland {
                    select: is('landcover', 'farmland');
                    fill: #9f806f;
                }
                landcover/ice {
                    select: is('landcover', 'ice');
                    fill: #afffff;
                }
                landcover/wood {
                    select: is('landcover', 'wood');
                    fill: #007f00,
                }
                landcover/rock {
                    select: is('landcover', 'rock');
                    fill: #6f6f6f;
                }
                landcover/grass {
                    select: is('landcover', 'grass');
                    fill: #00ff00;
                }
                landcover/wetland {
                    select: is('landcover', 'wetland');
                    fill: #9f9fff;
                }
                landcover/sand {
                    select: is('landcover', 'sand');
                    fill: #ffffef;
                }              
            </style>
            <script><![CDATA[
                function is(layer, clazz) {
                    return feature.properties.mvt_layer === layer && feature.properties['class'] === clazz;
                }
            ]]></script>
        </styles>
    </FeatureImage>
    
    <gdaldem name="Shaded relief" opacity="0.2" open="true">
    </gdaldem>
    
    <FeatureImage name="OMT Features (unshaded)" max_data_level="16" tile_size="512">
        <features>data:osm</features>
        <styles>
            <style type="text/css"><![CDATA[
                water {
                    select: feature.properties.mvt_layer === 'water';
                    fill: #30338f;
                }
                boundary {
                    select: feature.properties.mvt_layer === 'boundary' && feature.properties.admin_level === 2;
                    stroke: #ffff00;
                    stroke-width: 2px;
                    stroke-outline: #2f2f2f;
                    stroke-outline-width: 4px;
                }                    
                transportation {
                    select: feature.properties.mvt_layer === 'transportation' && feature.properties['class'] != 'ferry';
                    stroke: #efefef;
                    stroke-width: 1px;
                    stroke-outline: #4f4f4f;
                    stroke-outline-width: 2px;
                }                
                building {
                    select: feature.properties.mvt_layer === 'building';
                    fill: #ffdfbf;
                    stroke: #ff7f00;
                    stroke-width: 1px;
                }
            ]]></style>
        </styles>
    </FeatureImage>
       
    <TiledFeatureModel name="OMT 3D Buildings">
        <profile>spherical-mercator</profile>
        <features>data:osm</features>
        <additive>false</additive>
        <max_level>14</max_level>
        <styles>
            <style type="text/css"><![CDATA[
                building {
                    select: feature.properties.mvt_layer === 'building' && 'render_height' in feature.properties;
                    altitude-clamping: terrain;
                    extrusion-height: feature.properties.render_height;
                    extrusion-wall-shade: 0.5;
                    extrusion-wall-gradient: 0.5;
                }
            ]]></style>
        </styles>
    </TiledFeatureModel>
    

    <TiledFeatureModel name="OMT Labels">
        <features>data:osm</features>
        <filters>
            <script><![CDATA[ feature.properties.mvt_layer === 'place' && feature.properties.rank <= 2; ]]> </script>
        </filters>
        <additive>false</additive>
        <styles>
            <style type="text/css"><![CDATA[
                place {
                    select: 'capital' in feature.properties;
                    text: feature.properties.name_en;
                    text-align: center_center;
                    text-size: 30.0;
                    text-halo: #2f2f2f;
                    text-priority: 100.0-parseFloat(feature.properties.rank);
                    text-declutter: true;
                }
                capital {
                    select: !('capital' in feature.properties);
                    text: feature.properties.name_en;
                    text-align: center_center;
                    text-size: 22.0;
                    text-fill: #efefff;
                    text-halo: #2f2f2f;
                    text-priority: 100.0-parseFloat(feature.properties.rank); 
                    text-declutter: true;
                }
            ]]></style>            
        </styles>
    </TiledFeatureModel>
    
    <xyzfeatures name="data:osm">
        <url>https://readymap.org/readymap/mbtiles/osm-openmaptiles/{z}/{x}/{-y}.pbf</url>
        <profile>spherical-mercator</profile>
        <format>pbf</format>
        <min_level>0</min_level>
        <max_level>14</max_level>
    </xyzfeatures>
    
    <Viewpoints home="0" time="0">
        <viewpoint name="Tokyo">
            <heading>-1.94997e-06</heading>
            <pitch>-88.9992</pitch>
            <range>238445m</range>
            <long>139.3714749544664</long>
            <lat>35.62794037726271</lat>
            <height>140.499267118983</height>
            <srs>+proj=longlat +datum=WGS84 +no_defs</srs>
        </viewpoint>
        <viewpoint name="New Orleans">
            <heading>-1.99154e-09</heading>
            <pitch>-89</pitch>
            <range>458612m</range>
            <long>-90.54588070220815</long>
            <lat>30.06649820328758</lat>
            <height>-1.047214648686349</height>
            <srs>+proj=longlat +datum=WGS84 +no_defs</srs>
        </viewpoint>
        <viewpoint name="City of London">
            <heading>-0.838884</heading>
            <pitch>-37.3032</pitch>
            <range>2349.47m</range>
            <long>-0.07582713283597911</long>
            <lat>51.51117658901586</lat>
            <height>0.002267543226480484</height>
            <srs>+proj=longlat +datum=WGS84 +no_defs</srs>
        </viewpoint><viewpoint name="Geneva">
            <heading>1.35442e-07</heading>
            <pitch>-88.9975</pitch>
            <range>7066.05m</range>
            <long>6.137778140539923</long>
            <lat>46.20087766531671</lat>
            <height>379.9929252536967</height>
            <srs>+proj=longlat +datum=WGS84 +no_defs</srs>
        </viewpoint>

    </Viewpoints>
    
    <screen_space_layout>
        <sort_by_priority>true</sort_by_priority>
    </screen_space_layout>
</map>