you can catch your opened(active) popup with this way:
map.popups[a]
you can change so update its content:
map.popups[a].contentHTML = 'Test Content';
map.popups[a].redraw();
or
map.popups[a].setContentHTML = 'Test Content'
you can show or hide your popup:
map.popups[a].show();
map.popups[a].hide();
you can update position of your popup:
map.popups[a].lonlat.lon = 10;
map.popups[a].lonlat.lat = 10;
map.popups[a].updatePosition();
for openlayers cluster you should check out Cluster Strategy Example here. Only one thing you should do is that define fillColor or externalGraphic for your cluster.
var style = new OpenLayers.Style({
pointRadius: "${radius}",
fillColor: "${getColor}",
fillOpacity: 0.8,
strokeColor: "#cc6633",
strokeWidth: 2,
strokeOpacity: 0.8
}, {
context: {
radius: function(feature) {
return Math.min(feature.attributes.count, 7) + 3;
},
getColor: function(feature) {
return // Your color selection logic;
}
}
});
As the last question, i dont understand very well what you want? but try to use removeFeatures instead of destroyFeatures....
i hope it helps you...
when u check out OpenLayers.Layer.WMS structure, you can see that it inherits from OpenLayers.Layer.Grid... and when looking at api, you can notice that spiralTileLoad() may help you about what you want...
from OpenLayers doc:
spiralTileLoad: function()
Starts at the top right corner of the grid and proceeds in a spiral
towards the center, adding tiles one at a time to the beginning of a
queue.
Once all the grid’s tiles have been added to the queue, we go back and
iterate through the queue (thus reversing the spiral order from
outside-in to inside-out), calling draw() on each tile.
code:
var wms = new OpenLayers.Layer.WMS("NASA Global Mosaic",
"http://wms.jpl.nasa.gov/wms.cgi",
{layers: "modis,global_mosaic"});
wms.spiralTileLoad();
wms.redraw();
or
map.layers[i].spiralTileLoad();
map.layers[i].redraw();
i hope it helps you...
Best Answer
Assuming that you mean to set the extent to the whole POI layer, then each layer has a function getExtent:
You can use getCenterLonLat to find the centre point of the bounds, and feed this to the map.setCenter function. Try something like this (not actually tested):