<map name="ReadyMap.org">
    <options>
        <terrain progressive="false" morph_imagery="true" morph_terrain="true" skirt_ratio="0.01"/>
    </options>

    <TMSImage name="ReadyMap 15m Imagery" enabled="true">
        <url>https://readymap.org/readymap/tiles/1.0.0/7/</url>
    </TMSImage>

    <TMSElevation name="ReadyMap 90m Elevation" enabled="true">
        <url>https://readymap.org/readymap/tiles/1.0.0/116/</url>
        <vdatum>egm96</vdatum>
    </TMSElevation>

    <XYZFeatures name="data:osm-water">
        <url>https://readymap.org/readymap/mbtiles/osm-water/{z}/{x}/{-y}.pbf</url>
        <min_level>0</min_level>
        <max_level>12</max_level>
        <profile>spherical-mercator</profile>
        <format>pbf</format>
    </XYZFeatures>

    <TerrainConstraint name="Constraint: Water"
        features="data:osm-water"
        min_level="12"
        remove_interior="true" 
        open="true"/>
        
    <FeatureImage name="Water"
        features="data:osm-water"
        max_level="11"
        open="true">
        <styles>
            <style type="text/css">
                default {
                   fill: #ffbf6f;
                }
            </style>
        </styles>
    </FeatureImage>

    <XYZFeatures name="data:osm-roads">
        <url>https://readymap.org/readymap/mbtiles/osm/{z}/{x}/{-y}.pbf</url>
        <min_level>10</min_level>
        <max_level>14</max_level>
        <profile>spherical-mercator</profile>
        <format>pbf</format>
        <filters>
            <script language="javascript">
                <![CDATA[ ("highway" in feature.properties); ]]>
            </script>
        </filters>
    </XYZFeatures>
    
    <TerrainConstraint name="Constraint: Roads" 
        features="data:osm-roads"
        min_level="12"
        open="false"/>
        
    <FeatureImage name="Roads"
        features="data:osm-roads"
        min_level="12"
        open="false">
        <styles>
            <style type="text/css">
                default {
                   stroke: #ff0000;
                }
            </style>
        </styles>
    </FeatureImage>
    

    <TerrainConstraint name="Virginia cut-out" remove_interior="true" min_level="0">
        <comment>Simplify the constraint to 1% of the tile extent</comment>
        <OGRFeatures url="../data/virginia.shp">
            <filters>
                <simplify tolerance="1%"/>
            </filters>
        </OGRFeatures>
    </TerrainConstraint>

    <viewpoints>
        <viewpoint name="Grand Canyon">
            <heading>44.3337</heading>
            <pitch>-20.1218</pitch>
            <range>18503.6m</range>
            <long>-111.1835343396965</long>
            <lat>37.08967928224208</lat>
            <height>1172.659356549382</height>
            <srs>+proj=longlat +datum=WGS84 +no_defs</srs>
        </viewpoint>
        <viewpoint name="Nepal">
            <heading>-95.2569</heading>
            <pitch>-11.6282</pitch>
            <range>78258.3m</range>
            <long>86.95498284412729</long>
            <lat>27.98593558247672</lat>
            <height>6468.469810338691</height>
            <srs>+proj=longlat +datum=WGS84 +no_defs </srs>
        </viewpoint>
        <viewpoint name="Oahu">
            <heading>-3.55589e-06</heading>
            <pitch>-88.9993</pitch>
            <range>116321m</range>
            <long>-157.9617414418337</long>
            <lat>21.48730697505627</lat>
            <height>347.2645856048912</height>
            <srs>+proj=longlat +datum=WGS84 +no_defs </srs>
        </viewpoint>
        <viewpoint name="Sion">
            <heading>-2.76119e-06</heading>
            <pitch>-89.0028</pitch>
            <range>19865.8m</range>
            <long>7.290264823779213</long>
            <lat>46.2116331852606</lat>
            <height>528.5030263010412</height>
            <srs>+proj=longlat +datum=WGS84 +no_defs </srs>
        </viewpoint>
    </viewpoints>
</map>
