<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<blockquote cite="mid:1329737439879-4487467.post@n6.nabble.com"
type="cite">
<pre wrap="">
Thank you I got that.
but now I'm confused, when will this func be called ?
// called when features are fetched
function loadFeatures(data) {
var features = new OpenLayers.Format.GeoJSON().read(data);
states.addFeatures(features);</pre>
</blockquote>
This refers to the CQL_Filter example. If you look at the html, you
will see that it loads the wfs via jsonp with this script insertion:<br>
<pre id="line50"> <<span class="start-tag">script</span><span class="attribute-name"> src</span><span>="</span><a href="view-source:http://demo.opengeo.org/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&typename=topp:states&outputFormat=json&format_options=callback:loadFeatures">http://demo.opengeo.org/geoserver/wfs?service=WFS&amp;version=1.0.0&amp;request=GetFeature&amp;typename=topp:states&amp;outputFormat=json&amp;format_options=callback:loadFeatures</a><span>" </span><span class="attribute-name">type</span>=<span class="attribute-value">"text/javascript"</span>></<span class="end-tag">script</span>>
after the cql-format.js script.
If you are loading your data via geojson, you need this kind of mechanism to beat cross-domain ajax
prohibitions in browsers. However, depends on how and where you get the vector data. See other vector demos for alternatives.
</pre>
<br>
<p><span style="font-family:'Arial';font-size:8pt; color:#000000;">Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.</span></p>
<p><span style="font-family:'Arial';font-size:8pt; color:#000000;"> </span></p></body>
</html>