[OpenLayers-Users] Show polygon vectors as points
acangi
aca at ngi.be
Thu Apr 29 10:03:44 EDT 2010
OK, I was able to see the marker locally also.
To do it, I modified the function
OpenLayers.Renderer.Elements.drawGeometry(geometry, style, featureId) :
...
if (style.display != "none") {
if (!style.strokeColor && !style.fillColor && (geometry.CLASS_NAME !=
"OpenLayers.Geometry.Point" )) {
var centerLonLat = geometry.getBounds().getCenterLonLat();
geometry = new OpenLayers.Geometry.Point(centerLonLat.lon,
centerLonLat.lat);
}
...
The code is taken from
http://trac.openlayers.org/browser/sandbox/topp/almanac/lib/OpenLayers/Renderer/Elements.js?rev=6996
Now I'd prefer to override the method instead of writing in OL's code. I'm
trying with
OpenLayers.Renderer.Elements.prototype.drawGeometry = function(geometry,
style, featureId) {
... complete code of the function, including the modification...
}
but the override isn't taken into account : the result depends on what is
written in the base class. Any clue why my override isn't working ?
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Show-polygon-vectors-as-points-tp1829267p4980142.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list