<div dir="ltr"><div>Hi there,</div><div><br></div><div>I am new of Openlayers and I need to show some points that come from a database on a map centred in Turin (Italy), with some information related to this point (for instance an image). Searching on line I have found that Openlayers supports many formats of data like GML, KML, GeoJSON and many others. Could you suggest a format useful fror my problem and maybe some examples of how to use it?</div><div><br></div><div>I have tried with this code generating a map of europe, but it doesn't work</div><div><br></div><div><div><html></div><div><head></div><div> <title>Prova GML</title></div><div> <script src="<a href="http://openlayers.org/api/OpenLayers.js">http://openlayers.org/api/OpenLayers.js</a>"></script></div><div></head></div><div> <body></div><div> <div id="ch3_gml" style="width: 100%; height: 100%;"></div><br></div><div><br></div><div> <script type="text/javascript"><br></div><div><br></div><div> // Create the map using the specified DOM element</div><div> var map = new OpenLayers.Map("ch3_gml"); </div><div> </div><div> var layer = new OpenLayers.Layer.OSM("OpenStreetMap");</div><div> map.addLayer(layer);</div><div> </div><div> map.addControl(new OpenLayers.Control.LayerSwitcher());</div><div> map.setCenter(new OpenLayers.LonLat(0,0), 2);</div><div> </div><div> map.addLayer(new OpenLayers.Layer.Vector("Europe (GML)", {<br></div><div> protocol: new OpenLayers.Protocol.HTTP({</div><div> url: "./europe.gml",</div><div> format: new OpenLayers.Format.GML()</div><div> }),</div><div> strategies: [new OpenLayers.Strategy.Fixed()]</div><div> }));</div><div> </script></div><div></body></div><div></html></div></div><div><br></div>where europe.gml is a gml file in the same folder of this script, but nothing happens.<br clear="all"><div><br></div><div>Thank you very much for your help!</div><div><br></div><div>Regards</div><div><br></div><div>Niccolò</div><div><br></div>-- <br>Niccolò Dal Santo<div>+39 342 15 70 842</div><div><a href="mailto:ncl.dalsanto@gmail.com" target="_blank">ncl.dalsanto@gmail.com</a></div>
</div>