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...
First you need to project your geographic coordinates to a cartesian 2D coordinate system, since affine transformations don't apply to geographic coordinate systems.
You can apply an affine transformation from control points or from transformation parameters. The QGIS plugin asks you transformation parameters, but it is much more common for a user to have control points.
From control points you can calculate transformation parameters. For an affine transformation there are 6 transformation parameters, so you need at least 3 control points (each control point implies 4 coordinates: Xsource, Ysource, Xtarget, Ytarget), but more control points are recommended to have redundancy and thus be able to apply Least Squares, which would give you an estimation of the transformation's quality. Remember that affine transformations can rotate, shift, scale (even applying different factors on each axis) and skew geometries.
Control points must have the form:
X SOURCE: Xs
Y SOURCE: Ys
X TARGET: Xt
Y TARGET: Yt
Parameters are:
a: Scale X
e: Scale Y
d: Rotation X
b: Rotation Y
c: Translation X
f: Translation Y
And we know:
Xt = X*a + Y*b + c
Yt = X*d + Y*e + f
So, you need to solve this system of equations (for 3 control points):
¦ Xs1 Ys1 1 0 0 0 ¦ | a ¦ ¦ Xt1 ¦
¦ Xs2 Ys2 1 0 0 0 ¦ ¦ b ¦ ¦ Xt2 ¦
¦ Xs3 Ys3 1 0 0 0 ¦ ¦ c ¦ = ¦ Xt3 ¦
¦ 0 0 0 Xs1 Ys1 1 ¦ ¦ d ¦ ¦ Yt1 ¦
¦ 0 0 0 Xs2 Ys2 1 ¦ ¦ e ¦ ¦ Yt2 ¦
¦ 0 0 0 Xs3 Ys3 1 ¦ ¦ f ¦ ¦ Yt3 ¦
Where parameters a, b, c, d, e, and f are unknown.
Once you calculate parameters a, b, c, d, e, and f, (for example with this online equation solver) place them into the QGIS plugin interface like this:
X' = a*x + b*y + c
Y' = d*x + e*y + f
or:
I think this solves your two questions.
Best Answer
No. Openlayers cannot warp your images. OpenLayers reprojection/transform support is for vectors only.
For a raster solution, you will need to do the processing on the server side. You will have to determine if performance is enough of an issue that you decide to pre-process the imagery. If you want to do it on the fly, you could use MapServer or another WMS server. If you pre-process them, you could use MapServer or another WMS server, or you could build up a tile cache.
Raster processing is fairly expensive. You essentially have to determine whether 'disk is cheap' or 'time is cheap'.