New answers tagged html
You can switch to infoformat=application/json so you will get a json response from Geoserver. Then just check how many features are returned and if features.length>0 is true show the popup otherwise not. For this solution you will have to create a table from the json-response. You could do something like that: set infoformat in your ...
You need to call setVisibility(true/false) on the layer. setVisibility All you are doing in your code is changing the value of static variables. This will not trigger any action on the layer. In your checkbox handler, you need to get a reference to the layer and change the visibility: triangleLayer1.setVisibility(value);
When you're adding one layer, as you're doing, the map triggers the layer-add event. When adding a list of layers through map.addLayers(), it triggers the layers-add-result event. If you know you're going to be adding more layers, and want to use the map.addLayers() method to load them all at once, then you can do as Dan suggested: ...
Since you are listening for the layers-add-result event, you need to add layers with the addLayers method (not addLayer). So change this: map.addLayer(wmsLayer) To this: map.addLayers([wmsLayer])
I contacted Esri tech support about this question. They reminded me that the setExtentfunction takes two input variables: setExtent(extent, fit?). The fit variable is set to false by default, but according to the function documentation, it guarantees any map with tiled map service layers will "fit" on the screen. So, I have been able to fix this issue ...
Top 50 recent answers are included