internet explorer - Exception when I initialize a map with a vector layer in IE 8 -
i'm trying add together icon on openlayers 3 map noticed code doesn't work in ie 8.
here's code :
var vectorsource = new ol.source.vector({ //create empty vector }); var iconfeature = new ol.feature({ geometry: new ol.geom.point(ol.proj.transform([longitude,lat], 'epsg:4326', 'epsg:3857')), name: 'null island ', population: 4000, rainfall: 500 }); vectorsource.addfeature(iconfeature); //create style var iconstyle = new ol.style.style({ image: new ol.style.icon(({ anchor: [0.5, 46], anchorxunits: 'fraction', anchoryunits: 'pixels', opacity: 0.75, src: 'http://ol3js.org/en/master/examples/data/icon.png' })) }); //add feature vector layer vector, , apply style whole layer var vectorlayer = new ol.layer.vector({ source: vectorsource, style: iconstyle }); map = new ol.map({ layers: [ new ol.layer.tile({ source: new ol.source.osm() }) , vectorlayer ], view: new ol.view2d({ center: ol.proj.transform([longitude, lat], 'epsg:4326', 'epsg:3857'), zoom: 12 }), target: 'map' }); there's no exception when don't utilize vectorlayer during map initialization map centered 30km beside should , zoom effect doesn't work well.
the exception @ line 2421 of uncompressed ol.js. goog.asserts.enable_asserts equals true
goog.asserts.fail = function(opt_message, var_args) { if(goog.asserts.enable_asserts) { throw new goog.asserts.assertionerror("failure" + (opt_message ? ": " + opt_message : ""), array.prototype.slice.call(arguments, 1)); } }; question 1
does openlayers 3 supports ie 8?
on website mention back upwards less capable browsers
promises bring 3d capabilities , increased performance mapping needs latest browsers. openlayers 3.0 offer webgl, while degrading nicely in less capable browsers.
question 2
is there easy prepare avoid exception. don't mind zoom effect long icon shows @ place.
i utilize f12 tool in ie tests , set document mode , user agent string ie 8
thank you
reading thread, http://boundlessgeo.com/2012/06/visions-for-openlayers-3/, written 1 of main openlayers developers, sounds there intention back upwards dom based rendering older browsers. however, reading one, http://comments.gmane.org/gmane.comp.gis.openlayers.devel.ol3/952, or one, http://permalink.gmane.org/gmane.comp.gis.openlayers.devel.ol3/984, posted on year later, sounds no longer case because of versions of ie before 9 not supporting svg/canvas.
in openlayers 2, ie back upwards older browsers done via vml , 1 of parts of code base of operations there browser detection. grepped ol3 code base of operations , there no mention of vml, rule out polygon rendering in ie versions less 9.
openlayers 3 clean break openlayer 2 , reasonable development effort beingness focussed on webgl renderers , 3d capabilities in open source development environment, without unlimited funds. openlayer 2 go on work in future browsers , has big install , non-trivial upgrade path, survive time.
ultimately, best reply openlayers mailing list or on #openlayers.
internet-explorer openlayers openlayers-3
No comments:
Post a Comment