remove incorrect example. click.html does the same as this, and actually works in all browsers :-)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2778 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -1,43 +0,0 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>OpenLayers Cursor Example</title>
|
|
||||||
<style type="text/css">
|
|
||||||
#map {
|
|
||||||
width: 700px;
|
|
||||||
height: 400px;
|
|
||||||
border: 1px solid black;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script src="../lib/OpenLayers.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
<!--
|
|
||||||
function init(){
|
|
||||||
var map = new OpenLayers.Map('map', { controls: [] });
|
|
||||||
|
|
||||||
map.addControl(new OpenLayers.Control.PanZoomBar());
|
|
||||||
map.addControl(new OpenLayers.Control.MouseToolbar());
|
|
||||||
|
|
||||||
map.addControl(new OpenLayers.Control.MousePosition());
|
|
||||||
|
|
||||||
var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
|
||||||
"http://labs.metacarta.com/wms/vmap0",
|
|
||||||
{layers: 'basic'} );
|
|
||||||
|
|
||||||
map.addLayers([ol_wms]);
|
|
||||||
|
|
||||||
OpenLayers.Event.observe(OpenLayers.Util.getElem('map'),"click",mapclicked.bindAsEventListener(map));
|
|
||||||
function mapclicked(e){
|
|
||||||
var lonlat = map.getLonLatFromPixel(e.xy);
|
|
||||||
alert("Lat: " + lonlat.lat + " (Pixel.x:" + e.xy.x + ")" + "\n" + "Lon: " + lonlat.lon + " (Pixel.y:" + e.xy.y + ")" );
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!map.getCenter()) map.zoomToMaxExtent();
|
|
||||||
}
|
|
||||||
// -->
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body onload="init()">
|
|
||||||
<h1>OpenLayers Cursor Example</h1>
|
|
||||||
<div id="map"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user