Select to view content in your preferred language

IE 7 throws error, firefox does not

1707
20
11-15-2010 11:59 AM
TerryGiles
Occasional Contributor III
I have a series of anchor tags in a panel next to my map, each the name of a person.  The map contains just the ESRI street map service and points in the map's graphicslayer that are the person's location (not dynamic, just hard coded x,y). 

When you click one of the name <a> tags, it should zoom the map to their location and display the info window.  This works great in Firefox, but IE 7 does 2 things -
the graphics disappear from the map &
  if you try to pan the map or zoom out it throws an error about 'illegal string in Vector 2d' (see attached).

Any idea what's causing this and how to fix it (other than not using IE...)?

note - I added a demo version of html page to this post.  Try it in IE - click on Person 1 in the left and it will work.  Now click on Person 2 and you'll notice the graphic is gone and if you try to pan you'll get the error..  The Esri forums do not allow for uploading .htm files so rename it from .txt to .htm and give it a try.

Thanks, TG


sample html <a> tag -

<a href ='' title='some name' onclick='clickLink(1);return false;' >some name</a>



        //in my init function, the maps extent changed handler is set using 
        dojo.connect(map, 'onExtentChange', Extent_Change);

        function clickLink(id) {
            //generic handler for all of the links in the student list

            map.infoWindow.hide();

            var graphic;

            dojo.forEach(map.graphics.graphics, function (g) {
                if (g.attributes["ID"] == id)
                {
                    graphic = g;
                }
            });

            //tmpGraphic and bolClickLink are global in scope
            tmpGraphic = graphic;
            bolClickLink = true;
            map.centerAndZoom(graphic.geometry, map.getNumLevels()-3);
        }



        function Extent_Change(ext, delta, bolLevel,lod) {
            var e = new Object;

            if (bolClickLink) {
                e.graphic = tmpGraphic;
                e.screenPoint = map.toScreen(tmpGraphic.geometry);
                e.mapPoint = tmpGraphic.geometry;
                graphicClick(e);

            }

            bolClickLink = false;

        }

        function graphicClick(evt) {

            map.infoWindow.setTitle("Flat Stanley");
            map.infoWindow.setContent(evt.graphic.attributes["Name"] + "<br/>" + evt.graphic.attributes["Place"]);
            map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));

        }


0 Kudos
20 Replies
derekswingley1
Frequent Contributor II
Derek,
Also, if I understand correctly, you are defining a Local Coordinate Space (LCS), probably for a VML Group, that is only updated when the map level changes.

To clarify, we're talking about the coordinate space that VML sets up. Addressing this would probably require a patch at the dojox.gfx level.


Thanks again, I certainly understand that sometimes coding problems that sound easy can be very complicated.  I also know that VML is going away, but as I design web sites for the public, we still offer support back to IE6...

Wish I had a better workaround for you ... As an FYI, support for IE6 was dropped when version 2.0 of the API was released back in June 2010. Supported browsers listed here:  http://resources.arcgis.com/content/webapis/2.0/system-requirements


Finally, is there a place where "known workarounds" are compiled and officially posted?

Unfortunately, no. I'd like to say it's because scenarios like this aren't all that common :). The search function of these forums, as well as the folks who work in support are your best resources for workaround and fixes to common problems.
0 Kudos