Merge the excellent documentation work done during foss4g into trunk. Many

thanks to all the contributors who helped put this together. 
I'm not exactly sure of what's going to happen with this, but for now,
at http://openlayers.org/dev/doc/examples.html you can see links to all the
examples *with descriptions*. Hooray!


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5362 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-12-08 14:21:53 +00:00
parent ebf611c932
commit 7da6a3540e
90 changed files with 4188 additions and 1294 deletions

74
doc/Jugl.js Normal file
View File

@@ -0,0 +1,74 @@
/**
* Jugl.js -- JavaScript Template Attribute Language
* This code is not yet licensed for release or distribution.
*
* Copyright 2007 Tim Schaub
*/
/**
* Contains portions of OpenLayers.js -- OpenLayers Map Viewer Library
*
* Copyright 2005-2006 MetaCarta, Inc., released under a modified BSD license.
* Please see http://svn.openlayers.org/trunk/openlayers/repository-license.txt
* for the full text of the license.
*/
/**
* Contains portions of Prototype.js:
*
* Prototype JavaScript framework, version 1.4.0
* (c) 2005 Sam Stephenson <sam@conio.net>
*
* Prototype is freely distributable under the terms of an MIT-style license.
* For details, see the Prototype web site: http://prototype.conio.net/
*/
(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl={singleFile:true};window[uri]=Jugl;})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var singleFile=(typeof window[uri]=="object"&&window[uri].singleFile);var Jugl={prefix:"jugl",namespaceURI:"http://namespace.jugl.org/",scriptName:(!singleFile)?"lib/Jugl.js":"Jugl.js",getScriptLocation:function(){var scriptLocation="";var scriptName=Jugl.scriptName;var scripts=document.getElementsByTagName('script');for(var i=0;i<scripts.length;i++){var src=scripts[i].getAttribute('src');if(src){var index=src.lastIndexOf(scriptName);if((index>-1)&&(index+scriptName.length==src.length)){scriptLocation=src.slice(0,-scriptName.length);break;}}}
return scriptLocation;}};if(!singleFile){var jsfiles=new Array("Jugl/Util.js","Jugl/Class.js","Jugl/Async.js","Jugl/Node.js","Jugl/Attribute.js","Jugl/Console.js","Jugl/Template.js");var allScriptTags="";var host=Jugl.getScriptLocation()+"lib/";for(var i=0;i<jsfiles.length;i++){if(/MSIE/.test(navigator.userAgent)||/Safari/.test(navigator.userAgent)){var currentScriptTag="<script src='"+host+jsfiles[i]+"'></script>";allScriptTags+=currentScriptTag;}else{var s=document.createElement("script");s.src=host+jsfiles[i];var h=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;h.appendChild(s);}}
if(allScriptTags){document.write(allScriptTags);}}
window[uri]=Jugl;})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Class=function(){var Class=function(){this.initialize.apply(this,arguments);}
var extended={};var parent;for(var i=0;i<arguments.length;++i){if(typeof arguments[i]=="function"){parent=arguments[i].prototype;}else{parent=arguments[i];}
Jugl.Util.extend(extended,parent);}
Class.prototype=extended;return Class;};})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Util=new Object();Jugl.Util.extend=function(destination,source){for(property in source){destination[property]=source[property];}
return destination;};Jugl.Util.indexOf=function(array,obj){for(var i=0;i<array.length;i++){if(array[i]==obj)return i;}
return-1;};Jugl.Util.bind=function(method,object){var args=[];for(var i=2;i<arguments.length;++i){args.push(arguments[i]);}
return function(){for(var i=0;i<arguments.length;++i){args.push(arguments[i]);}
return method.apply(object,args);}};})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){}};(function(){if(window.console){var scripts=document.getElementsByTagName("script");for(var i=0;i<scripts.length;++i){if(scripts[i].src.indexOf("firebug.js")!=-1){Jugl.Util.extend(Jugl.Console,console);break;}}}})();})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Attribute=Jugl.Class({node:null,element:null,type:null,nodeValue:null,template:null,initialize:function(node,element,type){this.node=node;this.element=element;this.type=type;this.nodeValue=element.nodeValue;this.nodeName=element.nodeName;this.template=node.template;},splitAttributeValue:function(value){value=(value!=null)?value:this.nodeValue;var matches=this.template.regExes.trimSpace.exec(value);var items;if(matches.length==3){items=[matches[1],matches[2]];}
return items;},getAttributeValues:function(){var trimmed=this.nodeValue.replace(/[\t\n]/g,"").replace(/;\s*$/,"");var tabbed=trimmed.replace(/;;/g,"\t");var newlined=tabbed.split(";").join("\n");return newlined.replace(/\t/g,";").split(/\n/g);},removeSelf:function(){this.node.removeAttributeNode(this);},process:function(){return this.processAttribute[this.type].apply(this,[]);},evalInScope:function(str){var expression="with(this.node.scope){"+str+"}";return eval(expression);},processAttribute:{"define":function(){var values=this.getAttributeValues();var pair;for(var i=0;i<values.length;++i){pair=this.splitAttributeValue(values[i]);this.node.scope[pair[0]]=this.evalInScope(pair[1]);}
this.removeSelf();return true;},"condition":function(){var proceed;try{proceed=!!(this.evalInScope(this.nodeValue));}catch(err){var message=err.name+": "+err.message+"\n";message+="attribute: "+this.nodeName;Jugl.Console.error(message);Jugl.Console.dirxml(this.node.element);Jugl.Console.log(this.node.scope);}
this.removeSelf();if(!proceed){this.node.removeSelf();}
return proceed;},"repeat":function(){var pair=this.splitAttributeValue();var key=pair[0];var list=this.evalInScope(pair[1]);this.removeSelf();if(!(list instanceof Array)){var items=new Array();for(var p in list){items.push(p);}
list=items;}
var node;var previousSibling=this.node;var length=list.length;for(var i=0;i<length;++i){node=this.node.clone();node.scope[key]=list[i];node.scope.repeat[key]={index:i,number:i+1,even:!(i%2),odd:!!(i%2),start:(i==0),end:(i==length-1),length:length};previousSibling.insertAfter(node);node.process();previousSibling=node;}
this.node.removeSelf();return false;},"content":function(){var str;try{str=this.evalInScope(this.nodeValue);}catch(err){Jugl.Console.error("Failed to eval in node scope: "+
this.nodeValue);throw err;}
this.removeSelf();var child=new Jugl.Node(this.template,document.createTextNode(str));this.node.removeChildNodes();this.node.appendChild(child);return true;},"replace":function(){var str;try{str=this.evalInScope(this.nodeValue);}catch(err){Jugl.Console.error("Failed to eval in node scope: "+
this.nodeValue);throw err;}
this.removeSelf();var replacement=new Jugl.Node(this.template,document.createTextNode(str));this.node.insertBefore(replacement);this.node.removeSelf();return true;},"attributes":function(){var values=this.getAttributeValues();var pair,name,value;for(var i=0;i<values.length;++i){pair=this.splitAttributeValue(values[i]);name=pair[0];value=this.evalInScope(pair[1]);if(value!==false){this.node.setAttribute(name,value);}}
this.removeSelf();return true;},"omit-tag":function(){var omit;try{omit=((this.nodeValue=="")||!!(this.evalInScope(this.nodeValue)));}catch(err){Jugl.Console.error("Failed to eval in node scope: "+
this.nodeValue);throw err;}
this.removeSelf();if(omit){var children=this.node.getChildNodes();var child;for(var i=0;i<children.length;++i){this.node.insertBefore(children[i]);}
this.node.removeSelf();}}},CLASS_NAME:"Jugl.Attribute"});})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Template=Jugl.Class({element:null,usingNS:false,xhtmlns:"http://www.w3.org/1999/xhtml",xmldom:null,regExes:null,loaded:false,loading:false,initialize:function(element,options){if(typeof(element)=="string"){element=document.getElementById(element);}
if(element){this.element=element;this.loaded=true;}
this.regExes={trimSpace:(/^\s*(\w+)\s+(.*?)\s*$/)};if(window.ActiveXObject){this.xmldom=new ActiveXObject("Microsoft.XMLDOM");}},process:function(context,clone,toString){if(this.element.getAttributeNodeNS){if(this.element.getAttributeNodeNS(Jugl.xhtmlns,Jugl.prefix)){this.usingNS=true;}}
var node=new Jugl.Node(this,this.element);if(clone){node=node.clone();}
if(context){node.scope=context;}
try{node.process();}catch(err){Jugl.Console.error("Failed to process "+
this.element+" node");}
var data;if(toString){if(node.element.innerHTML){data=node.element.innerHTML;}else{if(this.xmldom){data=node.element.xml;}else{var serializer=new XMLSerializer();data=serializer.serializeToString(node.element);}}}else{data=node.element;}
return data;},load:function(url){this.loading=true;var setElement=function(request){var doc=request.responseXML;this.element=doc.documentElement;this.loading=false;this.loaded=true;this.onLoad();}
Jugl.Async.loadUrl(url,setElement,this);},onLoad:function(){},CLASS_NAME:"Jugl.Template"});})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Node=Jugl.Class({template:null,element:null,scope:null,initialize:function(template,element){this.template=template;this.element=element;this.scope=new Object();this.scope.repeat=new Object();},clone:function(){var element=this.element.cloneNode(true);var node=new Jugl.Node(this.template,element);Jugl.Util.extend(node.scope,this.scope);return node;},getAttribute:function(localName){var element;if(this.element.nodeType==1){if(this.template.usingNS){element=this.element.getAttributeNodeNS(Jugl.namespaceURI,localName);}else{element=this.element.getAttributeNode(Jugl.prefix+":"+
localName);}
if(element&&!element.specified){element=false;}}
var attribute;if(element){attribute=new Jugl.Attribute(this,element,localName);}else{attribute=element;}
return attribute;},setAttribute:function(name,value){this.element.setAttribute(name,value);},removeAttributeNode:function(attribute){this.element.removeAttributeNode(attribute.element);},getChildNodes:function(){var children=[];var node,scope;for(var i=0;i<this.element.childNodes.length;++i){node=new Jugl.Node(this.template,this.element.childNodes[i]);node.scope=Jugl.Util.extend({},this.scope);children.push(node);}
return children;},removeChildNodes:function(){while(this.element.hasChildNodes()){this.element.removeChild(this.element.firstChild);}},removeChild:function(node){this.element.removeChild(node.element);return node;},removeSelf:function(){this.element.parentNode.removeChild(this.element);},appendChild:function(node){this.element.appendChild(node.element);},insertAfter:function(node){var parent=this.element.parentNode;var sibling=this.element.nextSibling;if(sibling){parent.insertBefore(node.element,sibling);}else{parent.appendChild(node.element);}},insertBefore:function(node){var parent=this.element.parentNode;parent.insertBefore(node.element,this.element);},process:function(){var attribute;var keepProcessing=true;var series=["define","condition","repeat"];for(var i=0;i<series.length;++i){attribute=this.getAttribute(series[i]);if(attribute){try{keepProcessing=attribute.process();}catch(err){Jugl.Console.error("Failed to process "+
series[i]+" attribute");throw err;}
if(!keepProcessing){return;}}}
var content=this.getAttribute("content");if(content){try{content.process();}catch(err){Jugl.Console.error("Failed to process content attribute");throw err;}}else{var replace=this.getAttribute("replace");if(replace){try{replace.process();}catch(err){Jugl.Console.error("Failed to process replace attribute");throw err;}}}
var attributes=this.getAttribute("attributes");if(attributes){try{attributes.process();}catch(err){Jugl.Console.error("Failed to process attributes attribute");throw err;}}
if(!content&&!replace){this.processChildNodes();}
var omit=this.getAttribute("omit-tag");if(omit){try{omit.process();}catch(err){Jugl.Console.error("Failed to process omit-tag attribute");throw err;}}},processChildNodes:function(){var element,child;var children=this.getChildNodes();for(var i=0;i<children.length;++i){try{children[i].process();}catch(err){Jugl.Console.error("Failed to process "+
children[i]+" node");throw err;}}},CLASS_NAME:"Jugl.Node"});})();(function(){var uri="http://jugl.tschaub.net/trunk/lib/Jugl.js";var Jugl=window[uri];Jugl.Async={loadTemplate:function(url,onComplete,caller){var createTemplate=function(request){var doc=request.responseXML;var template=new Jugl.Template(doc.documentElement);var complete=Jugl.Util.bind(onComplete,caller);complete(template);}
Jugl.Async.loadUrl(url,createTemplate);},loadUrl:function(url,onComplete,caller){var complete=(caller)?Jugl.Util.bind(onComplete,caller):onComplete;var request=Jugl.Async.createXMLHttpRequest();request.open("GET",url);request.onreadystatechange=function(){if(request.readyState==4){complete(request);}}
request.send(null);},createXMLHttpRequest:function(){if(typeof XMLHttpRequest!="undefined"){return new XMLHttpRequest();}else if(typeof ActiveXObject!="undefined"){return new ActiveXObject("Microsoft.XMLHTTP");}else{throw new Error("XMLHttpRequest not supported");}}};})();

55
doc/examples.html Normal file
View File

@@ -0,0 +1,55 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html>
<head>
<title>OL Docs</title>
<style type="text/css">
html, body {margin: 0;padding: 0.5em 1em;font: 0.9em Verdana, Arial, sans serif;}
.exampleContainer{width:90%; padding:5px; border-bottom:1px solid grey; }
.exampleNumber{display:inline; font-weight:bold; color:#333; }
.exampleTitle{display:inline; font-weight:bold; color:#333; }
.exampleName{display:inline; color:#333; }
.exampleDescription{color:#222; padding:3px; font-size:1.2em; }
.exampleClasses{font-size:.7em; color:grey;display:none;}
</style>
<script type="text/javascript" src="./Jugl.js"></script>
<script type="text/javascript" src="examples.js"></script>
<script type="text/javascript">
// import
var uri = "http://jugl.tschaub.net/trunk/lib/Jugl.js";
var Jugl = window[uri];
// this part does the actual template processing
window.onload = function() {
var template = new Jugl.Template("basic");
template.process();
}
</script>
</head>
<body>
<div id="basic" style="margin: 0 auto;">
<div class="exampleContainer" jugl:repeat="example examples">
<div class="exampleNumber" jugl:content="repeat.example.number">
Example # goes here
</div>
<div class="exampleTitle" jugl:content="example.title">
Title goes here
</div>
<div class="exampleName">
<a jugl:content="example.example"
jugl:attributes="href example.link">
Example Filename and Link
</a>
</div>
<div class="exampleDescription">
<span jugl:content="example.shortdesc">
Short Description goes here
</span>
</div>
<div class="exampleClasses" >
<span jugl:content="example.classes">
Related Classes go here
</span>
</div>
</div>
</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers GML Parser</title>
<style type="text/css">
#map {
width: 800px;
@@ -21,7 +22,7 @@
}
html += "</ul>"
}
document.body.innerHTML = html;
document.getElementById('output').innerHTML = html;
}
function load() {
OpenLayers.loadURL("gml/owls.xml", "", null, parseData);
@@ -29,5 +30,19 @@
</script>
</head>
<body onload="load()">
<h1 id="title">GML Parser Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate the operation of the GML parser.
</p>
<div id="output"></div>
<div id="docs">
This script reads data from a GML file and parses out the coordinates, appending them to a HTML string with markup tags.
This markup is dumped to an element in the page.
</div>
</body>
</html>

View File

@@ -1,12 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<title>OpenLayers KML Parser Example</title>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
function parseData(req) {
@@ -21,7 +15,7 @@
}
html += "</ul>"
}
document.body.innerHTML = html;
document.getElementById('output').innerHTML = html;
}
function load() {
OpenLayers.loadURL("kml/lines.kml", "", null, parseData);
@@ -29,5 +23,19 @@
</script>
</head>
<body onload="load()">
<h1 id="title">KML Parser Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate the operation of the KML parser.
</p>
<div id="output"></div>
<div id="docs">
This script reads data from a KML file and parses out the coordinates, appending them to a HTML string with markup tags.
This markup is dumped to an element in the page.
</div>
</body>
</html>

View File

@@ -1,9 +1,11 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Accessible Example</title>
<style type="text/css">
#map {
width: 512px;
height: 256px;
height: 512px;
border: 1px solid #eee;
}
table {
@@ -25,6 +27,10 @@
a:hover {
text-decoration: underline;
}
a.api {
font-size:1em;
text-decoration:underline;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
@@ -45,7 +51,15 @@
</script>
</head>
<body onload="init()">
<h3>OpenLayers Example</h3>
<h1 id="title">Accessible Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Demonstrate how to use the KeyboardDefaults option parameter for layer types.
</p>
<table>
<tbody>
<tr>
@@ -95,6 +109,8 @@
</tr>
</tbody>
</table>
<div id="docs">
<p>Navigate the map in one of three ways:
<ul>
<li>Click on the named links to zoom and pan</li>
@@ -120,5 +136,8 @@
</li>
</ul>
</p>
This is an example of using alternate methods to control panning and zooming. This approach uses map.pan() and map.zoom(). You'll note that to pan, additional math is necessary along with map.size() in order to set the distance to pan.
</div>
</body>
</html>

View File

@@ -1,5 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Attribution Example</title>
<style type="text/css">
#map {
width: 512px;
@@ -30,7 +32,21 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">Attribution Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the attribution layer option on a number of layer types.
</p>
<div id="map"></div>
<div id="docs">
This is an example of how to add an attribution block to the OpenLayers window. In order to use an
attribution block, an attribution parameter must be set in each layer that requires attribution. In
addition, an attribution control must be added to the map.
</div>
</body>
</html>

View File

@@ -1,12 +1,18 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Base Layers Example</title>
<style type="text/css">
#map {
width: 100%;
width: 512;
height: 512px;
border: 1px solid black;
background-color: blue;
}
#controls
{
width: 512px;
}
</style>
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
@@ -72,9 +78,23 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers With WMS, Google, VE Example</h1>
<h1 id="title">Base Layers Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
This example shows the use base layers from multiple commercial map image providers.
</p>
<div id="controls">
<div id="map"></div>
<div style="background-color:green" onclick="add()"> click to add a marker to the map</div>
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
</div>
<div id="docs">
</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Boxes Example</title>
<style type="text/css">
#map {
width: 512px;
@@ -41,7 +42,17 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">Boxes Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Demonstrate marker and box type annotations on a map.
</p>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,9 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Buffer Example</title>
<style type="text/css">
#map {
width: 694px;
height: 464px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -34,8 +35,20 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Buffer Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
This example shows the use of the buffer layer option for any layer that inherits from OpenLayers.Layer.Grid.
</p>
<div id="map"></div>
<p>Use the buffer property to control how many tiles are included
outside the visible map area. Default is 2</p>
<div id="docs">
Use the buffer property to control how many tiles are included
outside the visible map area. Default is 2.
</div>
</body>
</html>

View File

@@ -1,5 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Click Event Example</title>
<style type="text/css">
#map {
width: 512px;
@@ -17,7 +19,7 @@
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://t1.hypercube.telascience.org/tiles/landsat7",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"});
jpl_wms.setVisibility(false);
@@ -35,7 +37,17 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">Click Event Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
This example shows the use of the register and getLonLatFromViewPortPx functions to trigger events on mouse click.
</p>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Map Controls Example</title>
<style type="text/css">
#map {
width: 512px;
@@ -13,7 +14,7 @@
function init(){
map = new OpenLayers.Map('map', { controls: [] });
map.addControl(new OpenLayers.Control.PanZoomBar({zoomWorldIcon:true}));
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.MouseToolbar());
map.addControl(new OpenLayers.Control.LayerSwitcher({'ascending':false}));
map.addControl(new OpenLayers.Control.Permalink());
@@ -25,11 +26,9 @@
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0",
{layers: 'basic'} );
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://t1.hypercube.telascience.org/tiles/landsat7",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"});
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
@@ -45,8 +44,18 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">Map Controls Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Attach zooming, panning, layer switcher, overview map, and permalink map controls to an OpenLayers window.
</p>
<a style="float:right" href="" id="permalink">Permalink</a>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,9 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Custom Control Point Examle</title>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -45,7 +46,18 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Custom Control Point Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Demonstrate the addition of a point reporting control to the OpenLayers window.
</p>
<div id="map"></div>
<div id="bounds"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,9 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Custom Control Example</title>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -44,6 +45,17 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Custom Control Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Demonstrate the addition of a draggable rectangle to the OpenLayers window.
</p>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,10 +1,12 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Custom Style Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<style type="text/css">
#map {
width: 500px;
height: 350px;
width: 512px;
height: 512px;
border: 1px solid gray;
}
p {
@@ -38,7 +40,18 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Custom Style Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Demonstrate changing CSS styles on controls in the OpenLayers window.
</p>
<div id="map"></div>
<div id="docs">
<p>If you care to modify the style of any OpenLayers element, include
the default stylesheet as a link and declare any style modifications
below that link. These style declarations can be in other linked
@@ -49,5 +62,6 @@
<p>This example shows how to declare the font family, size, and color
for the mouse position. Note that only the style keys that you want to
modify (change from the default) need to be specified.</p>
</div>
</body>
</html>

View File

@@ -2,6 +2,8 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Debug Example</title>
<script src="../lib/Firebug/firebug.js"></script>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
@@ -25,12 +27,20 @@
</script>
</head>
<body>
<h1>OpenLayers Debug Example</h1>
<h1 id="title">Debug Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate console calls to a Firebug console. Requires Firefox. Mostly for developers.
</p>
<div id="docs">
<p>To run OpenLayers in debug mode, include the following script
tag <b>before</b> the tag that loads OpenLayers:
<pre>
&lt;script src="../lib/Firebug/firebug.js"&gt;&lt;/script&gt;
</pre>
<pre> &lt;script src="../lib/Firebug/firebug.js"&gt;&lt;/script&gt;</pre>
The path to firebug.js must be relative to your
html file. With this script included calls to OpenLayers.Console
will be displayed in the Firebug console. For browsers without
@@ -60,5 +70,6 @@
<p>The Firebug website has a complete list of
<a href="http://www.getfirebug.com/console.html">console calls</a>.
Note that not all are supported with Firebug Lite.</p>
</div>
</body>
</html>

View File

@@ -1,9 +1,26 @@
<html>
<head>
<script src="../lib/OpenLayers.js"></script>
</head>
<body>
<div style="width:100%; height:100%" id="map"></div>
<head>
<title>OpenLayers Double Set Center Example</title>
<script src="../lib/OpenLayers.js"></script>
<style type="text/css">
#map {
width:512px;
height:521px;
}
</style>
</head>
<body>
<h1 id="title">Double Set Center Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate the behavior of two calls to set the center after instatiating the layer object.
</p>
<div id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
@@ -12,6 +29,8 @@
map.setCenter(new OpenLayers.LonLat(100,10));
map.setCenter(new OpenLayers.LonLat(1,1));
</script>
</body>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,10 +1,11 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Drag Feature</title>
<title>Drag Feature Example</title>
<style type="text/css">
#map {
width: 512px;
height: 350px;
height: 512px;
border: 1px solid gray;
}
#controls {
@@ -65,8 +66,16 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Drag Feature Example</h1>
<h1 id="title">Drag Feature Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates point, line and polygon creation and editing.
</p>
<div id="map"></div>
<div id="controls">
<ul id="controlToggle">
<li>
@@ -93,5 +102,7 @@
</li>
</ul>
</div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,9 +1,11 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Draw Feature Example</title>
<style type="text/css">
#map {
width: 512px;
height: 350px;
height: 512px;
border: 1px solid gray;
}
#controlToggle li {
@@ -65,8 +67,16 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Draw Feature Example</h1>
<h1 id="title">OpenLayers Draw Feature Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate on-screen digitizing tools for point, line, and polygon creation.
</p>
<div id="map"></div>
<ul id="controlToggle">
<li>
<input type="radio" name="type" value="none" id="noneToggle"
@@ -86,11 +96,13 @@
<label for="polygonToggle">draw polygon</label>
</li>
</ul>
<div id="docs">
<p>Feature digitizing is in freehand mode by default. In freehand mode, the mouse is treated as a pen.
Drawing begins on mouse down, continues with every mouse move, and ends with mouse up.</p>
<p>To turn freehand mode off, hold down the shift key while digitizing. With freehand mode off, one
vertex is added with each click and double-clicks finish drawing. Freehand mode can be toggled on and off
at any time while drawing.</p>
</div>
</body>
</html>

View File

@@ -1,15 +1,17 @@
<!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 Editing Toolbar Example</title>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<script src="../lib/Firebug/firebug.js"></script>
<script src="../lib/OpenLayers.js"></script>
<script src="../lib/Firebug/debug.js"></script>
<script type="text/javascript">
<!--
var lon = 5;
@@ -34,7 +36,17 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Editing Toolbar Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate polygon, polyline and point creation and editing tools.
</p>
<div id="panel"></div>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Example</title>
<style type="text/css">
#map {
width: 512px;
@@ -59,7 +60,7 @@
resolutions: [0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101]
};
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://t1.hypercube.telascience.org/tiles/landsat7",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"}, options2);
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
@@ -79,11 +80,17 @@
</script>
</head>
<body onload="init()">
<table><tr><td>
<h1>OpenLayers Example</h1>
</td><td>
<h3 id="browserHeader"></h3>
</td></tr></table>
<h1 id="title" style="display:inline;">OpenLayers Example</h1>
<h3 id="browserHeader" style="display:inline;"></h3>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a simple map with an overlay that includes layer switching controls.
</p>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,11 +1,20 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full Screen Example</title>
<style type="text/css">
#map {
width: 100%;
height: 100%;
border: 1px solid black;
}
#text {
position: absolute;
bottom: 0px;
left:0px;
width: 512px;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
@@ -13,11 +22,8 @@
function init(){
map = new OpenLayers.Map('map');
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com:80/wms/vmap0?", {layers: 'basic'});
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://t1.hypercube.telascience.org/tiles/landsat7",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"});
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
@@ -35,5 +41,20 @@
</head>
<body onload="init()">
<div id="map"></div>
<div id="text">
<h1 id="title">Full Screen Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a map that fill the entire browser window.
</p>
<div id="docs">
This example uses CSS to define the dimensions of the map element in order to fill the screen.
When the user resizes the window, the map size changes correspondingly. No scroll bars!
</div>
</div>
</body>
</html>

51
examples/fullScreen2.html Normal file
View File

@@ -0,0 +1,51 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full Screen Example 2</title>
<style type="text/css">
#map {
width: 100%;
height: 100%;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init(){
map = new OpenLayers.Map('map');
var options = {numZoomLevels: 3};
var docImage = new OpenLayers.Layer.Image(
'Full Screen',
'fullscreen.jpg',
new OpenLayers.Bounds(-156, -90, 156, 90),
new OpenLayers.Size(1121, 650),
options);
map.addLayers([docImage]);
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToMaxExtent();
}
</script>
</head>
<body onload="init()">
<div id="map"></div>
<div id="text">
<h1 id="title">Full Screen Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a map that fill the entire browser window.
</p>
<div id="docs">
This example uses CSS to define the dimensions of the map element in order to fill the screen.
When the user resizes the window, the map size changes correspondingly. No scroll bars!
</div>
</div>
</body>
</html>

BIN
examples/fullscreen.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

View File

@@ -1,9 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers GeoRSS Marker Example</title>
<style type="text/css">
#map {
width: 800px;
height: 400px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -28,7 +29,16 @@
</script>
</head>
<body onload="init()">
<h1>GeoRSS in OpenLayers</h1>
<h1 id="title">GeoRSS Marker Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate loading a GeoRSS feed using the GeoRSS parser.
</p>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,9 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers GeoRSS Serialize Example</title>
<style type="text/css">
#map {
width: 45%;
height: 350px;
width: 512px;
height: 512px;
border: 1px solid gray;
}
</style>
@@ -37,10 +38,20 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Draw Point Example</h1>
<h1 id="title">Draw Point Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate serialization of features in a Vector layer to GeoRSS.
</p>
<div style="float:right;width:50%">
<textarea id="gml" style="width:100%" rows="30"></textarea>
</div>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,9 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers GeoRSS Example</title>
<style type="text/css">
#map {
width: 800px;
height: 400px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -31,12 +32,31 @@
</script>
</head>
<body onload="init()">
<h1>GeoRSS in OpenLayers</h1>
<p style="font-size:.9em;">This demo uses the OpenLayers GeoRSS parser, which supports GeoRSS Simple and W3C GeoRSS. Only points are currently supported. <a href="http://trac.openlayers.org/wiki/HowToDownload">Get the code!</a></p>
<form onsubmit="return false;">
GeoRSS URL: <input type="text" id="url" size="50" /><input type="submit" onclick="addUrl(); return false;" value="Load Feed" onsubmit="addUrl(); return false;" />
</form>
<p>The above input box allows the input of a URL to a GeoRSS feed. This feed can be local to the HTML page -- for example, entering 'georss.xml' will work by default, because there is a local file in the directory called georss.xml -- or, with a properly set up ProxyHost variable (as is used here), it will be able to load any HTTP URL which contains GeoRSS and display it. Anything else will simply have no effect.</p>
<h1 id="title">GeoRSS Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Display a couple of locally cached georss feeds on an a basemap.
</p>
<div id="map"></div>
<div id="docs">
<p>This demo uses the OpenLayers GeoRSS parser, which supports GeoRSS Simple and W3C GeoRSS. Only points are
currently supported. The OpenLayers GeoRSS parser will automatically connect an information bubble to the map
markers, similar to Google maps. In addition, the parser can use custom PNG icons for markers. A sample GeoRSS
file (georss.xml) is included.
<form onsubmit="return false;">
GeoRSS URL: <input type="text" id="url" size="50" value="georss.xml" />
<input type="submit" onclick="addUrl(); return false;" value="Load Feed" onsubmit="addUrl(); return false;" />
</form>
<p>The above input box allows the input of a URL to a GeoRSS feed. This feed can be local to the HTML page --
for example, entering 'georss.xml' will work by default, because there is a local file in the directory called
georss.xml -- or, with a properly set up ProxyHost variable (as is used here), it will be able to load any
HTTP URL which contains GeoRSS and display it. Anything else will simply have no effect.</p>
</div>
</body>
</html>

View File

@@ -1,20 +1,30 @@
<html>
<head>
<script src="../lib/OpenLayers.js"></script>
<style type="text/css">
ul, li { padding-left: 0px; margin-left: 0px; }
</style>
<title>World Map Query</title>
</head>
<body>
<a id='permalink' href="">Permalink</a><br />
<head>
<title>OpenLayers Feature Info Example</title>
<script src="../lib/OpenLayers.js"></script>
<style type="text/css">
ul, li { padding-left: 0px; margin-left: 0px; }
</style>
</head>
<body>
<h1 id="title">Feature Info Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates sending a GetFeatureInfo query to an OWS. Returns information about a map feature in the side DIV.
</p>
<a id="permalink" href="">Permalink</a><br />
<div style="float:right;width:28%">
<h1 style="font-size:1.3em;">CIA Factbook</h1>
<p style='font-size:.8em;'>Click a country to see statistics about the country below.</p>
<p style="font-size:.8em;">Click a country to see statistics about the country below.</p>
<div id="nodeList">
</div>
</div>
<div id="map" style="width:70%; height:90%"></div>
<div id="map" style="width:512px; height:512px"></div>
<script defer="defer" type="text/javascript">
OpenLayers.ProxyHost = "/dev/examples/proxy.cgi?url=";
var map = new OpenLayers.Map('map', {'maxResolution':'auto'});
@@ -43,5 +53,8 @@ ul, li { padding-left: 0px; margin-left: 0px; }
OpenLayers.Util.getElement('nodeList').innerHTML = response.responseText;
}
</script>
</body>
<div id="docs">
</div>
</body>
</html>

View File

@@ -1,9 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers GML Layer Example</title>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -25,6 +26,16 @@
</script>
</head>
<body onload="init()">
<h1 id="title">GML Layer Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Loads locally stored GML vector data on a basemap. Includes GML example file.
</p>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers GML Serialization Example</title>
<style type="text/css">
#map {
width: 512px;
@@ -58,7 +59,14 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Draw Point Example</h1>
<h1 id="title">GML Serialization Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate the serialization of features drawn in the OpenLayers window.
</p>
<div style="float:right">
<ul id="controlToggle">
<li>
@@ -75,9 +83,14 @@
<label for="lineToggle">draw line</label>
</li>
</ul>
<p>Check the box to draw points. Uncheck to navigate normally.</p>
<textarea id="gml" cols="80" rows="30"></textarea>
</div>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,8 +1,9 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Google Layer Example</title>
<style type="text/css">
#map {
width: 100%;
width: 512px;
height: 512px;
border: 1px solid black;
background-color: red;
@@ -67,9 +68,21 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers With Google Layer Example</h1>
<h1 id="title">Google Layer Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a Google basemap used with boundary and marker overlay layers.
</p>
<div id="map"></div>
<div style="width:512px">
<div style="background-color:green" onclick="add()"> click to add a marker to the map</div>
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
</div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,13 +1,14 @@
<html>
<head>
<title>OpenLayers Gutter Example</title>
<style type="text/css">
#map {
width: 500px;
height: 300px;
width: 521px;
height: 512px;
border: 1px solid gray;
}
p.caption {
width: 500px;
width: 512px;
}
</style>
<script src="../lib/OpenLayers.js"></script>
@@ -33,8 +34,17 @@
</script>
</head>
<body>
<h1>OpenLayers Gutter Example</h1>
<h1 id="title">Gutter Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates map tiling artifacts, and OpenLayer's facility for correcting this distortion.
</p>
<div id="map"></div>
<div id="docs">
<p class="caption">
When you render tiles with certain types of symbols, there are artifacts
at tile edges that make symbology not look continuous. In the center of
@@ -42,6 +52,6 @@
vertically by a tile. Open the layer switcher and change to the layer
with a 15 pixel gutter to see how the symbology looks nicer.
</p>
</div>
</body>
</html>

View File

@@ -1,12 +1,13 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Image Layer Example</title>
<style type="text/css">
p {
width: 512px;
}
#map {
width: 512px;
height: 256px;
height: 512px;
border: 1px solid gray;
}
</style>
@@ -26,7 +27,7 @@
options);
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://t1.hypercube.telascience.org/tiles/landsat7",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"}, options);
map.addLayers([graphic, jpl_wms]);
@@ -36,8 +37,17 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Image Layer Example</h1>
<h1 id="title">Image Layer Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a single non-tiled image as a selectable base layer.
</p>
<div id="map"></div>
<div id="docs">
<p>
The "City Lights" layer above is created from a single web accessible
image. If you construct it without any resolution related options,
@@ -46,5 +56,6 @@
intended to be used in an overview map - where another layer type
might not make a good overview.
</p>
</div>
</body>
</html>

View File

@@ -1,9 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers KaMap Example</title>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -28,7 +29,16 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">KaMap Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a tiled kamap layer as the base map, which can be pre-cached for higher performance.
</p>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -25,6 +25,16 @@
</script>
</head>
<body onload="init()">
<h1 id="title">KML Layer Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates loading and displaying a KML file on top of a basemap.
</p>
<div id="map"></div>
<div id="docs"></div>
</body>
</html>

View File

@@ -1,12 +1,13 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Layer Opacity Example</title>
<style type="text/css">
body {
font-family: sans-serif;
}
#map {
width: 512px;
height: 350px;
height: 512px;
border: 1px solid lightgray;
}
p {
@@ -68,8 +69,17 @@
</script>
</head>
<body onload="init()">
<h2>OpenLayers Layer Opacity Example</h2>
<h1 id="title">Layer Opacity Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a change in the opacity for an overlay layer.
</p>
<div id="map"></div>
<div id="docs">
<p>
Note that if you also have the setOpacity method defined on the Layer
class, you can tweak the layer opacity after it has been added to the map.
@@ -80,5 +90,6 @@
<a title="increase opacity" href="javascript: changeOpacity(0.1);">&gt;&gt;</a>
</p>
<p class="note">IE users: Wait until the shade layer has finished loading to try this.</p>
</div>
</body>
</html>

View File

@@ -1,18 +1,18 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Layer Load Monitoring Example</title>
<style type="text/css">
#map {
position: absolute;
top: 5px;
left: 5px;
width: 450px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
#controls {
float: left;
text-align: right;
}
#eventsLogID {
position: absolute;
top: 5px;
left: 460px;
text-align: left;
width: 350px;
height: 475px;
overflow: auto;
@@ -108,14 +108,25 @@
</script>
</head>
<body onload="init()">
<div id="map"></div>
<h1 id="title">Layer Load Monitoring Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate a method for monitoring tile loading performance.
</p>
<div id="map" style="float:left;"></div>
<div id="controls">
<div id="eventsLogID">
<b>Events Log:</b>
</div>
<input type="button" value="Clear" onclick="clearLog()"/>
</div>
<div style="position:absolute; top: 500px; width: 700px">
<input type="button" value="Clear" style="float:right" onclick="clearLog()"/>
<div id="docs">
</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Layer Switcher Example</title>
<style type="text/css">
#map {
width: 512px;
@@ -20,7 +21,7 @@
{layers: 'basic'}, {'displayInLayerSwitcher':false} );
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://t1.hypercube.telascience.org/tiles/landsat7",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"}, {'isBaseLayer': false});
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
@@ -38,7 +39,15 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">Layer Switcher Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Demonstrates the use of the LayerSwitcher outside of the OpenLayers window.
</p>
<div id="layerswitcher" style="float:right; width: 20em;"></div>
<div id="map"></div>
<div id="docs">

View File

@@ -1,7 +1,12 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Basic Single WMS Example</title>
<style type="text/css">
#map { width:512px; height:256px; border:1px solid black; }
#map {
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
@@ -17,6 +22,16 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Basic Single WMS Example</h1>
<div id="tags"></div>
<div id="shortdesc">Show a Simple Map</div>
<div id="map"></div>
<div id="docs">
This example shows a very simple layout with minimal controls. This example uses a single WMS base layer.
</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MapServer Layer</title>
<style type="text/css">
#map {
width: 800px;
@@ -28,6 +29,12 @@
</script>
</head>
<body onload="init()">
<div id="title">MapServer Layer</div>
<div id="tags"></div>
<div id="shortdesc">Shows MapServer Layer</div>
<div id="map"></div>
<div id="docs">
This is an example of using a MapServer Layer with a gutter parameter. The gutter parameter is used to try to limit the edge effects between tiles.
</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MapServer Single Tile Mode</title>
<style type="text/css">
#map {
width: 100%;
@@ -21,6 +22,12 @@
</script>
</head>
<body>
<div id="title">MapServer Single Tile Mode</div>
<div id="tags"></div>
<div id="shortdesc">Shows single tile MapServer Layer</div>
<div id="map"></div>
<div id="docs">
This shows an example of using a MapServer Layer in single tile mode. Single tile mode can be useful when pulling data from dynamic sources.
</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Resize a Marker</title>
<style type="text/css">
#map {
width: 512px;
@@ -43,8 +44,13 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<div id="title">Resize a Marker</div>
<div id="tags"></div>
<div id="shortdesc">Dynamically resize a marker</div>
<div id="map"></div>
<div id="docs">
This example shows how to create a OpenLayers.Layer.Markers layer, add an icon, put it into a marker, and add the marker to the layer. Once the marker has been added it is possible to use setSize() on the icon in order to resize the marker.
</div>
<div style="background-color:purple" onclick="resize()"> click to resize marker</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Markers Layer Example</title>
<style type="text/css">
#map {
width: 512px;
@@ -46,7 +47,12 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<div id="title">Markers Layer Example</div>
<div id="tags"></div>
<div id="shortdesc">Show markers layer with different markers</div>
<div id="map"></div>
<div id="docs">
This is an example of an OpenLayers.Layers.Markers layer that shows some examples of adding markers. Also demonstrated is registering a mousedown effect on a marker.
</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Using a Layer.Text to display markers</title>
<style type="text/css">
#map {
width: 512px;
@@ -28,7 +29,11 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">Using a Layer.Text to display markers</h1>
<p id="shortdesc">
The Layer.Text class reads a Tab seperated values file and displays it as markers on
the map.
</p>
<div id="map"></div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MultiMap</title>
<style type="text/css">
#map {
width: 100%;
@@ -46,7 +47,10 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers MultiMap Example</h1>
<h1 id="title">MultiMap Example</h1>
<p id="shortdesc">
An example of using the Layer.MultiMap class.
</p>
<div id="map"></div>
<div style="background-color:green" onclick="add()"> click to add the marker to the map</div>
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>

View File

@@ -96,7 +96,8 @@
</script>
</head>
<body onload="init()">
<h3>OpenLayers Modify Feature Example</h3>
<h3 id="title">OpenLayers Modify Feature Example</h3>
<div id="shortdesc">A demonstraton of the ModifyFeature control for editing vector features.</div>
<div id="map"></div>
<div id="controls">
<ul id="controlToggle">

View File

@@ -2,6 +2,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" debug="true">
<head>
<title>MousePosition Control</title>
<style type="text/css">
body {
margin: 0;
@@ -35,6 +36,11 @@
</script>
</head>
<body onload="init()">
<h3 id="title">MousePosition Control</h3>
<p id="shortdesc">
Use the MousePosition Control to display the coordinates of the cursor
inside or outside the map div.
</p>
<div id="map"></div>
<div id="coords"></div>
<p>Moving your mouse to the upper left corner of this map should return 'x=0,y=0' -- in the past, it didn't in IE. If it returns 2,2, consider it a bug, and report it.</p>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MultiMap SphericalMercator</title>
<style type="text/css">
#map {
width: 100%;
@@ -51,7 +52,12 @@
</script>
</head>
<body onload="init()">
<h3>OpenLayers MultiMap Mercator Example</h3>
<h3 id="title">MultiMap Mercator Example</h3>
<p id="shortdesc">
This sphericalMercator example using multimap demonstrates that the
multimap layer does not fully support the sphericalMercator projection at
this time.
</p>
<div id="map"></div>
</body>
</html>

View File

@@ -28,6 +28,18 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Multiple Server URLS</h1>
<div id="tags">
</div>
<p id="shortdesc">
Load your tiles faster by pointing to the same server, but with different urls
</p>
<div id="map"></div>
<div id="docs">
This is an example of using a WFS layer type.
</div>
</body>
</html>

View File

@@ -88,7 +88,7 @@ function runMVS() {
case 'nasa':
theMVS.addLayer(
new OpenLayers.Layer.WMS("NASA Mosaic",
"http://t1.hypercube.telascience.org/tiles/landsat7",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{"EXCEPTIONS" : "application/vnd.ogc.se_inimage",
"format" : "image/jpeg",
layers:"landsat7"}

View File

@@ -9,6 +9,7 @@
}
</style>
<title>NavToolbar Demo</title>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
@@ -16,7 +17,7 @@
var zoom = 5;
var map, layer;
function init(){
function init() {
map = new OpenLayers.Map( 'map', { controls: [new OpenLayers.Control.PanZoom()] } );
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
@@ -30,6 +31,11 @@
</script>
</head>
<body onload="init()">
<h3 id="title">NavToolbar Demo</h3>
<p id="shortdesc">
Demo the NavToolbar, a subclass of Control.Panel which shows icons for
navigation.
</p>
<div id="map"></div>
</body>
</html>

View File

@@ -29,7 +29,11 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">Untiled Example</h1>
<p id="shortdesc">
Create an untiled WMS layer using the singleTile: true, option or the deprecated
WMS.Untiled layer.
</p>
<div id="mapDiv"></div>
<p> The first layer is an old OpenLayers.Layer.WMS.Untiled layer, using
a default ratio value of 1.5.

View File

@@ -136,6 +136,26 @@
</li>
</ul>
</div>
<p id="shortdesc">This example shows the use of a WFS service rendered using the OpenLayers vector library.</p>
<div id="map"></div>
<div id="docs">
<p>
This is an example that shows rendering a WFS service using OpenLayer vectors in the browser. The OpenLayers code will download the GML
from the WFS service for each layer, parse it and create features using the OL vector library to draw the features on the map. For
more information on the vector library, please visit <a href="http://trac.openlayers.org/wiki/Documentation/VectorSupport">vector support wiki</a>.
In this example there are 4 layers shown on the map. The base layer and parcel layer are created from a WMS serivce using the OpenLayers.Layer.WMS object.
The streams, roads, and plat layers are drawn from a WFS service using the OpenLayers.Layer.WFS object.
</p>
<p>
Rendering WFS layers into vectors is possible, but you need to be cautions when showing the features on the map. Testing has shown that when
you renderer more than 200 vectors in the browser the performance decreases dramatically. Also features that have a lot of vertices
can cause performance issues. In this example the parcel layer is rendered as a WMS layer because at the time of developing this example
there where a handful of features that had too many vertices to render without killing the browser resources.
There are a number of properties that can be set for each WFS layer, such color and line weight using style properties such as strokeColor and strokeWidth.
You can also get feature attributes from the WFS services using the extractAttribute property. View the source to see the example code.
</p>
</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Using maxResolution to control overlays</title>
<style type="text/css">
#map {
width: 650px;
@@ -50,7 +51,11 @@
<body onload="init()">
<h3 id="title">Using maxResolution to control overlays</h3>
<p id="shortdesc">
See how to control the maximum resolution for a markers layer,
causing it to not be displayed beyond a certain point.
</p>
<div id="map"></div>
</body>

View File

@@ -16,6 +16,13 @@
</style>
</head>
<body>
<h1 id="title">Overview Map</h1>
<div id="tags">
</div>
<p id="shortdesc">
Enable a small Overview Map that moves/interacts with your main map.
</p>
<div id="map1"></div>
<p>The above map has an overview map control that is created with
the default options. Much like a regular map, the map contained by
@@ -39,7 +46,7 @@
var jpl = new OpenLayers.Layer.WMS(
"NASA Global Mosaic",
"http://t1.hypercube.telascience.org/tiles/landsat7",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"}
);

View File

@@ -84,6 +84,11 @@
</script>
</head>
<body onload="init()">
<h3 id="title">Custom Control.Panel</h3>
<p id="shortdesc">
Create a custom control.panel, styled entirely with
CSS, and add your own controls to it.
</p>
<div id="panel"></div>
<div id="map"></div>
</body>

View File

@@ -120,6 +120,14 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Popup Mayhem</h1>
<div id="tags">
</div>
<p id="shortdesc">
All kinds of ways to create and interact with Popups.
</p>
<div id="map"></div>
<p>If you open an anchoredbubble and switch to google, it shouldn't crash. If it does, don't release OpenLayers.</p>
<div style="background-color:purple" onclick="add()"> click to add Popup to map</div>
@@ -129,5 +137,8 @@
<div style="background-color:grey" onclick="removelayer()"> click to remove the markers layer</div>
<div style="background-color:orange" onclick="alert(marker.onScreen())"> marker.onscreen()?</div>
<div style="background-color:yellow" onclick="destroy()"> click to destroy the popup from map</div>
<div id="docs">
Detailed description of this example needs to be written.
</div>
</body>
</html>

View File

@@ -55,6 +55,13 @@
</head>
<body onload="init()">
<h1 id="title">Layer Projections</h1>
<div id="tags">
</div>
<p id="shortdesc">
Use different (not default) projections with your map
</p>
<div id="map"></div>
<p>When using alternative projections, you still use OpenLayers.LonLat objects, even though
the properties are actually X/Y values at that point.</p>

View File

@@ -79,7 +79,11 @@
</script>
</head>
<body onload="init()">
<h2>OpenLayers Regular Polygon Example</h2>
<h2 id="title">OpenLayers Regular Polygon Example</h2>
<p id="shortdesc">
Shows how to use the RegularPolygon handler to draw features with
different numbers of sides.
</p>
<div id="map"></div>
<div id="config">

View File

@@ -82,6 +82,11 @@
</script>
</head>
<body onload="init()">
<h3 id="title">Resize Features Programatically</h3>
<p id="shortdesc">
Demonstration of how to use the geometry resize methods to
change feature sizes programatically.
</p>
<div id="map"></div>
<p>This example demonstrates how features can be resized. There is not yet
a control built that provides a tool for resizing, but the geometry.resize

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Restricted Extent Example</title>
<style type="text/css">
#map {
width: 512px;
@@ -40,7 +41,11 @@
</script>
</head>
<body onload="init()">
<h3>OpenLayers Restricted Extent Example</h3>
<h3 id="title">OpenLayers Restricted Extent Example</h3>
<p id="shortdesc">
Don't let users drag outside the map extent: instead, limit dragging such
that the extent of the layer is the maximum viewable area.
</p>
<div id="map"></div>
<p>
Map navigation is limited by a combination of map and layer properties.

View File

@@ -95,9 +95,17 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Rotate vector features</h1>
<div id="tags">
</div>
<p id="shortdesc">
Details on how to create and rotate vector features programmatically
</p>
<div id="map"></div>
<p>This example shows a few features rotating. There is not yet a control
<div id="docs">This example shows a few features rotating. There is not yet a control
built that provides a tool for rotating, but the geometry.rotate method
can be accessed to rotate programmatically.</p>
can be accessed to rotate programmatically.</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Open Popup on Layer.Vector</title>
<style type="text/css">
#map {
width: 800px;
@@ -72,7 +73,10 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Draw Feature Example</h1>
<h1 id="title">Open Popup on Layer.Vector</h1>
<p id="shortdesc">
Using a Control.SelectFeature, open a popup on click.
</p>
<div id="map"></div>
<ul id="controlToggle">
<li>

View File

@@ -1,6 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Select Feature</title>
<title>SelectFeature Control on Layer.Vector</title>
<style type="text/css">
#map {
width: 512px;
@@ -64,7 +64,11 @@
</script>
</head>
<body onload="init()">
<h3>OpenLayers Select Feature Example</h3>
<h1 id="title">OpenLayers Select Feature Example</h1>
<p id="shortdesc">
Select a feature on hover or click with the Control.SelectFeature on a
vector layer.
</p>
<div id="map"></div>
<ul id="controlToggle">
<li>

View File

@@ -4,7 +4,10 @@
<script src="../lib/OpenLayers.js"></script>
</head>
<body>
<h1>Setting a Visual Extent</h1>
<h1 id="title">Setting a Visual Extent</h1>
<p id='shortdesc'>
Use a boxes layer to visually display the area of interest indicated by a user.
</p>
<p>
Because the ability to set the map to a given extent is limited by the
current resolutions available, zoomToExtent will not always set the map to

View File

@@ -2,7 +2,7 @@
<head>
<style type="text/css">
#map {
width: 100%;
width: 512px;
height: 512px;
border: 1px solid gray;
}
@@ -125,7 +125,21 @@
</script>
</head>
<body onload="init()">
<h3>OpenLayers Spherical Mercator Example</h3>
<h1 id="title">OpenLayers Spherical Mercator Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the Spherical Mercator Layers, for overlaying
Google, Yahoo, Microsoft, and other layers with WMS and TMS tiles.
</p>
<div id="map"></div>
<div id="docs">
This is an example of using googles Mercator projection layers in a map window
</div>
</body>
</html>

View File

@@ -1,22 +0,0 @@
<html>
<head>
<script>
function set() {
if (document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#SVG", "1.1") ) {
document.getElementById("svg11").style.background="green";
}
if (document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#SVGDOM", "1.1") ) {
document.getElementById("svgdom").style.background="green";
}
}
</script>
</head>
<body onload="set()">
Vector Support:
<br />
Supports SVG 1.1: <div id="svg11" style="width:100px;height:100px;background-color:red"></div>
<br />
Supports SVG DOM: <div id="svgdom" style="width:100px;height:100px;background-color:red"></div>
</body>
</html>

View File

@@ -1,20 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers TileCache Example</title>
<style type="text/css">
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
width: 100%;
height: 100%;
}
#title {
position: absolute;
left: 1em;
bottom: 1em;
z-index: 5000;
width: 512px;
height: 512px;
}
</style>
<script src="../lib/OpenLayers.js"></script>
@@ -46,10 +36,17 @@
</script>
</head>
<body onload="init()">
<h1 id="title">TileCache Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates a TileCache layer that loads tiles from from a web accessible disk-based cache only.
</p>
<div id="map">
<div id="title">
<b>OpenLayers (Read-Only) TileCache Example</b>
<br />from a web accessible disk-based cache only
<div id="docs">
</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Tiled Map Service Example</title>
<style type="text/css">
#map {
width: 800px;
@@ -36,6 +37,17 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Tiled Map Service Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate the initialization and modification of a Tiled Map Service layer.
</p>
<div id="map"></div>
<div id="docs">
URL of TMS (Should end in /): <input type="text" id="url" size="60" value="http://labs.metacarta.com/wms-c/Basic.py/" /> layer_name <input type="text" id="layer" value="satellite" /> <select id="type"><option>jpg</option><option>png</option></select> <input type="submit" onclick="addTMS()"/><br />
<p>
Example: http://labs.metacarta.com/wms-c/Basic.py/, satellite, jpg<br />
@@ -44,6 +56,6 @@
be the output format used by that layer. (Any other behavior will result in
broken images being displayed.)
</p>
<div id="map"></div>
</div>
</body>
</html>

View File

@@ -1,5 +1,6 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers WorldWind Example</title>
<style type="text/css">
#map {
width: 800px;
@@ -26,7 +27,24 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">WorldWind Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrate the use of a NASA WorldWind base layer.
</p>
<div id="map"></div>
<div id="docs">
<p>
Add the Nasa WorldWind "Urban" layer to your map. The "Urban" layer contains aerial imagery for urban areas only.
</p>
<p>
You can do it with a ...
</p>
</div>
</body>
</html>

View File

@@ -1,8 +1,9 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Virtual Earth Example</title>
<style type="text/css">
#map {
width: 100%;
width: 512px;
height: 512px;
border: 1px solid black;
}
@@ -56,9 +57,19 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers VE Example</h1>
<h1 id="title">Virtual Earth Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates the use of a Virtual Earth base layer.
</p>
<div id="map"></div>
<div style="background-color:green" onclick="add()"> click to add the marker to the map</div>
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
<input type="button" onClick="javascript:add()"value="Add the marker from the map">
<input type="button" onClick="javascript:remove()" value="Remove the marker from the map">
<div id="docs">This example demonstrates the ability to add VirtualEarth and the and remove markers.</div>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -106,7 +106,17 @@
</script>
</head>
<body onload="init()">
<div id="map"></div>
<h1 id="title">Drawing Simple Vector Features Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the shows drawing simple vector features, in different styles.
</p>
<div id="map"></div>
<div id="docs">
<p>This example shows drawing simple vector features -- point, line, polygon
in different styles, created 'manually', by constructing the entire style
object, via 'copy', extending the default style object, and by
@@ -118,5 +128,8 @@
and graphicHeight are omitted, pointRadius will be used to set the size
of the image, which will then be twice the value of pointRadius with the
original aspect ratio.</p>
</div>
</body>
</html>

View File

@@ -19,15 +19,15 @@
top: 0;
left: 1em;
padding: 0;
width: 455px;
width: 517px;
}
#map {
width: 450px;
width: 512px;
height: 225px;
border: 1px solid #ccc;
}
#input {
width: 450px;
width: 512px;
}
#text {
font-size: 0.85em;
@@ -38,12 +38,12 @@
#info {
position: relative;
padding: 2em 0;
margin-left: 470px;
margin-left: 540px;
}
#output {
font-size: 0.8em;
width: 100%;
height: 500px;
height: 512px;
border: 0;
}
p {
@@ -138,7 +138,14 @@
</head>
<body onload="init()">
<div id="leftcol">
<h2>OpenLayers Vector Formats Example</h2>
<h1 id="title">Vector Formats Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the wide variety of vector formats that open layers supports.
</p>
<div id="map"></div>
<div id="input">
<p>Use the drop-down below to select the input/output format
@@ -161,6 +168,10 @@
<br />
<input type="button" value="add feature" onclick="deserialize();" />
</div>
<div id="docs">
</div>
</div>
<div id="info">
<p>Use the tools to the left to draw new polygons, lines, and points.
@@ -168,5 +179,6 @@
serialized version below.</p>
<textarea id="output"></textarea>
</div>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 100%;
height: 80%;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -62,18 +62,29 @@
</script>
</head>
<body onload="init()">
<h2>Draw Lines, Save to GeoServer</h2>
<p>Using GeoServer and the WFS-T support in OpenLayers, draw on a map,
save the results, reload the page and see the results still there!<br />
Hold shift to turn on freehand mode while drawing.</p>
<div style="float:right; text-align:right;">
<h1 id="title">Scribble on a WFS Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows how you can draw features and save to GeoServer.
</p>
<div id="map"></div>
<div id="docs">
Using GeoServer and the WFS-T support in OpenLayers, draw on a map, save the results, reload the page and see the results still there!
Hold shift to turn on freehand mode while drawing. </div>
<div style="float:left; text-align:right;">
<a href="#serialize" onclick="serialize('WFS')">Show WFS Transaction</a> |
<a href="#serialize" onclick="serialize('GML')">Export GML</a> |
<a href="#serialize" onclick="serialize('GeoRSS')">Export GeoRSS</a> |
<a href="#" onclick="return save()">Save</a> |
<a href="#" onclick="map.layers[1].refresh(); return false">Refresh</a> (removes all newly added lines)</div><br />
<div id="map"></div>
<textarea style="display:none" id="serialize" cols="100" rows="10">
</textarea>
</div>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 100%;
height: 80%;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -30,7 +30,22 @@
</script>
</head>
<body onload="init()">
<h2>GeoServer WFS</h2>
<div id="map"></div>
<h1 id="title">WFS United States (GeoServer) Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the WFS United States (GeoServer)
</p>
<div id="map"></div>
<div id="docs">see:
See <a href="WFS-js.html">WFS</a> for more info on Geoserver and WFS</div>
</body>
</html>
</div>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -62,8 +62,26 @@
</script>
</head>
<body onload="init()">
<h1 id="title">WFS Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the WFS layer type.
</p>
<a href="#" onclick="map.layers[2].commit();return false">Save Roads</a><br />
<a href="#" onclick="map.layers[3].commit();return false">Save Cities</a><br />
<div id="map"></div>
<div id="docs">
This is an example of using a WFS layer type.
</div>
</body>
</html>

View File

@@ -29,7 +29,11 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">WFS Points</h1>
<p id='shortdesc'>
Using a Layer.WFS with a featureClass, one can take in XML data
from a WFS class and display it any way you like.
</p>
<div id="map"></div>
</body>
</html>

View File

@@ -10,7 +10,7 @@
}
#map {
width: 512px;
height: 350px;
height: 512px;
border: 1px solid gray;
}
#controls {
@@ -110,9 +110,17 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers WKT Example</h1>
<h1 id="title">WKT Example</h1>
<div id="info"></div>
<p id="shortdesc">
Shows the use of WKT (Well known text) to draw features in openlayers
</p>
<div id="map"></div>
<div id="tags"></div>
<div id="docs">
<div id="controls">
<p>See <a href="http://en.wikipedia.org/wiki/Well-known_text#Geometric_Objects">Wikipedia</a>
for a description and examples of WKT.</p>
@@ -146,5 +154,6 @@
</li>
</ul>
</div>
</div>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 100%;
height: 100%;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -26,6 +26,20 @@
</script>
</head>
<body onload="init()">
<h1 id="title"> WMS Untiled Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows an example of the Untiled wms layer, which requests a single image for the entire map view</a>.
</p>
<div id="map"></div>
<div id="docs">
An untiled map will only request a single image at a time.
</div>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -26,6 +26,23 @@
</script>
</head>
<body onload="init()">
<h1 id="title">WMS Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the basic use of openlayers using a WMS layer
</p>
<div id="map"></div>
<div id="docs">
This is an example of how to add an WMS layer to the OpenLayers window. The images are tiled in this instance if you wanted to not use a tiled WMS
please use this example and pass the option <20>singleTile<6C> as true.
</div>
</body>
</html>

View File

@@ -3,7 +3,7 @@
<style type="text/css">
#map {
width: 512px;
height: 400px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -17,7 +17,7 @@
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
"http://t1.hypercube.telascience.org/tiles/landsat7",
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
{layers: "landsat7"});
ia_wms = new OpenLayers.Layer.WMS("Nexrad","http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?",{layers:"nexrad-n0r-wmst",transparent:true,format:'image/png',time:"2005-08-29T13:00:00Z"});
@@ -40,11 +40,20 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<p>WMS-T example: update the times, and the radar image will change. Uses Layer.mergeNewParams to update the date element with the strings from the input fields every time one of them is changed.</p>
<p>The inputs below describe a timestamp: The minute increments can only be updated in units of 5.</p>
<h1 id="title"> WMS Time Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the layer WMS-T (time) layer</a>
</p>
<input size="4" type='text' id='year' value="2005" onchange="update_date()"/>-<input size="2" type="text" id="month" value="08" onchange="update_date()"/>-<input size="2" type="text" id="day" value="29" onchange="update_date()" />T<input type="text" size="2" id="hour" value="13" onchange="update_date()" />:<input type="text" size="2" id="minute" value="00" onchange="update_date()" />:00
<div id="map"></div>
<div id="docs">
WMS-T example: update the times, and the radar image will change. Uses Layer.mergeNewParams to update the date element with the strings from the input fields every time one of them is changed.
The inputs below describe a timestamp: The minute increments can only be updated in units of 5.
</div>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -32,9 +32,21 @@
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">WorldWind layers Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the Tiled WorldWind layers.
</p>
<div id="map"></div>
<p>This is a demonstration of using Tiled WorldWind layers. WorldWind requires you to define a "LZTD" -- the 3rd param of the constructor -- and the number of zoom levels it supports. When a worldwind layer is not visible at a given tile level, and empty tile is placed there instead. Note that the maxResolution of the map times 512px, must be a multiple of a power of two different from the LZTD -- in this case, .28125 * 512 is 144, which is 36*4, and 2.25*64.</p>
<p>This example has a 'Bathy' layer, visible as you zoom out, and a 'landsat' layer, visible as you zoom in, both visible at zoom level 6.</p>
<div id="docs">
This is a demonstration of using Tiled WorldWind layers. WorldWind requires you to define a "LZTD" -- the 3rd param of the constructor -- and the number of zoom levels it supports. When a worldwind layer is not visible at a given tile level, and empty tile is placed there instead. Note that the maxResolution of the map times 512px, must be a multiple of a power of two different from the LZTD -- in this case, .28125 * 512 is 144, which is 36*4, and 2.25*64.
This example has a 'Bathy' layer, visible as you zoom out, and a 'landsat' layer, visible as you zoom in, both visible at zoom level 6.
</div>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 350px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -58,7 +58,7 @@
<a href="http://dev.openlayers.org/docs2/OpenLayers/Layer.html#wrapDateLine">wrapDateLine</a>
</div>
<p id="shortdesc">This example shows the use of the <a href="http://dev.openlayers.org/docs/OpenLayers/Layer.html#wrapDateLine">wrapDateLine</a> layer option on a number of layer types.</p>
<p id="shortdesc">Shows how to work around dateline issues, by wrapping the dateline on a number of layer types.</p>
<div id="map"></div>
<div id="docs">
<p>

View File

@@ -6,7 +6,15 @@
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
</head>
<body style="width:100%">
<div style="width:100%; height:500px" id="map"></div>
<h1 id="title">XHTML Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows openlayers runnig in a XHTML 1.0 Strict Doctype
</p>
<div style="width:512px; height:512px;border:1px black solid;" id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
@@ -14,10 +22,15 @@
map.addLayer(wms);
map.zoomToMaxExtent();
</script>
<p>
<div id="docs">This example shows openlayers using a XHTML 1.0 Strict Doctype click on the below image to validate.
<p>
<a href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0!" height="31" width="88" /></a>
</p>
</div>
</body>
</html>

View File

@@ -111,7 +111,16 @@
</script>
</head>
<body>
<h3>OpenLayers XML Example</h3>
<h1 id="title">XML Format Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the OpenLayers XML format class
</p>
<div id="docs">
<p>OpenLayers has a very simple XML format class (OpenLayers.Format.XML)
that can be used to read/write XML docs. The methods available on the
XML format (or parser if you like) allow for reading and writing of the
@@ -141,5 +150,8 @@
</ul>
Output:
<div id="output">&nbsp;</div>
</div>
</body>
</html>

View File

@@ -23,14 +23,28 @@
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(-5, 40), 4);
map.addControl(new OpenLayers.Control.LayerSwitcher());
}
</script>
</head>
<body onload="init()">
<h1>OpenLayers Example</h1>
<h1 id="title">Yahoo Base Layer Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows how you would add a yahoo layer and add the LayerSwitcher control
</p>
<div id="map"></div>
<div id="docs">
This is an example of how to add a yahoo layer to the OpenLayers window. In order to enable a
yahoo layer. Also shown in this example is the LayerSwitcher() control for toggling between both the yahoo layer and
the open layer WMS.
</div>
</body>
</html>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -15,7 +15,7 @@
var map, layer;
function init(){
OpenLayers.DOTS_PER_INCH = 72;
var options = {
// various ways of specifying similar things
@@ -26,6 +26,7 @@
// maxScale: 10000000,
// minScale: 50000000,
// numZoomLevels: 5,
// units: "dd",
minResolution: "auto",
minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),
maxResolution: "auto",
@@ -48,6 +49,35 @@
</script>
</head>
<body onload="init()">
<h1 id="title">Zoom Level</h1>
<div id="tags">
</div>
<p id="shortdesc">
This example shows the use of the resolutions layer option on a number of layer types.
</p>
<div id="map"></div>
<div id="docs">
<p>
Set the extent of the viewable map using preset levels of scale available
to the user via the zoom slider bar. You can set the minimum, maximum
scales or resolutions, the number of levels in between and the minimum
and maximum geographic extents in your map's units.
</p>
<p>
Default units for Scale are in inches. Resolution is specified in map units
per pixel where the default map units are decimal degrees(dd).<br/>
scale = resolution * OpenLayers.INCHES_PER_UNIT[units] *
OpenLayers.DOTS_PER_INCH <br/>
You can either set the scale or the resolution, there is no need to set both.
</p>
<p>
You can do it with a ...
</p>
</div>
</body>
</html>

1767
tools/BeautifulSoup.py Normal file

File diff suppressed because it is too large Load Diff

124
tools/exampleparser.py Executable file
View File

@@ -0,0 +1,124 @@
#!/usr/bin/env python
import sys
import os
import re
import urllib2
missing_deps = False
try:
import simplejson
from BeautifulSoup import BeautifulSoup
except ImportError, E:
missing_deps = E
def getListOfOnlineExamples(baseUrl):
"""
useful if you want to get a list of examples a url. not used by default.
"""
html = urllib2.urlopen(baseUrl)
soup = BeautifulSoup(html)
examples = soup.findAll('li')
examples = [example.find('a').get('href') for example in examples]
examples = [example for example in examples if example.endswith('.html')]
examples = [example for example in examples]
return examples
def getListOfExamples(relPath):
"""
returns list of .html filenames within a given path
"""
examples = os.listdir(relPath)
examples = [example for example in examples if example.endswith('.html')]
return examples
def getExampleHtml(location):
"""
returns html of a specific example that is available online or locally
"""
print '.',
if location.startswith('http'):
return urllib2.urlopen(location).read()
else:
f = open(location)
html = f.read()
f.close()
return html
def extractById(soup, tagId, value=None):
"""
returns full contents of a particular tag id
"""
beautifulTag = soup.find(id=tagId)
if beautifulTag:
if beautifulTag.contents:
value = str(beautifulTag.renderContents()).strip()
value = value.replace('\t','')
value = value.replace('\n','')
return value
def getRelatedClasses(html):
"""
parses the html, and returns a list of all OpenLayers Classes
used within (ie what parts of OL the javascript uses).
"""
rawstr = r'''(?P<class>OpenLayers\..*?)\('''
return re.findall(rawstr, html)
def parseHtml(html,ids):
"""
returns dictionary of items of interest
"""
soup = BeautifulSoup(html)
d = {}
for tagId in ids:
d[tagId] = extractById(soup,tagId)
#classes should eventually be parsed from docs - not automatically created.
classes = getRelatedClasses(html)
d['classes'] = classes
return d
if __name__ == "__main__":
if missing_deps:
print "This script requires simplejson and BeautifulSoup. You don't have them. \n(%s)" % E
sys.exit()
if len(sys.argv) > 1:
outFile = open(sys.argv[1],'w')
else:
outFile = open('../doc/examples.js','w')
examplesLocation = '../examples'
print 'Reading examples from %s and writing out to %s' % (examplesLocation, outFile.name)
exampleList = []
docIds = ['title','shortdesc']
#comment out option to create docs from online resource
#examplesLocation = 'http://svn.openlayers.org/sandbox/docs/examples/'
#examples = getListOfOnlineExamples(examplesLocation)
examples = getListOfExamples(examplesLocation)
for example in examples:
url = os.path.join(examplesLocation,example)
html = getExampleHtml(url)
tagvalues = parseHtml(html,docIds)
tagvalues['example'] = example
tagvalues['link'] = url
exampleList.append(tagvalues)
exampleList.sort(key=lambda x:x['example'].lower())
json = simplejson.dumps(exampleList)
#give the json a global variable we can use in our js. This should be replaced or made optional.
json = 'var examples=' + json
outFile.write(json)
outFile.close()
print 'complete'