Skip to content

Commit

Permalink
Merge pull request openlayers#20 from drnextgis/feature
Browse files Browse the repository at this point in the history
Fix unterminated statements
  • Loading branch information
tschaub committed Oct 23, 2011
2 parents 5486caf + 81fd4ad commit daa16c0
Show file tree
Hide file tree
Showing 28 changed files with 122 additions and 122 deletions.
4 changes: 2 additions & 2 deletions examples/KMLParser.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<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+",";
html += "<ul>";
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>";
Expand Down
2 changes: 1 addition & 1 deletion examples/WMSDescribeLayerParser.html
Original file line number Diff line number Diff line change
Expand Up @@ -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+",";
Expand Down
40 changes: 20 additions & 20 deletions examples/animator.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,22 @@ 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 [];
if (!o.length) return [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('-');
Expand All @@ -161,35 +161,35 @@ 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) {
return function(state) {
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) {
Expand All @@ -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) {
Expand All @@ -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 = {
Expand All @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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})$/;

Expand All @@ -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
Expand Down Expand Up @@ -482,7 +482,7 @@ CSSStyleSubject.prototype = {
}
return str;
}
}
};
// get the current value of a css property,
CSSStyleSubject.getStyle = function(el, property){
var style;
Expand All @@ -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*$/;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -667,4 +667,4 @@ Accordion.prototype = {
document.location.hash = this.rememberanceTexts[section];
}
}
}
};
2 changes: 1 addition & 1 deletion examples/buffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion examples/donut.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function updateOutput(event) {
map.layers[1].events.on({
sketchmodified: updateOutput,
sketchcomplete: updateOutput
})
});

// add behavior to UI elements
function toggleControl(element) {
Expand Down
14 changes: 7 additions & 7 deletions examples/editing-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $("insertXY").onclick = function() {
if (values != null) {
draw.insertXY(values[0], values[1]);
}
}
};
$("insertDeltaXY").onclick = function() {
var values = parseInput(
window.prompt(
Expand All @@ -39,7 +39,7 @@ $("insertDeltaXY").onclick = function() {
if (values != null) {
draw.insertDeltaXY(values[0], values[1]);
}
}
};
$("insertDirectionLength").onclick = function() {
var values = parseInput(
window.prompt(
Expand All @@ -49,7 +49,7 @@ $("insertDirectionLength").onclick = function() {
if (values != null) {
draw.insertDirectionLength(values[0], values[1]);
}
}
};
$("insertDeflectionLength").onclick = function() {
var values = parseInput(
window.prompt(
Expand All @@ -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(",");
Expand All @@ -80,4 +80,4 @@ function parseInput(text) {
}
}
return values;
}
}
6 changes: 3 additions & 3 deletions examples/example-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -185,7 +185,7 @@
scores[exIndex][word] = count;
}
}
}
};
if(dict) {
updateScores();
} else {
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion examples/filter-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function startAnimation() {
} else {
stopAnimation(true);
}
}
};
animationTimer = window.setInterval(next, interval * 1000);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/getfeatureinfo-control.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
},
queryVisible: true
})
}
};

map.addLayers([political, roads, cities, water, highlightLayer]);
for (var i in infoControls) {
Expand Down
2 changes: 1 addition & 1 deletion examples/gutter.html
Original file line number Diff line number Diff line change
Expand Up @@ -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&",
Expand Down
2 changes: 1 addition & 1 deletion examples/layerLoadMonitoring.html
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions examples/mapguide.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion examples/mobile-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion examples/mvs.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

// ----
// TODO: Handle all this parsing better.
var safeArgs = {}
var safeArgs = {};

var DEFAULT_LAT = 0;
var DEFAULT_LON = 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/ordering.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
graphicZIndex: useFirst ? FIRST_RED_Z_INDEX : SECOND_RED_Z_INDEX,
externalGraphic: "../img/marker.png",
pointRadius: 10
}
};

indexFeatures.push(
point
Expand Down
6 changes: 3 additions & 3 deletions examples/osm-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
2 changes: 1 addition & 1 deletion examples/overviewmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ <h1 id="title">Overview Map</h1>
20037508.34, 20037508.34)
}),
layers: [jplOverview]
}
};
var overview2 = new OpenLayers.Control.OverviewMap(controlOptions);
map2.addControl(overview2);

Expand Down
Loading

0 comments on commit daa16c0

Please sign in to comment.