Merged with upstream master
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
<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/google.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script src="all-overlays-google.js"></script>
|
<script src="all-overlays-google.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
+2
-2
@@ -34,7 +34,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
trigger: function(e) {
|
trigger: function(e) {
|
||||||
var lonlat = map.getLonLatFromViewPortPx(e.xy);
|
var lonlat = map.getLonLatFromPixel(e.xy);
|
||||||
alert("You clicked near " + lonlat.lat + " N, " +
|
alert("You clicked near " + lonlat.lat + " N, " +
|
||||||
+ lonlat.lon + " E");
|
+ lonlat.lon + " E");
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
<p id="shortdesc">
|
<p id="shortdesc">
|
||||||
This example shows the use of the click handler and
|
This example shows the use of the click handler and
|
||||||
getLonLatFromViewPortPx functions to trigger events on mouse click.
|
getLonLatFromPixel functions to trigger events on mouse click.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map" class="smallmap"></div>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ map.addControl(draw);
|
|||||||
draw.activate();
|
draw.activate();
|
||||||
|
|
||||||
// handle clicks on method links
|
// handle clicks on method links
|
||||||
$("insertXY").onclick = function() {
|
document.getElementById("insertXY").onclick = function() {
|
||||||
var values = parseInput(
|
var values = parseInput(
|
||||||
window.prompt(
|
window.prompt(
|
||||||
"Enter map coordinates for new point (e.g. '-111, 46')", "x, y"
|
"Enter map coordinates for new point (e.g. '-111, 46')", "x, y"
|
||||||
@@ -30,7 +30,7 @@ $("insertXY").onclick = function() {
|
|||||||
draw.insertXY(values[0], values[1]);
|
draw.insertXY(values[0], values[1]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$("insertDeltaXY").onclick = function() {
|
document.getElementById("insertDeltaXY").onclick = function() {
|
||||||
var values = parseInput(
|
var values = parseInput(
|
||||||
window.prompt(
|
window.prompt(
|
||||||
"Enter offset values for new point (e.g. '15, -10')", "dx, dy"
|
"Enter offset values for new point (e.g. '15, -10')", "dx, dy"
|
||||||
@@ -40,7 +40,7 @@ $("insertDeltaXY").onclick = function() {
|
|||||||
draw.insertDeltaXY(values[0], values[1]);
|
draw.insertDeltaXY(values[0], values[1]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$("insertDirectionLength").onclick = function() {
|
document.getElementById("insertDirectionLength").onclick = function() {
|
||||||
var values = parseInput(
|
var values = parseInput(
|
||||||
window.prompt(
|
window.prompt(
|
||||||
"Enter direction and length offset values for new point (e.g. '-45, 10')", "direction, length"
|
"Enter direction and length offset values for new point (e.g. '-45, 10')", "direction, length"
|
||||||
@@ -50,7 +50,7 @@ $("insertDirectionLength").onclick = function() {
|
|||||||
draw.insertDirectionLength(values[0], values[1]);
|
draw.insertDirectionLength(values[0], values[1]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$("insertDeflectionLength").onclick = function() {
|
document.getElementById("insertDeflectionLength").onclick = function() {
|
||||||
var values = parseInput(
|
var values = parseInput(
|
||||||
window.prompt(
|
window.prompt(
|
||||||
"Enter deflection and length offset values for new point (e.g. '15, 20')", "deflection, length"
|
"Enter deflection and length offset values for new point (e.g. '15, 20')", "deflection, length"
|
||||||
@@ -60,10 +60,10 @@ $("insertDeflectionLength").onclick = function() {
|
|||||||
draw.insertDeflectionLength(values[0], values[1]);
|
draw.insertDeflectionLength(values[0], values[1]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$("cancel").onclick = function() {
|
document.getElementById("cancel").onclick = function() {
|
||||||
draw.cancel();
|
draw.cancel();
|
||||||
};
|
};
|
||||||
$("finishSketch").onclick = function() {
|
document.getElementById("finishSketch").onclick = function() {
|
||||||
draw.finishSketch();
|
draw.finishSketch();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
function init() {
|
function init() {
|
||||||
map = new OpenLayers.Map( 'map',
|
map = new OpenLayers.Map( 'map',
|
||||||
{
|
{
|
||||||
'maxExtent': new OpenLayers.Bounds(0, 0, $("map").clientWidth, $("map").clientHeight),
|
'maxExtent': new OpenLayers.Bounds(0, 0, document.getElementById("map").clientWidth, document.getElementById("map").clientHeight),
|
||||||
controls: [],
|
controls: [],
|
||||||
maxResolution: 'auto'}
|
maxResolution: 'auto'}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -92,16 +92,15 @@ geolocate.events.register("locationupdated",geolocate,function(e) {
|
|||||||
geolocate.events.register("locationfailed",this,function() {
|
geolocate.events.register("locationfailed",this,function() {
|
||||||
OpenLayers.Console.log('Location detection failed');
|
OpenLayers.Console.log('Location detection failed');
|
||||||
});
|
});
|
||||||
|
document.getElementById('locate').onclick = function() {
|
||||||
$('locate').onclick = function() {
|
|
||||||
vector.removeAllFeatures();
|
vector.removeAllFeatures();
|
||||||
geolocate.deactivate();
|
geolocate.deactivate();
|
||||||
$('track').checked = false;
|
document.getElementById('track').checked = false;
|
||||||
geolocate.watch = false;
|
geolocate.watch = false;
|
||||||
firstGeolocation = true;
|
firstGeolocation = true;
|
||||||
geolocate.activate();
|
geolocate.activate();
|
||||||
};
|
};
|
||||||
$('track').onclick = function() {
|
document.getElementById('track').onclick = function() {
|
||||||
vector.removeAllFeatures();
|
vector.removeAllFeatures();
|
||||||
geolocate.deactivate();
|
geolocate.deactivate();
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
@@ -110,4 +109,4 @@ $('track').onclick = function() {
|
|||||||
geolocate.activate();
|
geolocate.activate();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$('track').checked = false;
|
document.getElementById('track').checked = false;
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
</style>
|
</style>
|
||||||
<script defer="defer" type="text/javascript">
|
<script defer="defer" type="text/javascript">
|
||||||
OpenLayers.ProxyHost = "proxy.cgi?url=";
|
OpenLayers.ProxyHost = "proxy.cgi?url=";
|
||||||
|
|
||||||
var map, infocontrols, water, highlightlayer;
|
var map, infocontrols, water, highlightlayer;
|
||||||
|
|
||||||
function load() {
|
function load() {
|
||||||
@@ -125,7 +124,7 @@
|
|||||||
highlightLayer.addFeatures(evt.features);
|
highlightLayer.addFeatures(evt.features);
|
||||||
highlightLayer.redraw();
|
highlightLayer.redraw();
|
||||||
} else {
|
} else {
|
||||||
$('responseText').innerHTML = evt.text;
|
document.getElementById('responseText').innerHTML = evt.text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<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/google.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script src="google-v3-alloverlays.js"></script>
|
<script src="google-v3-alloverlays.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
+12
-1
@@ -8,7 +8,7 @@
|
|||||||
<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/google.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script src="google-v3.js"></script>
|
<script src="google-v3.js"></script>
|
||||||
</head>
|
</head>
|
||||||
@@ -35,6 +35,17 @@
|
|||||||
location, you must include the extra theme/default/google.css
|
location, you must include the extra theme/default/google.css
|
||||||
stylesheet.
|
stylesheet.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>Note on Google Maps API versioning:</strong>
|
||||||
|
This example uses the "nightly" version of Google Maps
|
||||||
|
API. This is specified by using <code>v=3</code> in the
|
||||||
|
the Google Maps API URL. Production applications should use the
|
||||||
|
"release" or "frozen" versions of Google Maps
|
||||||
|
API. See the <code>OpenLayers.Layer.Google.v3</code> API
|
||||||
|
docs, and the
|
||||||
|
<a href="https://developers.google.com/maps/documentation/javascript/basics#Versioning">Versioning Section</a>
|
||||||
|
of the Google Maps API docs, for more details.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
var pixel = new OpenLayers.Pixel(center.x + x, center.y + y);
|
var pixel = new OpenLayers.Pixel(center.x + x, center.y + y);
|
||||||
|
|
||||||
var lonLat = map.getLonLatFromViewPortPx(pixel);
|
var lonLat = map.getLonLatFromPixel(pixel);
|
||||||
features.push(
|
features.push(
|
||||||
new OpenLayers.Feature.Vector(
|
new OpenLayers.Feature.Vector(
|
||||||
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ html, body, #map {
|
|||||||
#title, #tags, #shortdesc {
|
#title, #tags, #shortdesc {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.olTileImage {
|
.olLayerGrid .olTileImage {
|
||||||
-webkit-transition: opacity 0.2s linear;
|
-webkit-transition: opacity 0.2s linear;
|
||||||
-moz-transition: opacity 0.2s linear;
|
-moz-transition: opacity 0.2s linear;
|
||||||
-o-transition: opacity 0.2s linear;
|
-o-transition: opacity 0.2s linear;
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ var map;
|
|||||||
{layer:"lb", requestEncoding:"REST", transitionEffect:"resize"}, defaults
|
{layer:"lb", requestEncoding:"REST", transitionEffect:"resize"}, defaults
|
||||||
));
|
));
|
||||||
labels = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
labels = format.createLayer(caps, OpenLayers.Util.applyDefaults(
|
||||||
{layer:"beschriftung", requestEncoding:"REST", isBaseLayer: false},
|
{layer:"beschriftung", requestEncoding:"REST", className:"nofade", isBaseLayer: false},
|
||||||
defaults
|
defaults
|
||||||
));
|
));
|
||||||
map.addLayers([fmzk, aerial, labels]);
|
map.addLayers([fmzk, aerial, labels]);
|
||||||
@@ -184,25 +184,26 @@ var map;
|
|||||||
attribution: 'Datenquelle: Stadt Wien - <a href="http://data.wien.gv.at">data.wien.gv.at</a>'
|
attribution: 'Datenquelle: Stadt Wien - <a href="http://data.wien.gv.at">data.wien.gv.at</a>'
|
||||||
};
|
};
|
||||||
fmzk = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
fmzk = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
||||||
url: "http://www.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
url: "http://maps.wien.gv.at/wmts/fmzk/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
||||||
layer: "fmzk",
|
layer: "fmzk",
|
||||||
style: "pastell",
|
style: "pastell",
|
||||||
transitionEffect: "resize"
|
transitionEffect: "resize"
|
||||||
},
|
},
|
||||||
defaults));
|
defaults));
|
||||||
aerial = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
aerial = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
||||||
url: "http://www.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
url: "http://maps.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg",
|
||||||
layer: "lb",
|
layer: "lb",
|
||||||
style: "farbe",
|
style: "farbe",
|
||||||
transitionEffect: "resize"
|
transitionEffect: "resize"
|
||||||
},
|
},
|
||||||
defaults));
|
defaults));
|
||||||
labels = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
labels = new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults({
|
||||||
url: "http://www.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",
|
url: "http://maps.wien.gv.at/wmts/beschriftung/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",
|
||||||
layer: "beschriftung",
|
layer: "beschriftung",
|
||||||
style: "normal",
|
style: "normal",
|
||||||
transitionEffect: null,
|
transitionEffect: null,
|
||||||
isBaseLayer: false
|
isBaseLayer: false,
|
||||||
|
className: "nofade"
|
||||||
},
|
},
|
||||||
defaults));
|
defaults));
|
||||||
map.addLayers([fmzk, aerial, labels]);
|
map.addLayers([fmzk, aerial, labels]);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
// from bottom to top so as to quickly signal whether or not y-ordering is working.
|
// from bottom to top so as to quickly signal whether or not y-ordering is working.
|
||||||
while (bottom.y > top.y) {
|
while (bottom.y > top.y) {
|
||||||
bottom.y -= POINT_DISTANCE;
|
bottom.y -= POINT_DISTANCE;
|
||||||
var lonLat = map.getLonLatFromViewPortPx(bottom);
|
var lonLat = map.getLonLatFromPixel(bottom);
|
||||||
orderingFeatures.push(
|
orderingFeatures.push(
|
||||||
new OpenLayers.Feature.Vector(
|
new OpenLayers.Feature.Vector(
|
||||||
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
var indexFeatures = [];
|
var indexFeatures = [];
|
||||||
var useFirst = true;
|
var useFirst = true;
|
||||||
while (left.x <= right.x) {
|
while (left.x <= right.x) {
|
||||||
var lonLat = map.getLonLatFromViewPortPx(left);
|
var lonLat = map.getLonLatFromPixel(left);
|
||||||
var point = new OpenLayers.Feature.Vector(
|
var point = new OpenLayers.Feature.Vector(
|
||||||
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
new OpenLayers.Geometry.Point(lonLat.lon, lonLat.lat)
|
||||||
);
|
);
|
||||||
@@ -147,8 +147,8 @@
|
|||||||
// and succomb to y-ordering.
|
// and succomb to y-ordering.
|
||||||
var orderingFeatures = [];
|
var orderingFeatures = [];
|
||||||
while (bottom.y > top.y && left.x < right.x) {
|
while (bottom.y > top.y && left.x < right.x) {
|
||||||
var bottomLonLat = map.getLonLatFromViewPortPx(bottom);
|
var bottomLonLat = map.getLonLatFromPixel(bottom);
|
||||||
var leftLonLat = map.getLonLatFromViewPortPx(left);
|
var leftLonLat = map.getLonLatFromPixel(left);
|
||||||
orderingFeatures.push(
|
orderingFeatures.push(
|
||||||
new OpenLayers.Feature.Vector(
|
new OpenLayers.Feature.Vector(
|
||||||
new OpenLayers.Geometry.Point(leftLonLat.lon, bottomLonLat.lat),
|
new OpenLayers.Geometry.Point(leftLonLat.lon, bottomLonLat.lat),
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<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/google.css" type="text/css">
|
<link rel="stylesheet" href="../theme/default/google.css" type="text/css">
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
<link rel="stylesheet" href="style.css" type="text/css">
|
||||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script src="osm-google.js"></script>
|
<script src="osm-google.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -80,7 +80,9 @@
|
|||||||
|
|
||||||
// create an overview map control with the default options
|
// create an overview map control with the default options
|
||||||
var overview1 = new OpenLayers.Control.OverviewMap({
|
var overview1 = new OpenLayers.Control.OverviewMap({
|
||||||
maximized: true
|
maximized: true,
|
||||||
|
maximizeTitle: 'Show the overview map',
|
||||||
|
minimizeTitle: 'Hide the overview map'
|
||||||
});
|
});
|
||||||
map1.addControl(overview1);
|
map1.addControl(overview1);
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, drawControls;
|
var map, drawControls;
|
||||||
|
|
||||||
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
|
OpenLayers.Feature.Vector.style['default']['strokeWidth'] = '2';
|
||||||
function init(){
|
function init(){
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map');
|
||||||
@@ -33,10 +34,10 @@
|
|||||||
});
|
});
|
||||||
vectors.events.on({
|
vectors.events.on({
|
||||||
'featureselected': function(feature) {
|
'featureselected': function(feature) {
|
||||||
$('counter').innerHTML = this.selectedFeatures.length;
|
document.getElementById('counter').innerHTML = this.selectedFeatures.length;
|
||||||
},
|
},
|
||||||
'featureunselected': function(feature) {
|
'featureunselected': function(feature) {
|
||||||
$('counter').innerHTML = this.selectedFeatures.length;
|
document.getElementById('counter').innerHTML = this.selectedFeatures.length;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+10
-11
@@ -41,7 +41,6 @@
|
|||||||
initUI();
|
initUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var map, draw, modify, snap, split, vectors;
|
var map, draw, modify, snap, split, vectors;
|
||||||
function initMap() {
|
function initMap() {
|
||||||
|
|
||||||
@@ -185,15 +184,15 @@
|
|||||||
*/
|
*/
|
||||||
function initUI() {
|
function initUI() {
|
||||||
// add behavior to snap elements
|
// add behavior to snap elements
|
||||||
var snapCheck = $("snap_toggle");
|
var snapCheck = document.getElementById("snap_toggle");
|
||||||
snapCheck.checked = true;
|
snapCheck.checked = true;
|
||||||
snapCheck.onclick = function() {
|
snapCheck.onclick = function() {
|
||||||
if(snapCheck.checked) {
|
if(snapCheck.checked) {
|
||||||
snap.activate();
|
snap.activate();
|
||||||
$("snap_options").style.display = "block";
|
document.getElementById("snap_options").style.display = "block";
|
||||||
} else {
|
} else {
|
||||||
snap.deactivate();
|
snap.deactivate();
|
||||||
$("snap_options").style.display = "none";
|
document.getElementById("snap_options").style.display = "none";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var target, type, tog, tol;
|
var target, type, tog, tol;
|
||||||
@@ -201,12 +200,12 @@
|
|||||||
var target = snap.targets[0];
|
var target = snap.targets[0];
|
||||||
for(var j=0; j<types.length; ++j) {
|
for(var j=0; j<types.length; ++j) {
|
||||||
type = types[j];
|
type = types[j];
|
||||||
tog = $("target_" + type);
|
tog = document.getElementById("target_" + type);
|
||||||
tog.checked = target[type];
|
tog.checked = target[type];
|
||||||
tog.onclick = (function(tog, type, target) {
|
tog.onclick = (function(tog, type, target) {
|
||||||
return function() {target[type] = tog.checked;}
|
return function() {target[type] = tog.checked;}
|
||||||
})(tog, type, target);
|
})(tog, type, target);
|
||||||
tol = $("target_" + type + "Tolerance");
|
tol = document.getElementById("target_" + type + "Tolerance");
|
||||||
tol.value = target[type + "Tolerance"];
|
tol.value = target[type + "Tolerance"];
|
||||||
tol.onchange = (function(tol, type, target) {
|
tol.onchange = (function(tol, type, target) {
|
||||||
return function() {
|
return function() {
|
||||||
@@ -216,24 +215,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add behavior to split elements
|
// add behavior to split elements
|
||||||
var splitCheck = $("split_toggle");
|
var splitCheck = document.getElementById("split_toggle");
|
||||||
splitCheck.checked = true;
|
splitCheck.checked = true;
|
||||||
splitCheck.onclick = function() {
|
splitCheck.onclick = function() {
|
||||||
if(splitCheck.checked) {
|
if(splitCheck.checked) {
|
||||||
split.activate();
|
split.activate();
|
||||||
$("split_options").style.display = "block";
|
document.getElementById("split_options").style.display = "block";
|
||||||
} else {
|
} else {
|
||||||
split.deactivate();
|
split.deactivate();
|
||||||
$("split_options").style.display = "none";
|
document.getElementById("split_options").style.display = "none";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var edgeCheck = $("edge_toggle");
|
var edgeCheck = document.getElementById("edge_toggle");
|
||||||
edgeCheck.checked = split.edge;
|
edgeCheck.checked = split.edge;
|
||||||
edgeCheck.onclick = function() {
|
edgeCheck.onclick = function() {
|
||||||
split.edge = edgeCheck.checked;
|
split.edge = edgeCheck.checked;
|
||||||
};
|
};
|
||||||
|
|
||||||
$("clear").onclick = function() {
|
document.getElementById("clear").onclick = function() {
|
||||||
modify.deactivate();
|
modify.deactivate();
|
||||||
vectors.destroyFeatures();
|
vectors.destroyFeatures();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -194,7 +194,7 @@
|
|||||||
* property values.
|
* property values.
|
||||||
*/
|
*/
|
||||||
function initUI() {
|
function initUI() {
|
||||||
var check = $("snapping");
|
var check = document.getElementById("snapping");
|
||||||
check.checked = true;
|
check.checked = true;
|
||||||
check.onclick = function() {
|
check.onclick = function() {
|
||||||
if(check.checked) {
|
if(check.checked) {
|
||||||
@@ -204,7 +204,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var sel = $("editable");
|
var sel = document.getElementById("editable");
|
||||||
sel.value = "poly";
|
sel.value = "poly";
|
||||||
sel.onchange = function() {
|
sel.onchange = function() {
|
||||||
updateEditable(sel.value);
|
updateEditable(sel.value);
|
||||||
@@ -216,12 +216,12 @@
|
|||||||
target = snap.targets[i];
|
target = snap.targets[i];
|
||||||
for(var j=0; j<types.length; ++j) {
|
for(var j=0; j<types.length; ++j) {
|
||||||
type = types[j];
|
type = types[j];
|
||||||
tog = $(i + "_" + type);
|
tog = document.getElementById(i + "_" + type);
|
||||||
tog.checked = target[type];
|
tog.checked = target[type];
|
||||||
tog.onclick = (function(tog, type, target) {
|
tog.onclick = (function(tog, type, target) {
|
||||||
return function() {target[type] = tog.checked;}
|
return function() {target[type] = tog.checked;}
|
||||||
})(tog, type, target);
|
})(tog, type, target);
|
||||||
tol = $(i + "_" + type + "Tolerance");
|
tol = document.getElementById(i + "_" + type + "Tolerance");
|
||||||
tol.value = target[type + "Tolerance"];
|
tol.value = target[type + "Tolerance"];
|
||||||
tol.onchange = (function(tol, type, target) {
|
tol.onchange = (function(tol, type, target) {
|
||||||
return function() {
|
return function() {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script>
|
||||||
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -73,64 +73,64 @@ var map, vectorlayer, features, stylemap, select;
|
|||||||
|
|
||||||
// The function that gets called on feature selection: shows information
|
// The function that gets called on feature selection: shows information
|
||||||
// about the feature/cluser in a div on the page
|
// about the feature/cluser in a div on the page
|
||||||
var showInformation = function(evt){
|
var showInformation = function(evt){
|
||||||
var feature = evt.feature;
|
var feature = evt.feature;
|
||||||
var info = 'Last hovered feature:<br>';
|
var info = 'Last hovered feature:<br>';
|
||||||
if (feature.cluster) {
|
if (feature.cluster) {
|
||||||
info += ' Cluster of ' + feature.attributes.count + ' features:';
|
info += ' Cluster of ' + feature.attributes.count + ' features:';
|
||||||
var clazzes = {
|
var clazzes = {
|
||||||
'1': 0,
|
'1': 0,
|
||||||
'2': 0,
|
'2': 0,
|
||||||
'3': 0,
|
'3': 0,
|
||||||
'4': 0
|
'4': 0
|
||||||
};
|
};
|
||||||
for (var i = 0; i < feature.attributes.count; i++) {
|
for (var i = 0; i < feature.attributes.count; i++) {
|
||||||
var feat = feature.cluster[i];
|
var feat = feature.cluster[i];
|
||||||
clazzes[feat.attributes.clazz]++;
|
clazzes[feat.attributes.clazz]++;
|
||||||
}
|
}
|
||||||
for (var j=1; j<=4; j++) {
|
for (var j=1; j<=4; j++) {
|
||||||
var plural_s = (clazzes[j] !== 1) ? 's' : '';
|
var plural_s = (clazzes[j] !== 1) ? 's' : '';
|
||||||
info += '<br> • clazz ' + j + ': ' + clazzes[j] + ' feature' + plural_s;
|
info += '<br> • clazz ' + j + ': ' + clazzes[j] + ' feature' + plural_s;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
info += ' Single feature of clazz = ' + feature.attributes.clazz;
|
info += ' Single feature of clazz = ' + feature.attributes.clazz;
|
||||||
}
|
}
|
||||||
$('info').innerHTML = info;
|
document.getElementById('info').innerHTML = info;
|
||||||
};
|
};
|
||||||
|
|
||||||
// The function that gets called on feature selection. Shows information
|
// The function that gets called on feature selection. Shows information
|
||||||
// about the number of "points" on the map.
|
// about the number of "points" on the map.
|
||||||
var updateGeneralInformation = function() {
|
var updateGeneralInformation = function() {
|
||||||
var info = 'Currently ' + vectorlayer.features.length + ' points are shown on the map.';
|
var info = 'Currently ' + vectorlayer.features.length + ' points are shown on the map.';
|
||||||
$('generalinfo').innerHTML = info;
|
document.getElementById('generalinfo').innerHTML = info;
|
||||||
};
|
};
|
||||||
|
|
||||||
// instanciate the map
|
// instanciate the map
|
||||||
map = new OpenLayers.Map("map");
|
map = new OpenLayers.Map("map");
|
||||||
|
|
||||||
// background WMS
|
// background WMS
|
||||||
var ol_wms = new OpenLayers.Layer.WMS("OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", {
|
var ol_wms = new OpenLayers.Layer.WMS("OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", {
|
||||||
layers: "basic"
|
layers: "basic"
|
||||||
});
|
});
|
||||||
|
|
||||||
// context to style the vectorlayer
|
// context to style the vectorlayer
|
||||||
var context = {
|
var context = {
|
||||||
getColor: function(feature){
|
getColor: function(feature){
|
||||||
var color = '#aaaaaa';
|
var color = '#aaaaaa';
|
||||||
if (feature.attributes.clazz && feature.attributes.clazz === 4) {
|
if (feature.attributes.clazz && feature.attributes.clazz === 4) {
|
||||||
color = '#ee0000';
|
color = '#ee0000';
|
||||||
} else if(feature.cluster) {
|
} else if(feature.cluster) {
|
||||||
var onlyFour = true;
|
var onlyFour = true;
|
||||||
for (var i = 0; i < feature.cluster.length; i++) {
|
for (var i = 0; i < feature.cluster.length; i++) {
|
||||||
if (onlyFour && feature.cluster[i].attributes.clazz !== 4) {
|
if (onlyFour && feature.cluster[i].attributes.clazz !== 4) {
|
||||||
onlyFour = false;
|
onlyFour = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (onlyFour === true) {
|
if (onlyFour === true) {
|
||||||
color = '#ee0000';
|
color = '#ee0000';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -143,26 +143,26 @@ var map, vectorlayer, features, stylemap, select;
|
|||||||
strokeColor: "#666666",
|
strokeColor: "#666666",
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
strokeOpacity: 1,
|
strokeOpacity: 1,
|
||||||
graphicZIndex: 1
|
graphicZIndex: 1
|
||||||
}, {
|
}, {
|
||||||
context: context
|
context: context
|
||||||
}),
|
}),
|
||||||
'select' : new OpenLayers.Style({
|
'select' : new OpenLayers.Style({
|
||||||
pointRadius: 5,
|
pointRadius: 5,
|
||||||
fillColor: "#ffff00",
|
fillColor: "#ffff00",
|
||||||
fillOpacity: 1,
|
fillOpacity: 1,
|
||||||
strokeColor: "#666666",
|
strokeColor: "#666666",
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
strokeOpacity: 1,
|
strokeOpacity: 1,
|
||||||
graphicZIndex: 2
|
graphicZIndex: 2
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
// the vectorlayer
|
// the vectorlayer
|
||||||
vectorlayer = new OpenLayers.Layer.Vector('Vectorlayer', {styleMap: stylemap, strategies: []});
|
vectorlayer = new OpenLayers.Layer.Vector('Vectorlayer', {styleMap: stylemap, strategies: []});
|
||||||
|
|
||||||
// the select control
|
// the select control
|
||||||
select = new OpenLayers.Control.SelectFeature(
|
select = new OpenLayers.Control.SelectFeature(
|
||||||
vectorlayer, {hover: true}
|
vectorlayer, {hover: true}
|
||||||
);
|
);
|
||||||
map.addControl(select);
|
map.addControl(select);
|
||||||
@@ -197,18 +197,18 @@ var map, vectorlayer, features, stylemap, select;
|
|||||||
switch(this.value) {
|
switch(this.value) {
|
||||||
case 'cluster':
|
case 'cluster':
|
||||||
// standard clustering
|
// standard clustering
|
||||||
strategies.push(new OpenLayers.Strategy.Cluster());
|
strategies.push(new OpenLayers.Strategy.Cluster());
|
||||||
break;
|
break;
|
||||||
case 'attribute-cluster':
|
case 'attribute-cluster':
|
||||||
// use the custom class: only cluster features of the same clazz
|
// use the custom class: only cluster features of the same clazz
|
||||||
strategies.push(new OpenLayers.Strategy.AttributeCluster({
|
strategies.push(new OpenLayers.Strategy.AttributeCluster({
|
||||||
attribute:'clazz'
|
attribute:'clazz'
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
case 'rule-cluster':
|
case 'rule-cluster':
|
||||||
// use the custom class: only cluster features that have a
|
// use the custom class: only cluster features that have a
|
||||||
// clazz smaller than 4
|
// clazz smaller than 4
|
||||||
strategies.push(new OpenLayers.Strategy.RuleCluster({
|
strategies.push(new OpenLayers.Strategy.RuleCluster({
|
||||||
rule: new OpenLayers.Rule({
|
rule: new OpenLayers.Rule({
|
||||||
filter: new OpenLayers.Filter.Comparison({
|
filter: new OpenLayers.Filter.Comparison({
|
||||||
type: OpenLayers.Filter.Comparison.LESS_THAN,
|
type: OpenLayers.Filter.Comparison.LESS_THAN,
|
||||||
@@ -219,24 +219,24 @@ var map, vectorlayer, features, stylemap, select;
|
|||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// remove layer and control
|
// remove layer and control
|
||||||
map.removeLayer(vectorlayer);
|
map.removeLayer(vectorlayer);
|
||||||
map.removeControl(select);
|
map.removeControl(select);
|
||||||
// rebuild layer
|
// rebuild layer
|
||||||
vectorlayer = new OpenLayers.Layer.Vector('Vectorlayer', {styleMap: stylemap, strategies: strategies});
|
vectorlayer = new OpenLayers.Layer.Vector('Vectorlayer', {styleMap: stylemap, strategies: strategies});
|
||||||
map.addLayer( vectorlayer );
|
map.addLayer( vectorlayer );
|
||||||
vectorlayer.addFeatures(features);
|
vectorlayer.addFeatures(features);
|
||||||
// rebuild select control
|
// rebuild select control
|
||||||
select = new OpenLayers.Control.SelectFeature(
|
select = new OpenLayers.Control.SelectFeature(
|
||||||
vectorlayer, {hover: true}
|
vectorlayer, {hover: true}
|
||||||
);
|
);
|
||||||
map.addControl(select);
|
map.addControl(select);
|
||||||
select.activate();
|
select.activate();
|
||||||
vectorlayer.events.on({"featureselected": showInformation});
|
vectorlayer.events.on({"featureselected": showInformation});
|
||||||
// update meta information
|
// update meta information
|
||||||
updateGeneralInformation();
|
updateGeneralInformation();
|
||||||
};
|
};
|
||||||
// bind the behviour to the radios
|
// bind the behviour to the radios
|
||||||
var inputs = document.getElementsByTagName('input');
|
var inputs = document.getElementsByTagName('input');
|
||||||
for( var cnt = 0; cnt < inputs.length; cnt++) {
|
for( var cnt = 0; cnt < inputs.length; cnt++) {
|
||||||
var input = inputs[cnt];
|
var input = inputs[cnt];
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
</style>
|
</style>
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
<script src="../lib/OpenLayers.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
// create a semi-random grid of features to be clustered
|
// create a semi-random grid of features to be clustered
|
||||||
var dx = 3;
|
var dx = 3;
|
||||||
var dy = 3;
|
var dy = 3;
|
||||||
@@ -90,24 +89,24 @@
|
|||||||
map.setCenter(new OpenLayers.LonLat(0, 0), 2);
|
map.setCenter(new OpenLayers.LonLat(0, 0), 2);
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
$("reset").onclick = reset;
|
document.getElementById("reset").onclick = reset;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
var distance = parseInt($("distance").value);
|
var distance = parseInt(document.getElementById("distance").value);
|
||||||
var threshold = parseInt($("threshold").value);
|
var threshold = parseInt(document.getElementById("threshold").value);
|
||||||
strategy.distance = distance || strategy.distance;
|
strategy.distance = distance || strategy.distance;
|
||||||
strategy.threshold = threshold || strategy.threshold;
|
strategy.threshold = threshold || strategy.threshold;
|
||||||
$("distance").value = strategy.distance;
|
document.getElementById("distance").value = strategy.distance;
|
||||||
$("threshold").value = strategy.threshold || "null";
|
document.getElementById("threshold").value = strategy.threshold || "null";
|
||||||
clusters.removeFeatures(clusters.features);
|
clusters.removeFeatures(clusters.features);
|
||||||
clusters.addFeatures(features);
|
clusters.addFeatures(features);
|
||||||
}
|
}
|
||||||
|
|
||||||
function display(event) {
|
function display(event) {
|
||||||
var f = event.feature;
|
var f = event.feature;
|
||||||
var el = $("output");
|
var el = document.getElementById("output");
|
||||||
if(f.cluster) {
|
if(f.cluster) {
|
||||||
el.innerHTML = "cluster of " + f.attributes.count;
|
el.innerHTML = "cluster of " + f.attributes.count;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
<script src="Jugl.js"></script>
|
<script src="Jugl.js"></script>
|
||||||
<script src="animator.js"></script>
|
<script src="animator.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var map, template;
|
var map, template;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -171,21 +172,21 @@
|
|||||||
|
|
||||||
function display(event) {
|
function display(event) {
|
||||||
// clear previous photo list and create new one
|
// clear previous photo list and create new one
|
||||||
$("photos").innerHTML = "";
|
document.getElementById("photos").innerHTML = "";
|
||||||
var node = template.process({
|
var node = template.process({
|
||||||
context: {features: event.feature.cluster},
|
context: {features: event.feature.cluster},
|
||||||
clone: true,
|
clone: true,
|
||||||
parent: $("photos")
|
parent: document.getElementById("photos")
|
||||||
});
|
});
|
||||||
// set up forward/rewind
|
// set up forward/rewind
|
||||||
var forward = Animator.apply($("list"), ["start", "end"], {duration: 1500});
|
var forward = Animator.apply(document.getElementById("list"), ["start", "end"], {duration: 1500});
|
||||||
$("scroll-end").onmouseover = function() {forward.seekTo(1)};
|
document.getElementById("scroll-end").onmouseover = function() {forward.seekTo(1)};
|
||||||
$("scroll-end").onmouseout = function() {forward.seekTo(forward.state)};
|
document.getElementById("scroll-end").onmouseout = function() {forward.seekTo(forward.state)};
|
||||||
$("scroll-start").onmouseover = function() {forward.seekTo(0)};
|
document.getElementById("scroll-start").onmouseover = function() {forward.seekTo(0)};
|
||||||
$("scroll-start").onmouseout = function() {forward.seekTo(forward.state)};
|
document.getElementById("scroll-start").onmouseout = function() {forward.seekTo(forward.state)};
|
||||||
// set up photo zoom
|
// set up photo zoom
|
||||||
for(var i=0; i<event.feature.cluster.length; ++i) {
|
for(var i=0; i<event.feature.cluster.length; ++i) {
|
||||||
listen($("link-" + i), Animator.apply($("photo-" + i), ["thumb", "big"]));
|
listen(document.getElementById("link-" + i), Animator.apply(document.getElementById("photo-" + i), ["thumb", "big"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var map, layer;
|
var map, layer;
|
||||||
function init(){
|
function init(){
|
||||||
map = new OpenLayers.Map( $('map'), {
|
map = new OpenLayers.Map( 'map', {
|
||||||
resolutions: [0.087890625, 0.0439453125, 0.02197265625, 0.010986328125]
|
resolutions: [0.087890625, 0.0439453125, 0.02197265625, 0.010986328125]
|
||||||
});
|
});
|
||||||
layer = new OpenLayers.Layer.TileCache("TileCache Layer",
|
layer = new OpenLayers.Layer.TileCache("TileCache Layer",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
var map, vector;
|
var map, vector;
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
map = new OpenLayers.Map('map', {
|
map = new OpenLayers.Map('map', {
|
||||||
projection: 'EPSG:31467',
|
projection: 'EPSG:31467',
|
||||||
@@ -7,16 +8,16 @@ function init(){
|
|||||||
numZoomLevels: 1,
|
numZoomLevels: 1,
|
||||||
controls: [
|
controls: [
|
||||||
new OpenLayers.Control.Attribution({
|
new OpenLayers.Control.Attribution({
|
||||||
div: $('attribution')
|
div: document.getElementById('attribution')
|
||||||
}),
|
}),
|
||||||
new OpenLayers.Control.MousePosition({
|
new OpenLayers.Control.MousePosition({
|
||||||
div: $('mouse-position-31467'),
|
div: document.getElementById('mouse-position-31467'),
|
||||||
prefix: 'Coordinates: ',
|
prefix: 'Coordinates: ',
|
||||||
suffix: ' (in <a href="http://spatialreference.org/ref/epsg/'
|
suffix: ' (in <a href="http://spatialreference.org/ref/epsg/'
|
||||||
+ '31467/">EPSG:31467</a>)'
|
+ '31467/">EPSG:31467</a>)'
|
||||||
}),
|
}),
|
||||||
new OpenLayers.Control.MousePosition({
|
new OpenLayers.Control.MousePosition({
|
||||||
div: $('mouse-position-4326'),
|
div: document.getElementById('mouse-position-4326'),
|
||||||
displayProjection: new OpenLayers.Projection('EPSG:4326'),
|
displayProjection: new OpenLayers.Projection('EPSG:4326'),
|
||||||
prefix: 'Coordinates: ',
|
prefix: 'Coordinates: ',
|
||||||
suffix: ' (in <a href="http://spatialreference.org/ref/epsg/'
|
suffix: ' (in <a href="http://spatialreference.org/ref/epsg/'
|
||||||
@@ -59,7 +60,7 @@ function addVector(x, y, btn){
|
|||||||
|
|
||||||
status += '<br /><code class="emph"> '
|
status += '<br /><code class="emph"> '
|
||||||
+ geometry.toString() + '</code>.';
|
+ geometry.toString() + '</code>.';
|
||||||
$('status').innerHTML = status;
|
document.getElementById('status').innerHTML = status;
|
||||||
|
|
||||||
var feature = new OpenLayers.Feature.Vector(geometry, {}, {
|
var feature = new OpenLayers.Feature.Vector(geometry, {}, {
|
||||||
strokeColor: '#333333',
|
strokeColor: '#333333',
|
||||||
@@ -110,7 +111,7 @@ function addOutline(btn) {
|
|||||||
transformedFeature = new OpenLayers.Feature.Vector(geometry, {}, style);
|
transformedFeature = new OpenLayers.Feature.Vector(geometry, {}, style);
|
||||||
|
|
||||||
vector.addFeatures([transformedFeature]);
|
vector.addFeatures([transformedFeature]);
|
||||||
$('status').innerHTML = 'Transformed polygon';
|
document.getElementById('status').innerHTML = 'Transformed polygon';
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,8 +125,8 @@ function clearVectors(){
|
|||||||
'btnGermany'
|
'btnGermany'
|
||||||
];
|
];
|
||||||
for (var i = 0, len = ids.length; i < len; i++) {
|
for (var i = 0, len = ids.length; i < len; i++) {
|
||||||
var elem = $(ids[i]);
|
var elem = document.getElementById(ids[i]);
|
||||||
elem.disabled = false;
|
elem.disabled = false;
|
||||||
}
|
}
|
||||||
$('status').innerHTML = '';
|
document.getElementById('status').innerHTML = '';
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -414,4 +414,4 @@
|
|||||||
/**
|
/**
|
||||||
* Constant: VERSION_NUMBER
|
* Constant: VERSION_NUMBER
|
||||||
*/
|
*/
|
||||||
OpenLayers.VERSION_NUMBER="Release 2.12-rc4";
|
OpenLayers.VERSION_NUMBER="Release 2.12-rc5";
|
||||||
|
|||||||
@@ -127,6 +127,20 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
*/
|
*/
|
||||||
maximized: false,
|
maximized: false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APIProperty: maximizeTitle
|
||||||
|
* {String} This property is used for showing a tooltip over the
|
||||||
|
* maximize div. Defaults to "" (no title).
|
||||||
|
*/
|
||||||
|
maximizeTitle: "",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APIProperty: minimizeTitle
|
||||||
|
* {String} This property is used for showing a tooltip over the
|
||||||
|
* minimize div. Defaults to "" (no title).
|
||||||
|
*/
|
||||||
|
minimizeTitle: "",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor: OpenLayers.Control.OverviewMap
|
* Constructor: OpenLayers.Control.OverviewMap
|
||||||
* Create a new overview map
|
* Create a new overview map
|
||||||
@@ -247,6 +261,9 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
'absolute');
|
'absolute');
|
||||||
this.maximizeDiv.style.display = 'none';
|
this.maximizeDiv.style.display = 'none';
|
||||||
this.maximizeDiv.className = this.displayClass + 'MaximizeButton olButton';
|
this.maximizeDiv.className = this.displayClass + 'MaximizeButton olButton';
|
||||||
|
if (this.maximizeTitle) {
|
||||||
|
this.maximizeDiv.title = this.maximizeTitle;
|
||||||
|
}
|
||||||
this.div.appendChild(this.maximizeDiv);
|
this.div.appendChild(this.maximizeDiv);
|
||||||
|
|
||||||
// minimize button div
|
// minimize button div
|
||||||
@@ -259,6 +276,9 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
'absolute');
|
'absolute');
|
||||||
this.minimizeDiv.style.display = 'none';
|
this.minimizeDiv.style.display = 'none';
|
||||||
this.minimizeDiv.className = this.displayClass + 'MinimizeButton olButton';
|
this.minimizeDiv.className = this.displayClass + 'MinimizeButton olButton';
|
||||||
|
if (this.minimizeTitle) {
|
||||||
|
this.minimizeDiv.title = this.minimizeTitle;
|
||||||
|
}
|
||||||
this.div.appendChild(this.minimizeDiv);
|
this.div.appendChild(this.minimizeDiv);
|
||||||
this.minimizeControl();
|
this.minimizeControl();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -285,11 +285,9 @@ OpenLayers.Event = {
|
|||||||
if (elementObservers) {
|
if (elementObservers) {
|
||||||
for(var i = elementObservers.length-1; i >= 0; i--) {
|
for(var i = elementObservers.length-1; i >= 0; i--) {
|
||||||
var entry = elementObservers[i];
|
var entry = elementObservers[i];
|
||||||
var args = new Array(entry.element,
|
OpenLayers.Event.stopObserving.apply(this, [
|
||||||
entry.name,
|
entry.element, entry.name, entry.observer, entry.useCapture
|
||||||
entry.observer,
|
]);
|
||||||
entry.useCapture);
|
|
||||||
var removed = OpenLayers.Event.stopObserving.apply(this, args);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -311,8 +311,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: parseStyles
|
* Method: parseStyles
|
||||||
* Looks for <Style> nodes in the data and parses them
|
* Parses <Style> nodes
|
||||||
* Also parses <StyleMap> nodes, but only uses the 'normal' key
|
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* nodes - {Array} of {DOMElement} data to read/parse.
|
* nodes - {Array} of {DOMElement} data to read/parse.
|
||||||
@@ -558,8 +557,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: parseStyleMaps
|
* Method: parseStyleMaps
|
||||||
* Looks for <Style> nodes in the data and parses them
|
* Parses <StyleMap> nodes, but only uses the 'normal' key
|
||||||
* Also parses <StyleMap> nodes, but only uses the 'normal' key
|
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* nodes - {Array} of {DOMElement} data to read/parse.
|
* nodes - {Array} of {DOMElement} data to read/parse.
|
||||||
@@ -1212,8 +1210,8 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
|
|||||||
createPlacemarkXML: function(feature) {
|
createPlacemarkXML: function(feature) {
|
||||||
// Placemark name
|
// Placemark name
|
||||||
var placemarkName = this.createElementNS(this.kmlns, "name");
|
var placemarkName = this.createElementNS(this.kmlns, "name");
|
||||||
var name = feature.style && feature.style.label ? feature.style.label :
|
var label = (feature.style && feature.style.label) ? feature.style.label : feature.id;
|
||||||
feature.attributes.name || feature.id;
|
var name = feature.attributes.name || label;
|
||||||
placemarkName.appendChild(this.createTextNode(name));
|
placemarkName.appendChild(this.createTextNode(name));
|
||||||
|
|
||||||
// Placemark description
|
// Placemark description
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Format/XML.js
|
* @requires OpenLayers/Format/XML.js
|
||||||
* @requires OpenLayers/Format/WFST.js
|
* @requires OpenLayers/Format/WFST.js
|
||||||
|
* @requires OpenLayers/Filter/Spatial.js
|
||||||
|
* @requires OpenLayers/Filter/FeatureId.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,7 +11,13 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Layer.EventPane
|
* Class: OpenLayers.Layer.EventPane
|
||||||
* Base class for 3rd party layers. Create a new event pane layer with the
|
* Base class for 3rd party layers, providing a DOM element which isolates
|
||||||
|
* the 3rd-party layer from mouse events.
|
||||||
|
* Only used by Google layers.
|
||||||
|
*
|
||||||
|
* Automatically instantiated by the Google constructor, and not usually instantiated directly.
|
||||||
|
*
|
||||||
|
* Create a new event pane layer with the
|
||||||
* <OpenLayers.Layer.EventPane> constructor.
|
* <OpenLayers.Layer.EventPane> constructor.
|
||||||
*
|
*
|
||||||
* Inherits from:
|
* Inherits from:
|
||||||
|
|||||||
@@ -14,6 +14,11 @@
|
|||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Layer.Google
|
* Class: OpenLayers.Layer.Google
|
||||||
*
|
*
|
||||||
|
* Provides a wrapper for Google's Maps API
|
||||||
|
* Normally the Terms of Use for this API do not allow wrapping, but Google
|
||||||
|
* have provided written consent to OpenLayers for this - see email in
|
||||||
|
* http://osgeo-org.1560.n6.nabble.com/Google-Maps-API-Terms-of-Use-changes-tp4910013p4911981.html
|
||||||
|
*
|
||||||
* Inherits from:
|
* Inherits from:
|
||||||
* - <OpenLayers.Layer.SphericalMercator>
|
* - <OpenLayers.Layer.SphericalMercator>
|
||||||
* - <OpenLayers.Layer.EventPane>
|
* - <OpenLayers.Layer.EventPane>
|
||||||
@@ -462,6 +467,10 @@ OpenLayers.Layer.Google.cache = {};
|
|||||||
* Constant: OpenLayers.Layer.Google.v2
|
* Constant: OpenLayers.Layer.Google.v2
|
||||||
*
|
*
|
||||||
* Mixin providing functionality specific to the Google Maps API v2.
|
* Mixin providing functionality specific to the Google Maps API v2.
|
||||||
|
*
|
||||||
|
* This API has been deprecated by Google.
|
||||||
|
* Developers are encouraged to migrate to v3 of the API; support for this
|
||||||
|
* is provided by <OpenLayers.Layer.Google.v3>
|
||||||
*/
|
*/
|
||||||
OpenLayers.Layer.Google.v2 = {
|
OpenLayers.Layer.Google.v2 = {
|
||||||
|
|
||||||
|
|||||||
@@ -11,15 +11,42 @@
|
|||||||
/**
|
/**
|
||||||
* Constant: OpenLayers.Layer.Google.v3
|
* Constant: OpenLayers.Layer.Google.v3
|
||||||
*
|
*
|
||||||
* Mixin providing functionality specific to the Google Maps API v3 <= v3.6.
|
* Mixin providing functionality specific to the Google Maps API v3.
|
||||||
* Note that this layer configures the google.maps.map object with the
|
*
|
||||||
* "disableDefaultUI" option set to true. Using UI controls that the Google
|
* To use this layer, you must include the GMaps v3 API in your html.
|
||||||
* Maps API provides is not supported by the OpenLayers API. To use this layer,
|
*
|
||||||
* you must include the GMaps API (<= v3.6) in your html:
|
* Because OpenLayers needs to control mouse events, it isolates the GMaps mapObject
|
||||||
|
* (the DOM elements provided by Google) using the EventPane.
|
||||||
|
* However, because the Terms of Use require some of those elements,
|
||||||
|
* such as the links to Google's terms, to be clickable, these elements have
|
||||||
|
* to be moved up to OpenLayers' container div. There is however no easy way
|
||||||
|
* to identify these, and the logic (see the repositionMapElements function
|
||||||
|
* in the source) may need to be changed if Google changes them.
|
||||||
|
* These elements are not part of the published API and can be changed at any time,
|
||||||
|
* so a given OpenLayers release can only guarantee support for the 'frozen'
|
||||||
|
* Google release at the time of the OpenLayers release. See
|
||||||
|
* https://developers.google.com/maps/documentation/javascript/basics#Versioning
|
||||||
|
* for Google's current release cycle.
|
||||||
|
*
|
||||||
|
* For this reason, it's recommended that production code specifically loads
|
||||||
|
* the current frozen version, for example:
|
||||||
*
|
*
|
||||||
* (code)
|
* (code)
|
||||||
* <script src="http://maps.google.com/maps/api/js?v=3.6&sensor=false"></script>
|
* <script src="http://maps.google.com/maps/api/js?v=3.7&sensor=false"></script>
|
||||||
* (end)
|
* (end)
|
||||||
|
*
|
||||||
|
* but that development code should use the latest 'nightly' version, so that any
|
||||||
|
* problems can be dealt with as soon as they arise, and before they affect the production, 'frozen', code.
|
||||||
|
*
|
||||||
|
* Note, however, that frozen versions are retired as part of Google's release
|
||||||
|
* cycle, and once this happens, you will get the next version, in the example above, 3.8 once 3.7 is retired.
|
||||||
|
*
|
||||||
|
* This version supports 3.7.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* Note that this layer configures the google.maps.map object with the
|
||||||
|
* "disableDefaultUI" option set to true. Using UI controls that the Google
|
||||||
|
* Maps API provides is not supported by the OpenLayers API.
|
||||||
*/
|
*/
|
||||||
OpenLayers.Layer.Google.v3 = {
|
OpenLayers.Layer.Google.v3 = {
|
||||||
|
|
||||||
|
|||||||
@@ -1302,19 +1302,20 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
* columns - {Integer} Maximum number of columns we want our grid to have.
|
* columns - {Integer} Maximum number of columns we want our grid to have.
|
||||||
*/
|
*/
|
||||||
removeExcessTiles: function(rows, columns) {
|
removeExcessTiles: function(rows, columns) {
|
||||||
|
var i, l;
|
||||||
|
|
||||||
// remove extra rows
|
// remove extra rows
|
||||||
while (this.grid.length > rows) {
|
while (this.grid.length > rows) {
|
||||||
var row = this.grid.pop();
|
var row = this.grid.pop();
|
||||||
for (var i=0, l=row.length; i<l; i++) {
|
for (i=0, l=row.length; i<l; i++) {
|
||||||
var tile = row[i];
|
var tile = row[i];
|
||||||
this.destroyTile(tile);
|
this.destroyTile(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove extra columns
|
// remove extra columns
|
||||||
while (this.grid[0].length > columns) {
|
for (i=0, l=this.grid.length; i<l; i++) {
|
||||||
for (var i=0, l=this.grid.length; i<l; i++) {
|
while (this.grid[i].length > columns) {
|
||||||
var row = this.grid[i];
|
var row = this.grid[i];
|
||||||
var tile = row.pop();
|
var tile = row.pop();
|
||||||
this.destroyTile(tile);
|
this.destroyTile(tile);
|
||||||
|
|||||||
@@ -662,6 +662,7 @@ OpenLayers.Map = OpenLayers.Class({
|
|||||||
* be properly set below.
|
* be properly set below.
|
||||||
*/
|
*/
|
||||||
delete this.center;
|
delete this.center;
|
||||||
|
delete this.zoom;
|
||||||
this.addLayers(options.layers);
|
this.addLayers(options.layers);
|
||||||
// set center (and optionally zoom)
|
// set center (and optionally zoom)
|
||||||
if (options.center && !this.getCenter()) {
|
if (options.center && !this.getCenter()) {
|
||||||
|
|||||||
@@ -108,10 +108,7 @@ OpenLayers.Popup.Anchored =
|
|||||||
var oldRelativePosition = this.relativePosition;
|
var oldRelativePosition = this.relativePosition;
|
||||||
this.relativePosition = this.calculateRelativePosition(px);
|
this.relativePosition = this.calculateRelativePosition(px);
|
||||||
|
|
||||||
var newPx = this.calculateNewPx(px);
|
OpenLayers.Popup.prototype.moveTo.call(this, this.calculateNewPx(px));
|
||||||
|
|
||||||
var newArguments = new Array(newPx);
|
|
||||||
OpenLayers.Popup.prototype.moveTo.apply(this, newArguments);
|
|
||||||
|
|
||||||
//if this move has caused the popup to change its relative position,
|
//if this move has caused the popup to change its relative position,
|
||||||
// we need to make the appropriate cosmetic changes.
|
// we need to make the appropriate cosmetic changes.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ var OpenLayers = {
|
|||||||
/**
|
/**
|
||||||
* Constant: VERSION_NUMBER
|
* Constant: VERSION_NUMBER
|
||||||
*/
|
*/
|
||||||
VERSION_NUMBER: "Release 2.12-rc4",
|
VERSION_NUMBER: "Release 2.12-rc5",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant: singleFile
|
* Constant: singleFile
|
||||||
|
|||||||
@@ -74,13 +74,6 @@ OpenLayers.Util.isArray = function(a) {
|
|||||||
return (Object.prototype.toString.call(a) === '[object Array]');
|
return (Object.prototype.toString.call(a) === '[object Array]');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Maintain existing definition of $.
|
|
||||||
*/
|
|
||||||
if(typeof window.$ === "undefined") {
|
|
||||||
window.$ = OpenLayers.Util.getElement;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: removeItem
|
* Function: removeItem
|
||||||
* Remove an object from an array. Iterates through the array
|
* Remove an object from an array. Iterates through the array
|
||||||
|
|||||||
@@ -164,6 +164,17 @@ OpenLayers.Util.getArgs = function(url) {
|
|||||||
return OpenLayers.Util.getParameters(url);
|
return OpenLayers.Util.getParameters(url);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maintain existing definition of $.
|
||||||
|
*
|
||||||
|
* The use of our $-method is deprecated and the mapping of
|
||||||
|
* OpenLayers.Util.getElement will eventually be removed. Do not depend on
|
||||||
|
* window.$ being defined by OpenLayers.
|
||||||
|
*/
|
||||||
|
if(typeof window.$ === "undefined") {
|
||||||
|
window.$ = OpenLayers.Util.getElement;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Namespace: OpenLayers.Ajax
|
* Namespace: OpenLayers.Ajax
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -219,6 +219,20 @@ Corresponding issues/pull requests:
|
|||||||
|
|
||||||
* https://github.com/openlayers/openlayers/pull/101
|
* https://github.com/openlayers/openlayers/pull/101
|
||||||
|
|
||||||
|
## Google v3 Layer
|
||||||
|
|
||||||
|
This release fixes a problem with the clickable elements supplied by Google. `OpenLayers.Layer.Google.v3` is now compatible with the current frozen version of Google's API (3.7) and also with the current release and nightly versions (3.8 and 3.9), but be aware that Google may change these elements in their release and nightly versions at any time, and an interim fix OpenLayers release may be needed.
|
||||||
|
|
||||||
|
It's recommended that production servers always load the frozen version of Google's API, but it would help find potential problems if development pages used the latest nightly version.
|
||||||
|
|
||||||
|
See the class description in the API docs for `OpenLayers.Layer.Google.v3` for more details.
|
||||||
|
|
||||||
|
Good ideas on how to improve this unsatisfactory situation welcome!
|
||||||
|
|
||||||
|
Corresponding issues/pull requests:
|
||||||
|
|
||||||
|
* https://github.com/openlayers/openlayers/pull/472
|
||||||
|
|
||||||
## OSM and Bing Layers
|
## OSM and Bing Layers
|
||||||
|
|
||||||
`Layer.OSM` is now defined in its own script file, namely `OpenLayers/Layer/OSM.js`. So people using `Layer.OSM` should now include `OpenLayers/Layer/OSM.js`, as opposed to `OpenLayers/Layer/XYZ.js`, in their OpenLayers builds.
|
`Layer.OSM` is now defined in its own script file, namely `OpenLayers/Layer/OSM.js`. So people using `Layer.OSM` should now include `OpenLayers/Layer/OSM.js`, as opposed to `OpenLayers/Layer/XYZ.js`, in their OpenLayers builds.
|
||||||
|
|||||||
@@ -15,3 +15,23 @@ Removed rounding of zoom level for maps with fractionalZoom == true. So users wi
|
|||||||
Corresponding issues/pull requests:
|
Corresponding issues/pull requests:
|
||||||
|
|
||||||
* https://github.com/openlayers/openlayers/pull/483
|
* https://github.com/openlayers/openlayers/pull/483
|
||||||
|
|
||||||
|
# Behavior Changes from Past Releases
|
||||||
|
|
||||||
|
## window.$ is no longer an alias for OpenLayers.Util.getElement
|
||||||
|
|
||||||
|
We do no longer create a global variable '$' when such a symbol isn't already
|
||||||
|
defined. Previous versions of OpenLayers would define '$' to be an alias for
|
||||||
|
OpenLayers.Util.getElement. If your application requires window.$ to be defined
|
||||||
|
in such a way you can either
|
||||||
|
|
||||||
|
* include deprecated.js in your custom build or as additional ressource in your
|
||||||
|
HTML-file
|
||||||
|
* or you do the aliasing in your application code yourself:
|
||||||
|
|
||||||
|
window.$ = OpenLayers.Util.getElement;
|
||||||
|
|
||||||
|
Corresponding issue/pull requests:
|
||||||
|
|
||||||
|
* https://github.com/openlayers/openlayers/pull/423
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,23 @@
|
|||||||
"olControlOverviewMap", "displayClass is correct" );
|
"olControlOverviewMap", "displayClass is correct" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_divs_title(t) {
|
||||||
|
t.plan(2);
|
||||||
|
|
||||||
|
control = new OpenLayers.Control.OverviewMap({
|
||||||
|
maximizeTitle: "maximize title",
|
||||||
|
minimizeTitle: "minimize title"
|
||||||
|
});
|
||||||
|
map = new OpenLayers.Map('map', {
|
||||||
|
layers: [new OpenLayers.Layer("layer", {isBaseLayer: true})],
|
||||||
|
controls: [control]
|
||||||
|
});
|
||||||
|
map.zoomToMaxExtent();
|
||||||
|
t.eq(control.maximizeDiv.title, "maximize title", "maximizeDiv.title is correct");
|
||||||
|
t.eq(control.minimizeDiv.title, "minimize title", "minimizeDiv.title is correct");
|
||||||
|
map.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
function test_setMap(t) {
|
function test_setMap(t) {
|
||||||
t.plan(4);
|
t.plan(4);
|
||||||
|
|
||||||
|
|||||||
@@ -236,13 +236,13 @@
|
|||||||
var f = new OpenLayers.Format.KML();
|
var f = new OpenLayers.Format.KML();
|
||||||
|
|
||||||
t.eq(f.read(f.write(feature))[0].attributes.name, feature.id, "placemark name from feature.id");
|
t.eq(f.read(f.write(feature))[0].attributes.name, feature.id, "placemark name from feature.id");
|
||||||
|
|
||||||
feature.attributes.name = "placemark name from attributes.name";
|
|
||||||
t.eq(f.read(f.write(feature))[0].attributes.name, feature.attributes.name, "placemark name from attributes.name");
|
|
||||||
feature.style = {
|
feature.style = {
|
||||||
label: "placemark name from style.label"
|
label: "placemark name from style.label"
|
||||||
};
|
};
|
||||||
t.eq(f.read(f.write(feature))[0].attributes.name, feature.style.label, "placemark name from style.label");
|
t.eq(f.read(f.write(feature))[0].attributes.name, feature.style.label, "placemark name from style.label");
|
||||||
|
|
||||||
|
feature.attributes.name = "placemark name from attributes.name";
|
||||||
|
t.eq(f.read(f.write(feature))[0].attributes.name, feature.attributes.name, "placemark name from attributes.name");
|
||||||
}
|
}
|
||||||
function test_Format_KML_linestring_projected(t) {
|
function test_Format_KML_linestring_projected(t) {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
|
|||||||
@@ -1524,6 +1524,70 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_removeExcessTiles(t) {
|
||||||
|
t.plan(15);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set up
|
||||||
|
*/
|
||||||
|
|
||||||
|
var map = new OpenLayers.Map('map');
|
||||||
|
var layer = new OpenLayers.Layer.Grid('name', '/url',
|
||||||
|
{}, {isBaseLayer: true});
|
||||||
|
map.addLayer(layer);
|
||||||
|
|
||||||
|
function newTile(id) {
|
||||||
|
var t = new OpenLayers.Tile(layer,
|
||||||
|
new OpenLayers.Pixel(1, 1),
|
||||||
|
new OpenLayers.Bounds(1, 1, 1, 1));
|
||||||
|
t._id = id;
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
layer.grid = [
|
||||||
|
[newTile(1), newTile(2), newTile(3)],
|
||||||
|
[newTile(4), newTile(5)],
|
||||||
|
[newTile(6), newTile(7), newTile(8)]
|
||||||
|
];
|
||||||
|
|
||||||
|
// create a clone to be able to test whether
|
||||||
|
// tiles have been destroyed or not
|
||||||
|
var grid = [
|
||||||
|
layer.grid[0].slice(),
|
||||||
|
layer.grid[1].slice(),
|
||||||
|
layer.grid[2].slice()
|
||||||
|
];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Test
|
||||||
|
*/
|
||||||
|
|
||||||
|
layer.removeExcessTiles(2, 2);
|
||||||
|
|
||||||
|
t.eq(layer.grid.length, 2, 'grid has two rows');
|
||||||
|
t.eq(layer.grid[0].length, 2, 'row #1 has two columns');
|
||||||
|
t.eq(layer.grid[0][0]._id, 1, 'row #1 col #1 includes expected tile');
|
||||||
|
t.eq(layer.grid[0][1]._id, 2, 'row #1 col #2 includes expected tile');
|
||||||
|
t.eq(layer.grid[1].length, 2, 'row #2 has two columns');
|
||||||
|
t.eq(layer.grid[1][0]._id, 4, 'row #2 col #1 includes expected tile');
|
||||||
|
t.eq(layer.grid[1][1]._id, 5, 'row #2 col #2 includes expected tile');
|
||||||
|
|
||||||
|
t.ok(grid[0][0].events != null, 'tile 0,0 not destroyed');
|
||||||
|
t.ok(grid[0][1].events != null, 'tile 0,1 not destroyed');
|
||||||
|
t.ok(grid[0][2].events == null, 'tile 0,2 destroyed');
|
||||||
|
t.ok(grid[1][0].events != null, 'tile 1,0 not destroyed');
|
||||||
|
t.ok(grid[1][1].events != null, 'tile 1,1 not destroyed');
|
||||||
|
t.ok(grid[2][0].events == null, 'tile 2,0 destroyed');
|
||||||
|
t.ok(grid[2][1].events == null, 'tile 2,1 destroyed');
|
||||||
|
t.ok(grid[2][2].events == null, 'tile 2,2 destroyed');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Tear down
|
||||||
|
*/
|
||||||
|
|
||||||
|
map.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
+1
-1
@@ -748,7 +748,7 @@
|
|||||||
function test_Map_double_addLayer(t) {
|
function test_Map_double_addLayer(t) {
|
||||||
t.plan(2);
|
t.plan(2);
|
||||||
|
|
||||||
map = new OpenLayers.Map($('map'));
|
map = new OpenLayers.Map('map');
|
||||||
layer = new OpenLayers.Layer.WMS('Test Layer',
|
layer = new OpenLayers.Layer.WMS('Test Layer',
|
||||||
"http://octo.metacarta.com/cgi-bin/mapserv",
|
"http://octo.metacarta.com/cgi-bin/mapserv",
|
||||||
{map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'}
|
{map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'}
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||||
<script>
|
|
||||||
var custom$ = function() {};
|
|
||||||
window.$ = custom$;
|
|
||||||
</script>
|
|
||||||
<script>
|
<script>
|
||||||
var OpenLayers = [
|
var OpenLayers = [
|
||||||
"OpenLayers/BaseTypes/Class.js",
|
"OpenLayers/BaseTypes/Class.js",
|
||||||
@@ -77,11 +73,6 @@
|
|||||||
t.eq(OpenLayers.Util.isArray(testArray), true, "isArray works");
|
t.eq(OpenLayers.Util.isArray(testArray), true, "isArray works");
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_$(t) {
|
|
||||||
t.plan(1);
|
|
||||||
t.ok($ === custom$, "OpenLayers doesn't clobber existing definition of $.");
|
|
||||||
}
|
|
||||||
|
|
||||||
function test_Util_getImagesLocation (t) {
|
function test_Util_getImagesLocation (t) {
|
||||||
t.plan( 1 );
|
t.plan( 1 );
|
||||||
t.ok( OpenLayers.Util.getImagesLocation(), "../img/",
|
t.ok( OpenLayers.Util.getImagesLocation(), "../img/",
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<script>
|
||||||
|
var custom$ = function() {};
|
||||||
|
window.$ = custom$;
|
||||||
|
</script>
|
||||||
|
<script src="../OLLoader.js"></script>
|
||||||
|
<script src="../../lib/deprecated.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function test_$(t) {
|
||||||
|
t.plan(1);
|
||||||
|
t.ok($ === custom$, "OpenLayers doesn't clobber existing definition of $.");
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -231,6 +231,7 @@
|
|||||||
<li>Kinetic.html</li>
|
<li>Kinetic.html</li>
|
||||||
<li>Util.html</li>
|
<li>Util.html</li>
|
||||||
<li>deprecated/Ajax.html</li>
|
<li>deprecated/Ajax.html</li>
|
||||||
|
<li>deprecated/Util.html</li>
|
||||||
<li>deprecated/BaseTypes/Class.html</li>
|
<li>deprecated/BaseTypes/Class.html</li>
|
||||||
<li>deprecated/BaseTypes/Element.html</li>
|
<li>deprecated/BaseTypes/Element.html</li>
|
||||||
<li>deprecated/Control/MouseToolbar.html</li>
|
<li>deprecated/Control/MouseToolbar.html</li>
|
||||||
|
|||||||
+8
-17
@@ -3,10 +3,10 @@
|
|||||||
# check to see if the hosted examples or API docs need an update
|
# check to see if the hosted examples or API docs need an update
|
||||||
cd /osgeo/openlayers/repos/openlayers
|
cd /osgeo/openlayers/repos/openlayers
|
||||||
REMOTE_HEAD=`git ls-remote https://github.com/openlayers/openlayers/ | grep HEAD | awk '{print $1}'`
|
REMOTE_HEAD=`git ls-remote https://github.com/openlayers/openlayers/ | grep HEAD | awk '{print $1}'`
|
||||||
OLD_REMOTE_HEAD=`git rev-parse HEAD`
|
LOCAL_HEAD=`git rev-parse HEAD`
|
||||||
|
|
||||||
# if there's something different in the remote, update and build
|
# if there's something different in the remote, update and build
|
||||||
if [ ! o$REMOTE_HEAD = o$OLD_REMOTE_HEAD ]; then
|
if [ ! o$REMOTE_HEAD = o$LOCAL_HEAD ]; then
|
||||||
|
|
||||||
git checkout master
|
git checkout master
|
||||||
git clean -f
|
git clean -f
|
||||||
@@ -54,10 +54,10 @@ fi
|
|||||||
# check to see if the website needs an update
|
# check to see if the website needs an update
|
||||||
cd /osgeo/openlayers/repos/website
|
cd /osgeo/openlayers/repos/website
|
||||||
REMOTE_HEAD=`git ls-remote https://github.com/openlayers/website/ | grep HEAD | awk '{print $1}'`
|
REMOTE_HEAD=`git ls-remote https://github.com/openlayers/website/ | grep HEAD | awk '{print $1}'`
|
||||||
OLD_REMOTE_HEAD=`git rev-parse HEAD`
|
LOCAL_HEAD=`git rev-parse HEAD`
|
||||||
|
|
||||||
# if there's something different in the remote, update the clone
|
# if there's something different in the remote, update the clone
|
||||||
if [ ! o$REMOTE_HEAD = o$OLD_REMOTE_HEAD ]; then
|
if [ ! o$REMOTE_HEAD = o$LOCAL_HEAD ]; then
|
||||||
|
|
||||||
git checkout master
|
git checkout master
|
||||||
git clean -f
|
git clean -f
|
||||||
@@ -72,19 +72,17 @@ fi
|
|||||||
# check to see if prose docs need an update
|
# check to see if prose docs need an update
|
||||||
cd /osgeo/openlayers/repos/docs
|
cd /osgeo/openlayers/repos/docs
|
||||||
REMOTE_HEAD=`git ls-remote https://github.com/openlayers/docs/ | grep HEAD | awk '{print $1}'`
|
REMOTE_HEAD=`git ls-remote https://github.com/openlayers/docs/ | grep HEAD | awk '{print $1}'`
|
||||||
OLD_REMOTE_HEAD=`git rev-parse HEAD`
|
LOCAL_HEAD=`git rev-parse HEAD`
|
||||||
|
|
||||||
# if there's something different in the remote, update the clone
|
# if there's something different in the remote, update the clone
|
||||||
if [ ! o$REMOTE_HEAD = o$OLD_REMOTE_HEAD ]; then
|
if [ ! o$REMOTE_HEAD = o$LOCAL_HEAD ]; then
|
||||||
|
|
||||||
git checkout master
|
git checkout master
|
||||||
git clean -f
|
git clean -f
|
||||||
git pull origin master
|
git pull origin master
|
||||||
|
|
||||||
mkdir -p /tmp/ol/docs/build/html /tmp/ol/docs/build/doctrees
|
mkdir -p /osgeo/openlayers/sites/docs.openlayers.org /tmp/ol/docs/build/doctrees
|
||||||
sphinx-build -b html -d /tmp/ol/docs/build/doctrees . /tmp/ol/docs/build/html
|
sphinx-build -b html -d /tmp/ol/docs/build/doctrees . /osgeo/openlayers/sites/docs.openlayers.org
|
||||||
|
|
||||||
rsync -r --delete /tmp/ol/docs/build/html/ /osgeo/openlayers/sites/docs.openlayers.org
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -102,11 +100,4 @@ if [ ! o$SVNREV = $OLD_SVNREV ]; then
|
|||||||
svn up /osgeo/openlayers/repos/old_svn_repo/
|
svn up /osgeo/openlayers/repos/old_svn_repo/
|
||||||
# Record the revision
|
# Record the revision
|
||||||
echo -n $SVNREV > /tmp/ol_svn_rev
|
echo -n $SVNREV > /tmp/ol_svn_rev
|
||||||
|
|
||||||
# update the hosted sandboxes
|
|
||||||
rsync -r --delete --exclude=.svn --delete-excluded /osgeo/openlayers/repos/old_svn_repo/sandbox /osgeo/openlayers/sites/dev.openlayers.org/
|
|
||||||
|
|
||||||
# update the hosted addins
|
|
||||||
rsync -r --delete --exclude=.svn --delete-excluded /osgeo/openlayers/repos/old_svn_repo/addins /osgeo/openlayers/sites/dev.openlayers.org/
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user