<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle18
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body bgcolor=white lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>You could also create a simple CGI script
to produce a text file of markers from your database, which conformed to the
markers from text file example.  Below is the code that I use to do this in an example
based on markersTextLayer.html (in the OpenLayers examples folder).</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>First I changed the code in the OpenLayers
example file &#8220;markersTextLayer.html&#8221; to load my script file (a PHP
file, shown below)</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Change line in markersTextLayer.html demo </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>FROM:</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>var newl = new OpenLayers.Layer.Text(
&quot;text&quot;, {location: &quot;./textfile.txt&quot;} );</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>TO:</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>var newl = new OpenLayers.Layer.Text(
&quot;text&quot;, {location:
&quot;http://172.16.210.66/html/wms_maps/text.php&quot;} );</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>CONTENTS of text.php:</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&lt;?php</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>$connection = pg_connect(&quot;host=localhost
port=5432 dbname=wsp user=postgres password=topsecret&quot;);</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>$querystring = &quot;  select
\&quot;OWNNAME\&quot; as title, \&quot;FACILITY\&quot; as descrip, X(the_geom),
Y(the_geom) &quot;;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>$querystring .= &quot; from water_use_dd
limit 8 &quot;;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>$res = pg_query  ( $connection,
$querystring );</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>print(&quot;point&quot; . &quot;\t&quot; .
&quot;title&quot; . &quot;\t&quot; . &quot;description&quot; . &quot;\t&quot; .
&quot;icon&quot;);</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>while ($thisrec = pg_fetch_array($res)) {</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>   </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>   $x = $thisrec['x'];</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>   $y = $thisrec['y'];</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>   $title = $thisrec['title'];</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>   $descrip = $thisrec['descrip'];</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>   print(&quot;$y,$x&quot; . &quot;\t&quot;
. &quot;$title&quot; . &quot;\t&quot; . &quot;$descrip&quot; . &quot;\t&quot; .
&quot;&quot; . &quot;\n&quot;);</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>}</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>?&gt;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hope this helps,</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>r.b.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<div>

<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial'>Robert W. Burgholzer</span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial'>Surface Water Modeler</span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial'>Office of Water Supply and Planning</span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
  10.0pt;font-family:Arial'>Virginia</span></font><font size=2 face=Arial><span
 style='font-size:10.0pt;font-family:Arial'> </span></font><font size=2
  face=Arial><span style='font-size:10.0pt;font-family:Arial'>Department</span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> of
Environmental Quality</span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial'><a href="mailto:rwburgholzer@deq.virginia.gov">rwburgholzer@deq.virginia.gov</a></span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial'>804-698-4405</span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial'>Open Source Modeling Tools:</span></font></p>

<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial'><a href="http://sourceforge.net/projects/npsource/">http://sourceforge.net/projects/npsource/</a></span></font></p>

</div>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:windowtext'>-----Original
Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> users-bounces@openlayers.org
[mailto:users-bounces@openlayers.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Dipl. Inf. Carsten Eider<br>
<b><span style='font-weight:bold'>Sent:</span></b> </span></font><font size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
 color:windowtext'>Monday, February 18, 2008</span></font><font size=2
color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
color:windowtext'> </span></font><font size=2 color=black face=Tahoma><span
 style='font-size:10.0pt;font-family:Tahoma;color:windowtext'>11:58 AM</span></font><font
size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
color:windowtext'><br>
<b><span style='font-weight:bold'>To:</span></b> Eric Lemoine<br>
<b><span style='font-weight:bold'>Cc:</span></b> </span></font><font size=2
 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
 color:windowtext'>users@openlayers.org</span></font><font size=2 color=black
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:windowtext'><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [OpenLayers-Users]
Displaying Multiple Markers from Database</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt'>I have solved a similar
problem by abusing a GeoRSS-Layer.<br>
A servlet generated the required GeoRSS-Feed, it worked great.<br>
Unfortunatelay some of my feeds contained about 1000 items, where<br>
upto 4 feeds at one time where loaded.<br>
<br>
My local system sometimes broke down.<br>
<br>
Carsten<br>
<br>
Eric Lemoine schrieb: </span></font></p>

<pre style='margin-left:.5in' wrap=""><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt'>On </span></font>Feb 16, 2008 8:16 AM, schone <a href="mailto:prashant.g.raju@gmail.com">&lt;prashant.g.raju@gmail.com&gt;</a> wrote:</pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>  </span></font></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite><pre
style='margin-left:.5in' wrap=""><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>Hello all,</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>&nbsp;</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>New to OpenLayers but I think it is an amazing project!</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>So here is my situation...</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>I have around 200 long/lat in a database attached with unique locations.</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>(MySQL database)</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>I would like to display all these markers on the map using OpenLayers but</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>I'm finding it hard to display multiple markers.</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Has anyone got any good examples of working with Multiple Markers and MySQL</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>or an XML document?</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Thanks for the help!</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Kind Regards</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>Prashant</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>    </span></font></pre></blockquote>

<pre style='margin-left:.5in' wrap=""><font size=2 color=black
face="Courier New"><span style='font-size:10.0pt'>&nbsp;</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>Hi Prashant</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>&nbsp;</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>You'd need to have some software on the server side to extract the</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>data from your database and send it to the client. If I had to do</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>that, I'd implement a simple web sevice in Python that reads the</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>lon/lat's from the database and sends a JSON representation of this</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>data to the client. On the client side, I'd write code that requests</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>the data through </span></font>Ajax and uses OpenLayers to create and display a</pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>marker for each lon/lat in the response. This is just off the top of</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>my head...</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>&nbsp;</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>Cheers,</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>--</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>Eric</span></font></pre><pre style='margin-left:.5in'><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>_______________________________________________</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>Users mailing list</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><a href="mailto:Users@openlayers.org">Users@openlayers.org</a></span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'><a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a></span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>  </span></font></pre>

<p class=MsoNormal style='margin-left:.5in'><font size=3 color=black
face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
</span></font></p>

<pre style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>-- </span></font></pre><pre style='margin-left:.5in'><font
size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Mit freundlichen Grüßen / Yours faithfully</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>Carsten Eider</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Dipl. Inf. (FH)</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Kompetenzzentrum für Innovative Informationssysteme</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>c/o Fachhochschhule Bingen / University of applied sciences Bingen</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>&nbsp;</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>Berlinstraße 109</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>55411 Bingen</span></font></pre><pre style='margin-left:
.5in'><font size=2 color=black face="Courier New"><span style='font-size:10.0pt'>&nbsp;</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>Tel: +49 (0) 6721 / 409-179</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>Fax: +49 (0) 6721 / 409-158</span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>email: <a href="mailto:eider@fh-bingen.de">eider@fh-bingen.de</a></span></font></pre><pre
style='margin-left:.5in'><font size=2 color=black face="Courier New"><span
style='font-size:10.0pt'>Internet: iis.fh-bingen.de </span></font></pre></div>

</body>

</html>