Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mapbuilder/examples/ExampleList.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
Enhanced Map Viewer
</a>
</li>

<li>
<a href="../wmts/index.html"
title="WMTS map demo">
WMTS Map Viewer
</a>
</li>
</ul>
<h2>Complex</h2>
<ul>
Expand Down
57 changes: 57 additions & 0 deletions mapbuilder/examples/data/context/OwcBasemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<OWSContext version="0.0.13" id="ows-context-tie"
xmlns="http://www.opengis.net/context"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ows="http://www.opengis.net/ows">

<General>
<Window width="600" height="300"/>
<ows:BoundingBox crs="EPSG:3857">
<!-- general extent for Google Web Mercator (EPSG:3857), this is restricted by property tileFullExtent -->
<ows:LowerCorner>-20037508.34 -20037508.34</ows:LowerCorner>
<ows:UpperCorner>20037508.34 20037508.34</ows:UpperCorner>
</ows:BoundingBox>
<Title>Basemap.at</Title>
<Abstract>Basemap.at covering Austria</Abstract>
</General>

<ResourceList>
<ows:BaseLayer queryable="0" hidden="0" id="bmaporthofoto30cm">
<Server service="OGC:WMTS" version="1.0.0" title="OGC:WMTS">
<OnlineResource xlink:type="simple" xlink:href="https://maps.wien.gv.at/basemap/bmaporthofoto30cm/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg"/>
</Server>
<Name>bmaporthofoto30cm</Name>
<Title>Geoland Basemap colored aerial image of basemap.at</Title>
<SRS>EPSG:3857</SRS>
<FormatList>
<Format>image/jpeg</Format>
</FormatList>
</ows:BaseLayer>

<Layer queryable="0" hidden="0" id="bmapoverlay">
<Server service="OGC:WMTS" version="1.0.0" title="OGC:WMTS">
<OnlineResource xlink:type="simple" xlink:href="https://maps.wien.gv.at/basemap/bmapoverlay/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png"/>
</Server>
<Name>bmapoverlay</Name>
<Title>transparent labels overlay of basemap.at</Title>
<SRS>EPSG:3857</SRS>
<BoundingBox SRS="EPSG:3857" minx="977650" miny="5838030" maxx="1913530" maxy="6281290"/>
<FormatList>
<Format>image/png</Format>
</FormatList>
</Layer>

<Layer queryable="0" hidden="1" id="overview">
<Server service="OGC:WMTS" version="1.0.0" title="OGC:WMTS">
<OnlineResource xlink:type="simple" xlink:href="https://maps.wien.gv.at/basemap/geolandbasemap/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png"/>
</Server>
<Name>geolandbasemap</Name>
<Title>colored basemap of Austria of basemap.at</Title>
<SRS>EPSG:3857</SRS>
<BoundingBox SRS="EPSG:3857" minx="977650" miny="5838030" maxx="1913530" maxy="6281290"/>
<FormatList>
<Format>image/png</Format>
</FormatList>
</Layer>
</ResourceList>
</OWSContext>
5 changes: 4 additions & 1 deletion mapbuilder/examples/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ <h2 onclick="javascript: history.go(-1)" style="color:black;cursor:pointer;">Bac
<h3>Basic map viewers with different functionality</h3>
<dl>
<dt><a href="simple/index.html" title="simple map demo">Simple Map Viewer</a></dt>
<dd>A very simple example showing a non-interactive map on a webpage</dd>
<dd>A very simple example showing a non-interactive map on a webpage.</dd>

<dt><a href="interactive/index.html" title="interactive map demo">Interactive Map Viewer</a></dt>
<dd>A simple example showing a map an interactive map with pan and zoom buttons. This is a good example to use as a basis for your own application.</dd>

<dt><a href="mapViewer/index.html" title="enhanced map demo">Enhanced Map Viewer</a></dt>
<dd>A more complex example showing different widgets combined with an interactive map. This is a good example to use as a basis for more complex map viewers.</dd>

<dt><a href="wmts/index.html" title="WMTS map demo">WMTS Map Viewer</a></dt>
<dd>Another very simple example showing a WMTS map on a webpage.</dd>
</dl>
<h3>Examples of the more complex functionality of Mapbuilder</h3>
<dl>
Expand Down
34 changes: 34 additions & 0 deletions mapbuilder/examples/wmts/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<MapbuilderConfig version="0.2.1" id="simpleTemplate" xmlns="http://mapbuilder.sourceforge.net/mapbuilder" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mapbuilder.sourceforge.net/mapbuilder ../../lib/schemas/config.xsd">
<models>
<OwsContext id="mainMap">
<defaultModelUrl>../data/context/OwcBasemap.xml</defaultModelUrl>
<widgets>
<MapPaneOL id="mainMapWidget">
<htmlTagId>mainMapPane</htmlTagId>
<resolutions>1222.9924525644,611.4962262807999,305.74811314039994,152.87405657047998,76.43702828523999,38.21851414248,19.109257071295996,9.554628535647998,4.777314267823999,2.3886571339119995,1.1943285669559998,0.5971642834779999,0.29858214174039993,0.14929107086936</resolutions>
<transitionEffect>true</transitionEffect>
<displayOutsideMaxExtent>false</displayOutsideMaxExtent>
<requestEncoding>REST</requestEncoding>
<matrixSet>google3857</matrixSet>
<style>normal</style>
<tileFullExtent>977650,5838030,1913530,6281290</tileFullExtent>
<serverResolutions>156543.03392811998,78271.51696419998,39135.758481959994,19567.879241008,9783.939620504,4891.969810252,2445.984905126,1222.9924525644,611.4962262807999,305.74811314039994,152.87405657047998,76.43702828523999,38.21851414248,19.109257071295996,9.554628535647998,4.777314267823999,2.3886571339119995,1.1943285669559998,0.5971642834779999,0.29858214174039993,0.14929107086936,0.07464553542435169</serverResolutions>
</MapPaneOL>
<PanZoomBar id="panZoomBar"/>
<OverviewMap id="overviewMap">
<layers>
<layerName>overview</layerName>
</layers>
</OverviewMap>
</widgets>
</OwsContext>
</models>
<widgets>
<ExampleList id="exampleList"><!-- this is the widget that draws the example menu -->
<scriptFile>../ExampleList.js</scriptFile>
<stylesheet>../ExampleList.xsl</stylesheet>
</ExampleList>
</widgets>
<skinDir>../../lib/skin/default</skinDir>
</MapbuilderConfig>
74 changes: 74 additions & 0 deletions mapbuilder/examples/wmts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Mapbuilder WMTS Map Viewer</title>
<link rel='StyleSheet' type='text/css' href='../../lib/skin/default/demoStyles.css'/>
<script>
// URL of Mapbuilder configuration file.
var mbConfigUrl='config.xml';
</script>
<!-- This points to the core mapbuilder library, replaces this with MapbuilderCompressed.js when you want to use the compressed version -->
<script type="text/javascript" src="../../lib/Mapbuilder.js"></script>
</head>
<!-- This onload event starts mapbuilder -->
<body onload="mbDoLoad()" >
<!--

############################# cut here 1 #############################

-->
<div id="all">
<div id="header"><!-- The header of the page -->
<h1><a href="http://communitymapbuilder.org">MapBuilder</a> <!--Version--><!--VersionEnd--> WMTS Map Viewer</h1>
<!-- The version tag will be inserted into the comment tags above
during the build process. -->
</div><!-- /header -->
<div id="middle"><!-- The center piece of the page with left menubar and right mainbody -->
<div id="exampleList"></div><!-- this is the container where the menubar will be drawn -->
<div id="mainbody"><!-- right side of the middle div, is also divided into two areas -->
<div class="left">
<h3>Explanation</h3>
In it's almost most basic configuration, Mapbuilder can also be used to simply put a WMTS map
plus an overview map in a web page.<br/>
The configuration for this page consists of a single
model (a OWS Context document) and three widgets (MapPaneOL for the map, PanZoomBar for OpenLayers controls and OverviewMap).
See the <a href="../interactive/index.html">Interactive Map Viewer</a> to for an example of an interactive map,
as well as some of the more common ways to work with MapBuilder.
<h3>Overview Map</h3>
<div id="overviewMap"></div><!-- This is the container where the overview map will be drawn -->
</div><!-- /left -->
<div class="right">
<!--

############################# end cut 1 #############################

-->
<div id="mainMapPane"><!-- This is the container where the map will be drawn -->
<noscript>
this page requires Javascript to be enabled
</noscript>
</div><!-- /mainMapPane -->
<!--

############################# cut here 2 #############################

-->
</div><!-- /right -->
</div><!-- /mainbody -->
</div><!-- /middle -->
<div id="footer"><!-- The footer of the page -->
<div class="right">
<a href="http://communitymapbuilder.org/" title="powered by community mapbuilder"><img src="../../lib/skin/default/images/Icon.gif"/></a>
<a href="https://www.osgeo.org/" title="member of OSgeo"><img src="../../lib/skin/default/images/Osgeo.png"/></a>
</div><!-- /right -->
</div><!-- /footer -->
</div><!-- all -->
<!--

############################# end cut 2 #############################

-->
</body>
</html>
67 changes: 65 additions & 2 deletions mapbuilder/lib/schemas/config.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<xs:sequence>
<xs:element name="htmlTagId" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>the ID of the HTML element in the web page where this widget's ouput should be placed. Optional, if present, this value will be used instead of the widget's ID attribute.</xs:documentation>
<xs:documentation>the ID of the HTML element in the web page where this widget's output should be placed. Optional, if present, this value will be used instead of the widget's ID attribute.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="outputNodeId" type="xs:string" minOccurs="0">
Expand Down Expand Up @@ -947,6 +947,61 @@
<xs:documentation>Should layers be reprojected? Mainly used in combination with google map layers. Default is false.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="requestEncoding" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>For WMTS layers: Request encoding. Can be "REST" or "KVP". Default is "KVP".</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="matrixSet" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>For WMTS layers: One of the advertised matrix set identifiers. Must be provided.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="style" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>For WMTS layers: One of the advertised layer styles. Must be provided.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="tileOrigin" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>Sets the restricted extent of the map. This is not the initial extent when the map is loaded (that's the bounding box from the context) or the maxExtent, but it is restriction of the maximum extent that the user can navigate around in. For WMTS layers: The full extent of the tile set. If not supplied, the layer's maxExtent property will be used. Note that this may also be a part (subset) of the full extent of the servers' tile set, causing a restriction to the given bounds.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="tileFullExtent" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>For WMTS layers: The full extent of the tile set. If not supplied, the layer's maxExtent property will be used.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="formatSuffix" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>For WMTS layers: For REST request encoding, an image format suffix must be included in the request. If not provided, the suffix will be derived from the format property.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="matrixIds" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>For WMTS layers: A list of tile matrix identifiers. If not provided, the matrix identifiers will be assumed to be integers corresponding to the map zoom level. If a list of strings is provided, each item should be the matrix identifier that corresponds to the map zoom level. Additionally, a list of objects can be provided. Each object should describe the matrix as presented in the WMTS capabilities.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="dimensions" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>For WMTS layers: For RESTful request encoding, extra dimensions may be specified. Items in this list should be property names in the params object. Values of extra dimensions will be determined from the corresponding values in the params object.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="params" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>For WMTS layers: Extra parameters to include in tile requests. For KVP value of property requestEncoding, these properties will be encoded in the request query string. For REST value of property requestEncoding, these properties will become part of the request path, with order determined by the dimensions list.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="zoomOffset" type="xs:int" minOccurs="0">
<xs:annotation>
<xs:documentation>If your cache has more levels than you want to provide access to with this layer, supply a zoomOffset. This zoom offset is added to the current map zoom level to determine the level for a requested tile. For example, if you supply a zoomOffset of 3, when the map is at the zoom 0, tiles will be requested from level 3 of your cache. Default is 0 (assumes cache level and map zoom are equivalent). Additionally, if this layer is to be used as an overlay and the cache has fewer zoom levels than the base layer, you can supply a negative zoomOffset. For example, if a map zoom level of 1 corresponds to your cache level zero, you would supply a -1 zoomOffset (and set the maxResolution of the layer appropriately). The zoomOffset value has no effect if complete matrix definitions (including scaleDenominator) are supplied in the matrixIds property. Defaults to 0 (no zoom offset).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="serverResolutions" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>A list of all resolutions available on the server. Only set this property if the map resolutions differ from the server. This property serves two purposes. (a) serverResolutions can include resolutions that the server supports and that you don't want to provide with this layer; you can also look at property zoomOffset, which is an alternative to serverResolutions for that specific purpose. (b) The map can work with resolutions that aren't supported by the server, i.e. that aren't in serverResolutions. When the map is displayed in such a resolution data for the closest server-supported resolution is loaded and the layer div is stretched as necessary.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
Expand Down Expand Up @@ -976,7 +1031,15 @@
<xs:documentation>A widget to read and write the map scale value</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="mb:AbstractWidgetBaseXSLType"/>
<xs:extension base="mb:AbstractWidgetBaseXSLType">
<xs:sequence>
<xs:element name="mapScaleLabel" type="xs:string" minOccurs="0">
<xs:annotation>
<xs:documentation>The label of the map scale; optional. Default is: scale 1:</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ModelStatusType">
Expand Down
1 change: 1 addition & 0 deletions mapbuilder/lib/util/proj4js/defs/EPSG3857.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Proj4js.defs["EPSG:3857"] = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs";
Loading