[OpenLayers-Commits] r10945 - in sandbox/august/trunk/playground: . ags others

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Fri Dec 3 02:01:54 EST 2010


Author: augusttown
Date: 2010-12-02 23:01:54 -0800 (Thu, 02 Dec 2010)
New Revision: 10945

Added:
   sandbox/august/trunk/playground/ags/ags-tiled-customized-tilingschema.html
   sandbox/august/trunk/playground/ags/ags-tiled-customized-tilingschema.js
   sandbox/august/trunk/playground/others/
   sandbox/august/trunk/playground/others/export-svg.html
   sandbox/august/trunk/playground/others/export-svg.svg
Modified:
   sandbox/august/trunk/playground/index.html
   sandbox/august/trunk/playground/style.css
Log:
add/update some samples, index.html, style.css.

Added: sandbox/august/trunk/playground/ags/ags-tiled-customized-tilingschema.html
===================================================================
--- sandbox/august/trunk/playground/ags/ags-tiled-customized-tilingschema.html	                        (rev 0)
+++ sandbox/august/trunk/playground/ags/ags-tiled-customized-tilingschema.html	2010-12-03 07:01:54 UTC (rev 10945)
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>OpenLayers (GeoWebCache) WMTS Example</title>
+		<link rel="stylesheet" href="../../theme/default/style.css" type="text/css"/>
+		<link rel="stylesheet" href="../style.css" type="text/css" />
+		<script type="text/javascript" src="../../lib/Firebug/firebug.js"></script>
+		<script type="text/javascript" src="../../lib/OpenLayers.js"></script>
+
+		<script type="text/javascript" src="ags-tiled-customized-tilingschema.js"></script>
+	</head>
+	<body onload="init();">
+		<div id="map" class="bigmap"></div>  
+	</body>
+</html>

Added: sandbox/august/trunk/playground/ags/ags-tiled-customized-tilingschema.js
===================================================================
--- sandbox/august/trunk/playground/ags/ags-tiled-customized-tilingschema.js	                        (rev 0)
+++ sandbox/august/trunk/playground/ags/ags-tiled-customized-tilingschema.js	2010-12-03 07:01:54 UTC (rev 10945)
@@ -0,0 +1,56 @@
+var map = null;
+
+function init() {	        
+	
+	OpenLayers.ProxyHost= function(url) {
+		return "/openlayers-trunk/ApacheProxyServlet?url=" + url;
+    };
+
+    // Portland
+    /*
+    var lon = -122.838493; 
+	var lat = 45.432976;
+	var zoom = 9;
+	*/
+	// Portland in EPSG:2913
+    var lon = 7647130.2520;
+	var lat = 669087.0178;
+	var zoom = 3;
+        
+	var options = 	{
+		//panMethod: null, // set 'panMethod' to null to disable animated panning
+		controls: [       		
+		    new OpenLayers.Control.LayerSwitcher(),
+		    new OpenLayers.Control.PanZoomBar(),
+       		new OpenLayers.Control.Navigation(),       		
+       		new OpenLayers.Control.MousePosition()
+       	],
+       	projection: "EPSG:2913",
+        units: "ft",
+        /* the maxResolution is the most important and tricky parameter for WMTS layer with customer tiling schema to display correctly. I calculate the maxResolution based on the maxExtent:
+        (7891749.867238 - 7388277.645016) ft / 1024 pixel, assume the map is define as 1024x512
+        */
+        maxResolution: 2048000/(96*12),       
+        numZoomLevels: 11,	// default allowed zoom levels is 16 so change it to 20
+        maxExtent: new OpenLayers.Bounds(7241196.8729, 128656.7859, 9265592.9584, 981999.6828)        
+   	};	
+	
+	map = new OpenLayers.Map('map', options);			
+
+	var url = "http://sazabiii/ArcGIS/rest/services/playground/portland2913tiled/MapServer/tile/";	
+	var base_layer = new OpenLayers.Layer.AgsTiled( 
+		"ags-tiled-customized-tilingschema", 
+		url, 
+		{					
+			tileSize: new OpenLayers.Size(256, 256),
+			tileFormat:'png',
+			tileOrigin: new OpenLayers.LonLat(7241196.8729, 981999.6828),
+			tileFullExtent: new OpenLayers.Bounds(7241196.8729, 128656.7859, 9265592.9584, 981999.6828), 	
+			isBaseLayer: true,
+			buffer: 0,
+			singleTile: false					 					
+		}
+	);	
+	map.addLayer(base_layer);
+	map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);		
+}

Modified: sandbox/august/trunk/playground/index.html
===================================================================
--- sandbox/august/trunk/playground/index.html	2010-12-03 06:58:49 UTC (rev 10944)
+++ sandbox/august/trunk/playground/index.html	2010-12-03 07:01:54 UTC (rev 10945)
@@ -7,6 +7,7 @@
     <body>    	 
 		<table border="0" cellspacing="0" style="margin-top:0px;margin-left:0px;">
 			<tr><td><a href="ags/agsfeatureaccess.html"><b>ags/agsfeatureaccess.html</b></a></td></tr>
+			<tr><td><a href="ags/ags-tiled-customized-tilingschema.html"><b>ags/ags-tiled-customized-tilingschema.html</b></a></td></tr>
 			<tr><td><a href="gwc/gwc-client.html"><b>gwc/gwc-client</b></a></td></tr>
 			<tr><td><a href="outofbox/csw.html"><b>outofbox/csw</b></a></td></tr>
 			<tr><td><a href="others/export-svg.html"><b>others/export-svg.html</b></a></td></tr>
@@ -18,11 +19,21 @@
 			<tr><td><a href="wfst/wfst-with-lock.html"><b>wfst/wfst-with-lock.html</b></a></td></tr>
 			<tr><td><a href="outofbox/wms-v13.html"><b>outofbox/wms-v13</b></a></td></tr>
 			<tr><td><a href="wmts/wmts.html"><b>wmts/wmts.html</b></a></td></tr>
-			<tr><td><a href="wmts/wmts-geowebcache.html"><b>wmts/wmts-geowebcache.html</b></a></td></tr>
+			<tr><td><a href="wmts/wmts-geowebcache-epsg3857.html"><b>wmts/wmts-geowebcache-epsg3857.html</b></a></td></tr>
+			<tr><td><a href="wmts/wmts-geowebcache-wgs84.html"><b>wmts/wmts-geowebcache-wgs84.html</b></a></td></tr>
+			<tr><td><a href="wmts/wmts-geowebcache-customized-tilingschema.html"><b>wmts/wmts-geowebcache-customized-tilingschema.html</b></a></td></tr>
+			<tr><td><a href="wmts/jsapi-wmts-wgs84.html"><b>wmts/jsapi-wmts-wgs84.html</b></a></td></tr>
+			<tr><td><a href="wmts/jsapi-wmts-epsg3857.html"><b>wmts/jsapi-wmts-epsg3857.html</b></a></td></tr>
+			<tr><td><a href="wmts/jsapi-wmts-customized-tilingschema.html"><b>wmts/jsapi-wmts-customized-tilingschema.html</b></a></td></tr>
+			<tr><td><a href="wmts/wmts2tileinfo.html"><b>wmts/wmts2tileinfo.html</b></a></td></tr>
 			<tr><td><a href="../examples/wmts.html"><b>examples/wmts.html</b></a></td></tr>
 			<tr><td><a href="outofbox/wmts.html"><b>outofbox/wmts.html</b></a></td></tr>
 			<tr><td><a href="outofbox/wmts-capabilities.html"><b>outofbox/wmts-capabilities.html</b></a></td></tr>
 			<tr><td><a href="wps/wps.html"><b>wps/wps.html</b></a></td></tr>
+			<tr><td><a href="wps/wpscommon.html"><b>wps/wpscommon.html</b></a></td></tr>
+			<tr><td><a href="wps/wps-zooapi.html"><b>wps/wps-zooapi.html</b></a></td></tr>
+			<tr><td><a href="wps/wps-process.html"><b>wps/wps-process.html</b></a></td></tr>
+			<tr><td><a href="webmap.wms/webmap-wms-reqrecorder.html"><b>webmap.wms/webmap-wms-reqrecorder.html</b></a></td></tr>
 			<tr><td><a href="outofbox/zoomify.html"><b>outofbox/zoomify</b></a></td></tr>																
 		</table>
     </body>

Added: sandbox/august/trunk/playground/others/export-svg.html
===================================================================
--- sandbox/august/trunk/playground/others/export-svg.html	                        (rev 0)
+++ sandbox/august/trunk/playground/others/export-svg.html	2010-12-03 07:01:54 UTC (rev 10945)
@@ -0,0 +1,74 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>export-svg</title>
+	<link rel="stylesheet" href="../../theme/default/style.css"
+		type="text/css" />
+	<link rel="stylesheet" href="../style.css" type="text/css" />
+	<script src="../../lib/Firebug/firebug.js"></script>
+	<script src="../../lib/OpenLayers.js"></script>
+
+	<script type="text/javascript">
+        var lon = 5;
+        var lat = 40;
+        var zoom = 5;
+        var map, layer;
+
+        function init(){
+        	map = new OpenLayers.Map( 'map' );
+            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
+                    "http://labs.metacarta.com/wms/vmap0",
+                    {layers: 'basic'} );
+            map.addLayer(layer);
+            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
+            var featurecollection = {
+            	"type": "FeatureCollection", 
+              	"features": [
+                	{"geometry": {
+                    	"type": "GeometryCollection", 
+                    	"geometries": [
+	                        {
+	                            "type": "LineString", 
+	                            "coordinates": 
+	                                [[11.0878902207, 45.1602390564], 
+	                                [15.01953125, 48.1298828125]]
+	                        }, 
+	                        {
+	                            "type": "Polygon", 
+	                            "coordinates": 
+	                                [[[11.0878902207, 45.1602390564], 
+	                                  [14.931640625, 40.9228515625], 
+	                                  [0.8251953125, 41.0986328125], 
+	                                  [7.63671875, 48.96484375], 
+	                                  [11.0878902207, 45.1602390564]]]
+	                        },
+	                        {
+	                            "type":"Point", 
+	                            "coordinates":[15.87646484375, 44.1748046875]
+	                        }
+                    	]
+                	}, 
+                	"type": "Feature", 
+                	"properties": {}}
+              	]
+            };
+           	var geojson_format = new OpenLayers.Format.GeoJSON();
+          	var vector_layer = new OpenLayers.Layer.Vector(); 
+           	map.addLayer(vector_layer);
+           	vector_layer.addFeatures(geojson_format.read(featurecollection));
+
+			// export svg xml
+			var xmlFormat = new OpenLayers.Format.XML();
+			var svg;
+			if(vector_layer.renderer) {
+				svg = xmlFormat.write(vector_layer.renderer.rendererRoot); 
+				OpenLayers.Console.debug(svg);
+				// you can copy and paste the <svg> xml output in console as a .svg file and view that in broswer or any svg viewer
+			}
+        }
+    </script>
+</head>
+<body onload="init()">
+<h1 id="title">GeoJSON Example</h1>
+<div id="map" class="smallmap"></div>
+</body>
+</html>

Added: sandbox/august/trunk/playground/others/export-svg.svg
===================================================================
--- sandbox/august/trunk/playground/others/export-svg.svg	                        (rev 0)
+++ sandbox/august/trunk/playground/others/export-svg.svg	2010-12-03 07:01:54 UTC (rev 10945)
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg" id="OpenLayers.Layer.Vector_144_svgRoot" width="512" height="256" viewBox="0 0 512 256">
+	<g id="OpenLayers.Layer.Vector_144_root" style="visibility: visible;" transform="">
+		<g id="OpenLayers.Layer.Vector_144_vroot">
+			<polyline id="OpenLayers.Geometry.LineString_152" points="394.533,10.5759 484,-57" fill="none" stroke="#ee9900" stroke-opacity="1" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="none" pointer-events="visiblePainted" cursor="inherit"/>
+			<path id="OpenLayers.Geometry.Polygon_160" d=" M 394.5333241332622,10.57589347214207 482,107 161,103 316,-76 394.5333241332622,10.57589347214207 z" fill-rule="evenodd" fill="#ee9900" fill-opacity="0.4" stroke="#ee9900" stroke-opacity="1" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="none" pointer-events="visiblePainted" cursor="inherit"/>
+			<circle id="OpenLayers.Geometry.Point_161" cx="503.5" cy="33" r="6" fill="#ee9900" fill-opacity="0.4" stroke="#ee9900" stroke-opacity="1" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="none" pointer-events="visiblePainted" cursor="inherit"/>
+		</g>
+		<g id="OpenLayers.Layer.Vector_144_troot"/>
+	</g>
+</svg>

Modified: sandbox/august/trunk/playground/style.css
===================================================================
--- sandbox/august/trunk/playground/style.css	2010-12-03 06:58:49 UTC (rev 10944)
+++ sandbox/august/trunk/playground/style.css	2010-12-03 07:01:54 UTC (rev 10945)
@@ -77,6 +77,11 @@
     height: 256px;
     border: 1px solid #ccc;
 }
+.mediummap {
+    width: 512px;
+    height: 512px;
+    border: 1px solid #ccc;
+}
 .bigmap {
     width: 1024px;
     height: 512px;



More information about the Commits mailing list