Compare commits
5 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22c1d22caf | ||
|
|
53b20137cb | ||
|
|
4085a2c220 | ||
|
|
b9348dd5d5 | ||
|
|
1c055d4f84 |
@@ -4,7 +4,7 @@
|
|||||||
* Build:
|
* Build:
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
./build.py
|
./build.sh
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
* Upload the result to the server: e.g.
|
* Upload the result to the server: e.g.
|
||||||
|
|||||||
@@ -13,14 +13,7 @@ Rico/Corner.js
|
|||||||
[exclude]
|
[exclude]
|
||||||
Firebug/firebug.js
|
Firebug/firebug.js
|
||||||
Firebug/firebugx.js
|
Firebug/firebugx.js
|
||||||
OpenLayers/Lang/cs-CZ.js
|
|
||||||
OpenLayers/Lang/de.js
|
OpenLayers/Lang/de.js
|
||||||
OpenLayers/Lang/en-CA.js
|
OpenLayers/Lang/en-CA.js
|
||||||
OpenLayers/Lang/fr.js
|
OpenLayers/Lang/fr.js
|
||||||
OpenLayers/Lang/it.js
|
OpenLayers/Lang/cs-CZ.js
|
||||||
OpenLayers/Lang/nb.js
|
|
||||||
OpenLayers/Lang/nl.js
|
|
||||||
OpenLayers/Lang/pt-BR.js
|
|
||||||
OpenLayers/Lang/sv-SE.js
|
|
||||||
OpenLayers/Lang/zh-TW.js
|
|
||||||
OpenLayers/Lang/zh-CN.js
|
|
||||||
|
|||||||
@@ -46,16 +46,9 @@ OpenLayers/Renderer/Elements.js
|
|||||||
OpenLayers/Renderer/SVG.js
|
OpenLayers/Renderer/SVG.js
|
||||||
OpenLayers/Renderer/VML.js
|
OpenLayers/Renderer/VML.js
|
||||||
OpenLayers/Renderer.js
|
OpenLayers/Renderer.js
|
||||||
OpenLayers/Lang/cs-CZ.js
|
|
||||||
OpenLayers/Lang/de.js
|
OpenLayers/Lang/de.js
|
||||||
OpenLayers/Lang/en-CA.js
|
OpenLayers/Lang/en-CA.js
|
||||||
OpenLayers/Lang/fr.js
|
OpenLayers/Lang/fr.js
|
||||||
OpenLayers/Lang/it.js
|
OpenLayers/Lang/cs-CZ.js
|
||||||
OpenLayers/Lang/nb.js
|
|
||||||
OpenLayers/Lang/nl.js
|
|
||||||
OpenLayers/Lang/pt-BR.js
|
|
||||||
OpenLayers/Lang/sv-SE.js
|
|
||||||
OpenLayers/Lang/zh-TW.js
|
|
||||||
OpenLayers/Lang/zh-CN.js
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,12 +43,3 @@
|
|||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
|
|
||||||
/**
|
|
||||||
* Contains XMLHttpRequest.js <http://code.google.com/p/xmlhttprequest/>
|
|
||||||
* Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com)
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*/
|
|
||||||
|
|||||||
@@ -19,5 +19,10 @@ OpenLayers/Tile.js
|
|||||||
OpenLayers/Tile/Image.js
|
OpenLayers/Tile/Image.js
|
||||||
|
|
||||||
[exclude]
|
[exclude]
|
||||||
|
Firebug/firebug.js
|
||||||
|
Firebug/firebugx.js
|
||||||
|
OpenLayers/Lang/de.js
|
||||||
|
OpenLayers/Lang/en-CA.js
|
||||||
|
OpenLayers/Lang/fr.js
|
||||||
|
OpenLayers/Lang/cs-CZ.js
|
||||||
|
|
||||||
|
|||||||
74
doc/Jugl.js
Normal file
74
doc/Jugl.js
Normal 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");}}};})();
|
||||||
@@ -22,14 +22,11 @@ Gregers Rygg
|
|||||||
Tim Schaub
|
Tim Schaub
|
||||||
Christopher Schmidt
|
Christopher Schmidt
|
||||||
Cameron Shorter
|
Cameron Shorter
|
||||||
Pedro Simonetti
|
|
||||||
Paul Spencer
|
Paul Spencer
|
||||||
Paul Smith
|
|
||||||
Glen Stampoultzis
|
Glen Stampoultzis
|
||||||
James Stembridge
|
James Stembridge
|
||||||
Erik Uzureau
|
Erik Uzureau
|
||||||
Ivan Willig
|
Ivan Willig
|
||||||
Thomas Wood
|
|
||||||
Bill Woodall
|
Bill Woodall
|
||||||
Steve Woodbridge
|
Steve Woodbridge
|
||||||
|
|
||||||
|
|||||||
55
doc/examples.html
Normal file
55
doc/examples.html
Normal 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>
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers GML Parser</title>
|
<title>OpenLayers GML Parser</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 800px;
|
||||||
|
height: 475px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function parseData(req) {
|
function parseData(req) {
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
/**
|
|
||||||
* Jugl.js -- JavaScript Template Library
|
|
||||||
*
|
|
||||||
* Copyright 2007 Tim Schaub
|
|
||||||
* Released under the MIT license. Please see
|
|
||||||
* http://svn.tschaub.net/jugl/trunk/license.txt for the full license.
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function(){var Jugl={prefix:"jugl",namespaceURI:"http://namespace.jugl.org/"};Jugl.Array={indexOf:function(array,obj){for(var i=0;i<array.length;i++){if(array[i]==obj)return i;}
|
|
||||||
return-1;}};Jugl.Function={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);}}};Jugl.Node={appendChild:function(parent,child){if(typeof(parent)=="string"){var obj=document.getElementById(parent);if(!obj){throw Error("Element id not found: "+parent);}
|
|
||||||
parent=obj;}
|
|
||||||
if(typeof(child)=="string"){var obj=document.getElementById(child);if(!obj){throw Error("Element id not found: "+child);}
|
|
||||||
child=obj;}
|
|
||||||
if(child.namespaceURI&&child.xml){var wrapper=document.createElement('div');wrapper.innerHTML=child.xml;var children=wrapper.childNodes;for(var i=0;i<children.length;++i){parent.appendChild(children[i]);}}else{if(parent.ownerDocument&&parent.ownerDocument.importNode){child=parent.ownerDocument.importNode(child,true);}
|
|
||||||
parent.appendChild(child);}
|
|
||||||
return child;}};Jugl.Object={extend:function(destination,source){destination=destination||{};source=source||{};for(property in source){destination[property]=source[property];}
|
|
||||||
return destination;},applyDefaults:function(destination,source){destination=destination||{};source=source||{};for(property in source){if(destination[property]===undefined){destination[property]=source[property];}}
|
|
||||||
return destination;}};Jugl.Request={loadTemplate:function(url,onComplete,caller){var createTemplate=function(request){var doc,template;try{doc=request.responseXML;template=new Jugl.Template(doc.documentElement);}catch(invalidXML){try{doc=document.createElement("div");doc.innerHTML=request.responseText;template=new Jugl.Template(doc.firstChild);}catch(invalidHTML){var msg="Can't make HTML out of response: "+
|
|
||||||
request.responseText;Jugl.Console.error(msg);throw invalidHTML;}}
|
|
||||||
var complete=Jugl.Function.bind(onComplete,caller);complete(template);}
|
|
||||||
Jugl.Request.loadUrl(url,createTemplate);},loadUrl:function(url,onComplete,caller){var complete=(caller)?Jugl.Function.bind(onComplete,caller):onComplete;var request=Jugl.Request.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");}}};Jugl.Class=function(){var Class=function(){if(this===Jugl){var msg="Create an instance of a Jugl "+"class with the new keyword";throw Error(msg);}
|
|
||||||
this.initialize.apply(this,arguments);}
|
|
||||||
var extended={toString:function(){return"["+this.CLASS_NAME+"]";}};var parent;for(var i=0;i<arguments.length;++i){if(typeof arguments[i]=="function"){parent=arguments[i].prototype;}else{parent=arguments[i];}
|
|
||||||
Jugl.Object.extend(extended,parent);}
|
|
||||||
Class.prototype=extended;return Class;};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.Object.extend(Jugl.Console,console);break;}}}})();Jugl.Attribute=Jugl.Class({element:null,node:null,type:null,nodeValue:null,template:null,initialize:function(element,node,type){this.element=element;this.node=node;this.type=type;this.nodeValue=node.nodeValue;this.nodeName=node.nodeName;this.template=element.template;},splitAttributeValue:function(value){value=(value!=null)?value:this.nodeValue;var matches=this.template.regExes.trimSpace.exec(value);var items;if(matches&&matches.length==3){items=[matches[1],matches[2]];}
|
|
||||||
return items;},splitExpressionPrefix:function(){var items=this.splitAttributeValue();if(!items||(items[0]!='structure'&&items[0]!='text')){items=[null,this.nodeValue];}
|
|
||||||
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.element.removeAttributeNode(this);},process:function(){return this.processAttribute[this.type].apply(this,[]);},evalInScope:function(str){var expression="with(this.element.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.element.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"+"attribute: "+this.nodeName;Jugl.Console.error(message);throw err;}
|
|
||||||
this.removeSelf();if(!proceed){this.element.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 element;var previousSibling=this.element;var length=list.length;for(var i=0;i<length;++i){element=this.element.clone();element.scope[key]=list[i];element.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(element);element.process();previousSibling=element;}
|
|
||||||
this.element.removeSelf();return false;},"content":function(){var pair=this.splitExpressionPrefix();var str;try{str=this.evalInScope(pair[1]);}catch(err){Jugl.Console.error("Failed to eval in element scope: "+
|
|
||||||
pair[1]);throw err;}
|
|
||||||
this.removeSelf();if(pair[0]=='structure'){try{this.element.node.innerHTML=str;}catch(err){var wrapper=document.createElement('div');var msg;try{wrapper.innerHTML=str;}catch(invalidHTML){msg="Can't transform string into valid HTML : "+
|
|
||||||
str;Jugl.Console.error(msg);throw invalidHTML;}
|
|
||||||
if(this.element.node.xml&&this.template.xmldom){while(this.element.node.firstChild){this.element.node.removeChild(this.element.node.firstChild);}
|
|
||||||
this.template.xmldom.loadXML(wrapper.outerHTML);var children=this.template.xmldom.firstChild.childNodes;try{for(var i=0;i<children.length;++i){this.element.node.appendChild(children[i]);}}catch(invalidXML){msg="Can't transform string into valid XHTML : "+
|
|
||||||
str;Jugl.Console.error(msg);throw invalidXML;}}else{try{this.element.node.innerHTML=wrapper.innerHTML;}catch(invalidXML){msg="Can't transform string into valid XHTML : "+
|
|
||||||
str;Jugl.Console.error(msg);throw invalidXML;}}}}else{var text;if(this.element.node.xml&&this.template.xmldom){text=this.template.xmldom.createTextNode(str);}else{text=document.createTextNode(str);}
|
|
||||||
var child=new Jugl.Element(this.template,text);this.element.removeChildNodes();this.element.appendChild(child);}
|
|
||||||
return true;},"replace":function(){var pair=this.splitExpressionPrefix();var str;try{str=this.evalInScope(pair[1]);}catch(err){Jugl.Console.error("Failed to eval in element scope: "+
|
|
||||||
pair[1]);throw err;}
|
|
||||||
this.removeSelf();if(pair[0]=='structure'){var wrapper=document.createElement('div');try{wrapper.innerHTML=str;}catch(err){msg="Can't transform string into valid HTML : "+
|
|
||||||
str;Jugl.Console.error(msg);throw err;}
|
|
||||||
if(this.element.node.xml&&this.template.xmldom){try{this.template.xmldom.loadXML(wrapper.outerHTML);}catch(err){msg="Can't transform string into valid XML : "+
|
|
||||||
str;Jugl.Console.error(msg);throw err;}
|
|
||||||
wrapper=this.template.xmldom.firstChild;}
|
|
||||||
while(wrapper.firstChild){var child=wrapper.removeChild(wrapper.firstChild);if(this.element.node.ownerDocument&&this.element.node.ownerDocument.importNode){if(child.ownerDocument!=this.element.node.ownerDocument){child=this.element.node.ownerDocument.importNode(child,true);}}
|
|
||||||
this.element.node.parentNode.insertBefore(child,this.element.node);}}else{var text;if(this.element.node.xml&&this.template.xmldom){text=this.template.xmldom.createTextNode(str);}else{text=document.createTextNode(str);}
|
|
||||||
var replacement=new Jugl.Element(this.template,text);this.element.insertBefore(replacement);}
|
|
||||||
this.element.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.element.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 element scope: "+
|
|
||||||
this.nodeValue);throw err;}
|
|
||||||
this.removeSelf();if(omit){var children=this.element.getChildNodes();var child;for(var i=0;i<children.length;++i){this.element.insertBefore(children[i]);}
|
|
||||||
this.element.removeSelf();}},"reflow":function(){var reflow;try{reflow=((this.nodeValue=="")||!!(this.evalInScope(this.nodeValue)));}catch(err){Jugl.Console.error("Failed to eval in element scope: "+
|
|
||||||
this.nodeValue);throw err;}
|
|
||||||
this.removeSelf();if(reflow){if(this.element.node.outerHTML){this.element.node.outerHTML=this.element.node.outerHTML;}else{this.element.node.innerHTML=this.element.node.innerHTML;}}}},CLASS_NAME:"Jugl.Attribute"});Jugl.Element=Jugl.Class({template:null,node:null,scope:null,initialize:function(template,node){this.template=template;this.node=node;this.scope=new Object();this.scope.repeat=new Object();},clone:function(){var node=this.node.cloneNode(true);node.removeAttribute("id");var element=new Jugl.Element(this.template,node);Jugl.Object.extend(element.scope,this.scope);return element;},getAttribute:function(localName){var node;if(this.node.nodeType==1){if(this.template.usingNS){node=this.node.getAttributeNodeNS(Jugl.namespaceURI,localName);}else{node=this.node.getAttributeNode(Jugl.prefix+":"+
|
|
||||||
localName);}
|
|
||||||
if(node&&!node.specified){node=false;}}
|
|
||||||
var attribute;if(node){attribute=new Jugl.Attribute(this,node,localName);}else{attribute=node;}
|
|
||||||
return attribute;},setAttribute:function(name,value){this.node.setAttribute(name,value);},removeAttributeNode:function(attribute){this.node.removeAttributeNode(attribute.node);},getChildNodes:function(){var numNodes=this.node.childNodes.length;var children=new Array(numNodes);var node,scope;for(var i=0;i<numNodes;++i){node=new Jugl.Element(this.template,this.node.childNodes[i]);node.scope=Jugl.Object.extend({},this.scope);children[i]=node;}
|
|
||||||
return children;},removeChildNodes:function(){while(this.node.hasChildNodes()){this.node.removeChild(this.node.firstChild);}},removeChild:function(element){this.node.removeChild(element.node);return node;},removeSelf:function(){this.node.parentNode.removeChild(this.node);},importNode:function(element){if(this.node.ownerDocument&&this.node.ownerDocument.importNode){if(element.node.ownerDocument!=this.node.ownerDocument){element.node=this.node.ownerDocument.importNode(element.node,true);}}},appendChild:function(element){this.importNode(element);this.node.appendChild(element.node);},insertAfter:function(element){this.importNode(element);var parent=this.node.parentNode;var sibling=this.node.nextSibling;if(sibling){parent.insertBefore(element.node,sibling);}else{parent.appendChild(element.node);}},insertBefore:function(element){this.importNode(element);var parent=this.node.parentNode;parent.insertBefore(element.node,this.node);},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;}}
|
|
||||||
var reflow=this.getAttribute("reflow");if(reflow){try{reflow.process();}catch(err){Jugl.Console.error("Failed to process reflow attribute");throw err;}}},processChildNodes:function(){var children=this.getChildNodes();for(var i=0;i<children.length;++i){try{children[i].process();}catch(err){Jugl.Console.error("Failed to process child node: "+i);throw err;}}},CLASS_NAME:"Jugl.Element"});Jugl.Template=Jugl.Class({node:null,usingNS:false,xhtmlns:"http://www.w3.org/1999/xhtml",xmldom:window.ActiveXObject?new ActiveXObject("Microsoft.XMLDOM"):null,regExes:{trimSpace:(/^\s*(\w+)\s+(.*?)\s*$/)},loaded:false,loading:false,initialize:function(config){if(typeof config=="string"||(config&&config.nodeType==1)){config={node:config};}
|
|
||||||
config=config||{};if(typeof(config.node)=="string"){config.node=document.getElementById(config.node);if(!config.node){throw Error("Element id not found: "+config.node);}}
|
|
||||||
if(config.node){this.node=config.node;this.loaded=true;}else if(config.url){this.load({url:config.url,callback:config.callback,scope:config.scope});}},process:function(config){if(config&&!config.context&&!config.clone&&!config.string&&!config.parent){config={context:config}}
|
|
||||||
config=Jugl.Object.applyDefaults(config,{context:null,clone:false,string:false});if(this.node.getAttributeNodeNS){if(this.node.getAttributeNodeNS(Jugl.xhtmlns,Jugl.prefix)){this.usingNS=true;}}
|
|
||||||
var element=new Jugl.Element(this,this.node);if(config.clone){element=element.clone();}
|
|
||||||
if(config.context){element.scope=config.context;}
|
|
||||||
try{element.process();}catch(err){Jugl.Console.error("Failed to process "+
|
|
||||||
this.node.nodeName+" node");throw err;}
|
|
||||||
var data;if(config.string){if(element.node.innerHTML){data=element.node.innerHTML;}else{if(this.xmldom){data=element.node.xml;}else{var serializer=new XMLSerializer();data=serializer.serializeToString(element.node);}}}else{data=element.node;if(config.parent){if(config.clone){data=Jugl.Node.appendChild(config.parent,element.node);}else{this.appendTo(config.parent);}}}
|
|
||||||
return data;},load:function(config){if(typeof config=="string"){config={url:config};}
|
|
||||||
config=config||{};this.loading=true;var setNode=function(template){this.node=template.node;this.loading=false;this.loaded=true;if(config.callback){config.callback.apply(config.scope,[template]);}}
|
|
||||||
Jugl.Request.loadTemplate(config.url,setNode,this);},appendTo:function(parent){this.node=Jugl.Node.appendChild(parent,this.node);return this;},CLASS_NAME:"Jugl.Template"});window["http://jugl.tschaub.net/trunk/lib/Jugl.js"]=Jugl;})();
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers KML Parser Example</title>
|
<title>OpenLayers KML Parser Example</title>
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function parseData(req) {
|
function parseData(req) {
|
||||||
|
|||||||
@@ -2,8 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Accessible Example</title>
|
<title>OpenLayers Accessible Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid #eee;
|
||||||
|
}
|
||||||
table {
|
table {
|
||||||
border: 1 px solid white;
|
border: 1 px solid white;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -85,7 +90,7 @@
|
|||||||
pan <em>w</em>est
|
pan <em>w</em>est
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td id="map" class="smallmap"></td>
|
<td id="map"></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript: void map.pan(map.getSize().w / 4, 0);"
|
<a href="javascript: void map.pan(map.getSize().w / 4, 0);"
|
||||||
accesskey="e">
|
accesskey="e">
|
||||||
|
|||||||
@@ -2,7 +2,18 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Animated Panning of the Map via map.panTo</title>
|
<title>Animated Panning of the Map via map.panTo</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 256px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
#map2 {
|
||||||
|
width: 512px;
|
||||||
|
height: 256px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer, running = false;
|
var map, layer, running = false;
|
||||||
@@ -75,7 +86,7 @@
|
|||||||
<h1 id="title">map.panTo Example</h1>
|
<h1 id="title">map.panTo Example</h1>
|
||||||
<div id="tags">map.panTo</div>
|
<div id="tags">map.panTo</div>
|
||||||
<div id="shortdesc">Show animated panning effects in the map</div>
|
<div id="shortdesc">Show animated panning effects in the map</div>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>This is an example of transition effects. If the new random center is in the current extent, the map will pan smoothly. <br />
|
<p>This is an example of transition effects. If the new random center is in the current extent, the map will pan smoothly. <br />
|
||||||
The random selection will continue until you press it again. Additionally, you can single click in the map to pan smoothly
|
The random selection will continue until you press it again. Additionally, you can single click in the map to pan smoothly
|
||||||
@@ -83,7 +94,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button onclick="setCenterInterval()">Start/stop random recenter</button>
|
<button onclick="setCenterInterval()">Start/stop random recenter</button>
|
||||||
<div id="map2" class="smallmap"></div>
|
<div id="map2"></div>
|
||||||
<div>
|
<div>
|
||||||
<p>To turn off Animated Panning, create a map with an panMethod set to
|
<p>To turn off Animated Panning, create a map with an panMethod set to
|
||||||
null. </p>
|
null. </p>
|
||||||
|
|||||||
@@ -2,9 +2,15 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Attribution Example</title>
|
<title>OpenLayers Attribution Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map;
|
var map;
|
||||||
function init(){
|
function init(){
|
||||||
@@ -14,15 +20,11 @@
|
|||||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'},
|
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'},
|
||||||
{'attribution': 'Provided by <a href="http://labs.metacarta.com/">MetaCarta</a>'});
|
{'attribution': 'Provided by <a href="http://labs.metacarta.com/">MetaCarta</a>'});
|
||||||
|
|
||||||
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
||||||
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
|
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
|
||||||
{layers: "landsat7"},{attribution:"Provided by Telascience"});
|
{layers: "landsat7"},{attribution:"Provided by Telascience"});
|
||||||
|
|
||||||
var vector = new OpenLayers.Layer.Vector("Simple Geometry",
|
|
||||||
{attribution:"Vector Attibution in 2nd arg"});
|
|
||||||
|
|
||||||
map.addLayers([ol_wms, jpl_wms, vector]);
|
|
||||||
|
|
||||||
|
map.addLayers([ol_wms, jpl_wms]);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.addControl(new OpenLayers.Control.Attribution());
|
map.addControl(new OpenLayers.Control.Attribution());
|
||||||
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||||
@@ -34,21 +36,18 @@
|
|||||||
<h1 id="title">Attribution Example</h1>
|
<h1 id="title">Attribution Example</h1>
|
||||||
|
|
||||||
<div id="tags">
|
<div id="tags">
|
||||||
copyright watermark logo attribution
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
Shows the use of the attribution layer option on a number of layer types.
|
Shows the use of the attribution layer option on a number of layer types.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
This is an example of how to add an attribution block to the OpenLayers window. In order to use an
|
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
|
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, though one is added to all OpenLayers Maps by default.
|
addition, an attribution control must be added to the map.
|
||||||
Be aware that this is a layer *option*: the options hash goes in
|
|
||||||
different places depending on the layer type you are using.
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -3,8 +3,13 @@
|
|||||||
<title>OpenLayers Base Layers Example</title>
|
<title>OpenLayers Base Layers Example</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
background-color: blue;
|
||||||
|
}
|
||||||
#controls
|
#controls
|
||||||
{
|
{
|
||||||
width: 512px;
|
width: 512px;
|
||||||
@@ -16,7 +21,7 @@
|
|||||||
<!-- Localhost key -->
|
<!-- Localhost key -->
|
||||||
<!-- <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
|
<!-- <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
|
||||||
<script type="text/javascript" src="http://clients.multimap.com/API/maps/1.1/metacarta_04"></script>
|
<script type="text/javascript" src="http://clients.multimap.com/API/maps/1.1/metacarta_04"></script>
|
||||||
<script src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>
|
<script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script>
|
||||||
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
|
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -84,7 +89,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div style="background-color:green" onclick="add()"> click to add a marker to the 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 style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>OpenLayers Vector Behavior Example</title>
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var map;
|
|
||||||
|
|
||||||
function init(){
|
|
||||||
map = new OpenLayers.Map('map');
|
|
||||||
var wms = new OpenLayers.Layer.WMS(
|
|
||||||
"OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0",
|
|
||||||
{layers: 'basic'}
|
|
||||||
);
|
|
||||||
|
|
||||||
var layer = new OpenLayers.Layer.Vector("GML", {
|
|
||||||
strategies: [new OpenLayers.Strategy.Fixed()],
|
|
||||||
protocol: new OpenLayers.Protocol.HTTP({
|
|
||||||
url: "gml/polygon.xml",
|
|
||||||
format: new OpenLayers.Format.GML()
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
map.addLayers([wms, layer]);
|
|
||||||
map.zoomToExtent(new OpenLayers.Bounds(
|
|
||||||
-3.92, 44.34, 4.87, 49.55
|
|
||||||
));
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body onload="init()">
|
|
||||||
<h1 id="title">Vector Behavior Example (Fixed/HTTP/GML)</h1>
|
|
||||||
<p id="shortdesc">
|
|
||||||
Vector layer with a Fixed strategy, HTTP protocol, and GML format.
|
|
||||||
</p>
|
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
<div id="docs">
|
|
||||||
The vector layer shown uses the Fixed strategy, the HTTP protocol,
|
|
||||||
and the GML format.
|
|
||||||
The Fixed strategy is a simple strategy that fetches features once
|
|
||||||
and never re-requests new data.
|
|
||||||
The HTTP protocol makes requests using HTTP verbs. It should be
|
|
||||||
constructed with a url that corresponds to a collection of features
|
|
||||||
(a resource on some server).
|
|
||||||
The GML format is used to serialize features.
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Boxes Example</title>
|
<title>OpenLayers Boxes Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var box_extents = [
|
var box_extents = [
|
||||||
@@ -47,7 +53,7 @@
|
|||||||
Demonstrate marker and box type annotations on a map.
|
Demonstrate marker and box type annotations on a map.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Boxes Example</title>
|
<title>OpenLayers Boxes Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var box_extents = [
|
var box_extents = [
|
||||||
@@ -46,7 +52,7 @@
|
|||||||
Demonstrate marker and box type annotations on a map.
|
Demonstrate marker and box type annotations on a map.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,89 +0,0 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>OpenLayers Example</title>
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
// making this a global variable so that it is accessible for
|
|
||||||
// debugging/inspecting in Firebug
|
|
||||||
var map = null;
|
|
||||||
|
|
||||||
function init(){
|
|
||||||
|
|
||||||
//set title name to include Browser Detection
|
|
||||||
// this is the only way to test the functionality
|
|
||||||
// of the getBrowserName() function
|
|
||||||
//
|
|
||||||
var header = OpenLayers.Util.getElement("browserHeader");
|
|
||||||
header.innerHTML = "(browser: ";
|
|
||||||
var browserCode = OpenLayers.Util.getBrowserName();
|
|
||||||
switch (browserCode) {
|
|
||||||
case "opera":
|
|
||||||
browserName = "Opera";
|
|
||||||
break;
|
|
||||||
case "msie":
|
|
||||||
browserName = "Internet Explorer";
|
|
||||||
break;
|
|
||||||
case "safari":
|
|
||||||
browserName = "Safari";
|
|
||||||
break;
|
|
||||||
case "firefox":
|
|
||||||
browserName = "FireFox";
|
|
||||||
break;
|
|
||||||
case "mozilla":
|
|
||||||
browserName = "Mozilla";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
browserName = "detection error"
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
header.innerHTML += browserName + ")";
|
|
||||||
|
|
||||||
map = new OpenLayers.Map('map');
|
|
||||||
|
|
||||||
var options = {
|
|
||||||
resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101]
|
|
||||||
};
|
|
||||||
|
|
||||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
|
||||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'},
|
|
||||||
options);
|
|
||||||
|
|
||||||
var options2 = {
|
|
||||||
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/cgi-bin/landsat7",
|
|
||||||
{layers: "landsat7"}, options2);
|
|
||||||
|
|
||||||
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," +
|
|
||||||
"prov_bound,fedlimit,rail,road,popplace",
|
|
||||||
transparent: "true", format: "image/png"},
|
|
||||||
{minResolution: 0.17578125,
|
|
||||||
maxResolution: 0.703125});
|
|
||||||
|
|
||||||
map.addLayers([ol_wms, jpl_wms, dm_wms]);
|
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
|
||||||
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
|
||||||
map.zoomToMaxExtent();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body onload="init()">
|
|
||||||
<h1 id="title" style="display:inline;">Example Showing Browser Name</h1>
|
|
||||||
<h3 id="browserHeader" style="display:inline;"></h3>
|
|
||||||
|
|
||||||
<div id="tags"></div>
|
|
||||||
|
|
||||||
<p id="shortdesc">
|
|
||||||
Demonstrate a simple map that shows the browser name.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
|
|
||||||
<div id="docs"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Buffer Example</title>
|
<title>OpenLayers Buffer Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lon = 0;
|
var lon = 0;
|
||||||
@@ -39,7 +45,7 @@
|
|||||||
This example shows the use of the buffer layer option for any layer that inherits from OpenLayers.Layer.Grid.
|
This example shows the use of the buffer layer option for any layer that inherits from OpenLayers.Layer.Grid.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
Use the buffer property to control how many tiles are included
|
Use the buffer property to control how many tiles are included
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
<title>OpenLayers Click Handler Example</title>
|
<title>OpenLayers Click Handler Example</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 340px;
|
width: 340px;
|
||||||
@@ -162,7 +161,7 @@
|
|||||||
This example shows the use of the click handler.
|
This example shows the use of the click handler.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<p>
|
<p>
|
||||||
The click handler can be used to gain more flexibility over handling
|
The click handler can be used to gain more flexibility over handling
|
||||||
click events. The handler can be constructed with options to handle
|
click events. The handler can be constructed with options to handle
|
||||||
|
|||||||
@@ -3,10 +3,16 @@
|
|||||||
<title>OpenLayers Click Event Example</title>
|
<title>OpenLayers Click Event Example</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
|
OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
|
||||||
defaultHandlerOptions: {
|
defaultHandlerOptions: {
|
||||||
'single': true,
|
'single': true,
|
||||||
'double': false,
|
'double': false,
|
||||||
@@ -24,7 +30,7 @@
|
|||||||
);
|
);
|
||||||
this.handler = new OpenLayers.Handler.Click(
|
this.handler = new OpenLayers.Handler.Click(
|
||||||
this, {
|
this, {
|
||||||
'click': this.trigger
|
'click': this.trigger,
|
||||||
}, this.handlerOptions
|
}, this.handlerOptions
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -33,7 +39,7 @@
|
|||||||
var lonlat = map.getLonLatFromViewPortPx(e.xy);
|
var lonlat = map.getLonLatFromViewPortPx(e.xy);
|
||||||
alert("You clicked near " + lonlat.lat + " N, " +
|
alert("You clicked near " + lonlat.lat + " N, " +
|
||||||
+ lonlat.lon + " E");
|
+ lonlat.lon + " E");
|
||||||
}
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
var map;
|
var map;
|
||||||
@@ -72,7 +78,7 @@
|
|||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
Using the Click handler allows you to (for example) catch clicks without catching double clicks, something that standard browser events don't do for you. (Try double clicking: you'll zoom in, whereas using the browser click event, you would just get two alerts.) This example click control shows you how to use it.
|
Using the Click handler allows you to (for example) catch clicks without catching double clicks, something that standard browser events don't do for you. (Try double clicking: you'll zoom in, whereas using the browser click event, you would just get two alerts.) This example click control shows you how to use it.
|
||||||
|
|||||||
@@ -3,27 +3,28 @@
|
|||||||
<title>OpenLayers Map Controls Example</title>
|
<title>OpenLayers Map Controls Example</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map;
|
var map;
|
||||||
function init(){
|
function init(){
|
||||||
map = new OpenLayers.Map('map', {
|
map = new OpenLayers.Map('map', { controls: [] });
|
||||||
controls: [
|
|
||||||
new OpenLayers.Control.PanZoomBar(),
|
|
||||||
new OpenLayers.Control.MouseToolbar(),
|
|
||||||
new OpenLayers.Control.LayerSwitcher({'ascending':false}),
|
|
||||||
new OpenLayers.Control.Permalink(),
|
|
||||||
new OpenLayers.Control.ScaleLine(),
|
|
||||||
new OpenLayers.Control.Permalink('permalink'),
|
|
||||||
new OpenLayers.Control.MousePosition(),
|
|
||||||
new OpenLayers.Control.OverviewMap(),
|
|
||||||
new OpenLayers.Control.KeyboardDefaults()
|
|
||||||
],
|
|
||||||
numZoomLevels: 6
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
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());
|
||||||
|
map.addControl(new OpenLayers.Control.ScaleLine());
|
||||||
|
map.addControl(new OpenLayers.Control.Permalink('permalink'));
|
||||||
|
map.addControl(new OpenLayers.Control.MousePosition());
|
||||||
|
map.addControl(new OpenLayers.Control.OverviewMap());
|
||||||
|
map.addControl(new OpenLayers.Control.KeyboardDefaults());
|
||||||
|
|
||||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||||
"http://labs.metacarta.com/wms/vmap0",
|
"http://labs.metacarta.com/wms/vmap0",
|
||||||
@@ -56,7 +57,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a style="float:right" href="" id="permalink">Permalink</a>
|
<a style="float:right" href="" id="permalink">Permalink</a>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Custom Control Point Examle</title>
|
<title>OpenLayers Custom Control Point Examle</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lon = 5;
|
var lon = 5;
|
||||||
@@ -48,7 +54,7 @@
|
|||||||
Demonstrate the addition of a point reporting control to the OpenLayers window.
|
Demonstrate the addition of a point reporting control to the OpenLayers window.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="bounds"></div>
|
<div id="bounds"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Custom Control Example</title>
|
<title>Custom Control Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lon = 5;
|
var lon = 5;
|
||||||
@@ -52,7 +58,7 @@
|
|||||||
Demonstrate the addition of a draggable rectangle to the OpenLayers window.
|
Demonstrate the addition of a draggable rectangle to the OpenLayers window.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -3,8 +3,12 @@
|
|||||||
<title>Custom Style Example</title>
|
<title>Custom Style Example</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
p {
|
p {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
}
|
}
|
||||||
@@ -43,7 +47,7 @@
|
|||||||
Demonstrate changing CSS styles on controls in the OpenLayers window.
|
Demonstrate changing CSS styles on controls in the OpenLayers window.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>If you care to modify the style of any OpenLayers element, include
|
<p>If you care to modify the style of any OpenLayers element, include
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Debug Example</title>
|
<title>OpenLayers Debug Example</title>
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<script src="../lib/Firebug/firebug.js"></script>
|
<script src="../lib/Firebug/firebug.js"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@@ -4,7 +4,12 @@
|
|||||||
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width:512px;
|
||||||
|
height:521px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 id="title">Double Set Center Example</h1>
|
<h1 id="title">Double Set Center Example</h1>
|
||||||
@@ -15,7 +20,7 @@
|
|||||||
Demonstrate the behavior of two calls to set the center after instatiating the layer object.
|
Demonstrate the behavior of two calls to set the center after instatiating the layer object.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<script defer="defer" type="text/javascript">
|
<script defer="defer" type="text/javascript">
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
|
|||||||
@@ -3,8 +3,12 @@
|
|||||||
<title>Drag Feature Example</title>
|
<title>Drag Feature Example</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
#controls {
|
#controls {
|
||||||
width: 512px;
|
width: 512px;
|
||||||
}
|
}
|
||||||
@@ -68,7 +72,7 @@
|
|||||||
Demonstrates point, line and polygon creation and editing.
|
Demonstrates point, line and polygon creation and editing.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<ul id="controlToggle">
|
<ul id="controlToggle">
|
||||||
|
|||||||
@@ -3,8 +3,12 @@
|
|||||||
<title>Draw Feature Example</title>
|
<title>Draw Feature Example</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
#controlToggle li {
|
#controlToggle li {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
@@ -70,7 +74,7 @@
|
|||||||
Demonstrate on-screen digitizing tools for point, line, and polygon creation.
|
Demonstrate on-screen digitizing tools for point, line, and polygon creation.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<ul id="controlToggle">
|
<ul id="controlToggle">
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.olControlEditingToolbar {
|
.olControlEditingToolbar {
|
||||||
float:left;
|
float:left;
|
||||||
@@ -10,6 +9,11 @@
|
|||||||
height: 30px;
|
height: 30px;
|
||||||
width: 150px;
|
width: 150px;
|
||||||
}
|
}
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 256px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="../lib/Firebug/firebug.js"></script>
|
<script src="../lib/Firebug/firebug.js"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
@@ -41,11 +45,8 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">OpenLayers EditingToolbar Outside Viewport</h1>
|
<h3>OpenLayers EditingToolbar Outside Viewport</h3>
|
||||||
<p id="shortdesc">
|
<div id="map"></div>
|
||||||
Display an editing toolbar panel outside the map viewport.
|
|
||||||
</p>
|
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
<div id="panel" class="olControlEditingToolbar"></div>
|
<div id="panel" class="olControlEditingToolbar"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -4,7 +4,13 @@
|
|||||||
<title>OpenLayers Editing Toolbar Example</title>
|
<title>OpenLayers Editing Toolbar Example</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script src="../lib/Firebug/debug.js"></script>
|
<script src="../lib/Firebug/debug.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -14,17 +20,15 @@
|
|||||||
var map, layer;
|
var map, layer;
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
|
map = new OpenLayers.Map( 'map', { controls: [] } );
|
||||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||||
|
map.addLayer(layer);
|
||||||
|
|
||||||
vlayer = new OpenLayers.Layer.Vector( "Editable" );
|
vlayer = new OpenLayers.Layer.Vector( "Editable" );
|
||||||
map = new OpenLayers.Map( 'map', {
|
map.addLayer(vlayer);
|
||||||
controls: [
|
map.addControl(new OpenLayers.Control.PanZoomBar());
|
||||||
new OpenLayers.Control.PanZoom(),
|
map.addControl(new OpenLayers.Control.EditingToolbar(vlayer));
|
||||||
new OpenLayers.Control.EditingToolbar(vlayer)
|
|
||||||
]
|
|
||||||
});
|
|
||||||
map.addLayers([layer, vlayer]);
|
|
||||||
|
|
||||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||||
}
|
}
|
||||||
@@ -40,7 +44,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="panel"></div>
|
<div id="panel"></div>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Event Handling</title>
|
<title>OpenLayers Event Handling</title>
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 256px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
#panel {
|
#panel {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
@@ -142,7 +146,7 @@
|
|||||||
Demonstrating various styles of event handling in OpenLayers.
|
Demonstrating various styles of event handling in OpenLayers.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="panel"></div>
|
<div id="panel"></div>
|
||||||
<textarea id="output"></textarea>
|
<textarea id="output"></textarea>
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
|
|||||||
@@ -1,239 +0,0 @@
|
|||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<!-- This is the example list source: if you are trying to look at the
|
|
||||||
source of an example, YOU ARE IN THE WRONG PLACE. If you want to view
|
|
||||||
the source of just one example, you can typically choose
|
|
||||||
"This Frame -> View source" when right clicking on the exmaple. If not,
|
|
||||||
choose to open the example in a new window (via the context menu
|
|
||||||
click on the link), and view source from there. -->
|
|
||||||
<title>OpenLayers Examples</title>
|
|
||||||
<link rel="alternate" href="example-list.xml" type="application/atom+xml" />
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
|
||||||
html, body {
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
line-height: 1.25em;
|
|
||||||
}
|
|
||||||
.ex_container{
|
|
||||||
border-bottom: 1px solid #cccccc;
|
|
||||||
}
|
|
||||||
.ex_container a {
|
|
||||||
text-decoration: none;
|
|
||||||
padding: 5px 1em;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.ex_container a:hover {
|
|
||||||
background-color: #eeeeee;
|
|
||||||
}
|
|
||||||
.ex_title{
|
|
||||||
display: inline;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
.ex_filename {
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 0.8em;
|
|
||||||
color: #ccc
|
|
||||||
}
|
|
||||||
.ex_description{
|
|
||||||
color: #222;
|
|
||||||
padding: 3px;
|
|
||||||
}
|
|
||||||
.ex_classes{
|
|
||||||
font-size: .7em;
|
|
||||||
color: grey;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
#toc {
|
|
||||||
width: 30%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
#filter {
|
|
||||||
top: 0px;
|
|
||||||
height: 50px;
|
|
||||||
padding: 10px 1em 10px 1em;
|
|
||||||
}
|
|
||||||
#examples {
|
|
||||||
border-top: 1px solid #cccccc;
|
|
||||||
position: absolute;
|
|
||||||
width: 30%;
|
|
||||||
top: 70px;
|
|
||||||
bottom: 0px;
|
|
||||||
overflow: auto;
|
|
||||||
list-style: none;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
#examples ul {
|
|
||||||
list-style: none;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
#examples ul li {
|
|
||||||
display: block;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
#exwin {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 30%;
|
|
||||||
width: 70%;
|
|
||||||
height: 100%;
|
|
||||||
border: none;
|
|
||||||
border-left: 1px solid #cccccc;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type="text/javascript" src="Jugl.js"></script>
|
|
||||||
<script type="text/javascript" src="example-list.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
// import
|
|
||||||
var Jugl = window["http://jugl.tschaub.net/trunk/lib/Jugl.js"];
|
|
||||||
var template, target;
|
|
||||||
|
|
||||||
function listExamples(examples) {
|
|
||||||
target.innerHTML = "";
|
|
||||||
var node = template.process({
|
|
||||||
context: {examples: examples},
|
|
||||||
clone: true,
|
|
||||||
parent: target
|
|
||||||
});
|
|
||||||
document.getElementById("count").innerHTML = "(" + examples.length + ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
var timerId;
|
|
||||||
function inputChange() {
|
|
||||||
if(timerId) {
|
|
||||||
window.clearTimeout(timerId);
|
|
||||||
}
|
|
||||||
var text = this.value;
|
|
||||||
timerId = window.setTimeout(function() {
|
|
||||||
filterList(text);
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
function filterList(text) {
|
|
||||||
var examples;
|
|
||||||
if(text.length < 2) {
|
|
||||||
examples = info.examples;
|
|
||||||
} else {
|
|
||||||
var words = text.split(/\W+/);
|
|
||||||
var scores = {};
|
|
||||||
for(var i=0; i<words.length; ++i) {
|
|
||||||
var word = words[i].toLowerCase()
|
|
||||||
var dict = info.index[word];
|
|
||||||
if(dict) {
|
|
||||||
for(exIndex in dict) {
|
|
||||||
var count = dict[exIndex];
|
|
||||||
if(scores[exIndex]) {
|
|
||||||
if(scores[exIndex][word]) {
|
|
||||||
scores[exIndex][word] += count;
|
|
||||||
} else {
|
|
||||||
scores[exIndex][word] = count;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
scores[exIndex] = {};
|
|
||||||
scores[exIndex][word] = count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
examples = [];
|
|
||||||
for(var j in scores) {
|
|
||||||
var ex = info.examples[j];
|
|
||||||
ex.score = scores[j];
|
|
||||||
examples.push(ex);
|
|
||||||
}
|
|
||||||
// sort examples by first by number of words matched, then
|
|
||||||
// by word frequency
|
|
||||||
examples.sort(function(a, b) {
|
|
||||||
var cmp;
|
|
||||||
var aWords = 0, bWords = 0;
|
|
||||||
var aScore = 0, bScore = 0;
|
|
||||||
for(var i in a.score) {
|
|
||||||
aScore += a.score[i];
|
|
||||||
aWords += 1;
|
|
||||||
}
|
|
||||||
for(var j in b.score) {
|
|
||||||
bScore += b.score[j];
|
|
||||||
bWords += 1;
|
|
||||||
}
|
|
||||||
if(aWords == bWords) {
|
|
||||||
cmp = bScore - aScore;
|
|
||||||
} else {
|
|
||||||
cmp = bWords - aWords;
|
|
||||||
}
|
|
||||||
return cmp;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
listExamples(examples);
|
|
||||||
}
|
|
||||||
|
|
||||||
function showAll() {
|
|
||||||
document.getElementById("keywords").value = "";
|
|
||||||
listExamples(info.examples);
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseQuery() {
|
|
||||||
var params = {};
|
|
||||||
var list = window.location.search.substring(1).split("&");
|
|
||||||
for(var i=0; i<list.length; ++i) {
|
|
||||||
var pair = list[i].split("=");
|
|
||||||
if(pair.length == 2) {
|
|
||||||
params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(params["q"]) {
|
|
||||||
var input = document.getElementById("keywords");
|
|
||||||
input.value = params["q"];
|
|
||||||
inputChange.call(input);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
window.onload = function() {
|
|
||||||
template = new Jugl.Template("template");
|
|
||||||
target = document.getElementById("examples");
|
|
||||||
listExamples(info.examples);
|
|
||||||
document.getElementById("exwin").src = "../examples/example.html";
|
|
||||||
document.getElementById("keywords").onkeyup = inputChange
|
|
||||||
parseQuery();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="toc">
|
|
||||||
<div id="filter">
|
|
||||||
<p>
|
|
||||||
<label for="keywords">Filter by keywords</label><br />
|
|
||||||
<input type="text" id="keywords" />
|
|
||||||
<span id="count"></span><br />
|
|
||||||
<a href="javascript:void showAll();">show all</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div id="examples"></div>
|
|
||||||
</div>
|
|
||||||
<iframe id="exwin" name="exwin" frameborder="0"></iframe>
|
|
||||||
<div style="display: none;">
|
|
||||||
<ul id="template">
|
|
||||||
<li class="ex_container" jugl:repeat="example examples">
|
|
||||||
<a jugl:attributes="href example.link" target="exwin">
|
|
||||||
<h5 class="ex_title">
|
|
||||||
<span jugl:replace="example.title">title</span><br />
|
|
||||||
<span class="ex_filename" jugl:content="'(' + example.example + ')'">filename</span>
|
|
||||||
</h5>
|
|
||||||
<div class="ex_description" jugl:content="example.shortdesc">
|
|
||||||
Short Description goes here
|
|
||||||
</div>
|
|
||||||
<p class="ex_classes" jugl:content="example.classes">
|
|
||||||
Related Classes go here
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Example</title>
|
<title>OpenLayers Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// making this a global variable so that it is accessible for
|
// making this a global variable so that it is accessible for
|
||||||
@@ -11,46 +17,79 @@
|
|||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
|
|
||||||
|
//set title name to include Browser Detection
|
||||||
|
// this is the only way to test the functionality
|
||||||
|
// of the getBrowserName() function
|
||||||
|
//
|
||||||
|
var header = OpenLayers.Util.getElement("browserHeader");
|
||||||
|
header.innerHTML = "(browser: ";
|
||||||
|
var browserCode = OpenLayers.Util.getBrowserName();
|
||||||
|
switch (browserCode) {
|
||||||
|
case "opera":
|
||||||
|
browserName = "Opera";
|
||||||
|
break;
|
||||||
|
case "msie":
|
||||||
|
browserName = "Internet Explorer";
|
||||||
|
break;
|
||||||
|
case "safari":
|
||||||
|
browserName = "Safari";
|
||||||
|
break;
|
||||||
|
case "firefox":
|
||||||
|
browserName = "FireFox";
|
||||||
|
break;
|
||||||
|
case "mozilla":
|
||||||
|
browserName = "Mozilla";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
browserName = "detection error"
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
header.innerHTML += browserName + ")";
|
||||||
|
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map');
|
||||||
|
|
||||||
var ol_wms = new OpenLayers.Layer.WMS(
|
var options = {
|
||||||
"OpenLayers WMS",
|
resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101]
|
||||||
"http://labs.metacarta.com/wms/vmap0",
|
};
|
||||||
{layers: 'basic'}
|
|
||||||
);
|
|
||||||
|
|
||||||
var jpl_wms = new OpenLayers.Layer.WMS(
|
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||||
"NASA Global Mosaic",
|
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'},
|
||||||
|
options);
|
||||||
|
|
||||||
|
var options2 = {
|
||||||
|
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/cgi-bin/landsat7",
|
"http://t1.hypercube.telascience.org/cgi-bin/landsat7",
|
||||||
{layers: "landsat7"}
|
{layers: "landsat7"}, options2);
|
||||||
);
|
|
||||||
|
|
||||||
var dm_wms = new OpenLayers.Layer.WMS(
|
var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
|
||||||
"DM Solutions Demo",
|
|
||||||
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
|
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
|
||||||
{
|
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
|
||||||
layers: "bathymetry,land_fn,park,drain_fn,drainage," +
|
"prov_bound,fedlimit,rail,road,popplace",
|
||||||
"prov_bound,fedlimit,rail,road,popplace",
|
transparent: "true", format: "image/png"},
|
||||||
transparent: "true", format: "image/png"},
|
{minResolution: 0.17578125,
|
||||||
{
|
maxResolution: 0.703125});
|
||||||
minResolution: 0.17578125,
|
|
||||||
maxResolution: 0.703125
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
map.addLayers([ol_wms, jpl_wms, dm_wms]);
|
map.addLayers([ol_wms, jpl_wms, dm_wms]);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
|
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||||
map.zoomToMaxExtent();
|
map.zoomToMaxExtent();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">OpenLayers Example</h1>
|
<h1 id="title" style="display:inline;">OpenLayers Example</h1>
|
||||||
|
<h3 id="browserHeader" style="display:inline;"></h3>
|
||||||
|
|
||||||
<div id="tags"></div>
|
<div id="tags"></div>
|
||||||
|
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
Demonstrate a simple map with an overlay that includes layer switching controls.
|
Demonstrate a simple map with an overlay that includes layer switching controls.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 256px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map;
|
var map;
|
||||||
@@ -45,7 +51,7 @@
|
|||||||
Shows the use of a map with fractional (or non-discrete) zoom levels.
|
Shows the use of a map with fractional (or non-discrete) zoom levels.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<input type="checkbox" name="fractional"
|
<input type="checkbox" name="fractional"
|
||||||
id="fractional" checked="checked" onclick="update(this)" />
|
id="fractional" checked="checked" onclick="update(this)" />
|
||||||
<label for="fractional">Fractional Zoom</label>
|
<label for="fractional">Fractional Zoom</label>
|
||||||
|
|||||||
@@ -1,21 +1,19 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>Full Screen Example</title>
|
<title>Full Screen Example</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
#map {
|
#map {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
#text {
|
#text {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 1em;
|
bottom: 0px;
|
||||||
left: 1em;
|
left:0px;
|
||||||
width: 512px;
|
width: 512px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
52
examples/fullScreen2.html
Normal file
52
examples/fullScreen2.html
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title>Full Screen Example 2</title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
|
<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
BIN
examples/fullscreen.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
@@ -1,7 +1,13 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 800px;
|
||||||
|
height: 475px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lon = 5;
|
var lon = 5;
|
||||||
@@ -56,7 +62,6 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">GeoJSON Example</h1>
|
<div id="map"></div>
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 800px;
|
||||||
|
height: 400px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
.olPopupContent {
|
.olPopupContent {
|
||||||
font-size: smaller;
|
font-size: smaller;
|
||||||
}
|
}
|
||||||
@@ -27,7 +32,7 @@
|
|||||||
style = new OpenLayers.Style({externalGraphic: "${thumbnail}"});
|
style = new OpenLayers.Style({externalGraphic: "${thumbnail}"});
|
||||||
|
|
||||||
// create a rule with a point symbolizer that will make the thumbnail
|
// create a rule with a point symbolizer that will make the thumbnail
|
||||||
// larger if the title of the rss item contains "powder"
|
// larger if the title of the rss item conatins "powder"
|
||||||
var rule = new OpenLayers.Rule({
|
var rule = new OpenLayers.Rule({
|
||||||
symbolizer: {pointRadius: 30},
|
symbolizer: {pointRadius: 30},
|
||||||
filter: new OpenLayers.Filter.Comparison({
|
filter: new OpenLayers.Filter.Comparison({
|
||||||
@@ -46,23 +51,9 @@
|
|||||||
|
|
||||||
style.addRules([rule, elseRule]);
|
style.addRules([rule, elseRule]);
|
||||||
|
|
||||||
// Create a GML layer with GeoRSS format and a style map.
|
// Create a layer with a style map. Giving the style map keys
|
||||||
markerLayer = new OpenLayers.Layer.GML("Some images from Flickr",
|
// for "default" and "select" rendering intent.
|
||||||
"xml/georss-flickr.xml", {
|
markerLayer = new OpenLayers.Layer.Vector("", {
|
||||||
format: OpenLayers.Format.GeoRSS,
|
|
||||||
formatOptions: {
|
|
||||||
// adds the thumbnail attribute to the feature
|
|
||||||
createFeatureFromItem: function(item) {
|
|
||||||
var feature = OpenLayers.Format.GeoRSS.prototype
|
|
||||||
.createFeatureFromItem.apply(this, arguments);
|
|
||||||
feature.attributes.thumbnail =
|
|
||||||
this.getElementsByTagNameNS(
|
|
||||||
item, "*", "thumbnail")[0].getAttribute("url");
|
|
||||||
return feature;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Giving the style map keys for "default" and "select"
|
|
||||||
// rendering intent, to make the image larger when selected
|
|
||||||
styleMap: new OpenLayers.StyleMap({
|
styleMap: new OpenLayers.StyleMap({
|
||||||
"default": style,
|
"default": style,
|
||||||
"select": new OpenLayers.Style({pointRadius: 35})
|
"select": new OpenLayers.Style({pointRadius: 35})
|
||||||
@@ -89,12 +80,36 @@
|
|||||||
map.addControl(popupControl);
|
map.addControl(popupControl);
|
||||||
|
|
||||||
popupControl.activate();
|
popupControl.activate();
|
||||||
|
|
||||||
|
OpenLayers.loadURL("xml/georss-flickr.xml", null, window, afterload);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function afterload(req) {
|
||||||
|
// extended version of OpenLayers.Format.GeoRSS.createFeatureFromItem;
|
||||||
|
// adds the thumbnail attribute to the feature
|
||||||
|
function createFeatureFromItem(item) {
|
||||||
|
var feature = OpenLayers.Format.GeoRSS.prototype
|
||||||
|
.createFeatureFromItem.apply(this, arguments);
|
||||||
|
feature.attributes.thumbnail =
|
||||||
|
this.getElementsByTagNameNS(
|
||||||
|
item, "*", "thumbnail")[0].getAttribute("url");
|
||||||
|
return feature;
|
||||||
|
}
|
||||||
|
|
||||||
|
var store = new OpenLayers.Format.GeoRSS({
|
||||||
|
createFeatureFromItem: createFeatureFromItem});
|
||||||
|
|
||||||
|
rss = store.read(req.responseText);
|
||||||
|
|
||||||
|
markerLayer.setName("Some images from Flickr");
|
||||||
|
markerLayer.addFeatures(rss);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">GeoRSS from Flickr in OpenLayers</h1>
|
<h1>GeoRSS from Flickr in OpenLayers</h1>
|
||||||
<p>The displayed GeoRSS feed has a <tt><media:thumbnail/></tt> property for each item. An extended <tt>createFeatureFromItem()</tt> function is used to add this attribute to the attributes hash of each feature read in by <tt>OpenLayers.Format.GeoRSS</tt>. The example is configured with a style to render each item with its thumbnail image. Also, to show how rules work, we defined a rule that if the title of an rss item contains "powder", it will be rendered larger than the others.</p>
|
<p>The displayed GeoRSS feed has a <tt><media:thumbnail/></tt> property for each item. An extended <tt>createFeatureFromItem()</tt> function is used to add this attribute to the attributes hash of each feature read in by <tt>OpenLayers.Format.GeoRSS</tt>. The example is configured with a style to render each item with its thumbnail image. Also, to show how rules work, we defined a rule that if the title of an rss item contains "powder", it will be rendered larger than the others.</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers GeoRSS Marker Example</title>
|
<title>OpenLayers GeoRSS Marker Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer;
|
var map, layer;
|
||||||
@@ -32,7 +38,7 @@
|
|||||||
Demonstrate loading a GeoRSS feed using the GeoRSS parser.
|
Demonstrate loading a GeoRSS feed using the GeoRSS parser.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
58
examples/georss-serialize.html
Normal file
58
examples/georss-serialize.html
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title>OpenLayers GeoRSS Serialize Example</title>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var map, drawControl, g;
|
||||||
|
function serialize(feature) {
|
||||||
|
feature.attributes = {};
|
||||||
|
var name = prompt("Title for feature?");
|
||||||
|
feature.attributes['title'] = name;
|
||||||
|
var data = g.write(feature.layer.features);
|
||||||
|
OpenLayers.Util.getElement("gml").value = data;
|
||||||
|
}
|
||||||
|
function init(){
|
||||||
|
g = new OpenLayers.Format.GeoRSS();
|
||||||
|
map = new OpenLayers.Map('map');
|
||||||
|
|
||||||
|
var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||||
|
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
|
||||||
|
|
||||||
|
var pointLayer = new OpenLayers.Layer.Vector("Point Layer");
|
||||||
|
pointLayer.onFeatureInsert = serialize;
|
||||||
|
|
||||||
|
map.addLayers([wmsLayer, pointLayer]);
|
||||||
|
map.addControl(new OpenLayers.Control.EditingToolbar(pointLayer));
|
||||||
|
map.addControl(new OpenLayers.Control.MousePosition());
|
||||||
|
|
||||||
|
|
||||||
|
map.setCenter(new OpenLayers.LonLat(0, 0), 3);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body onload="init()">
|
||||||
|
<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>
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers GeoRSS Example</title>
|
<title>OpenLayers GeoRSS Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer;
|
var map, layer;
|
||||||
@@ -35,7 +41,7 @@
|
|||||||
Display a couple of locally cached georss feeds on an a basemap.
|
Display a couple of locally cached georss feeds on an a basemap.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>This demo uses the OpenLayers GeoRSS parser, which supports GeoRSS Simple and W3C GeoRSS. Only points are
|
<p>This demo uses the OpenLayers GeoRSS parser, which supports GeoRSS Simple and W3C GeoRSS. Only points are
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
<title>OpenLayers Feature Info Example</title>
|
<title>OpenLayers Feature Info Example</title>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
ul, li { padding-left: 0px; margin-left: 0px; }
|
ul, li { padding-left: 0px; margin-left: 0px; }
|
||||||
</style>
|
</style>
|
||||||
@@ -25,7 +24,7 @@
|
|||||||
<div id="nodeList">
|
<div id="nodeList">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map" style="width:512px; height:512px"></div>
|
||||||
|
|
||||||
<script defer="defer" type="text/javascript">
|
<script defer="defer" type="text/javascript">
|
||||||
OpenLayers.ProxyHost = "/dev/examples/proxy.cgi?url=";
|
OpenLayers.ProxyHost = "/dev/examples/proxy.cgi?url=";
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers GML Layer Example</title>
|
<title>OpenLayers GML Layer Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lon = 5;
|
var lon = 5;
|
||||||
@@ -29,7 +35,7 @@
|
|||||||
Loads locally stored GML vector data on a basemap. Includes GML example file.
|
Loads locally stored GML vector data on a basemap. Includes GML example file.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
97
examples/gml-serialize.html
Normal file
97
examples/gml-serialize.html
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title>OpenLayers GML Serialization Example</title>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 350px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var map, drawControl, g;
|
||||||
|
function serialize(feature) {
|
||||||
|
feature.attributes = {};
|
||||||
|
var name = prompt("Name for feature?");
|
||||||
|
feature.attributes['name'] = name;
|
||||||
|
var data = g.write(feature.layer.features);
|
||||||
|
OpenLayers.Util.getElement("gml").value = data;
|
||||||
|
}
|
||||||
|
function init(){
|
||||||
|
g = new OpenLayers.Format.GML();
|
||||||
|
map = new OpenLayers.Map('map');
|
||||||
|
|
||||||
|
var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||||
|
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
|
||||||
|
|
||||||
|
var pointLayer = new OpenLayers.Layer.Vector("Point Layer");
|
||||||
|
pointLayer.onFeatureInsert = serialize;
|
||||||
|
|
||||||
|
map.addLayers([wmsLayer, pointLayer]);
|
||||||
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
|
map.addControl(new OpenLayers.Control.MousePosition());
|
||||||
|
|
||||||
|
drawControls = {
|
||||||
|
point: new OpenLayers.Control.DrawFeature(pointLayer,
|
||||||
|
OpenLayers.Handler.Point),
|
||||||
|
line: new OpenLayers.Control.DrawFeature(pointLayer,
|
||||||
|
OpenLayers.Handler.Path)
|
||||||
|
};
|
||||||
|
|
||||||
|
for(var key in drawControls) {
|
||||||
|
map.addControl(drawControls[key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
map.setCenter(new OpenLayers.LonLat(0, 0), 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleControl(element) {
|
||||||
|
for(key in drawControls) {
|
||||||
|
var control = drawControls[key];
|
||||||
|
if(element.value == key && element.checked) {
|
||||||
|
control.activate();
|
||||||
|
} else {
|
||||||
|
control.deactivate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body onload="init()">
|
||||||
|
<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>
|
||||||
|
<input type="radio" name="type" value="none" id="noneToggle"
|
||||||
|
onclick="toggleControl(this);" checked="checked" />
|
||||||
|
<label for="noneToggle">navigate</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="radio" name="type" value="point" id="pointToggle" onclick="toggleControl(this);" />
|
||||||
|
<label for="pointToggle">draw point</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="radio" name="type" value="line" id="lineToggle" onclick="toggleControl(this);" />
|
||||||
|
<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>
|
||||||
@@ -2,7 +2,14 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Google with Overlay Example</title>
|
<title>OpenLayers Google with Overlay Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
|
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
|
||||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
@@ -31,6 +38,7 @@
|
|||||||
|
|
||||||
map.setCenter(new OpenLayers.LonLat(10.205188,48.857593), 5);
|
map.setCenter(new OpenLayers.LonLat(10.205188,48.857593), 5);
|
||||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||||
|
map.addControl( new OpenLayers.Control.PanZoomBar() );
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
@@ -43,7 +51,7 @@
|
|||||||
Demonstrate a Google basemap used with boundary overlay layer.
|
Demonstrate a Google basemap used with boundary overlay layer.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
An overlay in a Geographic projection can be stretched to somewhat
|
An overlay in a Geographic projection can be stretched to somewhat
|
||||||
|
|||||||
@@ -2,7 +2,14 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Google Layer Example</title>
|
<title>OpenLayers Google Layer Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
|
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
|
||||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
@@ -45,7 +52,7 @@
|
|||||||
Demonstrate use of the various types of Google layers.
|
Demonstrate use of the various types of Google layers.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
For best performance, you must be using a version of the Google Maps
|
For best performance, you must be using a version of the Google Maps
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>OpenLayers Graphic Names</title>
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var map;
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
map = new OpenLayers.Map('map');
|
|
||||||
|
|
||||||
// list of well-known graphic names
|
|
||||||
var graphics = ["star", "cross", "x", "square", "triangle", "circle"];
|
|
||||||
|
|
||||||
// Create one feature for each well known graphic.
|
|
||||||
// Give features a type attribute with the graphic name.
|
|
||||||
var num = graphics.length;
|
|
||||||
var slot = map.maxExtent.getWidth() / num;
|
|
||||||
var features = Array(num);
|
|
||||||
for(var i=0; i<graphics.length; ++i) {
|
|
||||||
lon = map.maxExtent.left + (i * slot) + (slot / 2);
|
|
||||||
features[i] = new OpenLayers.Feature.Vector(
|
|
||||||
new OpenLayers.Geometry.Point(
|
|
||||||
map.maxExtent.left + (i * slot) + (slot / 2), 0
|
|
||||||
), {
|
|
||||||
type: graphics[i]
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a style map for painting the features.
|
|
||||||
// The graphicName property of the symbolizer is evaluated using
|
|
||||||
// the type attribute on each feature (set above).
|
|
||||||
var styles = new OpenLayers.StyleMap({
|
|
||||||
"default": {
|
|
||||||
graphicName: "${type}",
|
|
||||||
pointRadius: 10,
|
|
||||||
strokeColor: "fuchsia",
|
|
||||||
strokeWidth: 2,
|
|
||||||
fillColor: "lime",
|
|
||||||
fillOpacity: 0.6
|
|
||||||
},
|
|
||||||
"select": {
|
|
||||||
pointRadius: 20,
|
|
||||||
fillOpacity: 1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Create a vector layer and give it your style map.
|
|
||||||
var layer = new OpenLayers.Layer.Vector(
|
|
||||||
"Graphics", {styleMap: styles, isBaseLayer: true}
|
|
||||||
);
|
|
||||||
layer.addFeatures(features);
|
|
||||||
map.addLayer(layer);
|
|
||||||
|
|
||||||
// Create a select feature control and add it to the map.
|
|
||||||
var select = new OpenLayers.Control.SelectFeature(layer, {hover: true});
|
|
||||||
map.addControl(select);
|
|
||||||
select.activate();
|
|
||||||
|
|
||||||
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body onload="init()">
|
|
||||||
<h1 id="title">Named Graphics Example</h1>
|
|
||||||
|
|
||||||
<div id="tags"></div>
|
|
||||||
|
|
||||||
<p id="shortdesc">
|
|
||||||
Shows how to use well-known graphic names.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
|
|
||||||
<div id="docs">
|
|
||||||
OpenLayers supports well-known names for a few graphics. You can use
|
|
||||||
the names "star", "cross", "x", "square", "triangle", and "circle" as
|
|
||||||
the value for the graphicName property of a symbolizer.
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -2,8 +2,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Gutter Example</title>
|
<title>OpenLayers Gutter Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 521px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
p.caption {
|
p.caption {
|
||||||
width: 512px;
|
width: 512px;
|
||||||
}
|
}
|
||||||
@@ -39,7 +43,7 @@
|
|||||||
Demonstrates map tiling artifacts, and OpenLayer's facility for correcting this distortion.
|
Demonstrates map tiling artifacts, and OpenLayer's facility for correcting this distortion.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p class="caption">
|
<p class="caption">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Hover Handler Example</title>
|
<title>OpenLayers Hover Handler Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 340px;
|
width: 340px;
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
This example shows the use of the hover handler.
|
This example shows the use of the hover handler.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<p>
|
<p>
|
||||||
The hover handler is to be used to emulate mouseovers on
|
The hover handler is to be used to emulate mouseovers on
|
||||||
objects on the map that aren't DOM elements. For example
|
objects on the map that aren't DOM elements. For example
|
||||||
|
|||||||
@@ -2,11 +2,15 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Image Layer Example</title>
|
<title>OpenLayers Image Layer Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
p.caption {
|
p {
|
||||||
width: 512px;
|
width: 512px;
|
||||||
}
|
}
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -42,10 +46,10 @@
|
|||||||
Demonstrate a single non-tiled image as a selectable base layer.
|
Demonstrate a single non-tiled image as a selectable base layer.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p class="caption">
|
<p>
|
||||||
The "City Lights" layer above is created from a single web accessible
|
The "City Lights" layer above is created from a single web accessible
|
||||||
image. If you construct it without any resolution related options,
|
image. If you construct it without any resolution related options,
|
||||||
the layer will be given a single resolution based on the extent/size.
|
the layer will be given a single resolution based on the extent/size.
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Geometry Intersections</title>
|
<title>Geometry Intersections</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
html, body {
|
html, body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -160,11 +159,8 @@
|
|||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<div id="leftcol">
|
<div id="leftcol">
|
||||||
<h1 id="title">OpenLayers Geometry Intersection Example</h1>
|
<h2>OpenLayers Geometry Intersection Example</h2>
|
||||||
<p id="shortdesc">
|
<div id="map"></div>
|
||||||
Use of geometry.intersects method for testing geometry intersections.
|
|
||||||
</p>
|
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
<div id="input">
|
<div id="input">
|
||||||
<textarea id="text"></textarea>
|
<textarea id="text"></textarea>
|
||||||
<input type="button" value="add feature" onclick="deserialize();" />
|
<input type="button" value="add feature" onclick="deserialize();" />
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers KaMap Example</title>
|
<title>OpenLayers KaMap Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map;
|
var map;
|
||||||
@@ -32,7 +38,7 @@
|
|||||||
Demonstrate a tiled kamap layer as the base map, which can be pre-cached for higher performance.
|
Demonstrate a tiled kamap layer as the base map, which can be pre-cached for higher performance.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lon = 5;
|
var lon = 5;
|
||||||
@@ -35,7 +41,7 @@
|
|||||||
Demonstrates loading and displaying a KML file on top of a basemap.
|
Demonstrates loading and displaying a KML file on top of a basemap.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -2,11 +2,15 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Layer Opacity Example</title>
|
<title>OpenLayers Layer Opacity Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body {
|
body {
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
}
|
}
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid lightgray;
|
||||||
|
}
|
||||||
p {
|
p {
|
||||||
width: 512px;
|
width: 512px;
|
||||||
}
|
}
|
||||||
@@ -71,7 +75,7 @@
|
|||||||
Demonstrate a change in the opacity for an overlay layer.
|
Demonstrate a change in the opacity for an overlay layer.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Layer Load Monitoring Example</title>
|
<title>OpenLayers Layer Load Monitoring Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
#controls {
|
#controls {
|
||||||
float: left;
|
float: left;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Layer Switcher Example</title>
|
<title>OpenLayers Layer Switcher Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map;
|
var map;
|
||||||
@@ -44,8 +50,8 @@
|
|||||||
Demonstrates the use of the LayerSwitcher outside of the OpenLayers window.
|
Demonstrates the use of the LayerSwitcher outside of the OpenLayers window.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="layerswitcher"></div>
|
<div id="layerswitcher" style="float:right; width: 20em;"></div>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p>This demonstrates use of the LayerSwitcher outside the map div. It also shows use
|
<p>This demonstrates use of the LayerSwitcher outside the map div. It also shows use
|
||||||
of the displayInLayerSwitcher option on the Layer to cause it to not display in the
|
of the displayInLayerSwitcher option on the Layer to cause it to not display in the
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Basic Single WMS Example</title>
|
<title>OpenLayers Basic Single WMS Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer;
|
var map, layer;
|
||||||
@@ -23,7 +29,7 @@
|
|||||||
|
|
||||||
<div id="shortdesc">Show a Simple Map</div>
|
<div id="shortdesc">Show a Simple Map</div>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
This example shows a very simple layout with minimal controls. This example uses a single WMS base layer.
|
This example shows a very simple layout with minimal controls. This example uses a single WMS base layer.
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers MapGuide Layer Example</title>
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 400px;
|
width: 400px;
|
||||||
@@ -21,24 +18,14 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var map, layer;
|
var map, layer;
|
||||||
var url = "http://demo01.dmsolutions.ca/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&";
|
var url = "http://demo01.dmsolutions.ca/mapguide/mapagent/mapagent.fcgi";
|
||||||
//you can use this URL when MapGuide OS is installed locally
|
//you can use this URL when MapGuide OS is installed locally
|
||||||
//var url = "/mapguide/mapagent/mapagent.fcgi";
|
//var url = "/mapguide/mapagent/mapagent.fcgi";
|
||||||
|
|
||||||
//Adjust the scale assumptions for MapGuide layers
|
|
||||||
//Tiled layers MUST use a DPI value of 96, untiled layers can use a
|
|
||||||
//different DPI value which will be passed to the server as a parameter.
|
|
||||||
//Tiled and untiled layers must adjust the OL INCHES_PER_UNIT values
|
|
||||||
//for any degree-based projections.
|
|
||||||
var metersPerUnit = 111319.4908; //value returned from mapguide
|
|
||||||
var inPerUnit = OpenLayers.INCHES_PER_UNIT.m * metersPerUnit;
|
|
||||||
OpenLayers.INCHES_PER_UNIT["dd"] = inPerUnit;
|
|
||||||
OpenLayers.INCHES_PER_UNIT["degrees"] = inPerUnit;
|
|
||||||
OpenLayers.DOTS_PER_INCH = 96;
|
|
||||||
|
|
||||||
//tiled version
|
//tiled version
|
||||||
function initTiled(){
|
function initTiled(){
|
||||||
|
|
||||||
|
OpenLayers.DOTS_PER_INCH = 96;
|
||||||
var extent = new OpenLayers.Bounds(-3631568.75,-1293815.5,4491139.5833333321,4937122);
|
var extent = new OpenLayers.Bounds(-3631568.75,-1293815.5,4491139.5833333321,4937122);
|
||||||
var tempScales = [50000000,23207944.16806,10772173.45016,5000000,2320794.41681,1077217.34502,500000,232079.44168,107721.7345,50000];
|
var tempScales = [50000000,23207944.16806,10772173.45016,5000000,2320794.41681,1077217.34502,500000,232079.44168,107721.7345,50000];
|
||||||
var mapOptions = {
|
var mapOptions = {
|
||||||
@@ -65,6 +52,7 @@
|
|||||||
//un-tiled version
|
//un-tiled version
|
||||||
function initUntiled() {
|
function initUntiled() {
|
||||||
|
|
||||||
|
OpenLayers.DOTS_PER_INCH = 96;
|
||||||
var extent = new OpenLayers.Bounds(-87.865114442365922,43.665065564837931,-87.595394059497067,43.823852564430069);
|
var extent = new OpenLayers.Bounds(-87.865114442365922,43.665065564837931,-87.595394059497067,43.823852564430069);
|
||||||
var mapOptions = {
|
var mapOptions = {
|
||||||
maxExtent: extent,
|
maxExtent: extent,
|
||||||
@@ -106,14 +94,6 @@
|
|||||||
var params = {
|
var params = {
|
||||||
mapName: 'Sheboygan',
|
mapName: 'Sheboygan',
|
||||||
session: '0b8cb80e-0000-1000-8003-0017a4e6ff5d_en_C0A802AD0AFC0AFB0AFA',
|
session: '0b8cb80e-0000-1000-8003-0017a4e6ff5d_en_C0A802AD0AFC0AFB0AFA',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mapName: 'Sheboygan',
|
|
||||||
session: '0b8cb80e-0000-1000-8003-0017a4e6ff5d_en_C0A802AD0AFC0AFB0AFA',
|
|
||||||
version: '2.0.0',
|
|
||||||
selectioncolor: '0xFF0000',
|
|
||||||
behavior: 7
|
|
||||||
};
|
};
|
||||||
layer = new OpenLayers.Layer.MapGuide( "MapGuide OS Overlay layer", url, params, options );
|
layer = new OpenLayers.Layer.MapGuide( "MapGuide OS Overlay layer", url, params, options );
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
@@ -123,17 +103,8 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="initUntiled(); initTiled()">
|
<body onload="initUntiled(); initTiled()">
|
||||||
<h1 id="title">MapGuide Layer Example</h1>
|
|
||||||
|
|
||||||
<div id="tags">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p id="shortdesc">
|
|
||||||
Demonstrates how to create MapGuide tiled and untiled layers.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>If prompted for a password, username is Anonymous and an empty password</p>
|
<p>If prompted for a password, username is Anonymous and an empty password</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="map2"></div>
|
<div id="map2"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>MapServer Layer</title>
|
<title>MapServer Layer</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 800px;
|
||||||
|
height: 475px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lon = 5;
|
var lon = 5;
|
||||||
@@ -27,7 +33,7 @@
|
|||||||
<div id="title">MapServer Layer</div>
|
<div id="title">MapServer Layer</div>
|
||||||
<div id="tags"></div>
|
<div id="tags"></div>
|
||||||
<div id="shortdesc">Shows MapServer Layer</div>
|
<div id="shortdesc">Shows MapServer Layer</div>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="docs">
|
<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.
|
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>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>MapServer Single Tile Mode</title>
|
<title>MapServer Single Tile Mode</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -27,7 +26,7 @@
|
|||||||
<div id="title">MapServer Single Tile Mode</div>
|
<div id="title">MapServer Single Tile Mode</div>
|
||||||
<div id="tags"></div>
|
<div id="tags"></div>
|
||||||
<div id="shortdesc">Shows single tile MapServer Layer</div>
|
<div id="shortdesc">Shows single tile MapServer Layer</div>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="docs">
|
<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.
|
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>
|
</div>
|
||||||
|
|||||||
@@ -1,141 +0,0 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
|
||||||
.smallmap {
|
|
||||||
width: 300px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.docs {
|
|
||||||
padding: 0px 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
var SHADOW_Z_INDEX = 10;
|
|
||||||
var MARKER_Z_INDEX = 11;
|
|
||||||
|
|
||||||
var DIAMETER = 200;
|
|
||||||
var NUMBER_OF_FEATURES = 15;
|
|
||||||
|
|
||||||
var map, layer;
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
map = new OpenLayers.Map("map");
|
|
||||||
|
|
||||||
layer = new OpenLayers.Layer.Vector(
|
|
||||||
"Marker Drop Shadows",
|
|
||||||
{
|
|
||||||
styleMap: new OpenLayers.StyleMap({
|
|
||||||
// Set the external graphic and background graphic images.
|
|
||||||
externalGraphic: "../img/marker-gold.png",
|
|
||||||
backgroundGraphic: "./marker_shadow.png",
|
|
||||||
|
|
||||||
// Makes sure the background graphic is placed correctly relative
|
|
||||||
// to the external graphic.
|
|
||||||
backgroundXOffset: 0,
|
|
||||||
backgroundYOffset: -7,
|
|
||||||
|
|
||||||
// Set the z-indexes of both graphics to make sure the background
|
|
||||||
// graphics stay in the background (shadows on top of markers looks
|
|
||||||
// odd; let's not do that).
|
|
||||||
graphicZIndex: MARKER_Z_INDEX,
|
|
||||||
backgroundGraphicZIndex: SHADOW_Z_INDEX,
|
|
||||||
|
|
||||||
pointRadius: 10
|
|
||||||
}),
|
|
||||||
isBaseLayer: true,
|
|
||||||
rendererOptions: {yOrdering: true}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
map.addLayers([layer]);
|
|
||||||
|
|
||||||
// Add a drag feature control to move features around.
|
|
||||||
var dragFeature = new OpenLayers.Control.DragFeature(layer);
|
|
||||||
|
|
||||||
map.addControl(dragFeature);
|
|
||||||
|
|
||||||
dragFeature.activate();
|
|
||||||
|
|
||||||
map.zoomToMaxExtent();
|
|
||||||
|
|
||||||
drawFeatures();
|
|
||||||
}
|
|
||||||
|
|
||||||
function drawFeatures() {
|
|
||||||
|
|
||||||
layer.removeFeatures(layer.features);
|
|
||||||
|
|
||||||
// Create features at random around the center.
|
|
||||||
var center = map.getViewPortPxFromLonLat(map.getCenter());
|
|
||||||
|
|
||||||
// Add the ordering features. These are the gold ones that all have the same z-index
|
|
||||||
// and succomb to y-ordering.
|
|
||||||
var features = [];
|
|
||||||
|
|
||||||
for (var index = 0; index < NUMBER_OF_FEATURES; index++) {
|
|
||||||
// Calculate a random x/y. Subtract half the diameter to make some
|
|
||||||
// features negative.
|
|
||||||
var x = (parseInt(Math.random() * DIAMETER)) - (DIAMETER / 2);
|
|
||||||
var y = (parseInt(Math.random() * DIAMETER)) - (DIAMETER / 2);
|
|
||||||
|
|
||||||
var pixel = new OpenLayers.Pixel(center.x + x, center.y + y);
|
|
||||||
|
|
||||||
var lonLat = map.getLonLatFromViewPortPx(pixel);
|
|
||||||
features.push(
|
|
||||||
new OpenLayers.Feature.Vector(
|
|
||||||
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.addFeatures(features);
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body onload="init()">
|
|
||||||
<h1 id="title">Marker Shadows using Background Graphics/Z-Indexes</h1>
|
|
||||||
|
|
||||||
<div id="tags">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p id="shortdesc">
|
|
||||||
This example shows off marker shadows using background graphics and z-indexes. Move the features around to show the shadows' interaction.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div class="docs">
|
|
||||||
The features in this map were generated at random. Each of these features have a <i>backgroundGraphic</i> property set in the style map to add a shadow image. Note that the background graphics are not duplicated features with a different style.
|
|
||||||
<br><br>
|
|
||||||
The shadows were set to have a different z-index than the markers themselves, using the <i>backgroundGraphicZIndex</i> property. This makes sure all shadows stay behind the markers, keeping a clean look. The shadows were also placed nicely relative to the external graphic using the <i>backgroundXOffset</i> and <i>backgroundYOffset</i> property.
|
|
||||||
<br><br>
|
|
||||||
Y-ordering on the layer is enabled. See the <a href="./ordering.html">ordering example</a>.
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<button onclick="drawFeatures()">Redraw Features</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Resize a Marker</title>
|
<title>Resize a Marker</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer;
|
var map, layer;
|
||||||
@@ -42,7 +48,7 @@
|
|||||||
<div id="title">Resize a Marker</div>
|
<div id="title">Resize a Marker</div>
|
||||||
<div id="tags"></div>
|
<div id="tags"></div>
|
||||||
<div id="shortdesc">Dynamically resize a marker</div>
|
<div id="shortdesc">Dynamically resize a marker</div>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="docs">
|
<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.
|
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>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 374 B |
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Markers Layer Example</title>
|
<title>Markers Layer Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer;
|
var map, layer;
|
||||||
@@ -45,7 +51,7 @@
|
|||||||
<div id="title">Markers Layer Example</div>
|
<div id="title">Markers Layer Example</div>
|
||||||
<div id="tags"></div>
|
<div id="tags"></div>
|
||||||
<div id="shortdesc">Show markers layer with different markers</div>
|
<div id="shortdesc">Show markers layer with different markers</div>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="docs">
|
<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.
|
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>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Using a Layer.Text to display markers</title>
|
<title>Using a Layer.Text to display markers</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer;
|
var map, layer;
|
||||||
@@ -29,6 +35,6 @@
|
|||||||
The Layer.Text class reads a Tab seperated values file and displays it as markers on
|
The Layer.Text class reads a Tab seperated values file and displays it as markers on
|
||||||
the map.
|
the map.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,149 +0,0 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
|
||||||
#controlToggle li {
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
width: 512px;
|
|
||||||
}
|
|
||||||
#options {
|
|
||||||
position: relative;
|
|
||||||
width: 512px;
|
|
||||||
}
|
|
||||||
#output {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var map, measureControls;
|
|
||||||
OpenLayers.Util.onImageLoadErrorColor = "transparent";
|
|
||||||
function init(){
|
|
||||||
map = new OpenLayers.Map('map');
|
|
||||||
|
|
||||||
var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
|
||||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
|
|
||||||
|
|
||||||
map.addLayers([wmsLayer]);
|
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
|
||||||
map.addControl(new OpenLayers.Control.MousePosition());
|
|
||||||
|
|
||||||
// style the sketch fancy
|
|
||||||
sketchSymbolizers = {
|
|
||||||
"Point": {
|
|
||||||
pointRadius: 4,
|
|
||||||
graphicName: "square",
|
|
||||||
fillColor: "white",
|
|
||||||
fillOpacity: 1,
|
|
||||||
strokeWidth: 1,
|
|
||||||
strokeOpacity: 1,
|
|
||||||
strokeColor: "#333333"
|
|
||||||
},
|
|
||||||
"Line": {
|
|
||||||
strokeWidth: 3,
|
|
||||||
strokeOpacity: 1,
|
|
||||||
strokeColor: "#666666",
|
|
||||||
strokeDashstyle: "dash"
|
|
||||||
},
|
|
||||||
"Polygon": {
|
|
||||||
strokeWidth: 2,
|
|
||||||
strokeOpacity: 1,
|
|
||||||
strokeColor: "#666666",
|
|
||||||
fillColor: "white",
|
|
||||||
fillOpacity: 0.3
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var style = new OpenLayers.Style();
|
|
||||||
style.addRules([
|
|
||||||
new OpenLayers.Rule({symbolizer: this.sketchSymbolizers})
|
|
||||||
]);
|
|
||||||
var styleMap = new OpenLayers.StyleMap({"default": style});
|
|
||||||
|
|
||||||
var options = {
|
|
||||||
handlerOptions: {
|
|
||||||
style: "default", // this forces default render intent
|
|
||||||
layerOptions: {styleMap: styleMap},
|
|
||||||
persist: true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
measureControls = {
|
|
||||||
line: new OpenLayers.Control.Measure(
|
|
||||||
OpenLayers.Handler.Path, options
|
|
||||||
),
|
|
||||||
polygon: new OpenLayers.Control.Measure(
|
|
||||||
OpenLayers.Handler.Polygon, options
|
|
||||||
)
|
|
||||||
};
|
|
||||||
|
|
||||||
var control;
|
|
||||||
for(var key in measureControls) {
|
|
||||||
control = measureControls[key];
|
|
||||||
control.events.on({
|
|
||||||
"measure": handleMeasurements,
|
|
||||||
"measurepartial": handleMeasurements
|
|
||||||
});
|
|
||||||
map.addControl(control);
|
|
||||||
}
|
|
||||||
|
|
||||||
map.setCenter(new OpenLayers.LonLat(0, 0), 3);
|
|
||||||
|
|
||||||
document.getElementById('noneToggle').checked = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleMeasurements(event) {
|
|
||||||
var geometry = event.geometry;
|
|
||||||
var units = event.units;
|
|
||||||
var order = event.order;
|
|
||||||
var measure = event.measure;
|
|
||||||
var element = document.getElementById('output');
|
|
||||||
var out = "";
|
|
||||||
if(order == 1) {
|
|
||||||
out += "measure: " + measure.toFixed(3) + " " + units;
|
|
||||||
} else {
|
|
||||||
out += "measure: " + measure.toFixed(3) + " " + units + "<sup>2</" + "sup>";
|
|
||||||
}
|
|
||||||
element.innerHTML = out;
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleControl(element) {
|
|
||||||
for(key in measureControls) {
|
|
||||||
var control = measureControls[key];
|
|
||||||
if(element.value == key && element.checked) {
|
|
||||||
control.activate();
|
|
||||||
} else {
|
|
||||||
control.deactivate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body onload="init()">
|
|
||||||
<h1 id="title">OpenLayers Measure Example</h1>
|
|
||||||
<p id="shortdesc">
|
|
||||||
Demonstrates the measure control to measure distances and areas.
|
|
||||||
</p>
|
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
<div id="options">
|
|
||||||
<div id="output">
|
|
||||||
</div>
|
|
||||||
<ul id="controlToggle">
|
|
||||||
<li>
|
|
||||||
<input type="radio" name="type" value="none" id="noneToggle"
|
|
||||||
onclick="toggleControl(this);" checked="checked" />
|
|
||||||
<label for="noneToggle">navigate</label>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<input type="radio" name="type" value="line" id="lineToggle" onclick="toggleControl(this);" />
|
|
||||||
<label for="lineToggle">measure distance</label>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<input type="radio" name="type" value="polygon" id="polygonToggle" onclick="toggleControl(this);" />
|
|
||||||
<label for="polygonToggle">measure area</label>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>MultiMap</title>
|
<title>MultiMap</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -53,7 +52,7 @@
|
|||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
An example of using the Layer.MultiMap class.
|
An example of using the Layer.MultiMap class.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div style="background-color:green" onclick="add()"> click to add the marker to the 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>
|
<div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -2,8 +2,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Modify Feature</title>
|
<title>Modify Feature</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 350px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
#controls {
|
#controls {
|
||||||
width: 512px;
|
width: 512px;
|
||||||
}
|
}
|
||||||
@@ -29,14 +33,20 @@
|
|||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.addControl(new OpenLayers.Control.MousePosition());
|
map.addControl(new OpenLayers.Control.MousePosition());
|
||||||
|
|
||||||
function report(event) {
|
var modifyOptions = {
|
||||||
OpenLayers.Console.log(event.type, event.feature.id);
|
onModificationStart: function(feature) {
|
||||||
}
|
OpenLayers.Console.log("start modifying", feature.id);
|
||||||
vectors.events.on({
|
},
|
||||||
"beforefeaturemodified": report,
|
onModification: function(feature) {
|
||||||
"featuremodified": report,
|
OpenLayers.Console.log("modified", feature.id);
|
||||||
"afterfeaturemodified": report
|
},
|
||||||
});
|
onModificationEnd: function(feature) {
|
||||||
|
OpenLayers.Console.log("end modifying", feature.id);
|
||||||
|
},
|
||||||
|
onDelete: function(feature) {
|
||||||
|
OpenLayers.Console.log("delete", feature.id);
|
||||||
|
}
|
||||||
|
};
|
||||||
controls = {
|
controls = {
|
||||||
point: new OpenLayers.Control.DrawFeature(vectors,
|
point: new OpenLayers.Control.DrawFeature(vectors,
|
||||||
OpenLayers.Handler.Point),
|
OpenLayers.Handler.Point),
|
||||||
@@ -47,7 +57,8 @@
|
|||||||
regular: new OpenLayers.Control.DrawFeature(vectors,
|
regular: new OpenLayers.Control.DrawFeature(vectors,
|
||||||
OpenLayers.Handler.RegularPolygon,
|
OpenLayers.Handler.RegularPolygon,
|
||||||
{handlerOptions: {sides: 5}}),
|
{handlerOptions: {sides: 5}}),
|
||||||
modify: new OpenLayers.Control.ModifyFeature(vectors)
|
modify: new OpenLayers.Control.ModifyFeature(vectors,
|
||||||
|
modifyOptions)
|
||||||
};
|
};
|
||||||
|
|
||||||
for(var key in controls) {
|
for(var key in controls) {
|
||||||
@@ -101,7 +112,7 @@
|
|||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h3 id="title">OpenLayers Modify Feature Example</h3>
|
<h3 id="title">OpenLayers Modify Feature Example</h3>
|
||||||
<div id="shortdesc">A demonstration of the ModifyFeature control for editing vector features.</div>
|
<div id="shortdesc">A demonstration of the ModifyFeature control for editing vector features.</div>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<ul id="controlToggle">
|
<ul id="controlToggle">
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -4,7 +4,16 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>MousePosition Control</title>
|
<title>MousePosition Control</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 256px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map;
|
var map;
|
||||||
@@ -33,7 +42,7 @@
|
|||||||
Use the MousePosition Control to display the coordinates of the cursor
|
Use the MousePosition Control to display the coordinates of the cursor
|
||||||
inside or outside the map div.
|
inside or outside the map div.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="coords"></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>
|
<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>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>MultiMap SphericalMercator</title>
|
<title>MultiMap SphericalMercator</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -60,6 +59,6 @@
|
|||||||
multimap layer does not fully support the sphericalMercator projection at
|
multimap layer does not fully support the sphericalMercator projection at
|
||||||
this time.
|
this time.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 800px;
|
||||||
|
height: 475px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lon = 5;
|
var lon = 5;
|
||||||
@@ -31,7 +37,7 @@
|
|||||||
Load your tiles faster by pointing to the same server, but with different urls
|
Load your tiles faster by pointing to the same server, but with different urls
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
Browsers typically limit the number of concurrent requests to the same server, based on hostname. In order to ake tiles load more quickly, it often makes sense to distribute requests over multiple hostnames to achieve more concurrency. Typically, browsers perform best with 3 different hostnames -- your performance may vary. (For example, if your server can't handle more than 2 requests simultaneously, then additional hostnames will not help you.)
|
Browsers typically limit the number of concurrent requests to the same server, based on hostname. In order to ake tiles load more quickly, it often makes sense to distribute requests over multiple hostnames to achieve more concurrency. Typically, browsers perform best with 3 different hostnames -- your performance may vary. (For example, if your server can't handle more than 2 requests simultaneously, then additional hostnames will not help you.)
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Navigation Control</title>
|
<title>OpenLayers Navigation Control</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer;
|
var map, layer;
|
||||||
@@ -25,7 +31,7 @@
|
|||||||
|
|
||||||
<div id="shortdesc">Demonstrate Navigation Control features</div>
|
<div id="shortdesc">Demonstrate Navigation Control features</div>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<a href="#" onclick="nav.enableZoomWheel();return false">Turn on Wheel Zoom</a> | <a href="#" onclick="nav.disableZoomWheel(); return false;">Turn off Wheel Zoom</a>
|
<a href="#" onclick="nav.enableZoomWheel();return false">Turn on Wheel Zoom</a> | <a href="#" onclick="nav.disableZoomWheel(); return false;">Turn off Wheel Zoom</a>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
This example demonstrates a couple features of the Navigation control. The Navigation control controls most map dragging, movement, zooming, etc. In this case, we have a demonstration of how to create a navigation control with no zoom wheel action, which can then be enabled or disabled by the user.
|
This example demonstrates a couple features of the Navigation control. The Navigation control controls most map dragging, movement, zooming, etc. In this case, we have a demonstration of how to create a navigation control with no zoom wheel action, which can then be enabled or disabled by the user.
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Navigation History Example</title>
|
<title>OpenLayers Navigation History Example</title>
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
<style>
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 256px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
#panel {
|
#panel {
|
||||||
right: 0px;
|
right: 0px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
@@ -12,12 +16,24 @@
|
|||||||
float: left;
|
float: left;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, nav, panel;
|
var map, nav, panel;
|
||||||
|
|
||||||
function init() {
|
// preload images if you care
|
||||||
|
var preload = [
|
||||||
|
"../theme/default/img/view_previous_on.png",
|
||||||
|
"../theme/default/img/view_next_on.png"
|
||||||
|
];
|
||||||
|
var img = new Array(preload.length);
|
||||||
|
for(var i=0; i<preload.length; ++i) {
|
||||||
|
img[i] = new Image();
|
||||||
|
img[i].src = preload[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
function init(){
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map');
|
||||||
|
|
||||||
nav = new OpenLayers.Control.NavigationHistory();
|
nav = new OpenLayers.Control.NavigationHistory();
|
||||||
@@ -37,6 +53,8 @@
|
|||||||
);
|
);
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
map.zoomToMaxExtent();
|
map.zoomToMaxExtent();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
@@ -50,7 +68,7 @@
|
|||||||
A control for zooming to previous and next map extents.
|
A control for zooming to previous and next map extents.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
Map navigation history controls<div id="panel"></div>
|
Map navigation history controls<div id="panel"></div>
|
||||||
<div id="docs"></div>
|
<div id="docs"></div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#paneldiv {
|
#map {
|
||||||
height: 80px;
|
width: 800px;
|
||||||
|
height: 475px;
|
||||||
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#paneldiv { float: right }
|
||||||
#paneldiv div {
|
#paneldiv div {
|
||||||
top: 10px;
|
top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -32,8 +35,8 @@
|
|||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">Navigation Toolbar: Outside the Map</h1>
|
<h1 id="title">Navigation Toolbar: Outside the Map</h1>
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
<div id="paneldiv" class="olControlNavToolbar"></div>
|
<div id="paneldiv" class="olControlNavToolbar"></div>
|
||||||
|
<div id="map"></div>
|
||||||
<div id="docs">
|
<div id="docs">
|
||||||
<p> To place the Naviation Toolbar outside the map:</p>
|
<p> To place the Naviation Toolbar outside the map:</p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -42,6 +45,20 @@
|
|||||||
<li>Specify the HTML element as a 'div' option in your NavToolbar constructor</li>
|
<li>Specify the HTML element as a 'div' option in your NavToolbar constructor</li>
|
||||||
<li>Add the olControlNavToolbar class to your div.</li>
|
<li>Add the olControlNavToolbar class to your div.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<pre id="code">
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
|
<style type="text/css">
|
||||||
|
#paneldiv { float: right; }
|
||||||
|
#paneldiv div {
|
||||||
|
top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id="paneldiv" class="olControlNavToolbar"></div>
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
var panel = new OpenLayers.Control.NavToolbar({'div':OpenLayers.Util.getElement('paneldiv')});
|
||||||
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,7 +1,15 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 800px;
|
||||||
|
height: 475px;
|
||||||
|
border: 1px solid black;
|
||||||
|
float:right;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
<title>NavToolbar Demo</title>
|
<title>NavToolbar Demo</title>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -29,6 +37,6 @@
|
|||||||
Demo the NavToolbar, a subclass of Control.Panel which shows icons for
|
Demo the NavToolbar, a subclass of Control.Panel which shows icons for
|
||||||
navigation.
|
navigation.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#mapDiv {
|
||||||
|
width: 400px;
|
||||||
|
height: 400px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map;
|
var map;
|
||||||
@@ -29,7 +35,7 @@
|
|||||||
Create an untiled WMS layer using the singleTile: true, option or the deprecated
|
Create an untiled WMS layer using the singleTile: true, option or the deprecated
|
||||||
WMS.Untiled layer.
|
WMS.Untiled layer.
|
||||||
</p>
|
</p>
|
||||||
<div id="mapDiv" class="smallmap"></div>
|
<div id="mapDiv"></div>
|
||||||
<p> The first layer is an old OpenLayers.Layer.WMS.Untiled layer, using
|
<p> The first layer is an old OpenLayers.Layer.WMS.Untiled layer, using
|
||||||
a default ratio value of 1.5.
|
a default ratio value of 1.5.
|
||||||
<p> The second layer is an OpenLayers.Layer.WMS layer with singleTile set
|
<p> The second layer is an OpenLayers.Layer.WMS layer with singleTile set
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 600px;
|
||||||
|
height: 475px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
#info {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer;
|
var map, layer;
|
||||||
@@ -109,27 +118,6 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<p id="shortdesc">This example shows the use of a WFS service rendered using the OpenLayers vector library.</p>
|
|
||||||
<div id="map" class="smallmap"></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>
|
|
||||||
<div id="info">
|
<div id="info">
|
||||||
<ul>
|
<ul>
|
||||||
<li>Streams: Feature Count <span id="stream_features">0</span></li>
|
<li>Streams: Feature Count <span id="stream_features">0</span></li>
|
||||||
@@ -149,5 +137,26 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,203 +0,0 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
|
||||||
.smallmap {
|
|
||||||
width: 300px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.docs {
|
|
||||||
padding: 0px 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
td {
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
var GOLD_Z_INDEX = 15;
|
|
||||||
var FIRST_RED_Z_INDEX = 10;
|
|
||||||
var SECOND_RED_Z_INDEX = 11;
|
|
||||||
|
|
||||||
var RADIUS_FROM_CENTER = 40;
|
|
||||||
var POINT_DISTANCE = 10;
|
|
||||||
|
|
||||||
function initYOrderMap() {
|
|
||||||
var map = new OpenLayers.Map("yorder");
|
|
||||||
|
|
||||||
var layer = new OpenLayers.Layer.Vector(
|
|
||||||
"Y-Order",
|
|
||||||
{
|
|
||||||
styleMap: new OpenLayers.StyleMap({
|
|
||||||
externalGraphic: "../img/marker-gold.png",
|
|
||||||
pointRadius: 10,
|
|
||||||
graphicZIndex: GOLD_Z_INDEX
|
|
||||||
}),
|
|
||||||
isBaseLayer: true,
|
|
||||||
rendererOptions: {yOrdering: true}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
map.addLayers([layer]);
|
|
||||||
map.zoomToMaxExtent();
|
|
||||||
|
|
||||||
// Add features to the layers to show off z-index/y-ordering.
|
|
||||||
// We do this after adding the layer so we can work in pixels.
|
|
||||||
var center = map.getViewPortPxFromLonLat(map.getCenter());
|
|
||||||
|
|
||||||
var top = new OpenLayers.Pixel(center.x, center.y - RADIUS_FROM_CENTER);
|
|
||||||
var bottom = new OpenLayers.Pixel(center.x, center.y + RADIUS_FROM_CENTER);
|
|
||||||
var left = new OpenLayers.Pixel(center.x - RADIUS_FROM_CENTER, center.y - POINT_DISTANCE / 2);
|
|
||||||
var right = new OpenLayers.Pixel(center.x + RADIUS_FROM_CENTER, center.y - POINT_DISTANCE / 2);
|
|
||||||
|
|
||||||
// Add the ordering features. These are the gold ones that all have the same z-index
|
|
||||||
// and succomb to y-ordering.
|
|
||||||
var orderingFeatures = [];
|
|
||||||
// Note: We use > here on purpose (instead of >= ), as well as subtracting the
|
|
||||||
// the POINT_DISTANCE in the beginning of the loop (as opposed to the end).
|
|
||||||
// This is purely for symmetry. Also note that the gold features are drawn
|
|
||||||
// from bottom to top so as to quickly signal whether or not y-ordering is working.
|
|
||||||
while (bottom.y > top.y) {
|
|
||||||
bottom.y -= POINT_DISTANCE;
|
|
||||||
var lonLat = map.getLonLatFromViewPortPx(bottom);
|
|
||||||
orderingFeatures.push(
|
|
||||||
new OpenLayers.Feature.Vector(
|
|
||||||
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.addFeatures(orderingFeatures);
|
|
||||||
|
|
||||||
// Add the z-index features. Technically, these features succomb to y-ordering
|
|
||||||
// as well; however, since they have different z-indexes, the z-indexes take
|
|
||||||
// precedence.
|
|
||||||
var indexFeatures = [];
|
|
||||||
var useFirst = true;
|
|
||||||
while (left.x <= right.x) {
|
|
||||||
var lonLat = map.getLonLatFromViewPortPx(left);
|
|
||||||
var point = new OpenLayers.Feature.Vector(
|
|
||||||
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
|
||||||
);
|
|
||||||
|
|
||||||
// This is where the magic happens. We override the style on the layer
|
|
||||||
// to give our own style with alternativing z-indexes.
|
|
||||||
point.style = {
|
|
||||||
graphicZIndex: useFirst ? FIRST_RED_Z_INDEX : SECOND_RED_Z_INDEX,
|
|
||||||
externalGraphic: "../img/marker.png",
|
|
||||||
pointRadius: 10
|
|
||||||
}
|
|
||||||
|
|
||||||
indexFeatures.push(
|
|
||||||
point
|
|
||||||
);
|
|
||||||
|
|
||||||
left.x += POINT_DISTANCE;
|
|
||||||
useFirst = !useFirst;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.addFeatures(indexFeatures);
|
|
||||||
}
|
|
||||||
|
|
||||||
function initDrawingOrderMap() {
|
|
||||||
var map = new OpenLayers.Map("drawingorder");
|
|
||||||
|
|
||||||
var layer = new OpenLayers.Layer.Vector(
|
|
||||||
"Drawing Order",
|
|
||||||
{
|
|
||||||
// Note there's no z-index set, and yOrdering is left
|
|
||||||
// to its default.
|
|
||||||
styleMap: new OpenLayers.StyleMap({
|
|
||||||
externalGraphic: "../img/marker-green.png",
|
|
||||||
pointRadius: 10
|
|
||||||
}),
|
|
||||||
isBaseLayer: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
map.addLayers([layer]);
|
|
||||||
map.zoomToMaxExtent();
|
|
||||||
|
|
||||||
// Add features to the layers to show off z-index/y-ordering.
|
|
||||||
// We do this after adding the layer so we can work in pixels.
|
|
||||||
var center = map.getViewPortPxFromLonLat(map.getCenter());
|
|
||||||
|
|
||||||
var top = new OpenLayers.Pixel(center.x, center.y - RADIUS_FROM_CENTER);
|
|
||||||
var bottom = new OpenLayers.Pixel(center.x, center.y + RADIUS_FROM_CENTER);
|
|
||||||
var left = new OpenLayers.Pixel(center.x - RADIUS_FROM_CENTER, center.y);
|
|
||||||
var right = new OpenLayers.Pixel(center.x + RADIUS_FROM_CENTER, center.y);
|
|
||||||
|
|
||||||
// Add the ordering features. These are the gold ones that all have the same z-index
|
|
||||||
// and succomb to y-ordering.
|
|
||||||
var orderingFeatures = [];
|
|
||||||
while (bottom.y > top.y && left.x < right.x) {
|
|
||||||
var bottomLonLat = map.getLonLatFromViewPortPx(bottom);
|
|
||||||
var leftLonLat = map.getLonLatFromViewPortPx(left);
|
|
||||||
orderingFeatures.push(
|
|
||||||
new OpenLayers.Feature.Vector(
|
|
||||||
new OpenLayers.Geometry.Point(leftLonLat.lon, bottomLonLat.lat)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
bottom.y -= POINT_DISTANCE / 2; // Divide by 2 for better visual.
|
|
||||||
left.x += POINT_DISTANCE / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.addFeatures(orderingFeatures);
|
|
||||||
}
|
|
||||||
|
|
||||||
function init(){
|
|
||||||
initYOrderMap();
|
|
||||||
initDrawingOrderMap();
|
|
||||||
};
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body onload="init()">
|
|
||||||
<h1 id="title">Z-Index/Y-Order Example</h1>
|
|
||||||
|
|
||||||
<div id="tags">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p id="shortdesc">
|
|
||||||
This example shows the use of z-indexing and y-ordering of external graphics. Zoom in and out to see this behavior.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Z-Index (with Y-Ordering enabled)</h3>
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<div id="yorder" class="smallmap"></div>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div class="docs">
|
|
||||||
In this map, the gold features all have the same z-index, and the red features have alternating z-indeces. The gold features' z-index is greater than the red features' z-indeces, which is why gold features look to be drawn on top of the red features. Since each gold feature has the same z-index, gold features succomb to y-ordering: this is where features that seem closest to the viewer (lower lattitude) show up above those that seem farther away (higher lattitude).
|
|
||||||
<br><br>
|
|
||||||
All vector layers have z-indexing enabled by default, but are not enabled with y-ordering. You can enable y-ordering by passing the parameter <i>yOrdering: true</i> in the vector layer's options hash. For all configurations, if features have the same z-index -- and if y-ordering is enabled: the same lattitude -- those features will succomb to drawing order, where the last feature to be drawn will appear above the rest.
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<br>
|
|
||||||
<h3>Drawing Order (no Z-Indexes set, and Y-Ordering disabled)</h3>
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<div id="drawingorder" class="smallmap"></div>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div class="docs">
|
|
||||||
In this map, features are not given z-indexes, and the layer's <i>yOrdering</i> parameter is set to the default (false). This configuration makes features succomb to drawing order instead of z-index order or y-order.
|
|
||||||
<br><br>
|
|
||||||
The features in this map were drawn from left to right and bottom to top, diagonally, to show that y-ordering is not enabled.
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
<style>
|
|
||||||
#map {
|
#map {
|
||||||
height: 350px;
|
width: 70%;
|
||||||
|
height: 475px;
|
||||||
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
@@ -102,9 +103,7 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">Advanced OSM Layer</h1>
|
<div style="width:28%; float:right" id="download">
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
<div id="download">
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="javascript:new_data();">Download current view</a></li>
|
<li><a href="javascript:new_data();">Download current view</a></li>
|
||||||
<li><a href="javascript:clear_data();">Clear current data</a></li>
|
<li><a href="javascript:clear_data();">Clear current data</a></li>
|
||||||
@@ -112,6 +111,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<div id="status">Loading...</div>
|
<div id="status">Loading...</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="map"></div>
|
||||||
<a id="vectorlink" href="" style="display:none">Display via data: URL (FF Only)</a>
|
<a id="vectorlink" href="" style="display:none">Display via data: URL (FF Only)</a>
|
||||||
<textarea id="vectors" style="display:none;width:100%" rows="10"></textarea>
|
<textarea id="vectors" style="display:none;width:100%" rows="10"></textarea>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Using maxResolution to control overlays</title>
|
<title>Using maxResolution to control overlays</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
<style>
|
|
||||||
#map {
|
#map {
|
||||||
height: 350px;
|
width: 650px;
|
||||||
|
height: 550px;
|
||||||
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
|
<!-- this gmaps key generated for http://openlayers.org/dev/ -->
|
||||||
@@ -19,17 +20,17 @@
|
|||||||
function init(){
|
function init(){
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
map = new OpenLayers.Map('map', {
|
map = new OpenLayers.Map('map', { controls: [] });
|
||||||
controls: [
|
|
||||||
new OpenLayers.Control.PanZoomBar(),
|
|
||||||
new OpenLayers.Control.LayerSwitcher({'ascending':false}),
|
|
||||||
new OpenLayers.Control.MousePosition(),
|
|
||||||
new OpenLayers.Control.Navigation()
|
|
||||||
]
|
|
||||||
});
|
|
||||||
var lon = 35;
|
var lon = 35;
|
||||||
var lat = -6;
|
var lat = -6;
|
||||||
var zoom = 6;
|
var zoom = 6;
|
||||||
|
var map, layer;
|
||||||
|
|
||||||
|
// Map Controls
|
||||||
|
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.MousePosition());
|
||||||
|
|
||||||
|
|
||||||
// Map Layers
|
// Map Layers
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
// Add Layers
|
// Add Layers
|
||||||
map.addLayers([GMapsHybr, GMapsStreets, GMapsSat, MarkersLayer2]);
|
map.addLayers([GMapsHybr, GMapsStreets, GMapsSat, MarkersLayer2]);
|
||||||
|
|
||||||
|
|
||||||
// Visual
|
// Visual
|
||||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||||
if (!map.getCenter()) map.zoomToMaxExtent();
|
if (!map.getCenter()) map.zoomToMaxExtent();
|
||||||
@@ -55,7 +57,7 @@
|
|||||||
See how to control the maximum resolution for a markers layer,
|
See how to control the maximum resolution for a markers layer,
|
||||||
causing it to not be displayed beyond a certain point.
|
causing it to not be displayed beyond a certain point.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Overview Map Example</title>
|
<title>Overview Map Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
|
<script src="../lib/OpenLayers.js" type="text/javascript"></script>
|
||||||
<style>
|
<style>
|
||||||
#map1 {
|
#map1 {
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Pan and Zoom Panels</title>
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
|
||||||
|
|
||||||
<!--
|
|
||||||
-- Special stylesheet inclusion for ie6, which doesn't handle the alpha
|
|
||||||
-- channel of images correctly. The special ie6 stylesheet will only
|
|
||||||
-- be included if the browser running is ie6. For now, the only thing it
|
|
||||||
-- does is load alternative, non-alpha pngs for the zoom/pan panels.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!--[if lte IE 6]>
|
|
||||||
<link rel="stylesheet" href="../theme/default/ie6-style.css" type="text/css" />
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<script type="text/javascript" src="../lib/OpenLayers.js"></script>
|
|
||||||
<script>
|
|
||||||
var map;
|
|
||||||
var lon = 5;
|
|
||||||
var lat = 40;
|
|
||||||
var zoom = 5;
|
|
||||||
function init(){
|
|
||||||
map = new OpenLayers.Map("map", {
|
|
||||||
controls: [
|
|
||||||
new OpenLayers.Control.Navigation(),
|
|
||||||
new OpenLayers.Control.PanPanel(),
|
|
||||||
new OpenLayers.Control.ZoomPanel()
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
var wms = new OpenLayers.Layer.WMS(
|
|
||||||
"OpenLayers WMS",
|
|
||||||
"http://labs.metacarta.com/wms/vmap0",
|
|
||||||
{layers: 'basic'}
|
|
||||||
);
|
|
||||||
map.addLayers([wms]);
|
|
||||||
|
|
||||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body onload='init();'>
|
|
||||||
<h1 id="title">Pan and Zoom Panels</h1>
|
|
||||||
<div id="tags"></div>
|
|
||||||
<p id="shortdesc">Customizable pan and zoom panels</p>
|
|
||||||
</p>
|
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
<p id="docs">
|
|
||||||
The pan and zoom panels allow you to use CSS styling to change the
|
|
||||||
look and feel of the panels, including changing their position
|
|
||||||
and their icons without needing to change any code.
|
|
||||||
</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 800px;
|
||||||
|
height: 475px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
.olControlPanel div {
|
.olControlPanel div {
|
||||||
display:block;
|
display:block;
|
||||||
width: 24px;
|
width: 24px;
|
||||||
@@ -90,6 +94,6 @@
|
|||||||
CSS, and add your own controls to it.
|
CSS, and add your own controls to it.
|
||||||
</p>
|
</p>
|
||||||
<div id="panel"></div>
|
<div id="panel"></div>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 800px;
|
||||||
|
height: 400px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer, rss, lineFeatures, popup;
|
var map, layer, rss, lineFeatures, popup;
|
||||||
@@ -51,13 +57,13 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">GeoRSS PointTrack in OpenLayers</h1>
|
<h1>GeoRSS PointTrack in OpenLayers</h1>
|
||||||
<p style="font-size:.9em;">This demo uses OpenLayers.Layer.GeoRSS and OpenLayers.Layer.PointTrack. The track is created by connecting the points of the GeoRSS feed.</a></p>
|
<p style="font-size:.9em;">This demo uses OpenLayers.Layer.GeoRSS and OpenLayers.Layer.PointTrack. The track is created by connecting the points of the GeoRSS feed.</a></p>
|
||||||
<form onsubmit="return false;">
|
<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;" />
|
GeoRSS URL: <input type="text" id="url" size="50" /><input type="submit" onclick="addUrl(); return false;" value="Load Feed" onsubmit="addUrl(); return false;" />
|
||||||
</form>
|
</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 'xml/track1.xml' will work by default.</p>
|
<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 'xml/track1.xml' will work by default.</p>
|
||||||
<p>The example shows a track, displayed as a line connecting the points of the feed. It also shows markers at positions that have a title tag in the rss item. If clicked, a popup will show title and description.</p>
|
<p>The example shows a track, displayed as a line connecting the points of the feed. It also shows markers at positions that have a title tag in the rss item. If clicked, a popup will show title and description.</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml" debug="true">
|
<html xmlns="http://www.w3.org/1999/xhtml" debug="true">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 900px;
|
width: 900px;
|
||||||
@@ -841,7 +840,7 @@
|
|||||||
*/
|
*/
|
||||||
function addMarker(ll, popupClass, popupContentHTML, closeBox, overflow) {
|
function addMarker(ll, popupClass, popupContentHTML, closeBox, overflow) {
|
||||||
|
|
||||||
var feature = new OpenLayers.Feature(markers, ll);
|
var feature = new OpenLayers.Feature(layer, ll);
|
||||||
feature.closeBox = closeBox;
|
feature.closeBox = closeBox;
|
||||||
feature.popupClass = popupClass;
|
feature.popupClass = popupClass;
|
||||||
feature.data.popupContentHTML = popupContentHTML;
|
feature.data.popupContentHTML = popupContentHTML;
|
||||||
@@ -876,27 +875,14 @@
|
|||||||
All kinds of different popup configurations.
|
All kinds of different popup configurations.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
|
|
||||||
<!-- preloading these images so the autosize will work correctly -->
|
<!-- preloading these images so the autosize will work correctly -->
|
||||||
|
<img src="small.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
||||||
<img src="wideshort.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
<img src="wideshort.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
||||||
<img src="widelong.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
<img src="widelong.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
||||||
<img src="thinlong.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
<img src="thinlong.jpg" style="position:absolute; top:-5000px; left: -5000px"></img>
|
||||||
|
|
||||||
<p> All of the images in this file a pre-cached, meaning they are
|
|
||||||
loaded immediately when you load the page (they are just placed
|
|
||||||
far offscreen, that's why you don't see them).
|
|
||||||
</p>
|
|
||||||
<br>
|
|
||||||
<p> The only image that is *not* preloaded is small.jpg, the brazilian
|
|
||||||
flag. We do this in order to test out to make sure that our auto-sizing
|
|
||||||
code does in fact activate itself as the images load. To verify
|
|
||||||
this, clear your cache and reload this example page. Click on
|
|
||||||
any of the markers in the 'AutoSize' row. If the popup autosizes
|
|
||||||
to correctly contain the entire flag: golden. If the popup is
|
|
||||||
tiny and you can only see a corner of it, then this code is broken.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 400px;
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
<script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -112,7 +118,7 @@
|
|||||||
All kinds of ways to create and interact with Popups.
|
All kinds of ways to create and interact with Popups.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<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>
|
<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>
|
<div style="background-color:purple" onclick="add()"> click to add Popup to map</div>
|
||||||
<div style="background-color:green" onclick="addMarker()"> click to add a Marker with an AnchoredBubble popup</div>
|
<div style="background-color:green" onclick="addMarker()"> click to add a Marker with an AnchoredBubble popup</div>
|
||||||
|
|||||||
@@ -2,8 +2,12 @@
|
|||||||
<head>
|
<head>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
border: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
#map {
|
#map {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -47,7 +51,6 @@
|
|||||||
|
|
||||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.addControl(new OpenLayers.Control.ScaleLine());
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
@@ -60,7 +63,7 @@
|
|||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
Use different (not default) projections with your map
|
Use different (not default) projections with your map
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<p>When using alternative projections, you still use OpenLayers.LonLat objects, even though
|
<p>When using alternative projections, you still use OpenLayers.LonLat objects, even though
|
||||||
the properties are actually X/Y values at that point.</p>
|
the properties are actually X/Y values at that point.</p>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import sys, os
|
|||||||
allowedHosts = ['www.openlayers.org', 'openlayers.org',
|
allowedHosts = ['www.openlayers.org', 'openlayers.org',
|
||||||
'labs.metacarta.com', 'world.freemap.in',
|
'labs.metacarta.com', 'world.freemap.in',
|
||||||
'prototype.openmnnd.org', 'geo.openplans.org',
|
'prototype.openmnnd.org', 'geo.openplans.org',
|
||||||
'sigma.openplans.org'
|
|
||||||
'www.openstreetmap.org']
|
'www.openstreetmap.org']
|
||||||
|
|
||||||
method = os.environ["REQUEST_METHOD"]
|
method = os.environ["REQUEST_METHOD"]
|
||||||
|
|||||||
@@ -2,8 +2,20 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Regular Polygon Example</title>
|
<title>OpenLayers Regular Polygon Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 1em;
|
||||||
|
font: 0.9em Verdana, Arial, sans serif;
|
||||||
|
}
|
||||||
|
input, select, textarea {
|
||||||
|
font: 1em Verdana, Arial, sans serif;
|
||||||
|
}
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 350px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
p {
|
p {
|
||||||
width: 512px;
|
width: 512px;
|
||||||
}
|
}
|
||||||
@@ -73,7 +85,7 @@
|
|||||||
Shows how to use the RegularPolygon handler to draw features with
|
Shows how to use the RegularPolygon handler to draw features with
|
||||||
different numbers of sides.
|
different numbers of sides.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="config">
|
<div id="config">
|
||||||
|
|
||||||
<ul id="controls"><b>Map Controls</b>
|
<ul id="controls"><b>Map Controls</b>
|
||||||
|
|||||||
@@ -2,8 +2,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Resize Features Example</title>
|
<title>OpenLayers Resize Features Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 500px;
|
||||||
|
height: 350px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
p {
|
p {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
}
|
}
|
||||||
@@ -84,7 +88,7 @@
|
|||||||
Demonstration of how to use the geometry resize methods to
|
Demonstration of how to use the geometry resize methods to
|
||||||
change feature sizes programatically.
|
change feature sizes programatically.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<p>This example demonstrates how features can be resized. There is not yet
|
<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
|
a control built that provides a tool for resizing, but the geometry.resize
|
||||||
method can be accessed to resize programmatically.</p>
|
method can be accessed to resize programmatically.</p>
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Restricted Extent Example</title>
|
<title>OpenLayers Restricted Extent Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 256px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/Firebug/firebug.js"></script>
|
<script src="../lib/Firebug/firebug.js"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -41,7 +47,7 @@
|
|||||||
Don't let users drag outside the map extent: instead, limit dragging such
|
Don't let users drag outside the map extent: instead, limit dragging such
|
||||||
that the extent of the layer is the maximum viewable area.
|
that the extent of the layer is the maximum viewable area.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<p>
|
<p>
|
||||||
Map navigation is limited by a combination of map and layer properties.
|
Map navigation is limited by a combination of map and layer properties.
|
||||||
The base layer resolutions array controls the resolutions (or zoom
|
The base layer resolutions array controls the resolutions (or zoom
|
||||||
|
|||||||
@@ -2,8 +2,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>OpenLayers Rotate Features Example</title>
|
<title>OpenLayers Rotate Features Example</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 500px;
|
||||||
|
height: 350px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
p {
|
p {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
}
|
}
|
||||||
@@ -77,12 +81,12 @@
|
|||||||
};
|
};
|
||||||
var center = new OpenLayers.Feature.Vector(origin, null, style);
|
var center = new OpenLayers.Feature.Vector(origin, null, style);
|
||||||
vectorLayer.addFeatures([center]);
|
vectorLayer.addFeatures([center]);
|
||||||
window.setInterval(function() {rotateFeature(
|
window.setInterval(rotateFeature, 100,
|
||||||
pointFeature, 360 / 20, origin)}, 100);
|
pointFeature, 360 / 20, origin);
|
||||||
window.setInterval(function() {rotateFeature(
|
window.setInterval(rotateFeature, 100,
|
||||||
lineFeature, 360 / 40, origin)}, 100);
|
lineFeature, 360 / 40, origin);
|
||||||
window.setInterval(function(){rotateFeature(
|
window.setInterval(rotateFeature, 100,
|
||||||
polygonFeature, -360 / 20, origin)}, 100);
|
polygonFeature, -360 / 20, origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
function rotateFeature(feature, angle, origin) {
|
function rotateFeature(feature, angle, origin) {
|
||||||
@@ -100,7 +104,7 @@
|
|||||||
Details on how to create and rotate vector features programmatically
|
Details on how to create and rotate vector features programmatically
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<div id="docs">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
|
built that provides a tool for rotating, but the geometry.rotate method
|
||||||
can be accessed to rotate programmatically.</div>
|
can be accessed to rotate programmatically.</div>
|
||||||
|
|||||||
@@ -3,8 +3,12 @@
|
|||||||
<title>Open Popup on Layer.Vector</title>
|
<title>Open Popup on Layer.Vector</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="../theme/default/framedCloud.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/framedCloud.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 800px;
|
||||||
|
height: 350px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
#controlToggle li {
|
#controlToggle li {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
@@ -75,7 +79,7 @@
|
|||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
Using a Control.SelectFeature, open a popup on click.
|
Using a Control.SelectFeature, open a popup on click.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<ul id="controlToggle">
|
<ul id="controlToggle">
|
||||||
<li>
|
<li>
|
||||||
<input type="radio" name="type" value="none" id="noneToggle"
|
<input type="radio" name="type" value="none" id="noneToggle"
|
||||||
|
|||||||
@@ -2,8 +2,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>SelectFeature Control on Layer.Vector</title>
|
<title>SelectFeature Control on Layer.Vector</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 512px;
|
||||||
|
height: 350px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
#controlToggle li {
|
#controlToggle li {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
@@ -23,6 +27,7 @@
|
|||||||
var vectors = new OpenLayers.Layer.Vector("Vector Layer");
|
var vectors = new OpenLayers.Layer.Vector("Vector Layer");
|
||||||
map.addLayers([wmsLayer, vectors]);
|
map.addLayers([wmsLayer, vectors]);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
|
map.addControl(new OpenLayers.Control.MousePosition());
|
||||||
|
|
||||||
drawControls = {
|
drawControls = {
|
||||||
point: new OpenLayers.Control.DrawFeature(
|
point: new OpenLayers.Control.DrawFeature(
|
||||||
@@ -40,15 +45,6 @@
|
|||||||
clickout: false, toggle: false,
|
clickout: false, toggle: false,
|
||||||
multiple: false, hover: false,
|
multiple: false, hover: false,
|
||||||
toggleKey: "ctrlKey", // ctrl key removes from selection
|
toggleKey: "ctrlKey", // ctrl key removes from selection
|
||||||
multipleKey: "shiftKey", // shift key adds to selection
|
|
||||||
box: true
|
|
||||||
}
|
|
||||||
),
|
|
||||||
selecthover: new OpenLayers.Control.SelectFeature(
|
|
||||||
vectors,
|
|
||||||
{
|
|
||||||
multiple: false, hover: true,
|
|
||||||
toggleKey: "ctrlKey", // ctrl key removes from selection
|
|
||||||
multipleKey: "shiftKey" // shift key adds to selection
|
multipleKey: "shiftKey" // shift key adds to selection
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -77,8 +73,8 @@
|
|||||||
drawControls.select.clickout = clickout;
|
drawControls.select.clickout = clickout;
|
||||||
var hover = document.getElementById("hover").checked;
|
var hover = document.getElementById("hover").checked;
|
||||||
drawControls.select.hover = hover;
|
drawControls.select.hover = hover;
|
||||||
drawControls.select.box = document.getElementById("box").checked;
|
if(hover && drawControls.select.active) {
|
||||||
if(drawControls.select.active) {
|
// turn on/off to clear feature property of handler
|
||||||
drawControls.select.deactivate();
|
drawControls.select.deactivate();
|
||||||
drawControls.select.activate();
|
drawControls.select.activate();
|
||||||
}
|
}
|
||||||
@@ -91,7 +87,7 @@
|
|||||||
Select a feature on hover or click with the Control.SelectFeature on a
|
Select a feature on hover or click with the Control.SelectFeature on a
|
||||||
vector layer.
|
vector layer.
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map"></div>
|
||||||
<ul id="controlToggle">
|
<ul id="controlToggle">
|
||||||
<li>
|
<li>
|
||||||
<input type="radio" name="type" value="none" id="noneToggle"
|
<input type="radio" name="type" value="none" id="noneToggle"
|
||||||
@@ -113,26 +109,21 @@
|
|||||||
onclick="toggleControl(this);" />
|
onclick="toggleControl(this);" />
|
||||||
<label for="polygonToggle">draw polygon</label>
|
<label for="polygonToggle">draw polygon</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<input type="radio" name="type" value="selecthover" id="selecthoverToggle"
|
|
||||||
onclick="toggleControl(this);" />
|
|
||||||
<label for="selecthoverToggle">Select features on hover</label>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<input type="radio" name="type" value="select" id="selectToggle"
|
<input type="radio" name="type" value="select" id="selectToggle"
|
||||||
onclick="toggleControl(this);" />
|
onclick="toggleControl(this);" />
|
||||||
<label for="selectToggle">select feature</label>
|
<label for="selectToggle">select feature</label>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
|
||||||
<input id="box" type="checkbox" checked="checked"
|
|
||||||
name="box" onchange="update()" />
|
|
||||||
<label for="box">select features in a box</label>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<input id="clickout" type="checkbox"
|
<input id="clickout" type="checkbox"
|
||||||
name="clickout" onchange="update()" />
|
name="clickout" onchange="update()" />
|
||||||
<label for="clickout">click out to unselect features</label>
|
<label for="clickout">click out to unselect features</label>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<input id="hover" type="checkbox"
|
||||||
|
name="hover" onchange="update()" />
|
||||||
|
<label for="hover">hover to select features</label>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Setting a visual Extent</title>
|
<title>Setting a visual Extent</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 800px;
|
||||||
|
height: 475px;
|
||||||
|
border: 1px solid black;
|
||||||
|
background: #ccddff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="../lib/Firebug/firebug.js"></script>
|
<script src="../lib/Firebug/firebug.js"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -90,12 +97,8 @@
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="init()">
|
<body onload="init()">
|
||||||
<h1 id="title">Styled Layer Descriptor (SLD) Example</h1>
|
<div id="map"></div>
|
||||||
<p id="shortdesc">
|
<p>This example uses a <a target="_blank" href="tasmania/sld-tasmania.xml">SLD
|
||||||
Parsing SLD and applying styles to a vector layer.
|
|
||||||
</p>
|
|
||||||
<div id="map" class="smallmap"></div>
|
|
||||||
<p id="docs">This example uses a <a target="_blank" href="tasmania/sld-tasmania.xml">SLD
|
|
||||||
file</a> to style the vector features. To construct layers that use styles
|
file</a> to style the vector features. To construct layers that use styles
|
||||||
from SLD, create a StyleMap for the layer that uses one of the userStyles in the
|
from SLD, create a StyleMap for the layer that uses one of the userStyles in the
|
||||||
namedLayers object of the return from format.read().</p>
|
namedLayers object of the return from format.read().</p>
|
||||||
|
|||||||
83
examples/smoothDragging.html
Executable file
83
examples/smoothDragging.html
Executable file
@@ -0,0 +1,83 @@
|
|||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
|
<style type="text/css">
|
||||||
|
#map {
|
||||||
|
width: 100%;
|
||||||
|
height: 512px;
|
||||||
|
border: 1px solid gray;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script src='http://maps.google.com/maps?file=api&v=2.82&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
|
||||||
|
<script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script>
|
||||||
|
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
|
||||||
|
|
||||||
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
// make map available for easy debugging
|
||||||
|
var map;
|
||||||
|
|
||||||
|
// avoid pink tiles
|
||||||
|
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
|
||||||
|
OpenLayers.Util.onImageLoadErrorColor = "transparent";
|
||||||
|
|
||||||
|
function init(){
|
||||||
|
var options = {
|
||||||
|
projection: "EPSG:900913",
|
||||||
|
units: "m",
|
||||||
|
maxResolution: 156543.0339,
|
||||||
|
maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
|
||||||
|
20037508, 20037508.34)
|
||||||
|
};
|
||||||
|
map = new OpenLayers.Map('map', options);
|
||||||
|
|
||||||
|
// create Google Mercator layers
|
||||||
|
var gmap = new OpenLayers.Layer.Google(
|
||||||
|
"Google Streets",
|
||||||
|
{'sphericalMercator': true}
|
||||||
|
);
|
||||||
|
|
||||||
|
// create Virtual Earth layers
|
||||||
|
var ve = new OpenLayers.Layer.VirtualEarth(
|
||||||
|
"Virtual Earth Raods",
|
||||||
|
{'type': VEMapStyle.Road, 'sphericalMercator': true}
|
||||||
|
);
|
||||||
|
|
||||||
|
// create Virtual Earth layers
|
||||||
|
var ve = new OpenLayers.Layer.VirtualEarth(
|
||||||
|
"Virtual Earth Raods",
|
||||||
|
{'type': VEMapStyle.Road, 'sphericalMercator': true}
|
||||||
|
);
|
||||||
|
|
||||||
|
// create Yahoo layer
|
||||||
|
var yahoo = new OpenLayers.Layer.Yahoo(
|
||||||
|
"Yahoo Street",
|
||||||
|
{'sphericalMercator': true}
|
||||||
|
);
|
||||||
|
|
||||||
|
// create WMS layer
|
||||||
|
var wms = new OpenLayers.Layer.WMS(
|
||||||
|
"World Map",
|
||||||
|
"http://world.freemap.in/tiles/",
|
||||||
|
{'layers': 'factbook-overlay', 'format':'png'},
|
||||||
|
{
|
||||||
|
'opacity': 0.4,
|
||||||
|
'isBaseLayer': false,'wrapDateLine': true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
map.addLayers([gmap, wms, ve, yahoo]);
|
||||||
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
|
map.zoomToMaxExtent()
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body onload="init()">
|
||||||
|
<h2>OpenLayers With Responsive Dragging</h3>
|
||||||
|
<h3>Uses Google Maps v2.82</h2>
|
||||||
|
<div id="map"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user