HI friends,
i have a big problem. I have the IE 8 VML error on VML.js.
I use the init function onload at body.
<body onload="mapInit()">
in my mapInit function i create my map object
map = new OpenLayers.Map('map', mapOptions);
then i create my lines layer
linesLayer = new OpenLayers.Layer.Vector("Lines", {...};
then i call my ajax loadLines() function
function loadLines(){
//check if document ready
$(document).ready(function() {
//jQuery ajax object
$.ajax({
url:"../ajax/ajax.php?ajax_load=lines",
// on success load maps
success: function(data) {
// parse maps to array
lines= JSON.parse(data);
// apply lines
// remove all lines on layer for a new reload
linesLayer.removeAllFeatures();
features=null;
//check if destroy needed ?
//linesLayer.destroyFeatures(features);
var features = new Array(lines.length);
for (var i=0; i<features.length; i++) {
features[i] = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.LineString([
//transform to EPSG
900913, set color
new
OpenLayers.Geometry.Point(lines[i]['x1'],lines[i]['y1']),
new
OpenLayers.Geometry.Point(lines[i]['x2'],lines[i]['y2'])
]),
{color:lines[i]['color']
}
);
}
linesLayer.addFeatures(features);
map.addLayer(linesLayer);
// refresh and redraw layer
linesLayer.redraw();
},
// show errors if loading success fail
error:function(xhr,err){
alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status);
alert("responseText: "+xhr.responseText);
}
});
});
}
but i can only see one line. Not more. Why not? It works well on all other
browsers.
Please help me! I doent know whats wrong.
Thanks for any advise,
Marcel
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/IE-VML-error-i-use-the-init-function-tp5880631p5880631.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users