[mapguide-commits] r9620 - in sandbox/jng/mvt_alt: Doc/samples Doc/samples/ol2samples Doc/samples/ol2samples/mvt UnitTest/TestData/Samples/Sheboygan UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Sep 23 17:58:47 PDT 2019


Author: jng
Date: 2019-09-23 17:58:46 -0700 (Mon, 23 Sep 2019)
New Revision: 9620

Added:
   sandbox/jng/mvt_alt/Doc/samples/ol2samples/mvt/
   sandbox/jng/mvt_alt/Doc/samples/ol2samples/mvt/index.html
   sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition_CONTENT.xml
   sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition_HEADER.xml
Modified:
   sandbox/jng/mvt_alt/Doc/samples/samples.php
   sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition_CONTENT.xml
   sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/MgResourcePackageManifest.xml
Log:
Add MVT sample. Update Sheboygan dataset with example MVT tile set

Added: sandbox/jng/mvt_alt/Doc/samples/ol2samples/mvt/index.html
===================================================================
--- sandbox/jng/mvt_alt/Doc/samples/ol2samples/mvt/index.html	                        (rev 0)
+++ sandbox/jng/mvt_alt/Doc/samples/ol2samples/mvt/index.html	2019-09-24 00:58:46 UTC (rev 9620)
@@ -0,0 +1,102 @@
+<html>
+
+<head>
+    <title>Sheboygan map as Mapbox Vector Tiles</title>
+    <link rel="stylesheet" href="../assets/ol.css" />
+    <style type="text/css">
+        #error {
+            color: red;
+        }
+
+        #wrap {
+            width: 900;
+        }
+
+        #map {
+            width: 800;
+            height: 600;
+            float: left;
+            border: 1px solid black;
+        }
+
+        #main {
+            margin-top: 50px;
+            padding-top: 20px;
+        }
+    </style>
+    <script type="text/javascript" src="../assets/ol-debug.js"></script>
+    <script type="text/javascript" src="../assets/jquery-1.10.2.min.js"></script>
+    <script type="text/javascript">
+
+        //This sample is assumed to be hosted at http://servername/mapguide/ol2samples/xyz/index_ol.html
+        var mapAgentUrl = "../../mapagent/mapagent.fcgi";
+
+        $(document).ready(function () {
+            //NOTE: Your map definition can be in any coordinate system as long as it it transformable to LL84
+            //
+            //But the ol3 tile layer must remain as EPSG:3857
+
+            var map = new ol.Map({
+                layers: [
+                    new ol.layer.Tile({
+                        source: new ol.source.OSM({
+                            attributions: [
+                                new ol.Attribution({
+                                    html: 'Tiles © <a href="http://www.openstreetmap.org/">' +
+                                        'OpenStreetMap</a>'
+                                }),
+                                ol.source.OSM.ATTRIBUTION
+                            ],
+                            url: 'http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'
+                        })
+                    }),
+                    new ol.layer.VectorTile({
+                        declutter: true,
+                        source: new ol.source.VectorTile({
+                            format: new ol.format.MVT(),
+                            tileGrid: ol.tilegrid.createXYZ({ maxZoom: 19, tileSize: [4096, 4096] }),
+                            url: mapAgentUrl + "?OPERATION=GETTILEIMAGE&VERSION=1.2.0&CLIENTAGENT=OpenLayers&USERNAME=Anonymous&MAPDEFINITION=Library://Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition&BASEMAPLAYERGROUPNAME=Base+Layer+Group&TILECOL={y}&TILEROW={x}&SCALEINDEX={z}",
+                            projection: "EPSG:3857"
+                        })
+                    })/*,
+                    new ol.layer.Tile({
+                        source: new ol.source.TileDebug({
+                            projection: 'EPSG:3857',
+                            tileGrid: ol.tilegrid.createXYZ({ maxZoom: 19 }),
+                        })
+                    }),*/
+                ],
+                target: document.getElementById('map'),
+                view: new ol.View({
+                    center: ol.proj.transform([-87.7302542509315, 43.744459064634], 'EPSG:4326', 'EPSG:3857'),
+                    minZoom: 10,
+                    maxZoom: 19,
+                    zoom: 12
+                })
+            });
+        });
+
+    </script>
+</head>
+
+<body>
+    <div id="main">
+        <div class="container">
+            <div class="alert alert-info">
+                <p>This example demonstrates Mapbox Vector Tile support in MapGuide with <a
+                        href="http://openlayers.org/">OpenLayers</a>.</p>
+                <p>An OpenStreetMap layer is included as a backdrop for context</p>
+                <p>Sample not loading? <a href="../data/load.php">Check that the required resources have been loaded</a>
+                </p>
+            </div>
+            <div id="error">
+            </div>
+            <div id="wrap">
+                <div id="map">
+                </div>
+            </div>
+        </div>
+    </div>
+</body>
+
+</html>
\ No newline at end of file

Modified: sandbox/jng/mvt_alt/Doc/samples/samples.php
===================================================================
--- sandbox/jng/mvt_alt/Doc/samples/samples.php	2019-09-23 21:14:27 UTC (rev 9619)
+++ sandbox/jng/mvt_alt/Doc/samples/samples.php	2019-09-24 00:58:46 UTC (rev 9620)
@@ -127,6 +127,7 @@
                     <li><a href="ol2samples/xyz/index_ol.html">Sheboygan map as XYZ layer</a></li>
                     <li><a href="ol2samples/utfgrid/index.html">Sheboygan map as XYZ layer with UTFGrid interaction tiles</a></li>
                     <li><a href="ol2samples/wms/index.html">Sheboygan map as WMS layers</a></li>
+                    <li><a href="ol2samples/mvt/index.html">Sheboygan map as Mapbox Vector Tiles</a></li>
                 </ul>
                 <? } ?>
             <? } ?>

Added: sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition_CONTENT.xml
===================================================================
--- sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition_CONTENT.xml	                        (rev 0)
+++ sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition_CONTENT.xml	2019-09-24 00:58:46 UTC (rev 9620)
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TileSetDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="TileSetDefinition-3.0.0.xsd">
+  <TileStoreParameters>
+    <TileProvider>XYZ</TileProvider>
+    <Parameter>
+      <Name>TilePath</Name>
+      <Value>%MG_TILE_CACHE_PATH%</Value>
+    </Parameter>
+    <Parameter>
+      <Name>TileFormat</Name>
+      <Value>MVT</Value>
+    </Parameter>
+    <Parameter>
+      <Name>RenderOnly</Name>
+      <Value>false</Value>
+    </Parameter>
+  </TileStoreParameters>
+  <Extents>
+    <MinX>-87.797866013831964</MinX>
+    <MaxX>-87.664527771869246</MaxX>
+    <MinY>43.6868578621819</MinY>
+    <MaxY>43.8037962206133</MaxY>
+  </Extents>
+  <BaseMapLayerGroup>
+    <Name>Base Layer Group</Name>
+    <Visible>true</Visible>
+    <ShowInLegend>true</ShowInLegend>
+    <ExpandInLegend>true</ExpandInLegend>
+    <LegendLabel>Tiled Layers</LegendLabel>
+    <BaseMapLayer>
+      <Name>Roads</Name>
+      <ResourceId>Library://Samples/Sheboygan/Layers/Roads.LayerDefinition</ResourceId>
+      <Selectable>false</Selectable>
+      <ShowInLegend>true</ShowInLegend>
+      <LegendLabel>Roads</LegendLabel>
+      <ExpandInLegend>true</ExpandInLegend>
+    </BaseMapLayer>
+    <BaseMapLayer>
+      <Name>Districts</Name>
+      <ResourceId>Library://Samples/Sheboygan/Layers/Districts.LayerDefinition</ResourceId>
+      <Selectable>false</Selectable>
+      <ShowInLegend>true</ShowInLegend>
+      <LegendLabel>Districts</LegendLabel>
+      <ExpandInLegend>true</ExpandInLegend>
+    </BaseMapLayer>
+    <BaseMapLayer>
+      <Name>Buildings</Name>
+      <ResourceId>Library://Samples/Sheboygan/Layers/Buildings.LayerDefinition</ResourceId>
+      <Selectable>false</Selectable>
+      <ShowInLegend>true</ShowInLegend>
+      <LegendLabel>Buildings</LegendLabel>
+      <ExpandInLegend>true</ExpandInLegend>
+    </BaseMapLayer>
+    <BaseMapLayer>
+      <Name>Parcels</Name>
+      <ResourceId>Library://Samples/Sheboygan/Layers/Parcels.LayerDefinition</ResourceId>
+      <Selectable>true</Selectable>
+      <ShowInLegend>true</ShowInLegend>
+      <LegendLabel>Parcels</LegendLabel>
+      <ExpandInLegend>true</ExpandInLegend>
+    </BaseMapLayer>
+    <BaseMapLayer>
+      <Name>Islands</Name>
+      <ResourceId>Library://Samples/Sheboygan/Layers/Islands.LayerDefinition</ResourceId>
+      <Selectable>false</Selectable>
+      <ShowInLegend>true</ShowInLegend>
+      <LegendLabel>Islands</LegendLabel>
+      <ExpandInLegend>true</ExpandInLegend>
+    </BaseMapLayer>
+    <BaseMapLayer>
+      <Name>Hydrography</Name>
+      <ResourceId>Library://Samples/Sheboygan/Layers/Hydrography.LayerDefinition</ResourceId>
+      <Selectable>false</Selectable>
+      <ShowInLegend>true</ShowInLegend>
+      <LegendLabel>Hydrography</LegendLabel>
+      <ExpandInLegend>true</ExpandInLegend>
+    </BaseMapLayer>
+    <BaseMapLayer>
+      <Name>CityLimits</Name>
+      <ResourceId>Library://Samples/Sheboygan/Layers/CityLimits.LayerDefinition</ResourceId>
+      <Selectable>false</Selectable>
+      <ShowInLegend>true</ShowInLegend>
+      <LegendLabel>CityLimits</LegendLabel>
+      <ExpandInLegend>true</ExpandInLegend>
+    </BaseMapLayer>
+  </BaseMapLayerGroup>
+</TileSetDefinition>
\ No newline at end of file

Added: sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition_HEADER.xml
===================================================================
--- sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition_HEADER.xml	                        (rev 0)
+++ sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition_HEADER.xml	2019-09-24 00:58:46 UTC (rev 9620)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ResourceDocumentHeader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="ResourceDocumentHeader-1.0.0.xsd">
+  <Security>
+    <Inherited>true</Inherited>
+  </Security>
+</ResourceDocumentHeader>
\ No newline at end of file

Modified: sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition_CONTENT.xml
===================================================================
--- sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition_CONTENT.xml	2019-09-23 21:14:27 UTC (rev 9619)
+++ sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/Library/Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition_CONTENT.xml	2019-09-24 00:58:46 UTC (rev 9620)
@@ -12,7 +12,7 @@
     </Parameter>
     <Parameter>
       <Name>RenderOnly</Name>
-      <Value>true</Value>
+      <Value>false</Value>
     </Parameter>
   </TileStoreParameters>
   <Extents>

Modified: sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/MgResourcePackageManifest.xml
===================================================================
--- sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/MgResourcePackageManifest.xml	2019-09-23 21:14:27 UTC (rev 9619)
+++ sandbox/jng/mvt_alt/UnitTest/TestData/Samples/Sheboygan/MgResourcePackageManifest.xml	2019-09-24 00:58:46 UTC (rev 9620)
@@ -2365,7 +2365,7 @@
             <Parameters>
                 <Parameter>
                     <Name>RESOURCEID</Name>
-                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition</Value>
+                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganXYZ.TileSetDefinition</Value>
                 </Parameter>
             </Parameters>
         </Operation>
@@ -2375,17 +2375,17 @@
             <Parameters>
                 <Parameter>
                     <Name>CONTENT</Name>
-                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition_CONTENT.xml</Value>
+                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganXYZ.TileSetDefinition_CONTENT.xml</Value>
                     <ContentType>text/xml</ContentType>
                 </Parameter>
                 <Parameter>
                     <Name>HEADER</Name>
-                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition_HEADER.xml</Value>
+                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganXYZ.TileSetDefinition_HEADER.xml</Value>
                     <ContentType>text/xml</ContentType>
                 </Parameter>
                 <Parameter>
                     <Name>RESOURCEID</Name>
-                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition</Value>
+                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganXYZ.TileSetDefinition</Value>
                 </Parameter>
             </Parameters>
         </Operation>
@@ -2395,7 +2395,7 @@
             <Parameters>
                 <Parameter>
                     <Name>RESOURCEID</Name>
-                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganXYZ.TileSetDefinition</Value>
+                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganXYZRetina.TileSetDefinition</Value>
                 </Parameter>
             </Parameters>
         </Operation>
@@ -2405,17 +2405,17 @@
             <Parameters>
                 <Parameter>
                     <Name>CONTENT</Name>
-                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganXYZ.TileSetDefinition_CONTENT.xml</Value>
+                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganXYZRetina.TileSetDefinition_CONTENT.xml</Value>
                     <ContentType>text/xml</ContentType>
                 </Parameter>
                 <Parameter>
                     <Name>HEADER</Name>
-                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganXYZ.TileSetDefinition_HEADER.xml</Value>
+                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganXYZRetina.TileSetDefinition_HEADER.xml</Value>
                     <ContentType>text/xml</ContentType>
                 </Parameter>
                 <Parameter>
                     <Name>RESOURCEID</Name>
-                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganXYZ.TileSetDefinition</Value>
+                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganXYZRetina.TileSetDefinition</Value>
                 </Parameter>
             </Parameters>
         </Operation>
@@ -2425,7 +2425,7 @@
             <Parameters>
                 <Parameter>
                     <Name>RESOURCEID</Name>
-                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganXYZRetina.TileSetDefinition</Value>
+                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition</Value>
                 </Parameter>
             </Parameters>
         </Operation>
@@ -2435,19 +2435,49 @@
             <Parameters>
                 <Parameter>
                     <Name>CONTENT</Name>
-                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganXYZRetina.TileSetDefinition_CONTENT.xml</Value>
+                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition_CONTENT.xml</Value>
                     <ContentType>text/xml</ContentType>
                 </Parameter>
                 <Parameter>
                     <Name>HEADER</Name>
-                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganXYZRetina.TileSetDefinition_HEADER.xml</Value>
+                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition_HEADER.xml</Value>
                     <ContentType>text/xml</ContentType>
                 </Parameter>
                 <Parameter>
                     <Name>RESOURCEID</Name>
-                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganXYZRetina.TileSetDefinition</Value>
+                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganUTFGrid.TileSetDefinition</Value>
                 </Parameter>
             </Parameters>
         </Operation>
+        <Operation>
+            <Name>DELETERESOURCE</Name>
+            <Version>1.0.0</Version>
+            <Parameters>
+                <Parameter>
+                    <Name>RESOURCEID</Name>
+                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition</Value>
+                </Parameter>
+            </Parameters>
+        </Operation>
+        <Operation>
+            <Name>SETRESOURCE</Name>
+            <Version>1.0.0</Version>
+            <Parameters>
+                <Parameter>
+                    <Name>CONTENT</Name>
+                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition_CONTENT.xml</Value>
+                    <ContentType>text/xml</ContentType>
+                </Parameter>
+                <Parameter>
+                    <Name>HEADER</Name>
+                    <Value>Library/Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition_HEADER.xml</Value>
+                    <ContentType>text/xml</ContentType>
+                </Parameter>
+                <Parameter>
+                    <Name>RESOURCEID</Name>
+                    <Value>Library://Samples/Sheboygan/TileSets/SheboyganMVT.TileSetDefinition</Value>
+                </Parameter>
+            </Parameters>
+        </Operation>
     </Operations>
 </ResourcePackageManifest>
\ No newline at end of file



More information about the mapguide-commits mailing list