We have an application required to run on IE7 and we've encountered a problem with an event object passed into a function during a dojo.connect "onclick". evt.graphic.symbol.type is coming in as "not defined" in IE7, but works in Firefox. The code:dojo.connect(this.map,"onClick", function(evt) {if(evt.graphic.symbol.type == "textsymbol"){ // do something}else{ // do something else}});Should this work in IE7?
My guess is this is due to the fact that IE uses canvas and everything else uses SVG. if you alert evt.graphic.symbol i bet you get different results in IE and others. YOu will have to do a dojo.isIE<9 and trap for canvas element or check dojox.gfx.renderer==="vml" and then do your event.
if( evt.graphic.hasOwnProperty("symbol") && evt.graphic.symbol.hasOwnProperty("type") && evt.graphic.symbol.type == "textsymbol") { // do something } else { // do something else }
Ah, so IE7 is probably blowing up because it passes a different type of object there (VML vs Canvas). Did not expect it would be different. Your help is very much appreciated.
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.