Compare commits
20 Commits
v4.6.4
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88033f1b4e | ||
|
|
521d45c091 | ||
|
|
ea959e5740 | ||
|
|
a80110add2 | ||
|
|
4934b386df | ||
|
|
d5f36de60f | ||
|
|
7bbfffa6d6 | ||
|
|
f90e4044e0 | ||
|
|
793bca701d | ||
|
|
00540c6d07 | ||
|
|
4784ed1acd | ||
|
|
14a859a60d | ||
|
|
d8263d200b | ||
|
|
00c0655cd2 | ||
|
|
97694ddcf7 | ||
|
|
8608c16344 | ||
|
|
86d7fa176e | ||
|
|
fd1fdf2f8e | ||
|
|
24b58b5e0b | ||
|
|
83197dc4f2 |
@@ -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
14
doc/authors.txt
Normal 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>.
|
||||
@@ -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>
|
||||
|
||||
@@ -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, " +
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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'} );
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<head>
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
width: 512px;
|
||||
height: 512px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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=";
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.)
|
||||
|
||||
@@ -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";
|
||||
},
|
||||
|
||||
@@ -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";
|
||||
},
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -47,7 +47,7 @@ OpenLayers.Layer.WMS.prototype =
|
||||
* @type Boolean
|
||||
*/
|
||||
isBaseLayer: function() {
|
||||
return (this.params.TRANSPARENT != true);
|
||||
return (this.params.TRANSPARENT != 'true');
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
|
||||
@@ -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
50
readme.txt
Normal 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 =
|
||||
@@ -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" );
|
||||
|
||||
}
|
||||
// -->
|
||||
|
||||
@@ -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." );
|
||||
}
|
||||
|
||||
@@ -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" );
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user