Adrian,<br><br>Thanks a lot! (you&#39;ve also inadvertently answered another question of mine). I was considering trying to implement something similar, but with having php-reload the page on submit, thus changing the static GML resource when the page refreshed. I think the javascript option is a little bit more elegant and will probably work better with my page structure (I&#39;m switching the body html with a php array).<br>
<br>Essentially, I&#39;m re-writing one of the KML export tutorials off of the web, I&#39;ve fudged it for now with &#39;Content-type: application/<a href="http://opengis.net/gml+xml">opengis.net/gml+xml</a>&#39; which I&#39;m sure is wrong (I&#39;m going to test it today), so if someone has any experience with writing their own gml, or manipulating it I&#39;d also be very grateful for any suggestions on how to structure this bit here. <br>
<br>No, essentially, I don&#39;t expect particularly high-volume or prolonged use (I also don&#39;t have tons of features).<br><br><div class="gmail_quote">On Mon, Aug 3, 2009 at 10:29 AM, Adrian Popa <span dir="ltr">&lt;<a href="mailto:adrian_gh.popa@romtelecom.ro">adrian_gh.popa@romtelecom.ro</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


  

<div bgcolor="#ffffff" text="#000000">
Hello Nick,<br>
<br>
Here&#39;s some code - it&#39;s not complete - because it mostly lacks variable
definitions which should be globals. However, they should be easy to
add:<br>
<br>
<tt>//layer definition<br>
markers = new OpenLayers.Layer.Vector(&quot;Alarms&quot;, {<br>
                        projection: map.displayProjection, strategies:
[new OpenLayers.Strategy.BBOX()],<br>
                        protocol: new OpenLayers.Protocol.HTTP({ url:
&quot;kml_alarms.pl&quot;, format: new OpenLayers.Format.KML({ extractStyles:
true, extractAttributes: true })})}); <br>
        map.addLayer(markers);<br>
<br>
       //if you want to select the markers later, you will need to add
the necessary functions.<br>
        select = new OpenLayers.Control.SelectFeature(markers,
{toggle:true});<br>
        markers.events.on({ &quot;featureselected&quot;: onMarkerSelect,
&quot;featureunselected&quot;: onMarkerUnselect, &quot;visibilitychanged&quot;:
onMarkerToggle });<br>
        map.addControl(select);<br>
        select.activate();<br>
<br>
//.........<br>
// onSubmit: - layer is the layer variable, options are the options
packed as a JSON/javascript object. Call refreshLayer like:
refreshLayer(markers, options);<br>
<br>
function refreshLayer(layer, options){<br>
<br>
    if(options == null){<br>
        layer.refresh({force: true});<br>
    }<br>
    else{ <br>
        if(layer.CLASS_NAME == &quot;OpenLayers.Layer.Vector&quot;){<br>
            layer.protocol.options.params = options; //override the
parameters sent to kml_alarms.pl<br>
            layer.refresh({force: true});<br>
        }<br>
    }<br>
}<br>
</tt><br>
If you&#39;re using KML format, make sure your serverside script outputs
content-type application/vnd.google-earth.kml+xml. Something similar
should exist for GML.<br>
>From this code you&#39;re missing a function to pack the search form into
the &quot;options&quot; object. The object should look like: <br>
options[name] = value;<br>
options[name2] = value2;<br>
<br>
<br>
Good luck!<br>
Adrian.<br>
<br>
P.S. If you intent your application to run for hours and to
automatically refresh your POIs, you should consider doing a full page
reload from time to time so that IE won&#39;t eat all available memory...<div><div></div><div class="h5"><br>
<br>
<br>
Nick Kendall wrote:
<blockquote type="cite">
  <div>Adrian, I&#39;d love some code examples. I was toting with the idea
of a gml writing php function that re-writes a gml file on the server,
and reloading the pages on submit, thus changing the static resource
but your way sounds more elegant<br>
  <br>
Nicholas Efremov-Kendall 
  <div>(917) 399-6939</div>
  <div>Sent from my mobile device</div>
  </div>
  <div><br>
On Aug 3, 2009, at 9:50 AM, Adrian Popa &lt;<a href="mailto:adrian_gh.popa@romtelecom.ro" target="_blank">adrian_gh.popa@romtelecom.ro</a>&gt;
wrote:<br>
  <br>
  </div>
  <blockquote type="cite">
    <div>Hello,<br>
    <br>
I had a similar task - of showing dynamic POIs and I chose to implement
it like this:<br>
- a Vector layer with KML data. <br>
- the path to the KML file is actually a path to a serverside script
wich generates KMLs.<br>
- on searchbox submit a javascript creates new parameters for the
serverside script<br>
- I force a layer refresh<br>
    <br>
It works great - but it tends to crash Internet Explorer after a while
- because IE keeps deleted markers in memory (silly behaviour). You can
get around this by refreshing the whole page, but it&#39;s nasty.<br>
    <br>
Let me know if you need some code examples.<br>
Regards,<br>
Adrian<br>
    <br>
Nicholas Efremov-Kendall wrote:
    <blockquote type="cite">
      <div>Hi all,<br>
      </div>
      <div><br>
      </div>
      <div>I&#39;m still trying to make a dynamic POI, or marker, or points
layer, whatever you want to call it, that changes the points in the map
in response to user&#39;s searches. I can&#39;t use mapserver or a
pre-programmed server-side option, so I&#39;m forced to write my own gml or
wkt. I&#39;m still not quite sure how to get this GML to OL and then
replace it by the next search.</div>
      <div><br>
      </div>
      <div>I think there are two options. One of which would be to send
data to a markers layer and have JS write the markers out. The other
would be to have php re-write the gml file on the server and
theoretically, this should create a new set of points each time the
search is submitted. Not sure what the best/easiest option would be
with respect to coding (either on the browser or server-side) or from a
performance perspective. Does anyone have any recommendations? I&#39;m
basically copying a php/mysql kml tutorial and adapting it to GML (for
largely ideological reasons). I&#39;ve just re-read the GML documentation,
and it states that the GML is meant to only be loaded once, so should I
be focusing on a dynamic marker layer or what?</div>
      <div><br>
      </div>
      <div>In effect, all I really want is a simple ajax function to
load
the POI/markers that correspond to search criteria, such that every
search produces a unique (within a limited span of variation of
course). The maps centering won&#39;t really change, just the make up of
the sites displayed in the map. I can write the gml server side, and I
can send the request, but I&#39;m not sure what to do with the call-back or
how to feed that info to OL.�</div>
      <div><br>
      </div>
      <div>Thank you in advance for any advice/help.</div>
      <div>(incidentally, I&#39;d be willing to consider contracting
someone to
do this)</div>
      <div><br>
      </div>
      <div>best,</div>
      <div>Nick</div>
      <pre><hr width="90%" size="4"><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openlayers.org" target="_blank">Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
  </pre>
    </blockquote>
    <br>
    <br>
    </div>
  </blockquote>
</blockquote>
<br>
<br>
</div></div><pre cols="72">-- <br>--- <br>Adrian Popa<br>NOC Division<br>Network Engineer<br>Divizia Centrul National de Operare Retea<br>Departament Transport IP &amp; Metro<br>Compartiment IP Core &amp; Backbone<br>Phone: +40 21 400 3099<br>
</pre>
</div>

</blockquote></div><br>