Merge branch 'master' into bigbackbuffer

This commit is contained in:
Éric Lemoine
2011-10-28 21:26:59 +02:00
47 changed files with 240 additions and 247 deletions

View File

@@ -10,7 +10,7 @@
<script type="text/javascript">
function parseData(req) {
g = new OpenLayers.Format.KML({extractStyles: true});
html = ""
html = "";
features = g.read(req.responseText);
for(var feat in features) {
html += "Feature: Geometry: "+ features[feat].geometry+",";
@@ -18,7 +18,7 @@
for (var j in features[feat].attributes) {
html += "<li>Attribute "+j+":"+features[feat].attributes[j]+"</li>";
}
html += "</ul>"
html += "</ul>";
html += "<ul>";
for (var j in features[feat].style) {
html += "<li>Style "+j+":"+features[feat].style[j]+"</li>";

View File

@@ -10,7 +10,7 @@
<script type="text/javascript">
function parseData(req) {
format = new OpenLayers.Format.WMSDescribeLayer();
html = "<br>"
html = "<br>";
resp = format.read(req.responseText);
for(var i = 0; i < resp.length; i++) {
html += "Layer: typeName: "+ resp[i].typeName+",";

View File

@@ -131,14 +131,14 @@ Animator.prototype = {
str += ">";
return str;
}
}
};
// merge the properties of two objects
Animator.applyDefaults = function(defaults, prefs) {
prefs = prefs || {};
var prop, result = {};
for (prop in defaults) result[prop] = prefs[prop] !== undefined ? prefs[prop] : defaults[prop];
return result;
}
};
// make an array from any object
Animator.makeArray = function(o) {
if (o == null) return [];
@@ -146,7 +146,7 @@ Animator.makeArray = function(o) {
var result = [];
for (var i=0; i<o.length; i++) result[i] = o[i];
return result;
}
};
// convert a dash-delimited-property to a camelCaseProperty (c/o Prototype, thanks Sam!)
Animator.camelize = function(string) {
var oStringList = string.split('-');
@@ -161,27 +161,27 @@ Animator.camelize = function(string) {
camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
}
return camelizedString;
}
};
// syntactic sugar for creating CSSStyleSubjects
Animator.apply = function(el, style, options) {
if (style instanceof Array) {
return new Animator(options).addSubject(new CSSStyleSubject(el, style[0], style[1]));
}
return new Animator(options).addSubject(new CSSStyleSubject(el, style));
}
};
// make a transition function that gradually accelerates. pass a=1 for smooth
// gravitational acceleration, higher values for an exaggerated effect
Animator.makeEaseIn = function(a) {
return function(state) {
return Math.pow(state, a*2);
}
}
};
// as makeEaseIn but for deceleration
Animator.makeEaseOut = function(a) {
return function(state) {
return 1 - Math.pow(1 - state, a*2);
}
}
};
// make a transition function that, like an object with momentum being attracted to a point,
// goes past the target then returns
Animator.makeElastic = function(bounces) {
@@ -189,7 +189,7 @@ Animator.makeElastic = function(bounces) {
state = Animator.tx.easeInOut(state);
return ((1-Math.cos(state * Math.PI * bounces)) * (1 - state)) + state;
}
}
};
// make an Attack Decay Sustain Release envelope that starts and finishes on the same level
//
Animator.makeADSR = function(attackEnd, decayEnd, sustainEnd, sustainLevel) {
@@ -206,7 +206,7 @@ Animator.makeADSR = function(attackEnd, decayEnd, sustainEnd, sustainLevel) {
}
return sustainLevel * (1 - ((state - sustainEnd) / (1 - sustainEnd)));
}
}
};
// make a transition function that, like a ball falling to floor, reaches the target and/
// bounces back again
Animator.makeBounce = function(bounces) {
@@ -215,7 +215,7 @@ Animator.makeBounce = function(bounces) {
state = fn(state);
return state <= 1 ? state : 2-state;
}
}
};
// pre-made transition functions to use with the 'transition' option
Animator.tx = {
@@ -233,7 +233,7 @@ Animator.tx = {
veryElastic: Animator.makeElastic(3),
bouncy: Animator.makeBounce(1),
veryBouncy: Animator.makeBounce(3)
}
};
// animates a pixel-based style property between two integer values
function NumericalStyleSubject(els, property, from, to, units) {
@@ -271,7 +271,7 @@ NumericalStyleSubject.prototype = {
inspect: function() {
return "\t" + this.property + "(" + this.from + this.units + " to " + this.to + this.units + ")\n";
}
}
};
// animates a colour based style property between two hex values
function ColorStyleSubject(els, property, from, to) {
@@ -313,7 +313,7 @@ ColorStyleSubject.prototype = {
inspect: function() {
return "\t" + this.property + "(" + this.origFrom + " to " + this.origTo + ")\n";
}
}
};
// return a properly formatted 6-digit hex colour spec, or false
ColorStyleSubject.parseColor = function(string) {
@@ -336,14 +336,14 @@ ColorStyleSubject.parseColor = function(string) {
return '#' + match[1];
}
return false;
}
};
// convert a number to a 2 digit hex string
ColorStyleSubject.toColorPart = function(number) {
if (number > 255) number = 255;
var digits = number.toString(16);
if (number < 16) return '0' + digits;
return digits;
}
};
ColorStyleSubject.parseColor.rgbRe = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i;
ColorStyleSubject.parseColor.hexRe = /^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
@@ -367,7 +367,7 @@ DiscreteStyleSubject.prototype = {
inspect: function() {
return "\t" + this.property + "(" + this.from + " to " + this.to + " @ " + this.threshold + ")\n";
}
}
};
// animates between two styles defined using CSS.
// if style1 and style2 are present, animate between them, if only style1
@@ -482,7 +482,7 @@ CSSStyleSubject.prototype = {
}
return str;
}
}
};
// get the current value of a css property,
CSSStyleSubject.getStyle = function(el, property){
var style;
@@ -497,7 +497,7 @@ CSSStyleSubject.getStyle = function(el, property){
style = el.currentStyle[property];
}
return style || el.style[property]
}
};
CSSStyleSubject.ruleRe = /^\s*([a-zA-Z\-]+)\s*:\s*(\S(.+\S)?)\s*$/;
@@ -604,7 +604,7 @@ AnimatorChain.prototype = {
this.animators[this.current].seekTo(1);
}
}
}
};
// an Accordion is a class that creates and controls a number of Animators. An array of elements is passed in,
// and for each element an Animator and a activator button is created. When an Animator's activator button is
@@ -667,4 +667,4 @@ Accordion.prototype = {
document.location.hash = this.rememberanceTexts[section];
}
}
}
};

View File

@@ -28,7 +28,7 @@
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{layers: 'basic'}, {'buffer':4} );
map.addLayer(layer);
map.addControl(new OpenLayers.Control.LayerSwitcher())
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
}
</script>

View File

@@ -31,7 +31,7 @@ function updateOutput(event) {
map.layers[1].events.on({
sketchmodified: updateOutput,
sketchcomplete: updateOutput
})
});
// add behavior to UI elements
function toggleControl(element) {

View File

@@ -29,7 +29,7 @@ $("insertXY").onclick = function() {
if (values != null) {
draw.insertXY(values[0], values[1]);
}
}
};
$("insertDeltaXY").onclick = function() {
var values = parseInput(
window.prompt(
@@ -39,7 +39,7 @@ $("insertDeltaXY").onclick = function() {
if (values != null) {
draw.insertDeltaXY(values[0], values[1]);
}
}
};
$("insertDirectionLength").onclick = function() {
var values = parseInput(
window.prompt(
@@ -49,7 +49,7 @@ $("insertDirectionLength").onclick = function() {
if (values != null) {
draw.insertDirectionLength(values[0], values[1]);
}
}
};
$("insertDeflectionLength").onclick = function() {
var values = parseInput(
window.prompt(
@@ -59,13 +59,13 @@ $("insertDeflectionLength").onclick = function() {
if (values != null) {
draw.insertDeflectionLength(values[0], values[1]);
}
}
};
$("cancel").onclick = function() {
draw.cancel();
}
};
$("finishSketch").onclick = function() {
draw.finishSketch();
}
};
function parseInput(text) {
var values = text.split(",");
@@ -80,4 +80,4 @@ function parseInput(text) {
}
}
return values;
}
}

View File

@@ -64,7 +64,7 @@
}
.ex_classes{
font-size: .7em;
color: grey;
color: gray;
display: none;
}
#toc {
@@ -169,7 +169,7 @@
var words = text.split(/\W+/);
var scores = {};
for(var i=0; i<words.length; ++i) {
var word = words[i].toLowerCase()
var word = words[i].toLowerCase();
var dict = info.index[word];
var updateScores = function() {
for(exIndex in dict) {
@@ -185,7 +185,7 @@
scores[exIndex][word] = count;
}
}
}
};
if(dict) {
updateScores();
} else {
@@ -255,7 +255,7 @@
template = new jugl.Template("template");
target = document.getElementById("examples");
listExamples(info.examples);
document.getElementById("keywords").onkeyup = inputChange
document.getElementById("keywords").onkeyup = inputChange;
parseQuery();
};
</script>

View File

@@ -24,7 +24,7 @@ function startAnimation() {
} else {
stopAnimation(true);
}
}
};
animationTimer = window.setInterval(next, interval * 1000);
}

View File

@@ -74,7 +74,7 @@
<div id="shortdesc">Simple acceleration demo; roll a vector feature around
on a map. (Only tested on iOS 4.)</div>
<div id="map" width="100%" height="100%" style="background-color: grey"></div>
<div id="map" width="100%" height="100%" style="background-color: gray"></div>
<div id="docs">
<p>Demo works best when device is locked in portrait mode.</p>
</div>

View File

@@ -105,7 +105,7 @@
},
queryVisible: true
})
}
};
map.addLayers([political, roads, cities, water, highlightLayer]);
for (var i in infoControls) {

View File

@@ -19,7 +19,7 @@
window.onload = function() {
options = {maxExtent: new OpenLayers.Bounds(-73.5295, 41.2318,
-69.9097, 42.8883),
maxResolution: 0.0003}
maxResolution: 0.0003};
map = new OpenLayers.Map('map', options);
var roads15 = new OpenLayers.Layer.WMS( "Roads (15px gutter)",
"http://boston.freemap.in/cgi-bin/mapserv?map=/www/freemap.in/boston/map/gmaps.map&",

View File

@@ -71,7 +71,7 @@
layer.logEvent = function(event) {
eventsLog.innerHTML += "<br>(" + getTimeStamp() + ") " +
this.name + ": " + event;
}
};
layer.events.register("loadstart", layer, function() {
this.logEvent("Load Start");

View File

@@ -54,10 +54,10 @@
var params = {
mapdefinition: 'Library://Samples/Sheboygan/MapsTiled/Sheboygan.MapDefinition',
basemaplayergroupname: "Base Layer Group"
}
};
var options = {
singleTile: false
}
};
var layer = new OpenLayers.Layer.MapGuide( "MapGuide OS tiled layer", url, params, options );
map.addLayer(layer);

View File

@@ -17,7 +17,7 @@ $(document).ready(function() {
content.height(contentHeight);
}
if (window.map) {
if (window.map && window.map instanceof OpenLayers.Map) {
map.updateSize();
} else {
// initialize map

View File

@@ -40,7 +40,7 @@ function init() {
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{layers: 'basic'},
{isBaseLayer: true, transitionEffect: 'resize'}
)
);
var kml = new OpenLayers.Layer.Vector("KML", {
projection: map.displayProjection,

View File

@@ -34,7 +34,7 @@ function runMVS() {
// ----
// TODO: Handle all this parsing better.
var safeArgs = {}
var safeArgs = {};
var DEFAULT_LAT = 0;
var DEFAULT_LON = 0;

View File

@@ -100,7 +100,7 @@
graphicZIndex: useFirst ? FIRST_RED_Z_INDEX : SECOND_RED_Z_INDEX,
externalGraphic: "../img/marker.png",
pointRadius: 10
}
};
indexFeatures.push(
point

View File

@@ -95,9 +95,9 @@
} else {
gml = new OpenLayers.Layer.GML("OSM", "xml/cambridgeport.osm", {format: OpenLayers.Format.OSM});
}
}
gml.events.register("loadstart", null, function() { $("status").innerHTML = "Loading..."; })
gml.events.register("loadend", null, function() { $("status").innerHTML = ""; })
}
gml.events.register("loadstart", null, function() { $("status").innerHTML = "Loading..."; });
gml.events.register("loadend", null, function() { $("status").innerHTML = ""; });
map.addLayer(gml);
gml.preFeatureInsert = style_osm_feature;
var sf = new OpenLayers.Control.SelectFeature(gml, {'onSelect': on_feature_hover});

View File

@@ -108,7 +108,7 @@
20037508.34, 20037508.34)
}),
layers: [jplOverview]
}
};
var overview2 = new OpenLayers.Control.OverviewMap(controlOptions);
map2.addControl(overview2);

View File

@@ -13,7 +13,7 @@ var rotation = document.getElementById("rotation");
rotation.value = String(points.rotation);
rotation.onchange = function() {
points.setRotation(Number(rotation.value));
}
};
var dx = document.getElementById("dx");
var dy = document.getElementById("dy");
@@ -21,13 +21,13 @@ dx.value = String(points.dx);
dy.value = String(points.dy);
dx.onchange = function() {
points.setSpacing(Number(dx.value), Number(dy.value));
}
};
dy.onchange = function() {
points.setSpacing(Number(dx.value), Number(dy.value));
}
};
var max = document.getElementById("max");
max.value = String(points.maxFeatures);
max.onchange = function() {
points.setMaxFeatures(Number(max.value));
}
};

View File

@@ -163,25 +163,25 @@
//anchored popup bigger contents autosize
ll = new OpenLayers.LonLat(5,20);
popupClass = AutoSizeAnchored;
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML);
//anchored popup bigger contents autosize closebox
ll = new OpenLayers.LonLat(10,20);
popupClass = AutoSizeAnchored;
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>closebox<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>closebox<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, true);
//anchored popup wide short text contents autosize
ll = new OpenLayers.LonLat(20,20);
popupClass = AutoSizeAnchored;
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize - wide short text<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize - wide short text<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML);
//anchored popup wide short text contents autosize closebox
ll = new OpenLayers.LonLat(25,20);
popupClass = AutoSizeAnchored;
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize - wide short text<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize - wide short text<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML, true);
@@ -214,13 +214,13 @@
//anchored popup wide long fixed contents autosize
ll = new OpenLayers.LonLat(65,20);
popupClass = AutoSizeAnchored;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML);
//anchored popup wide long fixed contents autosize closebox
ll = new OpenLayers.LonLat(70,20);
popupClass = AutoSizeAnchored;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true);
//
@@ -282,64 +282,64 @@
//anchored popup bigger contents autosize overflow
ll = new OpenLayers.LonLat(5,15);
popupClass = AutoSizeAnchored;
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>overflow<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>overflow<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored popup bigger contents autosize closebox overflow
ll = new OpenLayers.LonLat(10,15);
popupClass = AutoSizeAnchored;
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>overflow<br>closebox<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>overflow<br>closebox<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored popup wide short text contents autosize overflow
ll = new OpenLayers.LonLat(20,15);
popupClass = AutoSizeAnchored;
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>overflow<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>overflow<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored popup wide short text contents autosize closebox overflow
ll = new OpenLayers.LonLat(25,15);
popupClass = AutoSizeAnchored;
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>overflow<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.Anchored<br>autosize<br>overflow<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored popup wide short fixed contents autosize overflow
ll = new OpenLayers.LonLat(35,15);
popupClass = AutoSizeAnchored;
popupContentHTML = '<img src="img/wideshort.jpg"></img>'
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored popup wide short fixed contents autosize closebox overflow
ll = new OpenLayers.LonLat(40,15);
popupClass = AutoSizeAnchored;
popupContentHTML = '<img src="img/wideshort.jpg"></img>'
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored popup thin long fixed contents autosize overflow
ll = new OpenLayers.LonLat(50,15);
popupClass = AutoSizeAnchored;
popupContentHTML = '<img src="img/thinlong.jpg"></img>'
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored popup thin long fixed contents autosize closebox overflow
ll = new OpenLayers.LonLat(55,15);
popupClass = AutoSizeAnchored;
popupContentHTML = '<img src="img/thinlong.jpg"></img>'
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored popup wide long fixed contents autosize overflow
ll = new OpenLayers.LonLat(65,15);
popupClass = AutoSizeAnchored;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored popup wide long fixed contents autosize closebox overflow
ll = new OpenLayers.LonLat(70,15);
popupClass = AutoSizeAnchored;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true, true);
@@ -402,65 +402,65 @@
//anchored bubble popup bigger contents autosize closebox
ll = new OpenLayers.LonLat(5,5);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, false);
//anchored bubble popup bigger contents autosize closebox
ll = new OpenLayers.LonLat(10,5);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>closebox<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>closebox<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, true);
//anchored bubble popup wide short text contents autosize
ll = new OpenLayers.LonLat(20,5);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize - wide short text<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize - wide short text<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML);
//anchored bubble popup wide short text contents autosize closebox
ll = new OpenLayers.LonLat(25,5);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize - wide short text<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize - wide short text<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML, true);
//anchored bubble popup wide short fixed contents autosize
ll = new OpenLayers.LonLat(35,5);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/wideshort.jpg"></img>'
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML);
//anchored bubble popup wide short fixed contents autosize closebox
ll = new OpenLayers.LonLat(40,5);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/wideshort.jpg"></img>'
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true);
//anchored bubble popup thin long fixed contents autosize
ll = new OpenLayers.LonLat(50,5);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/thinlong.jpg"></img>'
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML);
//anchored bubble popup thin long fixed contents autosize closebox
ll = new OpenLayers.LonLat(55,5);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/thinlong.jpg"></img>'
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true);
//anchored bubble popup wide long fixed contents autosize
ll = new OpenLayers.LonLat(65,5);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML);
//anchored bubble popup wide long fixed contents autosize closebox
ll = new OpenLayers.LonLat(70,5);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true);
//
@@ -522,65 +522,65 @@
//anchored bubble popup bigger contents autosize closebox
ll = new OpenLayers.LonLat(5,0);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>overflow<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>overflow<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored bubble popup bigger contents autosize closebox
ll = new OpenLayers.LonLat(10,0);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>closebox<br>overflow<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>closebox<br>overflow<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored bubble popup wide short contents autosize overflow
ll = new OpenLayers.LonLat(20,0);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>overflow<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>overflow<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored bubble popup wide short contents autosize closebox overflow
ll = new OpenLayers.LonLat(25,0);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>overflow<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.AnchoredBubble<br>autosize<br>overflow<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored bubble popup wide short fixed contents autosize overflow
ll = new OpenLayers.LonLat(35,0);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/wideshort.jpg"></img>'
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored bubble popup wide short fixed contents autosize closebox overflow
ll = new OpenLayers.LonLat(40,0);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/wideshort.jpg"></img>'
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored bubble popup thin long fixed contents autosize overflow
ll = new OpenLayers.LonLat(50,0);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/thinlong.jpg"></img>'
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored bubble popup thin long fixed contents autosize closebox overflow
ll = new OpenLayers.LonLat(55,0);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/thinlong.jpg"></img>'
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored bubble popup wide long fixed contents autosize overflow
ll = new OpenLayers.LonLat(65,0);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored bubble popup wide long fixed contents autosize closebox overflow
ll = new OpenLayers.LonLat(70,0);
popupClass = AutoSizeAnchoredBubble;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//FRAMED
@@ -644,65 +644,65 @@
//anchored bubble popup bigger contents autosize closebox
ll = new OpenLayers.LonLat(5,-15);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, false);
//anchored bubble popup bigger contents autosize closebox
ll = new OpenLayers.LonLat(10,-15);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>closebox<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>closebox<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, true);
//anchored bubble popup wide short text contents autosize
ll = new OpenLayers.LonLat(20,-15);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize - wide short text<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize - wide short text<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML);
//anchored bubble popup wide short text contents autosize closebox
ll = new OpenLayers.LonLat(25,-15);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize - wide short text<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize - wide short text<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML, true);
//anchored bubble popup wide short fixed contents autosize
ll = new OpenLayers.LonLat(35,-15);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/wideshort.jpg"></img>'
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML);
//anchored bubble popup wide short fixed contents autosize closebox
ll = new OpenLayers.LonLat(40,-15);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/wideshort.jpg"></img>'
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true);
//anchored bubble popup thin long fixed contents autosize
ll = new OpenLayers.LonLat(50,-15);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/thinlong.jpg"></img>'
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML);
//anchored bubble popup thin long fixed contents autosize closebox
ll = new OpenLayers.LonLat(55,-15);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/thinlong.jpg"></img>'
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true);
//anchored bubble popup wide long fixed contents autosize
ll = new OpenLayers.LonLat(65,-15);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML);
//anchored bubble popup wide long fixed contents autosize closebox
ll = new OpenLayers.LonLat(70,-15);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true);
//
@@ -764,65 +764,65 @@
//anchored bubble popup bigger contents autosize closebox
ll = new OpenLayers.LonLat(5,-20);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>overflow<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>overflow<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored bubble popup bigger contents autosize closebox
ll = new OpenLayers.LonLat(10,-20);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>closebox<br>overflow<br>' + samplePopupContentsHTML + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>closebox<br>overflow<br>' + samplePopupContentsHTML + '</div>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored bubble popup wide short contents autosize overflow
ll = new OpenLayers.LonLat(20,-20);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>overflow<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>overflow<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored bubble popup wide short contents autosize closebox overflow
ll = new OpenLayers.LonLat(25,-20);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>overflow<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>'
popupContentHTML = '<div style="background-color:red;">Popup.FramedCloud<br>autosize<br>overflow<br>closebox<br>' + samplePopupContentsHTML_WideShort + '</div>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored bubble popup wide short fixed contents autosize overflow
ll = new OpenLayers.LonLat(35,-20);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/wideshort.jpg"></img>'
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored bubble popup wide short fixed contents autosize closebox overflow
ll = new OpenLayers.LonLat(40,-20);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/wideshort.jpg"></img>'
popupContentHTML = '<img src="img/wideshort.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored bubble popup thin long fixed contents autosize overflow
ll = new OpenLayers.LonLat(50,-20);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/thinlong.jpg"></img>'
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored bubble popup thin long fixed contents autosize closebox overflow
ll = new OpenLayers.LonLat(55,-20);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/thinlong.jpg"></img>'
popupContentHTML = '<img src="img/thinlong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true, true);
//anchored bubble popup wide long fixed contents autosize overflow
ll = new OpenLayers.LonLat(65,-20);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, false, true);
//anchored bubble popup wide long fixed contents autosize closebox overflow
ll = new OpenLayers.LonLat(70,-20);
popupClass = AutoSizeFramedCloud;
popupContentHTML = '<img src="img/widelong.jpg"></img>'
popupContentHTML = '<img src="img/widelong.jpg"></img>';
addMarker(ll, popupClass, popupContentHTML, true, true);

View File

@@ -124,7 +124,7 @@
<div style="background-color:green" onclick="addMarker()"> click to add a Marker with an AnchoredBubble popup</div>
<div style="background-color:blue" onclick="changer()"> click to modify popup's attributes</div>
<div style="background-color:red" onclick="remove()"> click to remove the popup from map</div>
<div style="background-color:grey" onclick="removelayer()"> click to remove the markers layer</div>
<div style="background-color:gray" onclick="removelayer()"> click to remove the markers layer</div>
<div style="background-color:orange" onclick="alert(marker.onScreen())"> marker.onscreen()?</div>
<div style="background-color:yellow" onclick="destroy()"> click to destroy the popup from map</div>
<div id="docs">

View File

@@ -179,7 +179,7 @@
error = true;
return;
}
modify.selectControl.unselectAll()
modify.selectControl.unselectAll();
if (resp.reqFeatures) {
vector.destroyFeatures(resp.reqFeatures);
@@ -214,7 +214,7 @@
}
var feature = vector.selectedFeatures[0];
if (feature) {
modify.selectControl.unselectAll()
modify.selectControl.unselectAll();
feature.state = OpenLayers.State.DELETE;
displayStatus();
}

View File

@@ -16,7 +16,7 @@
function init() {
var options = {
restrictedExtent: extent
}
};
map = new OpenLayers.Map('map', options);
var wms = new OpenLayers.Layer.WMS(
@@ -74,4 +74,4 @@
</label>
</body>
</html>
</html>

View File

@@ -66,16 +66,16 @@ var rotation = document.getElementById("rotation");
rotation.value = String(points.rotation);
rotation.onchange = function() {
points.setRotation(Number(rotation.value));
}
};
var spacing = document.getElementById("spacing");
spacing.value = String(points.dx);
spacing.onchange = function() {
points.setSpacing(Number(spacing.value));
}
};
var max = document.getElementById("max");
max.value = String(points.maxFeatures);
max.onchange = function() {
points.setMaxFeatures(Number(max.value));
}
};

View File

@@ -208,7 +208,7 @@
sel.value = "poly";
sel.onchange = function() {
updateEditable(sel.value);
}
};
var target, type, tog, tol;
var types = ["node", "vertex", "edge"];

View File

@@ -53,7 +53,7 @@
right: 80px;
}
#photos ul li {
padding 10px;
padding: 10px;
margin: 0;
list-style: none;
display: inline;

View File

@@ -1,5 +1,5 @@
div.olControlZoomPanel {
height: 108px
height: 108px;
width: 36px;
position: absolute;
top: 20px;

View File

@@ -39,7 +39,7 @@
0: {externalGraphic: "../img/marker-blue.png"},
1: {externalGraphic: "../img/marker-green.png"},
2: {externalGraphic: "../img/marker-gold.png"}
}
};
// add rules from the above lookup table, with the keyes mapped to
// the "type" property of the features, for the "default" intent
@@ -69,7 +69,7 @@
var context = function(feature) {
return feature;
}
};
var styleMap = new OpenLayers.StyleMap();
// create a lookup table with different symbolizers for the different

View File

@@ -43,7 +43,7 @@ function init() {
alert("Trouble getting capabilities doc");
OpenLayers.Console.error.apply(OpenLayers.Console, arguments);
}
})
});
map = new OpenLayers.Map({
div: "map",

View File

@@ -16,7 +16,7 @@
<script type="text/javascript">
var map, layer;
function init(){
var layerExtent = new OpenLayers.Bounds( -13758743.4295939, 5591455.28887228, -13531302.3472101 , 5757360.4178881)
var layerExtent = new OpenLayers.Bounds( -13758743.4295939, 5591455.28887228, -13531302.3472101 , 5757360.4178881);
map = new OpenLayers.Map( 'map', {'restrictedExtent': layerExtent} );
layer = new OpenLayers.Layer.XYZ( "ESRI",
"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_LandBase_WebMercator/MapServer/tile/${z}/${y}/${x}",

View File

@@ -1,38 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>OpenLayers XYZ with Offset</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 src="xyz-offset.js"></script>
</head>
<body onload="init()">
<h1 id="title">XYZ Layer with Offset</h1>
<div id="tags">
XYZ, layer, tile
</div>
<div id="shortdesc">Using a limited set of levels from an XYZ layer with zoomOffset.</div>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
The XYZ layer allows a zoomOffset to be set if you want to have
a maximum resolution for the map that differs from the maxiumum
resolution of the cached tiles. This example uses only 6 of the
levels in the cache, starting with the ninth level (index of 8)
in the cache. To do this, the layer is constructed with a
zoomOffset of 8. When the map zoom level is zero, the level
with index 8 will be requested from the cache.
</p>
<p>
See the <a href="xyz-offset.js" target="_blank">
xyz-offset.js source</a> to see how this is done.
</p>
</div>
</body>
</html>

View File

@@ -1,32 +0,0 @@
var map, layer;
// called on body load
function init() {
var extent = new OpenLayers.Bounds(
-13758743.4295939, 5591455.28887228, -13531302.3472101 , 5757360.4178881
);
map = new OpenLayers.Map({
div: "map",
maxExtent: new OpenLayers.Bounds(
-128 * 156543.0339, -128 * 156543.0339,
128 * 156543.0339, 128 * 156543.0339
),
restrictedExtent: extent,
maxResolution: 611.496226171875, // corresponds to level 8 in the cache
numZoomLevels: 6,
projection: new OpenLayers.Projection("EPSG:900913"),
units: "m",
layers: [
new OpenLayers.Layer.XYZ(
"ESRI",
"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_LandBase_WebMercator/MapServer/tile/${z}/${y}/${x}",
{zoomOffset: 8} // since our map maxResolution differs from cache max resolution
)
]
});
map.zoomToExtent(extent);
}

View File

@@ -208,7 +208,7 @@ if (!window.console || !console.firebug) { (function()
consoleBody = doc.getElementById("log");
layout();
flush();
}
};
var baseURL = getFirebugURL();

View File

@@ -210,35 +210,6 @@ OpenLayers.Control.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Control, {
}
},
/**
* Method: activate
* Activates the control.
*
* Returns:
* {Boolean} The control was effectively activated.
*/
activate: function () {
if (!this.active) {
this.handler.activate();
}
return OpenLayers.Control.prototype.activate.apply(
this, arguments
);
},
/**
* Method: deactivate
* Deactivates the control.
*
* Returns:
* {Boolean} The control was effectively deactivated.
*/
deactivate: function () {
return OpenLayers.Control.prototype.deactivate.apply(
this, arguments
);
},
/**
* Method: getInfoForClick
* Called on click

View File

@@ -267,7 +267,7 @@ OpenLayers.Format.Context = OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,
keywords: context.keywords,
logo: context.logo,
descriptionURL: context.descriptionURL
}
};
options.metadata = metadata;

View File

@@ -297,7 +297,7 @@ OpenLayers.Format.Filter.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
"Filter": function(filter) {
var node = this.createElementNSPlus("ogc:Filter");
if (filter.type === "FID") {
this.writeFeatureIdNodes(filter, node);
OpenLayers.Format.Filter.v1.prototype.writeFeatureIdNodes.call(this, filter, node);
} else {
this.writeNode(this.getFilterType(filter), filter, node);
}
@@ -314,7 +314,7 @@ OpenLayers.Format.Filter.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
for (var i=0, ii=filter.filters.length; i<ii; ++i) {
childFilter = filter.filters[i];
if (childFilter.type === "FID") {
this.writeFeatureIdNodes(childFilter, node);
OpenLayers.Format.Filter.v1.prototype.writeFeatureIdNodes.call(this, childFilter, node);
} else {
this.writeNode(
this.getFilterType(childFilter), childFilter, node
@@ -329,7 +329,7 @@ OpenLayers.Format.Filter.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
for (var i=0, ii=filter.filters.length; i<ii; ++i) {
childFilter = filter.filters[i];
if (childFilter.type === "FID") {
this.writeFeatureIdNodes(childFilter, node);
OpenLayers.Format.Filter.v1.prototype.writeFeatureIdNodes.call(this, childFilter, node);
} else {
this.writeNode(
this.getFilterType(childFilter), childFilter, node
@@ -342,7 +342,7 @@ OpenLayers.Format.Filter.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
var node = this.createElementNSPlus("ogc:Not");
var childFilter = filter.filters[0];
if (childFilter.type === "FID") {
this.writeFeatureIdNodes(childFilter, node);
OpenLayers.Format.Filter.v1.prototype.writeFeatureIdNodes.call(this, childFilter, node);
} else {
this.writeNode(
this.getFilterType(childFilter), childFilter, node

View File

@@ -429,7 +429,7 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
setFilterProperty: function(filter) {
if(filter.filters) {
for(var i=0, len=filter.filters.length; i<len; ++i) {
this.setFilterProperty(filter.filters[i]);
OpenLayers.Format.WFST.v1.prototype.setFilterProperty.call(this, filter.filters[i]);
}
} else {
if(filter instanceof OpenLayers.Filter.Spatial && !filter.property) {

View File

@@ -169,7 +169,7 @@ OpenLayers.Format.WFST.v1_1_0 = OpenLayers.Class(
}
}
if(options.filter) {
this.setFilterProperty(options.filter);
OpenLayers.Format.WFST.v1_1_0.prototype.setFilterProperty.call(this, options.filter);
this.writeNode("ogc:Filter", options.filter, node);
}
return node;

View File

@@ -112,6 +112,7 @@ OpenLayers.Format.WMTSCapabilities.v1_0_0 = OpenLayers.Class(
var layer = {
styles: [],
formats: [],
dimensions: [],
tileMatrixSetLinks: []
};
layer.layers = [];
@@ -218,7 +219,23 @@ OpenLayers.Format.WMTSCapabilities.v1_0_0 = OpenLayers.Class(
obj.serviceMetadataUrl = {};
obj.serviceMetadataUrl.href = node.getAttribute("xlink:href");
// TODO: other attributes of <ServiceMetadataURL> element
}
},
"LegendURL": function(node, obj) {
obj.legend = {};
obj.legend.href = node.getAttribute("xlink:href");
obj.legend.format = node.getAttribute("format");
},
"Dimension": function(node, obj) {
var dimension = {values: []};
this.readChildNodes(node, dimension);
obj.dimensions.push(dimension);
},
"Default": function(node, obj) {
obj["default"] = this.getChildValue(node);
},
"Value": function(node, obj) {
obj.values.push(this.getChildValue(node));
}
},
"ows": OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers["ows"]
},

View File

@@ -242,6 +242,7 @@ OpenLayers.Format.WPSExecute = OpenLayers.Class(OpenLayers.Format.XML, {
},
"wcs": OpenLayers.Format.WCSGetCoverage.prototype.writers.wcs,
"wfs": OpenLayers.Format.WFST.v1_1_0.prototype.writers.wfs,
"ogc": OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc,
"ows": OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows
},

View File

@@ -325,15 +325,15 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
/**
* Method: getServerResolution
* Return the server-supported resolution that is the closest to
* the resolution passed as a parameter. If no resolution is
* passed the map resolution is used.
* Return the closest highest server-supported resolution. Throw an
* exception if none is found in the serverResolutions array.
*
* Parameters:
* resolution - {Number} The base resolution.
* resolution - {Number} The base resolution. If undefined the
* map resolution is used.
*
* Returns:
* {Number} The closest server supported resolution.
* {Number} The closest highest server resolution value.
*/
getServerResolution: function(resolution) {
resolution = resolution || this.map.getResolution();

View File

@@ -299,11 +299,11 @@ OpenLayers.Map = OpenLayers.Class({
/**
* APIProperty: maxExtent
* {<OpenLayers.Bounds>} The maximum extent for the map. Defaults to the
* whole world in decimal degrees
* (-180, -90, 180, 90). Specify a different
* extent in the map options if you are not using a
* geographic projection and displaying the whole
* world.
* whole world in decimal degrees (-180, -90, 180, 90). Specify a
* different extent in the map options if you are not using a geographic
* projection and displaying the whole world. To restrict user panning
* and zooming of the map, use <restrictedExtent> instead. The value
* for <maxExtent> will change calculations for tile URLs.
*/
maxExtent: null,

View File

@@ -132,7 +132,7 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
this.translate(this.xOffset, 0);
return true;
} else {
inRange = this.translate(left - this.left + this.xOffset, top - this.top);
var inRange = this.translate(left - this.left + this.xOffset, top - this.top);
if (!inRange) {
// recenter the coordinate system
this.setExtent(extent, true);

View File

@@ -36,7 +36,7 @@
}
function test_layers(t) {
t.plan(25);
t.plan(37);
var xml = document.getElementById("ogcsample").firstChild.nodeValue;
var doc = new OpenLayers.Format.XML().read(xml);
@@ -61,9 +61,12 @@
t.eq(layer.styles[0].identifier, "DarkBlue", "style 0 identifier is correct");
t.eq(layer.styles[0].isDefault, true, "style 0 isDefault is correct");
t.eq(layer.styles[0].title, "Dark Blue", "style 0 title is correct");
t.eq(layer.styles[0].legend.href, "http://www.miramon.uab.es/wmts/Coastlines/coastlines_darkBlue.png", "style 0 legend href is correct");
t.eq(layer.styles[0].legend.format, "image/png", "style 0 legend format is correct");
t.eq(layer.styles[1].identifier, "thickAndRed", "style 1 identifier is correct");
t.ok(!layer.styles[1].isDefault, "style 1 isDefault is correct");
t.eq(layer.styles[1].title, "Thick And Red", "style 1 title is correct");
t.eq(layer.styles[1].legend, undefined, "style 1 legend is not set");
//t.eq(layer.styles[1].abstract, "Specify this style if you want your maps to have thick red coastlines. ", "style 1 abstract is correct");
t.eq(layer.tileMatrixSetLinks.length, 1, "correct count of tileMatrixSetLinks");
@@ -83,6 +86,17 @@
t.eq(layer.resourceUrl.FeatureInfo.format, "application/gml+xml; version=3.1", "resourceUrl.FeatureInfo.format is correct");
t.eq(layer.resourceUrl.FeatureInfo.template, "http://www.example.com/wmts/coastlines/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{J}/{I}.xml",
"resourceUrl.FeatureInfo.template is correct");
var dimensions = layer.dimensions;
t.eq(dimensions.length, 1, "correct count of dimensions");
t.eq(dimensions[0].title, "Time", "first dimension title is correct");
t.eq(dimensions[0].abstract, "Monthly datasets", "first dimension abstract is correct");
t.eq(dimensions[0].identifier, "TIME", "first dimension identifier is correct");
t.eq(dimensions[0]['default'], "default", "first dimension default is correct");
t.eq(dimensions[0].values.length, 3, "first dimension has correct count of values");
t.eq(dimensions[0].values[0], "2007-05", "first value is correct");
t.eq(dimensions[0].values[1], "2007-06", "second value is correct");
t.eq(dimensions[0].values[2], "2007-07", "third value is correct");
}
function test_tileMatrixSets(t) {
@@ -271,6 +285,7 @@ http://schemas.opengis.net/wmts/1.0/examples/wmtsGetCapabilities_response.xml
<Value>2007-05</Value>
<Value>2007-06</Value>
<Value>2007-07</Value>
<Default>default</Default>
</Dimension>
<TileMatrixSetLink>
<TileMatrixSet>BigWorld</TileMatrixSet>

View File

@@ -458,6 +458,65 @@
t.xml_eq(result, expected, "WPS Execute written out correctly");
}
function test_write_WPSExecuteFID(t) {
t.plan(1);
var result,
expected,
format = ({geometryName: 'the_geom'});
expected = '<?xml version="1.0" encoding="UTF-8"?>' +
'<wps:Execute xmlns:wps="http://www.opengis.net/wps/1.0.0" version="1.0.0" service="WPS" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' +
' <ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">gs:Bounds</ows:Identifier>' +
' <wps:DataInputs>' +
' <wps:Input>' +
' <ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">features</ows:Identifier>' +
' <wps:Reference mimeType="text/xml" xlink:href="http://geoserver/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" method="POST">' +
' <wps:Body>' +
' <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0">' +
' <wfs:Query typeName="foo:bar">' +
' <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">' +
' <ogc:FeatureId fid="123"/>' +
' </ogc:Filter>' +
' </wfs:Query>' +
' </wfs:GetFeature>' +
' </wps:Body>' +
' </wps:Reference>' +
' </wps:Input>' +
' </wps:DataInputs>' +
' <wps:ResponseForm>' +
' <wps:RawDataOutput>' +
' <ows:Identifier xmlns:ows="http://www.opengis.net/ows/1.1">bounds</ows:Identifier>' +
' </wps:RawDataOutput>' +
' </wps:ResponseForm>' +
'</wps:Execute>';
result = new OpenLayers.Format.WPSExecute().write({
identifier: 'gs:Bounds',
dataInputs: [{
identifier: 'features',
reference: {
mimeType: 'text/xml',
href: 'http://geoserver/wfs',
method: 'POST',
body: {
wfs: {
featureType: 'foo:bar',
version: '1.0.0',
filter: new OpenLayers.Filter.FeatureId({fids: [123]})
}
}
}
}],
responseForm: {
rawDataOutput: {
identifier: 'bounds'
}
}
});
t.xml_eq(result, expected, 'WPS Execute written out correctly with a FID filter');
}
</script>
</head>
<body>

View File

@@ -272,7 +272,7 @@
style: "blue_marble",
matrixSet: "arcgis_online",
tileSize: new OpenLayers.Size(512, 512),
requestEncoding: "REST",
requestEncoding: "REST"
});
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0,0), 5);