Last change
on this file since 5194 was 5194, checked in by mervart, 12 years ago |
|
-
Property svn:executable
set to
*
|
File size:
981 bytes
|
Line | |
---|
1 | <!DOCTYPE HTML>
|
---|
2 | <html>
|
---|
3 |
|
---|
4 | <head>
|
---|
5 | <title>BNC OpenStreetMap View</title>
|
---|
6 | <style type="text/css">
|
---|
7 | html, body, #basicMap {
|
---|
8 | width: 100%;
|
---|
9 | height: 100%;
|
---|
10 | margin: 0;
|
---|
11 | }
|
---|
12 | </style>
|
---|
13 |
|
---|
14 | <script src="http://openlayers.org/api/OpenLayers.js" ></script>
|
---|
15 |
|
---|
16 | <script>
|
---|
17 | function initialize(lat, lon) {
|
---|
18 | map = new OpenLayers.Map("basicMap");
|
---|
19 |
|
---|
20 | var mapnik = new OpenLayers.Layer.OSM();
|
---|
21 | var fromProjection = new OpenLayers.Projection("EPSG:4326"); // WGS 1984
|
---|
22 | var toProjection = new OpenLayers.Projection("EPSG:900913"); // Spherical Mercator
|
---|
23 | var position = new OpenLayers.LonLat(lon, lat).transform(fromProjection, toProjection);
|
---|
24 | var zoom = 15;
|
---|
25 |
|
---|
26 | map.addLayer(mapnik);
|
---|
27 | map.setCenter(position, zoom );
|
---|
28 | }
|
---|
29 | </script>
|
---|
30 |
|
---|
31 | </head>
|
---|
32 |
|
---|
33 | <body onload="initialize(50.090956, 8.663283);">
|
---|
34 | <div id="basicMap"></div>
|
---|
35 | </body>
|
---|
36 |
|
---|
37 | </html>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.