Merge 2.0 branch to trunk.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1369 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -23,20 +23,23 @@
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
map = new OpenLayers.Map( $('map') ,
|
||||
{ controls: [new OpenLayers.Control.MouseDefaults()] });
|
||||
|
||||
var normal = new OpenLayers.Layer.Google( "Google" );
|
||||
var normal = new OpenLayers.Layer.Google( "Google", // );
|
||||
{ minZoomLevel: 3, maxZoomLevel: 8 });
|
||||
var satellite = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP });
|
||||
var hybrid = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_MAP });
|
||||
|
||||
|
||||
map.addLayers([normal, satellite, hybrid]);
|
||||
map.addLayers([satellite, normal, hybrid]);
|
||||
|
||||
markers = new OpenLayers.Layer.Markers("markers");
|
||||
map.addLayer(markers);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
map.addControl( new OpenLayers.Control.PanZoomBar() );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{layers: 'basic'} );
|
||||
|
||||
var jpl_wms = new OpenLayers.Layer.KaMap( "Satellite",
|
||||
"/world/index.php", {g: "satellite", map: "world"});
|
||||
"http://www.openlayers.org/world/index.php", {g: "satellite", map: "world"});
|
||||
var dm_wms = new OpenLayers.Layer.WMS( "Canada",
|
||||
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
|
||||
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
|
||||
|
||||
29
examples/setextent.html
Normal file
29
examples/setextent.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Setting a visual Extent</title>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Setting a Visual Extent</h1>
|
||||
<p>
|
||||
Because the ability to set the map to a given extent is limited by the
|
||||
current resolutions available, zoomToExtent will not always set the map to
|
||||
exactly the right extent. In order to visually annotate the actual extent,
|
||||
this example, will use the Boxes layer to visually describe the desired
|
||||
extent as well as setting the map extent.
|
||||
</p>
|
||||
<div style="width:100%; height:75%" id="map"></div>
|
||||
<script defer="defer" type="text/javascript">
|
||||
var map = new OpenLayers.Map('map');
|
||||
var bounds = new OpenLayers.Bounds(-45,-45, 0, 45);
|
||||
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
|
||||
map.addLayer(wms);
|
||||
map.zoomToExtent(bounds);
|
||||
var boxes = new OpenLayers.Layer.Boxes("boxes");
|
||||
var box = new OpenLayers.Marker.Box(bounds);
|
||||
boxes.addMarker(box);
|
||||
map.addLayer(boxes);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
90
examples/test.html
Normal file
90
examples/test.html
Normal file
@@ -0,0 +1,90 @@
|
||||
<html>
|
||||
|
||||
<script src="../lib/Prototype.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var one, two, div, msg;
|
||||
|
||||
function init() {
|
||||
|
||||
one = $("one");
|
||||
two = $("two");
|
||||
div = $("div");
|
||||
msg = $("msg");
|
||||
|
||||
Event.observe(div, "click", bar);
|
||||
|
||||
one.checked = true;
|
||||
two.checked = false;
|
||||
|
||||
Event.observe(one, "change", oneClick);
|
||||
Event.observe(two, "change", twoClick);
|
||||
|
||||
}
|
||||
|
||||
function bar(e) {
|
||||
message("clicked div");
|
||||
|
||||
Event.stop(e);
|
||||
|
||||
var status = "one: ";
|
||||
status += (one.checked) ? "checked" : "unchecked";
|
||||
status += " two: ";
|
||||
status += (two.checked) ? "checked" : "unchecked";
|
||||
message(status);
|
||||
}
|
||||
|
||||
function oneClick(e) {
|
||||
message("clicked one");
|
||||
}
|
||||
|
||||
function twoClick(e) {
|
||||
message("clicked two");
|
||||
}
|
||||
|
||||
function message(txt) {
|
||||
msg.innerHTML += " ** " + txt;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body onload="init()" onclick="message('clicked body')" onmouseup="message('<br>')">
|
||||
|
||||
<div> The idea here is to simulate the layerswitcher radiobuttons UI
|
||||
without all the overhead of openlayers.
|
||||
<br>
|
||||
<br>
|
||||
There are event handlers attached to the following elements:
|
||||
<br>
|
||||
* Body - Prints message "clicked body" to message area
|
||||
<br>
|
||||
* Blue Div - Prints message "clicked div" to message area, stops
|
||||
the event propagation, prints a message with the
|
||||
status of the two radiobuttons
|
||||
<br>
|
||||
* Radio One - Prints message "clicked one" to message area
|
||||
<br>
|
||||
* Radio Two - Prints message "clicked two" to message area
|
||||
<br>
|
||||
<br>
|
||||
<b>
|
||||
The problem, as you will see if you click the radio buttons
|
||||
themselves, is that their "checked" status seems to update, but
|
||||
their visual UI bit does not. Can we fix this!?!
|
||||
</b>
|
||||
</div>
|
||||
|
||||
<div id="div" style="background-color:blue; margin:50px">
|
||||
<input id="one" type="radio" name="foo"/>
|
||||
<span> one </span>
|
||||
<br>
|
||||
<input id="two" type="radio" name="foo"/>
|
||||
<span> two </span>
|
||||
</div>
|
||||
|
||||
<div id="msg" style="background-color:pink; margin-top:200px">
|
||||
Events:
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -14,11 +14,12 @@
|
||||
var map = new OpenLayers.Map('map', {'maxResolution': 1.40625/4, controls:[]});
|
||||
|
||||
var ka_wms = new OpenLayers.Layer.KaMap( "TIGER (KaMap)",
|
||||
"http://boston.freemap.in/tile.php" , { map: 'tiger', layers: 'TIGER' }, 'degrees', 72 );
|
||||
"http://boston.freemap.in/tile.php" , { map: 'tiger', layers: 'TIGER' });
|
||||
var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
|
||||
"http://wms.jpl.nasa.gov/wms.cgi",
|
||||
{layers: "modis,global_mosaic"});
|
||||
jpl_wms.setVisibility(false);
|
||||
ka_wms.isBaseLayer = false;
|
||||
map.addLayers([jpl_wms,ka_wms]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.addControl(new OpenLayers.Control.MouseToolbar());
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
function init(){
|
||||
var map = new OpenLayers.Map('map', {'maxResolution': 1.6, maxZoomLevel:20});
|
||||
|
||||
var mapOptions = { maxResolution: 1.6, numZoomLevels: 21};
|
||||
var map = new OpenLayers.Map('map', mapOptions);
|
||||
|
||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} );
|
||||
|
||||
var ww = new OpenLayers.Layer.WorldWind( "Urban",
|
||||
"http://worldwind25.arc.nasa.gov/tile/tile.aspx?", .8, 9,
|
||||
{T:"104"});
|
||||
ww.setTileSize(new OpenLayers.Size(512,512));
|
||||
{T:"104"}, { tileSize: new OpenLayers.Size(512,512) });
|
||||
|
||||
|
||||
map.addLayers([ol_wms, ww]);
|
||||
|
||||
@@ -18,20 +18,23 @@
|
||||
|
||||
var lon = 5;
|
||||
var lat = 40;
|
||||
var zoom = 5;
|
||||
var zoom = 15;
|
||||
var map, velayer, layer;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map( $('map') );
|
||||
map = new OpenLayers.Map( $('map') ,
|
||||
{controls:[new OpenLayers.Control.MouseDefaults()]});
|
||||
|
||||
velayer = new OpenLayers.Layer.VirtualEarth( "VE");
|
||||
velayer = new OpenLayers.Layer.VirtualEarth( "VE",
|
||||
{ minZoomLevel: 4, maxZoomLevel: 6 });
|
||||
map.addLayer(velayer);
|
||||
|
||||
markers = new OpenLayers.Layer.Markers("markers");
|
||||
map.addLayer(markers);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), 2);
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
map.addControl( new OpenLayers.Control.LayerSwitcher() );
|
||||
map.addControl( new OpenLayers.Control.PanZoomBar() );
|
||||
}
|
||||
|
||||
function add() {
|
||||
|
||||
@@ -35,7 +35,7 @@ var map,ia_wms;
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers Example</h1>
|
||||
<p>WMS-T example: update the times, and the radar image will change. Uses Layer.changeParams. Thanks to David Bitner for the inspiration, the original code, and the kick in the butt!</p>
|
||||
<input type='text' id='time' value="2005-08-29T13:00:00Z" onChange='ia_wms.changeParams({"time":this.value});' >
|
||||
<input type='text' id='time' value="2005-08-29T13:00:00Z" onChange='ia_wms.mergeNewParams({"time":this.value});' >
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
54
examples/zoomLevels.html
Normal file
54
examples/zoomLevels.html
Normal file
@@ -0,0 +1,54 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
|
||||
<style type="text/css">
|
||||
#map {
|
||||
width: 800px;
|
||||
height: 475px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
var lon = 50;
|
||||
var lat = 0;
|
||||
var zoom = 0;
|
||||
var map, layer;
|
||||
|
||||
function init(){
|
||||
|
||||
var options = {
|
||||
// resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101],
|
||||
// scales: [50000000, 10000000],
|
||||
// maxResolution: 0.17578125,
|
||||
// minResolution: 0.0439453125,
|
||||
// maxScale: 10000000,
|
||||
// minScale: 50000000,
|
||||
minResolution: "auto",
|
||||
minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),
|
||||
maxResolution: "auto",
|
||||
maxExtent: new OpenLayers.Bounds(-180, -90, 90, 180),
|
||||
// numZoomLevels: 5,
|
||||
controls: [new OpenLayers.Control.MouseDefaults()]
|
||||
};
|
||||
|
||||
map = new OpenLayers.Map( $('map') , options);
|
||||
|
||||
map.addControl(new OpenLayers.Control.PanZoomBar());
|
||||
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});
|
||||
map.addLayer(layer);
|
||||
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||
}
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<div id="map"></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user