[ka-Map-users] xmloverlay error BrowserIdent_setCanvasHW
Antonio P. Dinoy Jr.
jundinoy at yahoo.com
Thu Aug 25 04:20:34 EST 2011
Dear All,
I got this problem: Error: uncaught exception: [Exception... "Component returned failure code: 0x8007000e (NS_ERROR_OUT_OF_MEMORY) [nsIDOMHTMLCanvasElement.height]" nsresult: "0x8007000e (NS_ERROR_OUT_OF_MEMORY)" location: "JS frame :: http://localhost/bma/kamap/htdocs/XMLOverlay/kaXmlOverlay.js :: _BrowserIdent_setCanvasHW :: line 1551" data: no]
the line xmloverlay are not shown when zoomed at the last scale of the map using this following scales ('scales' => array( 4,3,2,1,0.5,0.1,0.08,0.06,0.05,0.04,0.02,0.01 ), and ESPG 4326.
using this algorithm:
function hiliteLine(retval){
//alert(retval);
if (retval!=null){
var a=retval.split('|');
var aPoints = new Array();
for (p=0;p<a.length;p++){
var b=a[p].split(',');
aPoints[p] = new Array(parseFloat(b[0]),parseFloat(b[1]),p);
}
//the function
if (
myXmlOverlay!=null){myXmlOverlay.remove();myXmlOverlay=null;}
printFlaglets (aPoints[0][0],aPoints[0][1],aPoints[aPoints.length-1][0],aPoints[aPoints.length-1][1]);
myXmlOverlay = new kaXmlOverlay( myKaMap, 510);
var line =null;
var coordinates = "";
//xmlOverlayUseCanvas = false;//disable canvas use for
any compatibility problem
for(i=0;i<aPoints.length;i++){
var latitude = aPoints[i][0];
var longuitude = aPoints[i][1];
var pointId =
i;
var my_point =myXmlOverlay.addNewPoint(pointId, longuitude, latitude);
/*var my_symbol = new kaXmlSymbol();
my_symbol.size = 12;
my_symbol.color = '#ff0000';
//my_point.setInnerHtml(aPoints[i][2]);
my_point.onmouseover = myPointClicked;
my_point.addGraphic(my_symbol);*/
if (i>0) coordinates += ",";
coordinates += longuitude + " " + latitude;
}
my_point = myXmlOverlay.addNewPoint("Line",longuitude, latitude);
alert(coordinates);
line = new kaXmlLinestring(my_point);
line.readCoordinates(my_point, coordinates);
line.color = 'red';
line.stroke = 4;
line.opacity=0.5;
my_point.addGraphic(line);
/*my_point = myXmlOverlay.addNewPoint("myPoly",longuitude, latitude);
poly = new kaXmlPolygon(my_point);
poly.readCoordinates(my_point, coordinates);
poly.color = 'green';
my_point.addGraphic(poly);*/
}
}
map:
MAP
NAME mainmap
# EXTENT [minx] [miny] [maxx] [maxy].
# EXTENT -137138 586244 1618910 2308935
EXTENT 100 13.45 101.32 13.99
#83.49609375 1.1864386394452024 118.5205078125 21.3303150734318
FONTSET
../etc/fonts.txt
IMAGECOLOR 139 166 188
INTERLACE TRUE
SYMBOLSET ../etc/symbols.sym
SHAPEPATH "../data"
IMAGETYPE png
INTERLACE OFF
OUTPUTFORMAT
NAME aggpng
DRIVER AGG/PNG
MIMETYPE "image/png"
## transparency only with RGBA Image Mode
## mapserver had to be compiled -with-experimental-png
IMAGEMODE RGBA
EXTENSION "png"
FORMATOPTION "QUANTIZE_FORCE=ON"
FORMATOPTION "QUANTIZE_COLORS=256"
FORMATOPTION "QUANTIZE_NEW=ON"
TRANSPARENT ON
end
OUTPUTFORMAT
NAME "png"
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE RGB
FORMATOPTION INTERLACE=OFF
TRANSPARENT OFF
EXTENSION "png"
END
OUTPUTFORMAT
NAME "png8"
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE
PC256
FORMATOPTION INTERLACE=OFF
TRANSPARENT OFF
EXTENSION "png"
END
OUTPUTFORMAT
NAME "jpeg"
DRIVER "GD/JPEG"
MIMETYPE "image/jpeg"
IMAGEMODE RGB
FORMATOPTION "QUALITY=70"
EXTENSION "jpg"
END
#
# Image formats for AGG
#
# OUTPUTFORMAT ### 24 bit PNG
# NAME 'agg_png'
# DRIVER AGG/PNG
# IMAGEMODE RGB
# END
# OUTPUTFORMAT ### 32 bit PNG with alpha channel from transparency
# NAME 'agg_pnga'
# DRIVER AGG/PNG
# IMAGEMODE RGBA
# END
# OUTPUTFORMAT ### 8 bit PNG
# NAME 'agg_png8'
# DRIVER AGG/PNG
# IMAGEMODE RGB
# FORMATOPTION "QUANTIZE_FORCE=ON"
# FORMATOPTION "QUANTIZE_DITHER=OFF"
# FORMATOPTION "QUANTIZE_COLORS=256"
# END
# OUTPUTFORMAT
# NAME 'agg_jpeg'
# DRIVER AGG/JPEG
# IMAGEMODE RGB
# END
OUTPUTFORMAT
NAME GTiff
DRIVER "GDAL/GTiff"
MIMETYPE "image/tiff"
IMAGEMODE RGB
#FORMATOPTION "TFW=YES"
#FORMATOPTION "COMPRESS=PACKBITS"
EXTENSION "tif"
END
OUTPUTFORMAT
NAME imagemap
MIMETYPE "text/html"
FORMATOPTION SKIPENDTAG=OFF
DRIVER imagemap
END
SIZE 800 525
STATUS ON
TRANSPARENT TRUE
UNITS METERS
#PROJECTION
#"init=epsg:4326"
#"proj=longlat"
#"datum=WGS84"
#"ellps=WGS84"
#"no_defs"
#END
PROJECTION
"init=epsg:4326"
END
WEB
IMAGEPATH "/ms4w/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
END
REFERENCE
COLOR -1 -1 -1
EXTENT 91.87 4.57 112.01 21.73
# 83.49609375 1.1864386394452024 118.5205078125 21.3303150734318
IMAGE "images/reference.png"
OUTLINECOLOR 0 0 0
SIZE 120 90
STATUS ON
END
LEGEND
KEYSIZE 18 12
LABEL
TYPE BITMAP
SIZE MEDIUM
COLOR 0 0 89
END
STATUS OFF
END
SCALEBAR
STATUS off
TRANSPARENT off
INTERVALS 4
SIZE 200 3
UNITS meters
COLOR 250 250 250
OUTLINECOLOR 0 0 0
BACKGROUNDCOLOR 100 100 100
STYLE 0
POSTLABELCACHE true
LABEL
COLOR 0 0
90
#OUTLINECOLOR 200 200 200
SIZE small
END # Label
END # Reference
QUERYMAP
STYLE HILITE
COLOR 0 0 0
END
SYMBOL
NAME 'circle'
TYPE ELLIPSE
POINTS 1 1 END
FILLED TRUE
END
############
#/////////////////province here
LAYER
NAME "province"
group "province"
# CONNECTION "user=postgres dbname=rpmsii host=localhost port=5432 password=dohtu"
# CONNECTIONTYPE POSTGIS
# DATA "the_geom from province using unique gid using srid=4326"
DATA province
#PROJECTION
#"init=epsg:32647"
#"proj=utm"
#"zone=47"
#"a=6377276.345"
#"b=6366075.41314024"
#"units=m"
#"no_defs"
# END
METADATA
"DESCRIPTION" "Thailand Provinces"
"RESULT_FIELDS" "province_name_t area prov_code"
END
TYPE POLYGON
STATUS ON
#LabelItem "province_name_t"
CLASSITEM "gid"
CLASS
EXPRESSION "1"
TEMPLATE "parks.html"
NAME "31"
METADATA
END
STYLE
ANGLE 360
COLOR 206 254 135
OUTLINECOLOR 0 0 0
SIZE 1
SYMBOL 0
END
END
.....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20110825/c6a4ffd9/attachment.htm
More information about the ka-Map-users
mailing list