Compare commits

..

15 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
32 changed files with 114 additions and 90 deletions

View File

@@ -6,5 +6,9 @@ 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

@@ -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) {
@@ -94,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 );

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");
@@ -171,7 +169,7 @@ OpenLayers.Control.MouseToolbar.prototype =
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++) {
@@ -183,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);
}
},
@@ -226,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 );

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

@@ -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

@@ -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

@@ -36,7 +36,9 @@ OpenLayers.Tile.Image.prototype =
/**
*/
draw:function(transparent) {
if (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,

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();

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

@@ -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" );