<!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=296101617-21092014><FONT color=#0000ff
size=2 face=Arial>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296101617-21092014><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=296101617-21092014><FONT color=#0000ff
size=2 face=Arial>your map is in projection EPSG:900913 (OSM).
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296101617-21092014><FONT color=#0000ff
size=2 face=Arial>Are your data also in this projection or perhaps in EPSG:4326
(lonlat)?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296101617-21092014><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=296101617-21092014><FONT color=#0000ff
size=2 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 class=296101617-21092014><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=296101617-21092014><FONT color=#0000ff
size=2 face=Arial>Regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=296101617-21092014><FONT color=#0000ff
size=2 face=Arial>Arnd</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> openlayers-users-bounces@lists.osgeo.org
[mailto:openlayers-users-bounces@lists.osgeo.org] <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>
<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">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 class=h5><BR>2014-09-19 15:45 GMT+02:00 Niccolò Dal Santo <<A
href="mailto:ncl.dalsanto@gmail.com">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"
value="+393421570842">+39 342 15 70 842</A><BR>> <A
href="mailto:ncl.dalsanto@gmail.com">ncl.dalsanto@gmail.com</A><BR>><BR></DIV></DIV>>
_______________________________________________<BR>> Users mailing
list<BR>> <A
href="mailto:Users@lists.osgeo.org">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
class=HOEnZb><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">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 />
<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>