Tag Info

New answers tagged

1

Here is what I do: In your GeoServer content.ftl file (explained here FTL), add a hidden list item like this: <li style="display:none";>popup</li> You can change the key word 'popup' to anything you like. You will be searching for this word in you popup javascript. This word will only appear in the getFeatureInfo request if there is a feature ...


1

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 ...


1

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);


2

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: ...


2

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])


1

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