Why do this the hard way? Mapserver now can generate KML output.<br>Just create a KMLLayer on google maps API an it will do all for you.<br><br>The KMLlayer do the ajax request for you, setup the click handler on Map, setup the infoWindow events all in a two line call, support all simple features geometry types for vector data.<br>
<br>On mapserver side, setup the kml layer, bind an attribute to the kml name attribute that will de the infowWindow header.<br>For additional text on info window you can instruct mapserver to assembly an HTML template to the kml description attribute.<br>
? Can someone put an layer example for this case ?<br><br>Check out KML sample builder for details<br><a href="http://kml-samples.googlecode.com/svn/trunk/interactive/index.html">http://kml-samples.googlecode.com/svn/trunk/interactive/index.html</a><br>
<br>and Mapserver<br><a href="http://mapserver.org/output/kml_output.html">http://mapserver.org/output/kml_output.html</a><br><br>and Maps API KML<br><a href="http://code.google.com/intl/pt-BR/apis/maps/documentation/javascript/reference.html#KmlLayer">http://code.google.com/intl/pt-BR/apis/maps/documentation/javascript/reference.html#KmlLayer</a><br>
<br>If mapserver options do not meet your requires is very easy to create KML without Mapserver at all.<br>The problem now is turning into to force mapserver do what google requires.<br>If mapserver is becoming hard to do it, you make your logic without it.<br>
<br><br><div class="gmail_quote">2011/9/12 Steve Lime <span dir="ltr">&lt;<a href="mailto:sdlime@gmail.com">sdlime@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The forward could be to a JavaScript file with an empty object. Browser should follow ok...<br>
<br>
Sent from my iPad<br>
<div><div></div><div class="h5"><br>
On Sep 11, 2011, at 4:58 PM, Mr. Puneet Kishor &lt;<a href="mailto:punk.kish@gmail.com">punk.kish@gmail.com</a>&gt; wrote:<br>
<br>
&gt;<br>
&gt; On Sep 11, 2011, at 4:18 PM, Steve Lime wrote:<br>
&gt;<br>
&gt;&gt; You could try the web object and the empty parameter.<br>
&gt;<br>
&gt;<br>
&gt; From TFM<br>
&gt;<br>
&gt; EMPTY [url]<br>
&gt; URL to forward users to if a query fails. If not defined the value for ERROR is used.<br>
&gt;<br>
&gt;<br>
&gt; Hmmmm... I am not sure I want to forward the user to any URL. This is all Ajax, so I have to receive an empty data structure. I guess I could try exploiting the jQuery `$.ajax({ error: function() { popup an infowindow with regrets message } });`<br>

&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Sent from my iPad<br>
&gt;&gt;<br>
&gt;&gt; On Sep 11, 2011, at 1:33 PM, &quot;Mr. Puneet Kishor&quot; &lt;<a href="mailto:punk.kish@gmail.com">punk.kish@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Sep 11, 2011, at 12:46 PM, Steve Lime wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Sent from my iPad<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Sep 11, 2011, at 9:36 AM, Mr. Puneet Kishor &lt;<a href="mailto:punk.kish@gmail.com">punk.kish@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Partial solution (phew, for now), but other problems persist --<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ..<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; One issue I have not solved -- if no result is found, MapServer sends back the following --<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; ----<br>
&gt;&gt;&gt;&gt;&gt; &lt;HTML&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &lt;HEAD&gt;&lt;TITLE&gt;MapServer Message&lt;/TITLE&gt;&lt;/HEAD&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &lt;!-- MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=GEOS INPUT=POSTGIS INPUT=GDAL INPUT<br>

&gt;&gt;&gt;&gt;&gt; =SHAPEFILE --&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &lt;BODY BGCOLOR=&quot;#FFFFFF&quot;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; msQueryByPoint(): Search returned no results. No matching record(s) found.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; &lt;/BODY&gt;&lt;/HTML&gt;<br>
&gt;&gt;&gt;&gt;&gt; ----<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Well, that gums up the works. I really want MapServer to just send an empty JSON structure, something like foo({}). Suggestions on how I can prevent this HTML message from MapServer, and force it to use the template instead?<br>

&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Any suggestion for the above? That is, force MapServer to not send back an error message of the above kind. Instead, send back an empty JSON structure based on the template?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Puneet.<br>
&gt;<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</div></div></blockquote></div><br>