Tag RC4 release.

git-svn-id: http://svn.openlayers.org/tags/openlayers/release-2.4-rc4@3178 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-05-24 14:55:48 +00:00
parent 3c6cd6f559
commit 07d333cc79
109 changed files with 542 additions and 419 deletions

View File

@@ -2,7 +2,7 @@
<head>
<style type="text/css">
#map {
width: 512px;
width: 45%;
height: 350px;
border: 1px solid gray;
}
@@ -42,8 +42,8 @@
</head>
<body onload="init()">
<h1>OpenLayers Draw Point Example</h1>
<div style="float:right">
<textarea id="gml" cols="80" rows="30"></textarea>
<div style="float:right;width:50%">
<textarea id="gml" style="width:100%" rows="30"></textarea>
</div>
<div id="map"></div>
</body>

View File

@@ -47,7 +47,7 @@
popup = new OpenLayers.Popup.Anchored("chicken",
new OpenLayers.LonLat(5,40),
new OpenLayers.Size(200,200),
"example popup");
"example popup", true);
map.addPopup(popup);
}
@@ -69,8 +69,17 @@
}
function mousedown(evt) {
// check to see if the popup was hidden by the close box
// if so, then destroy it before continuing
if (popup != null) {
if (!popup.visible()) {
markers.map.removePopup(popup);
popup.destroy();
popup = null;
}
}
if (popup == null) {
popup = feature.createPopup();
popup = feature.createPopup(true);
popup.setContentHTML("<a href='http://www.somethingconstructive.net' target='_blank'>click me</a>");
popup.setBackgroundColor("yellow");
popup.setOpacity(0.7);

View File

@@ -17,11 +17,23 @@
var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
var style_blue = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
style_blue.strokeColor = "blue";
style_blue.fillColor = "blue";
var style_green = {
strokeColor: "#00FF00",
strokeOpacity: 1,
strokeWidth: 3,
pointRadius: 6,
pointerEvents: "visiblePainted"
};
var vectorLayer = new OpenLayers.Layer.Vector("Simple Geometry");
// create a point feature
var point = new OpenLayers.Geometry.Point(-111.04, 45.68);
var pointFeature = new OpenLayers.Feature.Vector(point);
var pointFeature = new OpenLayers.Feature.Vector(point,null,style_blue);
// create a line feature from a list of points
var pointList = [];
@@ -32,7 +44,7 @@
pointList.push(newPoint);
}
var lineFeature = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.LineString(pointList));
new OpenLayers.Geometry.LineString(pointList),null,style_green);
// create a polygon feature from a linear ring of points
var pointList = [];
@@ -59,5 +71,9 @@
</head>
<body onload="init()">
<div id="map"></div>
<p>This example shows drawing simple vector features -- point, line, polygon
in different styles, created 'manually', by constructing the entire style
object, via 'copy', extending the default style object, and by
inheriting the default style from the layer.</p>
</body>
</html>

View File

@@ -78,7 +78,7 @@
}
function displayWKT(feature) {
var str = wkt.write(feature.geometry);
var str = wkt.write(feature);
// not a good idea in general, just for this demo
str = str.replace(/,/g, ', ');
document.getElementById('info').innerHTML = str;
@@ -86,19 +86,18 @@
function parseWKT() {
var element = document.getElementById('wkt');
var collection = wkt.read(element.value);
var features = wkt.read(element.value);
var bounds;
if(collection) {
if(collection.constructor != Array) {
collection = [collection];
if(features) {
if(features.constructor != Array) {
features = [features];
}
var features = [];
for(var i=0; i<collection.length; ++i) {
features.push(new OpenLayers.Feature.Vector(collection[i]));
for(var i=0; i<features.length; ++i) {
if (!bounds) {
bounds = collection[i].getBounds();
bounds = features[i].geometry.getBounds();
} else {
bounds.extend(features[i].geometry.getBounds());
}
bounds.extend(collection[i].getBounds());
}
vectors.addFeatures(features);