Compare commits

...

20 Commits

Author SHA1 Message Date
Schuyler Erle
88033f1b4e Tagging release 1.0.
git-svn-id: http://svn.openlayers.org/tags/openlayers/release-1.0@787 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 04:32:18 +00:00
Schuyler Erle
521d45c091 Fixed up examples for 1.0 release.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@786 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 04:25:23 +00:00
Schuyler Erle
ea959e5740 Made WFS at least display points by default.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@785 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-27 04:23:43 +00:00
Schuyler Erle
a80110add2 Fixed check for image location in single-file version.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@775 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 22:55:04 +00:00
Schuyler Erle
4934b386df Fixed tests following r770.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@772 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 15:55:15 +00:00
Schuyler Erle
d5f36de60f Last round of left click checks added following r769 and r770.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@771 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 15:46:46 +00:00
Schuyler Erle
7bbfffa6d6 Applied similar change to r769 to MouseDefaults.js.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@770 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 15:43:38 +00:00
Schuyler Erle
f90e4044e0 Applied patch from Corey Puffault, checking for left click only in mouse toolbar, fixing #101.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@769 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 15:32:15 +00:00
Schuyler Erle
793bca701d Bug fix overflow: 'none' -> 'clip' for IE.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@768 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 15:28:27 +00:00
Schuyler Erle
00540c6d07 Fixed unit tests following r729.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@767 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-26 15:11:27 +00:00
Schuyler Erle
4784ed1acd Disable alpha PNG hack in WMS tiles from r605 and r681... it just kills IE6 when used in earnest.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@731 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-25 11:41:04 +00:00
Schuyler Erle
14a859a60d Made the layer switcher a bit more responsive in IE. It would be nice if we could figure out how to keep the text from being selected when the switcher is clicked.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@730 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-25 11:29:37 +00:00
Schuyler Erle
d8263d200b Changed zoomToFullExtent to call getZoomForExtent rather than just using zoom level 0.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@729 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-25 10:18:13 +00:00
Schuyler Erle
00c0655cd2 Changed default proxy host for ol.org.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@726 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-23 17:34:07 +00:00
Schuyler Erle
97694ddcf7 Merged in missing fix for #95 from r678:r679.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@718 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-23 15:31:41 +00:00
Schuyler Erle
8608c16344 Adding cleanup phase to build.sh.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@692 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 20:14:21 +00:00
Schuyler Erle
86d7fa176e Added some fiddling bits of documentation.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@690 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 20:10:49 +00:00
Schuyler Erle
fd1fdf2f8e Pulled up r686:r688 test fixes from trunk.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@689 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 19:58:01 +00:00
Schuyler Erle
24b58b5e0b Pulled up r679:r684 from trunk for the IE performance and bug fixes.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@685 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 19:28:31 +00:00
Schuyler Erle
83197dc4f2 Branching OpenLayers for 1.0 release.
git-svn-id: http://svn.openlayers.org/branches/openlayers/1.0@678 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-22 17:17:50 +00:00
39 changed files with 203 additions and 104 deletions

View File

@@ -33,5 +33,8 @@ echo Shrinking and post-processing...
cat ${LICENSE_HEADER_FILENAME} > ${OUTPUT_FILENAME}
${CMD_JSMIN} <${TMP_OUTPUT_FILENAME} >> ${OUTPUT_FILENAME}
echo Cleaning up...
rm $TMP_OUTPUT_FILENAME
echo
echo Done.

14
doc/authors.txt Normal file
View File

@@ -0,0 +1,14 @@
OpenLayers core development team
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Erik Uzureau
Christopher R. Schmidt
Philip Lindsay
John Frank
Schuyler Erle
Patch contributors
------------------
Corey Puffault
OpenLayers is graciously supported by MetaCarta, Inc.
<http://www.metacarta.com>.

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -27,7 +27,8 @@
map.addLayers([ol_wms, jpl_wms, cie_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToFullExtent();
}
// -->
</script>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -24,7 +24,8 @@
map.addLayers([ol_wms, jpl_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToFullExtent();
map.events.register("click", map, function(e) {
var lonlat = map.getLonLatFromViewPortPx(e.xy);
alert("You clicked near " + lonlat.lat + " N, " +

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -34,7 +34,8 @@
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.MouseToolbar());
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToFullExtent();
}
// -->
</script>

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -31,7 +31,8 @@
map.addLayers([ol_wms, jpl_wms, dm_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
// map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToFullExtent();
}
// -->
</script>

View File

@@ -33,10 +33,10 @@
{map: '/www/freemap.in/boston/map/mass.map', layers: 'border,water,roads', format: 'png'} );
var rapid = new OpenLayers.Layer.WMS( "Rapid Transit",
"http://boston.freemap.in/cgi-bin/mapserv?",
{map: '/www/freemap.in/boston/map/mass.map', layers: 'rapid_transit', format: 'png'} );
{map: '/www/freemap.in/boston/map/mass.map', layers: 'rapid_transit', format: 'png', transparent:'true'} );
var buildings = new OpenLayers.Layer.WMS( "Buildings",
"http://boston.freemap.in/cgi-bin/mapserv?",
{map: '/www/freemap.in/boston/map/mass.map', layers: 'buildings', format: 'png'} );
{map: '/www/freemap.in/boston/map/mass.map', layers: 'buildings', format: 'png', transparent:'true'} );
map.addLayer(basemap);
map.addLayer(rapid);

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
background-color: red;
}

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -16,12 +16,14 @@
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
var ka_wms = new OpenLayers.Layer.KaMap( "KaMap",
"http://www.h2guide.com/my-ka-map/h2tile.php?" , { map: 'h2guide', g: 'background' }, new OpenLayers.LonLat(0,0));
"http://www.h2guide.com/my-ka-map/h2tile.php?",
{ map: 'h2guide', g: 'background' },
new OpenLayers.LonLat(0,0));
map.addLayers([ol_wms, ka_wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.zoomToFullExtent();
}
// -->
</script>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -25,14 +25,15 @@
size = new OpenLayers.Size(50,50);
calculateOffset = function(size) {
return new OpenLayers.Pixel(-(size.w/2), -size.h);
};
icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',size,null, calculateOffset);
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(-180,90),
icon));
return new OpenLayers.Pixel(-(size.w/2), -size.h); };
icon = new OpenLayers.Icon(
'http://boston.openguides.org/markers/AQUA.png',
size, null, calculateOffset);
markers.addMarker(
new OpenLayers.Marker(new OpenLayers.LonLat(-180,90), icon));
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToFullExtent();
}
function resize() {

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -31,8 +31,8 @@
marker = new OpenLayers.Marker(new OpenLayers.LonLat(90,10),icon);
marker.events.register('mousedown', marker, function(evt) { alert(this.icon.url); Event.stop(evt); });
markers.addMarker(marker);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToFullExtent();
}
// -->
</script>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -23,8 +23,8 @@
var newl = new OpenLayers.Layer.Text( "text", "./textfile.txt" );
map.addLayer(newl);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToFullExtent();
}
// -->
</script>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -34,8 +34,8 @@
markers = new OpenLayers.Layer.Markers( "Markers" );
map.addLayer(markers);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToFullExtent();
}
function changer() {

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -11,7 +11,7 @@
<script type="text/javascript">
<!--
function init(){
var map = new OpenLayers.Map('map');
var map = new OpenLayers.Map('map', {maxResolution: 'auto'});
var ol_wms = new OpenLayers.Layer.WMS.Untiled( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -20,14 +20,8 @@
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS2",
"http://octo.metacarta.com/cgi-bin/mapserv",
{map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'} );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToFullExtent();
}
function changer() {

View File

@@ -2,8 +2,8 @@
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>
@@ -14,20 +14,18 @@
var map, layer;
function init(){
OpenLayers.ProxyHost = '/dev/examples/proxy.cgi?url=';
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
layer = new OpenLayers.Layer.WFS( "OpenLayers WFS",
"http://labs.metacarta.com/search/WFS?",
{q: 'dolphins', maxfeatures: 10} );
layer = new OpenLayers.Layer.WFS( "Owl Survey",
"http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?",
{typename: "OWLS", maxfeatures: 10},
OpenLayers.Feature.WFS );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(new OpenLayers.LonLat(-100, 60), 3);
}
// -->
</script>

View File

@@ -3,8 +3,8 @@
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
<style type="text/css">
#map {
width: 800px;
height: 475px;
width: 512px;
height: 512px;
border: 1px solid black;
}
</style>

View File

@@ -6,7 +6,11 @@
///
OpenLayers = new Object();
OpenLayers._scriptName = "lib/OpenLayers.js";
OpenLayers._scriptName = (
typeof(_OPENLAYERS_SFL_) == "undefined" ? "lib/OpenLayers.js"
: "OpenLayers.js" );
OpenLayers._getScriptLocation = function () {
var scriptLocation = "";
var SCRIPT_NAME = OpenLayers._scriptName;

View File

@@ -2,7 +2,7 @@
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
OpenLayers.ProxyHost = "/viewer/Crossbrowser/blindproxy.py?url=";
OpenLayers.ProxyHost = "/proxy/?url=";
//OpenLayers.ProxyHost = "examples/proxy.cgi?url=";
/**
@@ -110,4 +110,4 @@ OpenLayers.parseXMLString = function(text) {
);
return ajaxResponse;
};
};

View File

@@ -143,6 +143,8 @@ OpenLayers.Control.LayerSwitcher.prototype =
backdropLabelOuter.style.marginTop = "4px";
backdropLabelOuter.style.marginBottom = "4px";
this._setEventHandlers(backdropLabelOuter);
// Inner Label - for Rico Corners
//
var backdropLabel = document.createElement('p');
@@ -191,9 +193,10 @@ OpenLayers.Control.LayerSwitcher.prototype =
_setEventHandlers : function(element, labelDiv) {
// We only want to respond to a mousedown event.
element.onclick = this.ignoreEvent.bindAsEventListener(this);
element.ondblclick = this.ignoreEvent.bindAsEventListener(this);
element.onmousedown = this.singleClick.bindAsEventListener(this);
element.onclick = this.singleClick.bindAsEventListener(this);
element.ondblclick = this.singleClick.bindAsEventListener(this);
element.onmouseup = this.ignoreEvent.bindAsEventListener(this);
element.onmousedown = this.ignoreEvent.bindAsEventListener(this);
// If we are operating on a corner span we need to store a
// reference to the actual tab. (See comment about OL #57 fix above.)

View File

@@ -22,6 +22,7 @@ OpenLayers.Control.MouseDefaults.prototype =
},
defaultClick: function (evt) {
if (!Event.isLeftClick(evt)) return;
var notAfterDrag = !this.performedDrag;
this.performedDrag = false;
return notAfterDrag;
@@ -39,6 +40,7 @@ OpenLayers.Control.MouseDefaults.prototype =
* @param {Event} evt
*/
defaultMouseDown: function (evt) {
if (!Event.isLeftClick(evt)) return;
this.mouseDragStart = evt.xy.copyOf();
this.performedDrag = false;
if (evt.shiftKey) {
@@ -55,6 +57,7 @@ OpenLayers.Control.MouseDefaults.prototype =
this.zoomBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
this.map.viewPortDiv.appendChild(this.zoomBox);
}
document.onselectstart=function() { return false; }
Event.stop(evt);
},
@@ -93,6 +96,7 @@ OpenLayers.Control.MouseDefaults.prototype =
* @param {Event} evt
*/
defaultMouseUp: function (evt) {
if (!Event.isLeftClick(evt)) return;
if (this.zoomBox) {
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
var end = this.map.getLonLatFromViewPortPx( evt.xy );
@@ -111,6 +115,7 @@ OpenLayers.Control.MouseDefaults.prototype =
} else {
this.map.setCenter(this.map.center);
}
document.onselectstart=null;
this.mouseDragStart = null;
this.map.div.style.cursor = "default";
},

View File

@@ -63,7 +63,7 @@ OpenLayers.Control.MouseToolbar.prototype =
btn.events = new OpenLayers.Events(this, btn);
btn.events.register("mousedown", this, this.buttonClick);
btn.events.register("mouseup", this, this.stopAction);
btn.events.register("mouseup", this, Event.stop);
btn.action = id;
btn.title = title;
btn.alt = title;
@@ -74,11 +74,8 @@ OpenLayers.Control.MouseToolbar.prototype =
return btn;
},
stopAction: function(evt) {
Event.stop(evt);
},
buttonClick: function(evt) {
if (!Event.isLeftClick(evt)) return;
this.switchModeTo(evt.div.action);
Event.stop(evt);
},
@@ -96,6 +93,7 @@ OpenLayers.Control.MouseToolbar.prototype =
* @param {Event} evt
*/
defaultMouseDown: function (evt) {
if (!Event.isLeftClick(evt)) return;
this.mouseDragStart = evt.xy.copyOf();
if (evt.shiftKey && this.mode !="zoombox") {
this.switchModeTo("zoombox");
@@ -164,13 +162,14 @@ OpenLayers.Control.MouseToolbar.prototype =
this.map.div.style.cursor = "move";
break;
}
document.onselectstart = function() { return false; }
Event.stop(evt);
},
switchModeTo: function(mode) {
if (mode != this.mode) {
if (this.mode) {
this.buttons[this.mode].firstChild.src = this.buttons[this.mode].imgLocation;
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode], null, null, null, this.buttons[this.mode].imgLocation);
}
if (this.mode == "measure" && mode != "measure") {
for(var i = 0; i < this.measureDivs.length; i++) {
@@ -182,7 +181,7 @@ OpenLayers.Control.MouseToolbar.prototype =
this.measureStart = null;
}
this.mode = mode;
this.buttons[mode].firstChild.src = this.buttons[mode].activeImgLocation;
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode], null, null, null, this.buttons[mode].activeImgLocation);
}
},
@@ -225,6 +224,7 @@ OpenLayers.Control.MouseToolbar.prototype =
* @param {Event} evt
*/
defaultMouseUp: function (evt) {
if (!Event.isLeftClick(evt)) return;
switch (this.mode) {
case "zoombox":
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
@@ -247,6 +247,7 @@ OpenLayers.Control.MouseToolbar.prototype =
this.map.setCenter(this.map.center);
}
document.onselectstart = null;
this.mouseDragStart = null;
this.map.div.style.cursor = "default";
},

View File

@@ -111,6 +111,7 @@ OpenLayers.Control.PanZoom.prototype =
* @param {event} evt
*/
buttonDown: function (evt) {
if (!Event.isLeftClick(evt)) return;
var slide = this.map.getResolution() * this.slideFactor;
var center = this.map.getCenter();

View File

@@ -127,6 +127,7 @@ OpenLayers.Control.PanZoomBar.prototype =
* and sets the zoom level appropriately.
*/
divClick: function (evt) {
if (!Event.isLeftClick(evt)) return;
var y = evt.xy.y;
var top = Position.page(evt.object)[1];
var levels = Math.floor((y - top)/this.zoomStopHeight);
@@ -139,6 +140,7 @@ OpenLayers.Control.PanZoomBar.prototype =
* event listener for clicks on the slider
*/
zoomBarDown:function(evt) {
if (!Event.isLeftClick(evt)) return;
this.map.events.register("mousemove", this, this.passEventToSlider);
this.map.events.register("mouseup", this, this.passEventToSlider);
this.mouseDragStart = evt.xy.copyOf();
@@ -173,6 +175,7 @@ OpenLayers.Control.PanZoomBar.prototype =
* and switch to it.
*/
zoomBarUp:function(evt) {
if (!Event.isLeftClick(evt)) return;
if (this.zoomStart) {
this.div.style.cursor="default";
this.map.events.remove("mousemove");

View File

@@ -43,8 +43,15 @@ OpenLayers.Feature.WFS.prototype =
*/
processXMLNode: function(xmlNode) {
//this should be overridden by subclasses
// must return an Object with 'id' and 'lonlat' values set
var point = xmlNode.getElementsByTagName("Point");
var text = point[0].textContent;
var floats = text.split(",");
return {lonlat: new OpenLayers.LonLat(parseFloat(floats[0]),
parseFloat(floats[1])),
id: null};
},
/** @final @type String */

View File

@@ -146,7 +146,7 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
new OpenLayers.Pixel(tileoffsetx - parseInt(this.map.layerContainerDiv.style.left),
tileoffsety - parseInt(this.map.layerContainerDiv.style.top))
);
tile.draw();
tile.draw((this.params.TRANSPARENT == 'true'));
row.append(tile);
tileoffsetlon += tilelon;
@@ -181,7 +181,7 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
bounds.top = bounds.top + deltaLat;
position.y = position.y + deltaY;
var newTile = this.addTile(bounds, position);
newTile.draw();
newTile.draw((this.params.TRANSPARENT == 'true'));
newRow.append(newTile);
}
@@ -215,7 +215,7 @@ OpenLayers.Layer.Grid.prototype = Object.extend( new OpenLayers.Layer(), {
bounds.right = bounds.right + deltaLon;
position.x = position.x + deltaX;
var newTile = this.addTile(bounds, position);
newTile.draw();
newTile.draw((this.params.TRANSPARENT == 'true'));
if (prepend) {
row = row.prepend(newTile);

View File

@@ -12,7 +12,7 @@ OpenLayers.Layer.WFS.prototype =
Object.extend(new OpenLayers.Layer.Markers(), {
/** @type Object */
featureClass: null,
featureClass: OpenLayers.Feature.WFS,
/** @final @type hash */
DEFAULT_PARAMS: { service: "WFS",
@@ -30,7 +30,7 @@ OpenLayers.Layer.WFS.prototype =
* @param {Object} featureClass
*/
initialize: function(name, url, params, featureClass) {
this.featureClass = featureClass;
if (featureClass != null) this.featureClass = featureClass;
var newArguments = new Array();
if (arguments.length > 0) {

View File

@@ -47,7 +47,7 @@ OpenLayers.Layer.WMS.prototype =
* @type Boolean
*/
isBaseLayer: function() {
return (this.params.TRANSPARENT != true);
return (this.params.TRANSPARENT != 'true');
},
/**

View File

@@ -545,12 +545,11 @@ OpenLayers.Map.prototype = {
*/
zoomToFullExtent: function() {
var fullExtent = this.getFullExtent();
var oldZoom = this.zoom;
this.setCenter(
new OpenLayers.LonLat((fullExtent.left+fullExtent.right)/2,
(fullExtent.bottom+fullExtent.top)/2),
0
);
this.getZoomForExtent(fullExtent)
);
},
/**

View File

@@ -51,7 +51,7 @@ OpenLayers.Popup.AnchoredBubble.prototype =
var id = this.div.id + "-contentDiv";
this.contentDiv = OpenLayers.Util.createDiv(id, null, contentSize,
null, "relative", null,
"none");
"hidden");
this.div.appendChild(this.contentDiv);
this.setContentHTML();

View File

@@ -35,12 +35,22 @@ OpenLayers.Tile.Image.prototype =
/**
*/
draw:function() {
this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null,
this.position,
this.size,
this.url,
"absolute");
draw:function(transparent) {
if (false) { // don't actually use the alpha PNG hack right now
// it has a fiercely bad effect on IE6's performance
// if (transparent) {
this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null,
this.position,
this.size,
this.url,
"absolute");
} else {
this.imgDiv = OpenLayers.Util.createImage(null,
this.position,
this.size,
this.url,
"absolute");
}
this.layer.div.appendChild(this.imgDiv);
},

View File

@@ -79,7 +79,7 @@ OpenLayers.Tile.WFS.prototype =
doc = OpenLayers.parseXMLString(request.responseText);
}
var resultFeatures = OpenLayers.Util.getNodes(doc, "gml:featureMember");
var resultFeatures = doc.getElementsByTagName("featureMember");
//clear old featureList
this.features = new Array();

50
readme.txt Normal file
View File

@@ -0,0 +1,50 @@
OpenLayers
-=-=-=-=-=-
Copyright (c) 2005-2006 MetaCarta, Inc.
OpenLayers is a JavaScript library for building map applications
on the web. OpenLayers is made available under a BSD-license.
Please see license.txt in this distribution for more details.
------------------
Getting OpenLayers
------------------
OpenLayers lives at http://www.openlayers.org/.
You can get OpenLayers from
http://trac.openlayers.org/wiki/HowToDownload.
---------------------
Installing OpenLayers
---------------------
You can use OpenLayers as-is by copying build/OpenLayers.js and the
entire lib/ directory up to your webserver, putting them in the same
directory. To include the OpenLayers library in your web page, use:
<script type="text/javascript" src="OpenLayers.js" />
If you want to use the multiple-file version of OpenLayers (for, say,
debugging or development purposes), copy the lib/ directory up to your
webserver in the same directory you put the img/ folder. Then add
the following to your web page instead:
<script type="text/javascript" src="lib/OpenLayers.js" />
------------------------------------
Using OpenLayers in Your Own Website
------------------------------------
The examples/ directory is full of useful examples.
There is some documentation at http://trac.openlayers.org/ as well.
--------------------------
Contributing to OpenLayers
--------------------------
Please join the email lists at http://openlayers.org/EmailLists/.
Patches are welcome!
= 30 =

View File

@@ -28,12 +28,12 @@
}
function test_03_Control_PanZoom_control_events (t) {
t.plan( 7 );
var evt = new Object();
var evt = {which: 1}; // control expects left-click
map = new OpenLayers.Map('map');
control = new OpenLayers.Control.PanZoom();
map.addControl(control,
new OpenLayers.Pixel(20,20));
map.setCenter(new OpenLayers.LonLat(0,0), 0);
map.setCenter(new OpenLayers.LonLat(0,0), 4);
var res = map.getResolution();
control.buttons[0].onmousedown(evt);
t.eq( map.getCenter().lat, res*50, "Pan up works correctly" );
@@ -45,12 +45,12 @@
t.eq( map.getCenter().lat, 0, "Pan down works correctly" );
control.buttons[4].onmousedown(evt);
control.buttons[4].onmousedown(evt);
t.eq( map.getZoom(), 2, "zoomin workds correctly" );
t.eq( map.getZoom(), 6, "zoomin works correctly" );
control.buttons[6].onmousedown(evt);
t.eq( map.getZoom(), 1, "zoomout workds correctly" );
t.eq( map.getZoom(), 5, "zoomout works correctly" );
control.buttons[4].onmousedown(evt);
control.buttons[5].onmousedown(evt);
t.eq( map.getZoom(), 0, "zoomworld workds correctly" );
t.eq( map.getZoom(), 2, "zoomworld works correctly" );
}
// -->

View File

@@ -26,7 +26,7 @@
var tile = layer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel);
tile.draw();
var img = tile.imgDiv.childNodes[0];
var img = tile.imgDiv;
t.eq( img.src, "http://octo.metacarta.com/cgi-bin/mapserv?MAP=/mapdata/vmap_wms.map&LAYERS=basic&FORMAT=image/jpeg&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=1,2,3,4&WIDTH=256&HEIGHT=256", "image src is created correctly via addtile" );
t.eq( tile.imgDiv.style.top, "6px", "image top is set correctly via addtile" );
@@ -37,7 +37,7 @@
t.ok( true, "skipping element test outside of Mozilla");
else
t.ok( firstChild instanceof HTMLElement, "div first child is an image object" );
t.eq( firstChild.childNodes[0].src, "http://octo.metacarta.com/cgi-bin/mapserv?MAP=/mapdata/vmap_wms.map&LAYERS=basic&FORMAT=image/jpeg&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=1,2,3,4&WIDTH=256&HEIGHT=256", "div first child is correct image object" );
t.eq( firstChild.src, "http://octo.metacarta.com/cgi-bin/mapserv?MAP=/mapdata/vmap_wms.map&LAYERS=basic&FORMAT=image/jpeg&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application/vnd.ogc.se_inimage&SRS=EPSG:4326&BBOX=1,2,3,4&WIDTH=256&HEIGHT=256", "div first child is correct image object" );
var pos = tile.getPosition();
t.eq( pos.toString(), "x=5,y=6", "Position of tile is set correctly." );
}

View File

@@ -71,7 +71,7 @@
map.zoomTo(5);
t.eq( map.getZoom(), 5, "map.zoom is correct after calling zoomTo" );
map.zoomToFullExtent();
t.eq( map.getZoom(), 0, "map.zoom is correct after calling zoomToFullExtent" );
t.eq( map.getZoom(), 2, "map.zoom is correct after calling zoomToFullExtent" );
var lonlat = map.getCenter();
var zero = new OpenLayers.LonLat(0, 0);
t.ok( lonlat.equals(zero), "map center is correct after calling zoomToFullExtent" );

View File

@@ -35,7 +35,7 @@
tile.draw();
var img = tile.imgDiv.childNodes[0];
var img = tile.imgDiv;
if (!isMozilla)
t.ok( true, "skipping element test outside of Mozilla");