arcgis works on IE but not Chrome/Firefox

3653
29
Jump to solution
09-03-2014 02:11 PM
NathanLindley
New Contributor

Map just keeps trying to load in Chrome/Firefox but works great in Internet Explorer...any ideas??

Using:

<script type="text/javascript" src="http://js.arcgis.com/3.10/"></script>

Thanks in advance for any suggestions!

0 Kudos
29 Replies
NathanLindley
New Contributor

So after a little more digging I did find an error:

I tried adding the following require but got the same error:

dojo.require("esri/symbols/SimpleMarkerSymbol")

This is my markerSymbol var:

var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 28, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([27, 236, 86]), 0.75), new dojo.Color([255, 0, 0, 0.30]));

0 Kudos
NathanLindley
New Contributor

Issue has been fixed by moving the variable declarations to after the dojo.AddOnLoad(init).  Not sure why this fixed it, but it is fixed.  Thanks for all of the suggestions!

Edit:  This is not the correct solution.  It just lets the maps load before the error occurs again and then the markers do not display.

0 Kudos
NathanLindley
New Contributor

Not trying to bump/whatever, just want to make sure people know this is not a solved issue.

Thanks for all of the help!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Nathan,

  Can you post your code or add it to a fiddle to have it reviewed for errors?

0 Kudos
NathanLindley
New Contributor

Robert,

I tried to do a jsfiddle which is Edit fiddle - JSFiddle but I am not sure how to load a public map in.

Basically this code is what is causing an error in firefox/chrome but works perfect in IE:

var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 28, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([27, 236, 86]), 0.75), new dojo.Color([255, 0, 0, 0.30]));

Error:

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Nathan,

  So you are using

var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 28, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([27, 236, 86]), 0.75), new dojo.Color([255, 0, 0, 0.30]));

and the correct object name is esri.symbols.SimpleMarkerSymbol

var markerSymbol = new esri.symbols.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 28, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([27, 236, 86]), 0.75), new dojo.Color([255, 0, 0, 0.30]));

0 Kudos
NathanLindley
New Contributor

I thought that might be an issue so I tried that before but didn't work.

When looking at the new way to do it, I noticed the format is a bit different with the require([]), etc.  But the scalebar works fine with the dojo.require("esri.dijit.Scalebar") so it doesn't really make sense for that to be the issue.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

The new way is called AMD and they way you currently have your app developed is called Legacy. You should definetly move your app to AMD. So from the fiddle it looks like you have your app in an ASPX page or something is this correct?

0 Kudos
NathanLindley
New Contributor

I had a feeling that was probably the way to go but just assumed there was an easier fix since it works fine in IE.

Yep, the map is being loaded via an aspx page and was designed by my predecessor thus my lack of knowledge of GIS programming.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Nathan,

   I am really not sure why is would working IE and not in other browsers. Is this site publicly accessible?

0 Kudos