I have been trying to use a public WFS service NZ Street Address Web Services and API Availability | LINZ Data Service .
My main objective is to display some point of this service on my WAB developer edition, based on bounding box using Javascript.
I have achieve to display the data on my map but the custom parameters seems completely ignored.
Here is the link from LINZ which provide a parameter to set a bounding box. https://www.linz.govt.nz/data/linz-data-service/guides-and-documentation/wfs-spatial-filtering
If i only use my browser the custom parameter from LINZ works perfectly :
http://data.linz.govt.nz/services;key="the key that you can generate easily on the linz website"/wfs?service=WFS&version=2.0.0&request=GetFeature&typeNames=layer-53353&cql_filter=bbox(shape,42.436793,173.634652,-42.384224,173.727006)
I also have tried to add this custom parameter "cql_filter=bbox(shape,42.436793,173.634652,-42.384224,173.727006) " in Arcgis Online map viewer too (when added "layer from web" -> "WFS OGC web service") but it's ignored so the output data are not limited by this bounding box.
I have been stuck on this problem for a while now, please if someone has a solution or has already done something similar your help will be much appreciated.
My JS looks like this :
esriConfig<SPAN class="punctuation token">.</SPAN>defaults<SPAN class="punctuation token">.</SPAN>io<SPAN class="punctuation token">.</SPAN>corsEnabledServers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">push</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"data.linz.govt.nz"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">// supports CORS</SPAN>
<SPAN class="keyword token">var</SPAN> url <SPAN class="operator token">=</SPAN> <SPAN class="string token"><SPAN>"</SPAN><A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdata.linz.govt.nz%2Fservices%3Bkey%3D" target="_blank">https://data.linz.govt.nz/services;key=</A><SPAN>"</SPAN></SPAN>the key that you can generate easily on linz website<SPAN class="string token">"/wfs?REQUEST=GetFeature&typeNames=layer-53353&BBOX(shape,-36.764156,174.975230,-36.817467,175.023120)"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> opts <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN>
customParameters <SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN><SPAN class="string token">"cql_filter"</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="string token">"bbox(shape,-36.764156,174.975230,-36.817467,175.023120)"</SPAN><SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
url<SPAN class="punctuation token">:</SPAN> url<SPAN class="punctuation token">,</SPAN>
version<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"2.0.0"</SPAN><SPAN class="punctuation token">,</SPAN>
name<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"layer-53353"</SPAN><SPAN class="punctuation token">,</SPAN>
wkid<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">4326</SPAN><SPAN class="punctuation token">,</SPAN>
maxFeatures<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1000</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> mylayer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">WFSLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
mylayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">fromJson</SPAN><SPAN class="punctuation token">(</SPAN>opts<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> symbol <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SimpleMarkerSymbol</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">setColor</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">esri<SPAN class="punctuation token">.</SPAN>Color</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">255</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="number token">0.5</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> renderer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SimpleRenderer</SPAN><SPAN class="punctuation token">(</SPAN>symbol<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
mylayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setRenderer</SPAN><SPAN class="punctuation token">(</SPAN>renderer<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">addLayer</SPAN><SPAN class="punctuation token">(</SPAN>mylayer<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>