<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.23588"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=750072617-22092014><FONT color=#0000ff
size=2 face=Arial>Hi Niccolò,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=750072617-22092014><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=750072617-22092014><FONT color=#0000ff
size=2 face=Arial>if your vector data is in EPSG:4326, then you have to declare
the projection of the data in the options of your vector
layer:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=750072617-22092014><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=750072617-22092014><FONT color=#0000ff
size=2 face=Arial> map.addLayer(new
OpenLayers.Layer.Vector("Continents (GML)",
{<BR>
protocol: new
OpenLayers.Protocol.HTTP({<BR>
url:
"../OL210/MapServer_WFS_Demo/MapServer_SHP/simple_continents.gml",<BR>
format: new
OpenLayers.Format.GML()<BR>
}),<BR>
projection:new OpenLayers.Projection("EPSG:4326"), //<--
projection of the data, if not the same as the
map<BR>
attribution:'<a href="/OLClient/extension/OLClient Object Browser.asp"
target="OLCOB">Object
Browser</a>',<BR>
strategies: [new
OpenLayers.Strategy.Fixed()]<BR>
}));<BR></FONT></DIV>
<DIV></SPAN><SPAN class=750072617-22092014></SPAN><FONT face=Arial><FONT
color=#0000ff><FONT size=2>see</FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><A
href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OLdev/prova_gml_dev.asp">http://gis.ibbeck.de/ginfo/apps/OLExamples/OLdev/prova_gml_dev.asp</A></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT
size=2></FONT></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=750072617-22092014>G</SPAN><SPAN class=750072617-22092014>ood Luck,
Arnd</SPAN></FONT></FONT></FONT></DIV>
<DIV><BR></DIV>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> Niccolò Dal Santo
[mailto:ncl.dalsanto@gmail.com] <BR><B>Gesendet:</B> Sonntag, 21. September 2014
19:50<BR><B>An:</B> arnd.wippermann@web.de<BR><B>Cc:</B>
openlayers-users<BR><B>Betreff:</B> Re: [OpenLayers-Users] Showing points from a
database<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr>At first ,thanks a lot for the help.
<DIV><BR></DIV>
<DIV>Secondly, I don't know since this is an example downloaded by the internet.
However I have tried by inserting this line in my code</DIV>
<DIV><BR></DIV>
<DIV>
<DIV> map.setCenter(</DIV>
<DIV> new OpenLayers.LonLat(0,0).transform(</DIV>
<DIV> new
OpenLayers.Projection("EPSG:4326"),</DIV>
<DIV> map.getProjectionObject()</DIV>
<DIV> ), 1</DIV>
<DIV> );</DIV></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV>So, this is my final code:</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"
target=_blank>http://openlayers.org/api/OpenLayers.js</A>"></script></DIV>
<DIV></head></DIV>
<DIV> <body></DIV>
<DIV><BR></DIV>
<DIV><div id="ch3_cluster" style="width: 100%; height:
100%;"></div></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV> <script type="text/javascript"></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV> var map = new OpenLayers.Map("ch3_cluster");
</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><BR></DIV>
<DIV> map.setCenter(</DIV>
<DIV> new OpenLayers.LonLat(0,0).transform(</DIV>
<DIV> new
OpenLayers.Projection("EPSG:4326"),</DIV>
<DIV> map.getProjectionObject()</DIV>
<DIV> ), 1</DIV>
<DIV> );</DIV>
<DIV> </DIV>
<DIV> // World Cities</DIV>
<DIV> var citiesLayer = new OpenLayers.Layer.Vector("World Cities
(GeoJSON)", </DIV>
<DIV> { protocol: new
OpenLayers.Protocol.HTTP({</DIV>
<DIV> url: "<A
href="http://localhost/world_cities.json"
target=_blank>http://localhost/world_cities.json</A>",</DIV>
<DIV> format: new
OpenLayers.Format.GeoJSON()</DIV>
<DIV> }),</DIV>
<DIV> strategies: [</DIV>
<DIV> new
OpenLayers.Strategy.Fixed(), </DIV>
<DIV> new
OpenLayers.Strategy.Cluster({distance: 15})</DIV>
<DIV> ]</DIV>
<DIV> });</DIV>
<DIV> map.addLayer(citiesLayer);</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV></script></DIV>
<DIV></body></DIV>
<DIV></html></DIV></DIV>
<DIV><BR></DIV>
<DIV>Now I have also tried with another and easier example found in the web but
it doesn't work as well, so I was wondering whether I am missing something like
a basic requirement or a Java updating or whatever in order to use these
features. What I have done is to download the library ( but the source in this
code should be the web as the first script states). Do you have any idea on
that?</DIV>
<DIV><BR></DIV>
<DIV>Thank you very much!</DIV>
<DIV><BR></DIV>
<DIV>Niccolò</DIV>
<DIV><BR></DIV></DIV>
<DIV class=gmail_extra><BR>
<DIV class=gmail_quote>2014-09-21 19:19 GMT+02:00 Arnd Wippermann <SPAN
dir=ltr><<A href="mailto:arnd.wippermann@web.de"
target=_blank>arnd.wippermann@web.de</A>></SPAN>:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><U></U>
<DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff
face=Arial>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff face=Arial>your map is in
projection EPSG:900913 (OSM). </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff face=Arial>Are your data
also in this projection or perhaps in EPSG:4326 (lonlat)?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff face=Arial>If so, it could
be that your data are shown (at x=0,y=0), but you only can't see
them.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff
face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff
face=Arial>Regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff
face=Arial>Arnd</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=de align=left>
<HR>
<FONT face=Tahoma><B>Von:</B> <A
href="mailto:openlayers-users-bounces@lists.osgeo.org"
target=_blank>openlayers-users-bounces@lists.osgeo.org</A> [mailto:<A
href="mailto:openlayers-users-bounces@lists.osgeo.org"
target=_blank>openlayers-users-bounces@lists.osgeo.org</A>] <B>Im Auftrag von
</B>Niccolò Dal Santo<BR><B>Gesendet:</B> Freitag, 19. September 2014
23:11<BR><B>An:</B> Mark Prins<BR><B>Cc:</B>
openlayers-users<BR><B>Betreff:</B> Re: [OpenLayers-Users] Showing points from
a database<BR></FONT><BR></DIV>
<DIV>
<DIV class=h5>
<DIV></DIV>
<DIV dir=ltr>Thank you very much for your answer. I have therefore started to
investigate the possiblity to use the GeoJSON format, and now I am trying to
train with this format with this example but it doesn't work
<DIV><BR></DIV>
<DIV>
<DIV> <script type="text/javascript"></DIV>
<DIV><BR></DIV>
<DIV> var map = new OpenLayers.Map("my_map");<BR></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> var citiesLayer = new OpenLayers.Layer.Vector("World Cities
(GeoJSON)", <BR></DIV>
<DIV> { protocol: new
OpenLayers.Protocol.HTTP({</DIV>
<DIV> url: "<A
href="http://localhost/openlayers/world_cities.json"
target=_blank>http://localhost/openlayers/world_cities.json</A>",</DIV>
<DIV> format: new
OpenLayers.Format.GeoJSON()</DIV>
<DIV> }),</DIV>
<DIV> strategies: [</DIV>
<DIV> new
OpenLayers.Strategy.Fixed(), </DIV>
<DIV> new
OpenLayers.Strategy.Cluster({distance: 15})</DIV>
<DIV> ]</DIV>
<DIV> });</DIV>
<DIV> map.addLayer(citiesLayer);</DIV>
<DIV></script></DIV></DIV>
<DIV><BR></DIV>
<DIV>In order to make the protocol work I have installed nginx on my laptop
and the url correctly points to the file world_cities.json in my browser.
Anyway this example doesn't work, any idea why?</DIV>
<DIV><BR></DIV>
<DIV>Thanks! </DIV>
<DIV>Niccolò</DIV></DIV>
<DIV class=gmail_extra><BR>
<DIV class=gmail_quote>2014-09-19 15:54 GMT+02:00 Mark Prins <SPAN
dir=ltr><<A href="mailto:mc.prins@gmail.com"
target=_blank>mc.prins@gmail.com</A>></SPAN>:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>using plain text or (geo) json is much less error prone
than using<BR>GML, and probably gives better performance<BR>
<DIV>
<DIV><BR>2014-09-19 15:45 GMT+02:00 Niccolò Dal Santo <<A
href="mailto:ncl.dalsanto@gmail.com"
target=_blank>ncl.dalsanto@gmail.com</A>>:<BR>> Hi
there,<BR>><BR>> I am new of Openlayers and I need to show some points
that come from a<BR>> database on a map centred in Turin (Italy), with
some information related to<BR>> this point (for instance an image).
Searching on line I have found that<BR>> Openlayers supports many formats
of data like GML, KML, GeoJSON and many<BR>> others. Could you suggest a
format useful fror my problem and maybe some<BR>> examples of how to use
it?<BR>><BR>> I have tried with this code generating a map of europe,
but it doesn't work<BR>><BR>> <html><BR>>
<head><BR>> <title>Prova
GML</title><BR>> <script src="<A
href="http://openlayers.org/api/OpenLayers.js"
target=_blank>http://openlayers.org/api/OpenLayers.js</A>"></script><BR>>
</head><BR>> <body><BR>>
<div id="ch3_gml" style="width: 100%; height:
100%;"></div><BR>><BR>> <script
type="text/javascript"><BR>><BR>>
// Create the map using the specified DOM element<BR>>
var map = new
OpenLayers.Map("ch3_gml");<BR>><BR>>
var layer = new OpenLayers.Layer.OSM("OpenStreetMap");<BR>>
map.addLayer(layer);<BR>><BR>>
map.addControl(new
OpenLayers.Control.LayerSwitcher());<BR>>
map.setCenter(new OpenLayers.LonLat(0,0), 2);<BR>><BR>>
map.addLayer(new OpenLayers.Layer.Vector("Europe
(GML)", {<BR>> protocol:
new OpenLayers.Protocol.HTTP({<BR>>
url: "./europe.gml",<BR>>
format: new
OpenLayers.Format.GML()<BR>>
}),<BR>> strategies:
[new OpenLayers.Strategy.Fixed()]<BR>>
}));<BR>> </script><BR>>
</body><BR>> </html><BR>><BR>> where europe.gml is a
gml file in the same folder of this script, but<BR>> nothing
happens.<BR>><BR>> Thank you very much for your help!<BR>><BR>>
Regards<BR>><BR>> Niccolò<BR>><BR>> --<BR>> Niccolò Dal
Santo<BR>> <A href="tel:%2B39%20342%2015%2070%20842" target=_blank
value="+393421570842">+39 342 15 70 842</A><BR>> <A
href="mailto:ncl.dalsanto@gmail.com"
target=_blank>ncl.dalsanto@gmail.com</A><BR>><BR></DIV></DIV>>
_______________________________________________<BR>> Users mailing
list<BR>> <A href="mailto:Users@lists.osgeo.org"
target=_blank>Users@lists.osgeo.org</A><BR>> <A
href="http://lists.osgeo.org/mailman/listinfo/openlayers-users"
target=_blank>http://lists.osgeo.org/mailman/listinfo/openlayers-users</A><BR><SPAN><FONT
color=#888888><BR><BR><BR>--<BR>Disclaimer;<BR>This message is just a
reflection of what I thought at the time of<BR>sending. The message may
contain information that is not intended for<BR>you or that you don't
understand.<BR>_______________________________________________<BR>Users
mailing list<BR><A href="mailto:Users@lists.osgeo.org"
target=_blank>Users@lists.osgeo.org</A><BR><A
href="http://lists.osgeo.org/mailman/listinfo/openlayers-users"
target=_blank>http://lists.osgeo.org/mailman/listinfo/openlayers-users</A></FONT></SPAN></BLOCKQUOTE></DIV><BR><BR
clear=all>
<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><BR><BR></DIV></DIV>
<HR
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BACKGROUND-COLOR: #b0b0b0; MIN-HEIGHT: 1px; WIDTH: 99%; COLOR: #909090; BORDER-TOP: medium none; BORDER-RIGHT: medium none">
<TABLE
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-COLLAPSE: collapse; BORDER-TOP: medium none; BORDER-RIGHT: medium none">
<TBODY>
<TR>
<TD
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0px; PADDING-LEFT: 8px; PADDING-RIGHT: 15px; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0px"><A
href="http://www.avast.com/" target=_blank><IMG border=0
src="http://static.avast.com/emails/avast-mail-stamp.png" NOSEND="1">
</A></TD>
<TD>
<P
style="FONT-FAMILY: 'Calibri','Verdana','Arial','Helvetica'; COLOR: #3d4d5a; FONT-SIZE: 12pt">Diese
E-Mail ist frei von Viren und Malware, denn der <A
href="http://www.avast.com/" target=_blank>avast! Antivirus</A> Schutz
ist aktiv. </P></TD></TR></TBODY></TABLE><BR></DIV></BLOCKQUOTE></DIV><BR><BR
clear=all>
<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>
<br /><br />
<hr style='border:none; color:#909090; background-color:#B0B0B0; height: 1px; width: 99%;' />
<table style='border-collapse:collapse;border:none;'>
<tr>
<td style='border:none;padding:0px 15px 0px 8px'>
<a href="http://www.avast.com/">
<img border=0 src="http://static.avast.com/emails/avast-mail-stamp.png" />
</a>
</td>
<td>
<p style='color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helvetica"; font-size:12pt;'>
Diese E-Mail ist frei von Viren und Malware, denn der <a href="http://www.avast.com/">avast! Antivirus</a> Schutz ist aktiv.
</p>
</td>
</tr>
</table>
<br />
</BODY></HTML>