for testing getPixelFromLonLat()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@325 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
65
examples/markerss.html
Normal file
65
examples/markerss.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<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 map, layer, popup;
|
||||
|
||||
var marker, markers;
|
||||
|
||||
function init(){
|
||||
map = new OpenLayers.Map('map');
|
||||
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
|
||||
"http://octo.metacarta.com/cgi-bin/mapserv",
|
||||
{map: '/mapdata/vmap_wms.map', layers: 'basic', format: 'image/jpeg'} );
|
||||
|
||||
map.addLayer(layer);
|
||||
|
||||
markers = new OpenLayers.Layer.Markers( "Markers" );
|
||||
map.addLayer(markers);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
}
|
||||
|
||||
function changer() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
function add() {
|
||||
var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',new OpenLayers.Size(10,17));
|
||||
marker = new OpenLayers.Marker(new OpenLayers.LonLat(180,90), icon);
|
||||
markers.addMarker(marker);
|
||||
|
||||
}
|
||||
|
||||
function destroy() {
|
||||
popup.destroy();
|
||||
}
|
||||
|
||||
function remove() {
|
||||
map.removePopup(popup);
|
||||
}
|
||||
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1>OpenLayers Example</h1>
|
||||
<div id="map"></div>
|
||||
<div style="background-color:purple" onclick="add()"> click to add popup to map</div>
|
||||
<div style="background-color:blue" onclick="changer()"> click to modify popup's attributes</div>
|
||||
<div style="background-color:red" onclick="destroy()"> click to destroy the popup</div>
|
||||
<div style="background-color:green" onclick="remove()"> click to remove the popup from map</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user