Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cbc808c5d0 |
@@ -6,9 +6,5 @@ Philip Lindsay
|
|||||||
John Frank
|
John Frank
|
||||||
Schuyler Erle
|
Schuyler Erle
|
||||||
|
|
||||||
Patch contributors
|
|
||||||
------------------
|
|
||||||
Corey Puffault
|
|
||||||
|
|
||||||
OpenLayers is graciously supported by MetaCarta, Inc.
|
OpenLayers is graciously supported by MetaCarta, Inc.
|
||||||
<http://www.metacarta.com>.
|
<http://www.metacarta.com>.
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -27,8 +27,7 @@
|
|||||||
|
|
||||||
map.addLayers([ol_wms, jpl_wms, cie_wms]);
|
map.addLayers([ol_wms, jpl_wms, cie_wms]);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
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>
|
</script>
|
||||||
|
|||||||
+3
-4
@@ -2,8 +2,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -24,8 +24,7 @@
|
|||||||
|
|
||||||
map.addLayers([ol_wms, jpl_wms]);
|
map.addLayers([ol_wms, jpl_wms]);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
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) {
|
map.events.register("click", map, function(e) {
|
||||||
var lonlat = map.getLonLatFromViewPortPx(e.xy);
|
var lonlat = map.getLonLatFromViewPortPx(e.xy);
|
||||||
alert("You clicked near " + lonlat.lat + " N, " +
|
alert("You clicked near " + lonlat.lat + " N, " +
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -34,8 +34,7 @@
|
|||||||
map.addControl(new OpenLayers.Control.PanZoomBar());
|
map.addControl(new OpenLayers.Control.PanZoomBar());
|
||||||
map.addControl(new OpenLayers.Control.MouseToolbar());
|
map.addControl(new OpenLayers.Control.MouseToolbar());
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
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>
|
</script>
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -31,8 +31,7 @@
|
|||||||
|
|
||||||
map.addLayers([ol_wms, jpl_wms, dm_wms]);
|
map.addLayers([ol_wms, jpl_wms, dm_wms]);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
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>
|
</script>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
background-color: red;
|
background-color: red;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-6
@@ -2,8 +2,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -16,14 +16,12 @@
|
|||||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
|
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
|
||||||
var ka_wms = new OpenLayers.Layer.KaMap( "KaMap",
|
var ka_wms = new OpenLayers.Layer.KaMap( "KaMap",
|
||||||
"http://www.h2guide.com/my-ka-map/h2tile.php?",
|
"http://www.h2guide.com/my-ka-map/h2tile.php?" , { map: 'h2guide', g: 'background' }, new OpenLayers.LonLat(0,0));
|
||||||
{ map: 'h2guide', g: 'background' },
|
|
||||||
new OpenLayers.LonLat(0,0));
|
|
||||||
|
|
||||||
|
|
||||||
map.addLayers([ol_wms, ka_wms]);
|
map.addLayers([ol_wms, ka_wms]);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.zoomToFullExtent();
|
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||||
}
|
}
|
||||||
// -->
|
// -->
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -25,15 +25,14 @@
|
|||||||
|
|
||||||
size = new OpenLayers.Size(50,50);
|
size = new OpenLayers.Size(50,50);
|
||||||
calculateOffset = function(size) {
|
calculateOffset = function(size) {
|
||||||
return new OpenLayers.Pixel(-(size.w/2), -size.h); };
|
return new OpenLayers.Pixel(-(size.w/2), -size.h);
|
||||||
icon = new OpenLayers.Icon(
|
};
|
||||||
'http://boston.openguides.org/markers/AQUA.png',
|
icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',size,null, calculateOffset);
|
||||||
size, null, calculateOffset);
|
markers.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(-180,90),
|
||||||
markers.addMarker(
|
icon));
|
||||||
new OpenLayers.Marker(new OpenLayers.LonLat(-180,90), icon));
|
|
||||||
|
|
||||||
|
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.zoomToFullExtent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resize() {
|
function resize() {
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
marker = new OpenLayers.Marker(new OpenLayers.LonLat(90,10),icon);
|
marker = new OpenLayers.Marker(new OpenLayers.LonLat(90,10),icon);
|
||||||
marker.events.register('mousedown', marker, function(evt) { alert(this.icon.url); Event.stop(evt); });
|
marker.events.register('mousedown', marker, function(evt) { alert(this.icon.url); Event.stop(evt); });
|
||||||
markers.addMarker(marker);
|
markers.addMarker(marker);
|
||||||
|
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.zoomToFullExtent();
|
|
||||||
}
|
}
|
||||||
// -->
|
// -->
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -23,8 +23,8 @@
|
|||||||
var newl = new OpenLayers.Layer.Text( "text", "./textfile.txt" );
|
var newl = new OpenLayers.Layer.Text( "text", "./textfile.txt" );
|
||||||
map.addLayer(newl);
|
map.addLayer(newl);
|
||||||
|
|
||||||
|
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.zoomToFullExtent();
|
|
||||||
}
|
}
|
||||||
// -->
|
// -->
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -34,8 +34,8 @@
|
|||||||
markers = new OpenLayers.Layer.Markers( "Markers" );
|
markers = new OpenLayers.Layer.Markers( "Markers" );
|
||||||
map.addLayer(markers);
|
map.addLayer(markers);
|
||||||
|
|
||||||
|
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.zoomToFullExtent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function changer() {
|
function changer() {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
function init(){
|
function init(){
|
||||||
var map = new OpenLayers.Map('map', {maxResolution: 'auto'});
|
var map = new OpenLayers.Map('map');
|
||||||
|
|
||||||
var ol_wms = new OpenLayers.Layer.WMS.Untiled( "OpenLayers WMS",
|
var ol_wms = new OpenLayers.Layer.WMS.Untiled( "OpenLayers WMS",
|
||||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
|
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -20,8 +20,14 @@
|
|||||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||||
map.addLayer(layer);
|
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.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.zoomToFullExtent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function changer() {
|
function changer() {
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@
|
|||||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+9
-7
@@ -3,8 +3,8 @@
|
|||||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -14,18 +14,20 @@
|
|||||||
var map, layer;
|
var map, layer;
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
|
OpenLayers.ProxyHost = '/dev/examples/proxy.cgi?url=';
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map');
|
||||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
layer = new OpenLayers.Layer.WFS( "Owl Survey",
|
layer = new OpenLayers.Layer.WFS( "OpenLayers WFS",
|
||||||
"http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?",
|
"http://labs.metacarta.com/search/WFS?",
|
||||||
{typename: "OWLS", maxfeatures: 10},
|
{q: 'dolphins', maxfeatures: 10} );
|
||||||
OpenLayers.Feature.WFS );
|
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
|
|
||||||
|
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||||
map.setCenter(new OpenLayers.LonLat(-100, 60), 3);
|
|
||||||
}
|
}
|
||||||
// -->
|
// -->
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@
|
|||||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
#map {
|
#map {
|
||||||
width: 512px;
|
width: 800px;
|
||||||
height: 512px;
|
height: 475px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+1
-5
@@ -6,11 +6,7 @@
|
|||||||
///
|
///
|
||||||
|
|
||||||
OpenLayers = new Object();
|
OpenLayers = new Object();
|
||||||
|
OpenLayers._scriptName = "lib/OpenLayers.js";
|
||||||
OpenLayers._scriptName = (
|
|
||||||
typeof(_OPENLAYERS_SFL_) == "undefined" ? "lib/OpenLayers.js"
|
|
||||||
: "OpenLayers.js" );
|
|
||||||
|
|
||||||
OpenLayers._getScriptLocation = function () {
|
OpenLayers._getScriptLocation = function () {
|
||||||
var scriptLocation = "";
|
var scriptLocation = "";
|
||||||
var SCRIPT_NAME = OpenLayers._scriptName;
|
var SCRIPT_NAME = OpenLayers._scriptName;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||||
* text of the license. */
|
* text of the license. */
|
||||||
|
|
||||||
OpenLayers.ProxyHost = "/proxy/?url=";
|
OpenLayers.ProxyHost = "/viewer/Crossbrowser/blindproxy.py?url=";
|
||||||
//OpenLayers.ProxyHost = "examples/proxy.cgi?url=";
|
//OpenLayers.ProxyHost = "examples/proxy.cgi?url=";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -143,8 +143,6 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
|||||||
backdropLabelOuter.style.marginTop = "4px";
|
backdropLabelOuter.style.marginTop = "4px";
|
||||||
backdropLabelOuter.style.marginBottom = "4px";
|
backdropLabelOuter.style.marginBottom = "4px";
|
||||||
|
|
||||||
this._setEventHandlers(backdropLabelOuter);
|
|
||||||
|
|
||||||
// Inner Label - for Rico Corners
|
// Inner Label - for Rico Corners
|
||||||
//
|
//
|
||||||
var backdropLabel = document.createElement('p');
|
var backdropLabel = document.createElement('p');
|
||||||
@@ -193,10 +191,9 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
|||||||
_setEventHandlers : function(element, labelDiv) {
|
_setEventHandlers : function(element, labelDiv) {
|
||||||
|
|
||||||
// We only want to respond to a mousedown event.
|
// We only want to respond to a mousedown event.
|
||||||
element.onclick = this.singleClick.bindAsEventListener(this);
|
element.onclick = this.ignoreEvent.bindAsEventListener(this);
|
||||||
element.ondblclick = this.singleClick.bindAsEventListener(this);
|
element.ondblclick = this.ignoreEvent.bindAsEventListener(this);
|
||||||
element.onmouseup = this.ignoreEvent.bindAsEventListener(this);
|
element.onmousedown = this.singleClick.bindAsEventListener(this);
|
||||||
element.onmousedown = this.ignoreEvent.bindAsEventListener(this);
|
|
||||||
|
|
||||||
// If we are operating on a corner span we need to store a
|
// 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.)
|
// reference to the actual tab. (See comment about OL #57 fix above.)
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ OpenLayers.Control.MouseDefaults.prototype =
|
|||||||
},
|
},
|
||||||
|
|
||||||
defaultClick: function (evt) {
|
defaultClick: function (evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
|
||||||
var notAfterDrag = !this.performedDrag;
|
var notAfterDrag = !this.performedDrag;
|
||||||
this.performedDrag = false;
|
this.performedDrag = false;
|
||||||
return notAfterDrag;
|
return notAfterDrag;
|
||||||
@@ -40,7 +39,6 @@ OpenLayers.Control.MouseDefaults.prototype =
|
|||||||
* @param {Event} evt
|
* @param {Event} evt
|
||||||
*/
|
*/
|
||||||
defaultMouseDown: function (evt) {
|
defaultMouseDown: function (evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
|
||||||
this.mouseDragStart = evt.xy.copyOf();
|
this.mouseDragStart = evt.xy.copyOf();
|
||||||
this.performedDrag = false;
|
this.performedDrag = false;
|
||||||
if (evt.shiftKey) {
|
if (evt.shiftKey) {
|
||||||
@@ -96,7 +94,6 @@ OpenLayers.Control.MouseDefaults.prototype =
|
|||||||
* @param {Event} evt
|
* @param {Event} evt
|
||||||
*/
|
*/
|
||||||
defaultMouseUp: function (evt) {
|
defaultMouseUp: function (evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
|
||||||
if (this.zoomBox) {
|
if (this.zoomBox) {
|
||||||
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
||||||
var end = this.map.getLonLatFromViewPortPx( evt.xy );
|
var end = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
|
|
||||||
btn.events = new OpenLayers.Events(this, btn);
|
btn.events = new OpenLayers.Events(this, btn);
|
||||||
btn.events.register("mousedown", this, this.buttonClick);
|
btn.events.register("mousedown", this, this.buttonClick);
|
||||||
btn.events.register("mouseup", this, Event.stop);
|
btn.events.register("mouseup", this, this.stopAction);
|
||||||
btn.action = id;
|
btn.action = id;
|
||||||
btn.title = title;
|
btn.title = title;
|
||||||
btn.alt = title;
|
btn.alt = title;
|
||||||
@@ -74,8 +74,11 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
return btn;
|
return btn;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
stopAction: function(evt) {
|
||||||
|
Event.stop(evt);
|
||||||
|
},
|
||||||
|
|
||||||
buttonClick: function(evt) {
|
buttonClick: function(evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
|
||||||
this.switchModeTo(evt.div.action);
|
this.switchModeTo(evt.div.action);
|
||||||
Event.stop(evt);
|
Event.stop(evt);
|
||||||
},
|
},
|
||||||
@@ -93,7 +96,6 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
* @param {Event} evt
|
* @param {Event} evt
|
||||||
*/
|
*/
|
||||||
defaultMouseDown: function (evt) {
|
defaultMouseDown: function (evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
|
||||||
this.mouseDragStart = evt.xy.copyOf();
|
this.mouseDragStart = evt.xy.copyOf();
|
||||||
if (evt.shiftKey && this.mode !="zoombox") {
|
if (evt.shiftKey && this.mode !="zoombox") {
|
||||||
this.switchModeTo("zoombox");
|
this.switchModeTo("zoombox");
|
||||||
@@ -169,7 +171,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
switchModeTo: function(mode) {
|
switchModeTo: function(mode) {
|
||||||
if (mode != this.mode) {
|
if (mode != this.mode) {
|
||||||
if (this.mode) {
|
if (this.mode) {
|
||||||
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode], null, null, null, this.buttons[this.mode].imgLocation);
|
this.buttons[this.mode].firstChild.src = this.buttons[this.mode].imgLocation;
|
||||||
}
|
}
|
||||||
if (this.mode == "measure" && mode != "measure") {
|
if (this.mode == "measure" && mode != "measure") {
|
||||||
for(var i = 0; i < this.measureDivs.length; i++) {
|
for(var i = 0; i < this.measureDivs.length; i++) {
|
||||||
@@ -181,7 +183,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
this.measureStart = null;
|
this.measureStart = null;
|
||||||
}
|
}
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode], null, null, null, this.buttons[mode].activeImgLocation);
|
this.buttons[mode].firstChild.src = this.buttons[mode].activeImgLocation;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -224,7 +226,6 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
* @param {Event} evt
|
* @param {Event} evt
|
||||||
*/
|
*/
|
||||||
defaultMouseUp: function (evt) {
|
defaultMouseUp: function (evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
|
||||||
switch (this.mode) {
|
switch (this.mode) {
|
||||||
case "zoombox":
|
case "zoombox":
|
||||||
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ OpenLayers.Control.PanZoom.prototype =
|
|||||||
* @param {event} evt
|
* @param {event} evt
|
||||||
*/
|
*/
|
||||||
buttonDown: function (evt) {
|
buttonDown: function (evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
|
||||||
|
|
||||||
var slide = this.map.getResolution() * this.slideFactor;
|
var slide = this.map.getResolution() * this.slideFactor;
|
||||||
var center = this.map.getCenter();
|
var center = this.map.getCenter();
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ OpenLayers.Control.PanZoomBar.prototype =
|
|||||||
* and sets the zoom level appropriately.
|
* and sets the zoom level appropriately.
|
||||||
*/
|
*/
|
||||||
divClick: function (evt) {
|
divClick: function (evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
|
||||||
var y = evt.xy.y;
|
var y = evt.xy.y;
|
||||||
var top = Position.page(evt.object)[1];
|
var top = Position.page(evt.object)[1];
|
||||||
var levels = Math.floor((y - top)/this.zoomStopHeight);
|
var levels = Math.floor((y - top)/this.zoomStopHeight);
|
||||||
@@ -140,7 +139,6 @@ OpenLayers.Control.PanZoomBar.prototype =
|
|||||||
* event listener for clicks on the slider
|
* event listener for clicks on the slider
|
||||||
*/
|
*/
|
||||||
zoomBarDown:function(evt) {
|
zoomBarDown:function(evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
|
||||||
this.map.events.register("mousemove", this, this.passEventToSlider);
|
this.map.events.register("mousemove", this, this.passEventToSlider);
|
||||||
this.map.events.register("mouseup", this, this.passEventToSlider);
|
this.map.events.register("mouseup", this, this.passEventToSlider);
|
||||||
this.mouseDragStart = evt.xy.copyOf();
|
this.mouseDragStart = evt.xy.copyOf();
|
||||||
@@ -175,7 +173,6 @@ OpenLayers.Control.PanZoomBar.prototype =
|
|||||||
* and switch to it.
|
* and switch to it.
|
||||||
*/
|
*/
|
||||||
zoomBarUp:function(evt) {
|
zoomBarUp:function(evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
|
||||||
if (this.zoomStart) {
|
if (this.zoomStart) {
|
||||||
this.div.style.cursor="default";
|
this.div.style.cursor="default";
|
||||||
this.map.events.remove("mousemove");
|
this.map.events.remove("mousemove");
|
||||||
|
|||||||
@@ -43,15 +43,8 @@ OpenLayers.Feature.WFS.prototype =
|
|||||||
*/
|
*/
|
||||||
processXMLNode: function(xmlNode) {
|
processXMLNode: function(xmlNode) {
|
||||||
//this should be overridden by subclasses
|
//this should be overridden by subclasses
|
||||||
|
|
||||||
// must return an Object with 'id' and 'lonlat' values set
|
// 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 */
|
/** @final @type String */
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ OpenLayers.Layer.WFS.prototype =
|
|||||||
Object.extend(new OpenLayers.Layer.Markers(), {
|
Object.extend(new OpenLayers.Layer.Markers(), {
|
||||||
|
|
||||||
/** @type Object */
|
/** @type Object */
|
||||||
featureClass: OpenLayers.Feature.WFS,
|
featureClass: null,
|
||||||
|
|
||||||
/** @final @type hash */
|
/** @final @type hash */
|
||||||
DEFAULT_PARAMS: { service: "WFS",
|
DEFAULT_PARAMS: { service: "WFS",
|
||||||
@@ -30,7 +30,7 @@ OpenLayers.Layer.WFS.prototype =
|
|||||||
* @param {Object} featureClass
|
* @param {Object} featureClass
|
||||||
*/
|
*/
|
||||||
initialize: function(name, url, params, featureClass) {
|
initialize: function(name, url, params, featureClass) {
|
||||||
if (featureClass != null) this.featureClass = featureClass;
|
this.featureClass = featureClass;
|
||||||
|
|
||||||
var newArguments = new Array();
|
var newArguments = new Array();
|
||||||
if (arguments.length > 0) {
|
if (arguments.length > 0) {
|
||||||
|
|||||||
@@ -545,10 +545,11 @@ OpenLayers.Map.prototype = {
|
|||||||
*/
|
*/
|
||||||
zoomToFullExtent: function() {
|
zoomToFullExtent: function() {
|
||||||
var fullExtent = this.getFullExtent();
|
var fullExtent = this.getFullExtent();
|
||||||
|
var oldZoom = this.zoom;
|
||||||
this.setCenter(
|
this.setCenter(
|
||||||
new OpenLayers.LonLat((fullExtent.left+fullExtent.right)/2,
|
new OpenLayers.LonLat((fullExtent.left+fullExtent.right)/2,
|
||||||
(fullExtent.bottom+fullExtent.top)/2),
|
(fullExtent.bottom+fullExtent.top)/2),
|
||||||
this.getZoomForExtent(fullExtent)
|
0
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ OpenLayers.Popup.AnchoredBubble.prototype =
|
|||||||
var id = this.div.id + "-contentDiv";
|
var id = this.div.id + "-contentDiv";
|
||||||
this.contentDiv = OpenLayers.Util.createDiv(id, null, contentSize,
|
this.contentDiv = OpenLayers.Util.createDiv(id, null, contentSize,
|
||||||
null, "relative", null,
|
null, "relative", null,
|
||||||
"hidden");
|
"none");
|
||||||
this.div.appendChild(this.contentDiv);
|
this.div.appendChild(this.contentDiv);
|
||||||
this.setContentHTML();
|
this.setContentHTML();
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,7 @@ OpenLayers.Tile.Image.prototype =
|
|||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
draw:function(transparent) {
|
draw:function(transparent) {
|
||||||
if (false) { // don't actually use the alpha PNG hack right now
|
if (transparent) {
|
||||||
// it has a fiercely bad effect on IE6's performance
|
|
||||||
// if (transparent) {
|
|
||||||
this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null,
|
this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null,
|
||||||
this.position,
|
this.position,
|
||||||
this.size,
|
this.size,
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ OpenLayers.Tile.WFS.prototype =
|
|||||||
doc = OpenLayers.parseXMLString(request.responseText);
|
doc = OpenLayers.parseXMLString(request.responseText);
|
||||||
}
|
}
|
||||||
|
|
||||||
var resultFeatures = doc.getElementsByTagName("featureMember");
|
var resultFeatures = OpenLayers.Util.getNodes(doc, "gml:featureMember");
|
||||||
|
|
||||||
//clear old featureList
|
//clear old featureList
|
||||||
this.features = new Array();
|
this.features = new Array();
|
||||||
|
|||||||
@@ -28,12 +28,12 @@
|
|||||||
}
|
}
|
||||||
function test_03_Control_PanZoom_control_events (t) {
|
function test_03_Control_PanZoom_control_events (t) {
|
||||||
t.plan( 7 );
|
t.plan( 7 );
|
||||||
var evt = {which: 1}; // control expects left-click
|
var evt = new Object();
|
||||||
map = new OpenLayers.Map('map');
|
map = new OpenLayers.Map('map');
|
||||||
control = new OpenLayers.Control.PanZoom();
|
control = new OpenLayers.Control.PanZoom();
|
||||||
map.addControl(control,
|
map.addControl(control,
|
||||||
new OpenLayers.Pixel(20,20));
|
new OpenLayers.Pixel(20,20));
|
||||||
map.setCenter(new OpenLayers.LonLat(0,0), 4);
|
map.setCenter(new OpenLayers.LonLat(0,0), 0);
|
||||||
var res = map.getResolution();
|
var res = map.getResolution();
|
||||||
control.buttons[0].onmousedown(evt);
|
control.buttons[0].onmousedown(evt);
|
||||||
t.eq( map.getCenter().lat, res*50, "Pan up works correctly" );
|
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" );
|
t.eq( map.getCenter().lat, 0, "Pan down works correctly" );
|
||||||
control.buttons[4].onmousedown(evt);
|
control.buttons[4].onmousedown(evt);
|
||||||
control.buttons[4].onmousedown(evt);
|
control.buttons[4].onmousedown(evt);
|
||||||
t.eq( map.getZoom(), 6, "zoomin works correctly" );
|
t.eq( map.getZoom(), 2, "zoomin workds correctly" );
|
||||||
control.buttons[6].onmousedown(evt);
|
control.buttons[6].onmousedown(evt);
|
||||||
t.eq( map.getZoom(), 5, "zoomout works correctly" );
|
t.eq( map.getZoom(), 1, "zoomout workds correctly" );
|
||||||
control.buttons[4].onmousedown(evt);
|
control.buttons[4].onmousedown(evt);
|
||||||
control.buttons[5].onmousedown(evt);
|
control.buttons[5].onmousedown(evt);
|
||||||
t.eq( map.getZoom(), 2, "zoomworld works correctly" );
|
t.eq( map.getZoom(), 0, "zoomworld workds correctly" );
|
||||||
|
|
||||||
}
|
}
|
||||||
// -->
|
// -->
|
||||||
|
|||||||
+1
-1
@@ -71,7 +71,7 @@
|
|||||||
map.zoomTo(5);
|
map.zoomTo(5);
|
||||||
t.eq( map.getZoom(), 5, "map.zoom is correct after calling zoomTo" );
|
t.eq( map.getZoom(), 5, "map.zoom is correct after calling zoomTo" );
|
||||||
map.zoomToFullExtent();
|
map.zoomToFullExtent();
|
||||||
t.eq( map.getZoom(), 2, "map.zoom is correct after calling zoomToFullExtent" );
|
t.eq( map.getZoom(), 0, "map.zoom is correct after calling zoomToFullExtent" );
|
||||||
var lonlat = map.getCenter();
|
var lonlat = map.getCenter();
|
||||||
var zero = new OpenLayers.LonLat(0, 0);
|
var zero = new OpenLayers.LonLat(0, 0);
|
||||||
t.ok( lonlat.equals(zero), "map center is correct after calling zoomToFullExtent" );
|
t.ok( lonlat.equals(zero), "map center is correct after calling zoomToFullExtent" );
|
||||||
|
|||||||
Reference in New Issue
Block a user