Hi,
Im extended VectorLayer and fixed the large processor usage as told on
other posts in this forum. But there is a memory issue that Im
debugging and cant find where it is happening. On zoom level 9
( maxResolution/Math.pow(2,9) ) the memory increases 500mb after
redraw. If you change the zoom level it releases imediately the
memory. I know that it has something to do with redraw, but the
problem is not there. My feature only has 2 points, cause when I add a
third point in Tokyo, and zoom to level 9 zoom, the flash pluggin
breaks. My code is below, any tip to where the memory problem is
happening will be a great deal. Thanks in advance!
var style:Style = new Style();
style.rules.push(new Rule());
(style.rules[0] as Rule).symbolizers.push(new PointSymbolizer(new
WellKnownMarker(WellKnownMarker.WKN_SQUARE,new
SolidFill(0xFF9900,0.5),new Stroke(0xFF9900,2),10)));
var featureLayer:OSVectorLayer = new OSVectorLayer("MyPoints");
featureLayer.projection = EPSG_4326;
map.addLayer(featureLayer);
var geomPoint:org.openscales.geometry.Point;
//MT
geomPoint = new org.openscales.geometry.Point(-56.0852417369095,
-15.5959780446607);
geomPoint.projection = EPSG_4326;
featureLayer.addFeature(new PointFeature(geomPoint,null,style));
//NY
geomPoint = new org.openscales.geometry.Point(-74.0061344408378,
40.7133534576121);
geomPoint.projection = EPSG_4326;
featureLayer.addFeature(new PointFeature(geomPoint,null,style));
//My custom VectorLayer
package com.openscales
{
import org.openscales.core.layer.VectorLayer;
import org.openscales.core.layer.osm.OSM;
public class OSVectorLayer extends VectorLayer
{
public function OSVectorLayer(name:String)
{
super(name);
}
override public function redraw(fullRedraw:Boolean=false):void{
if (fullRedraw || _centerChanged || _projectionChanged ||
_projectionChanged){
super.redraw(fullRedraw);
}
}
override public function clear():void{
this._centerChanged = false;
this._resolutionChanged = false;
this._projectionChanged = false;
super.clear();
}
}
}