mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2025-12-09 15:24:31 +00:00
found files left on server - Philip
This commit is contained in:
29
map/test.html
Normal file
29
map/test.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>OpenLayers Simplest Example</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="Map" style="height:250px"></div>
|
||||
<script src="/javascript/openlayers/OpenLayers.js"></script>
|
||||
<script>
|
||||
var lat = 47.35387;
|
||||
var lon = 8.43609;
|
||||
var zoom = 18;
|
||||
|
||||
var fromProjection = new OpenLayers.Projection("EPSG:4326"); // Transform from WGS 1984
|
||||
var toProjection = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection
|
||||
var position = new OpenLayers.LonLat(lon, lat).transform( fromProjection, toProjection);
|
||||
|
||||
map = new OpenLayers.Map("Map");
|
||||
var mapnik = new OpenLayers.Layer.OSM();
|
||||
map.addLayer(mapnik);
|
||||
|
||||
var markers = new OpenLayers.Layer.Markers( "Markers" );
|
||||
map.addLayer(markers);
|
||||
markers.addMarker(new OpenLayers.Marker(position));
|
||||
|
||||
map.setCenter(position, zoom);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user