1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
4 <link rel="stylesheet" href="style.css" type="text/css" />
5 <script src="../lib/OpenLayers.js"></script>
6 <script type="text/javascript">
13 map = new OpenLayers.Map( 'map' );
14 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
15 "http://labs.metacarta.com/wms/vmap0",
18 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
19 var featurecollection = {
20 "type": "FeatureCollection",
23 "type": "GeometryCollection",
28 [[11.0878902207, 45.1602390564],
29 [15.01953125, 48.1298828125]]
34 [[[11.0878902207, 45.1602390564],
35 [14.931640625, 40.9228515625],
36 [0.8251953125, 41.0986328125],
37 [7.63671875, 48.96484375],
38 [11.0878902207, 45.1602390564]]]
42 "coordinates":[15.87646484375, 44.1748046875]
50 var geojson_format = new OpenLayers.Format.GeoJSON();
51 var vector_layer = new OpenLayers.Layer.Vector();
52 map.addLayer(vector_layer);
53 vector_layer.addFeatures(geojson_format.read(featurecollection));
58 <body onload="init()">
59 <h1 id="title">GeoJSON Example</h1>
60 <div id="map" class="smallmap"></div>