reachalan / geoxml3

Automatically exported from code.google.com/p/geoxml3
0 stars 0 forks source link

KML Markers are not displayed in Internet Explorer #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Loading KML with markers with this method:

var geoXml = new geoXML3.parser({map: map});
geoXml.parse('file.kml');

displays the markers in all standard browsers (FF, Chrome, Opera, ...) but
not in Interent Explorer :-(

See:
http://perassi.org/quickhacks/gmaps3/
http://sterlingudell.com/geoxml3/overlay.html

What is the expected output? What do you see instead?
Displaying Markers - Not displaying Markers

What version of the product are you using? On what operating system?
Last SVN version, Windows XP

Please provide any additional information below.

Thank you, Jan

Original issue reported on code.google.com by pavelka....@gmail.com on 16 Feb 2010 at 1:31

GoogleCodeExporter commented 9 years ago
This ia also occuring with IE8 under Windows 7. It also causes the map window 
to jump
out to zoom 3 and show the whole world regardless of the centre and zoom 
options the
map was created with.

Another example of the problem:

http://vk5hz.com/sagrn/map/
http://vk5hz.com/sagrn/map/?nogeo

Original comment by daemond...@gmail.com on 18 Feb 2010 at 12:45

GoogleCodeExporter commented 9 years ago
Declare a global variable
var xhrText;

Down in the http GET section below // Returned successfully assign xhrText 
xhrText = xhrFetcher.responseText;

Up in the render section, after groundNodes is assigned, test it
if(groundNodes.length === 0)
{
  var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async = false;
  xmlDoc.loadXML(xhrText);
  groundNodes = xmlDoc.getElementsByTagName('GroundOverlay');
}

That should take care of it.

John Huddleston

Original comment by jhuddles...@hughes.net on 9 Mar 2010 at 1:01

GoogleCodeExporter commented 9 years ago
Hi,
still no success, you only get js error in Firefox:

ActiveXObject is not defined :-(

Original comment by pavelka....@gmail.com on 10 Mar 2010 at 6:37

GoogleCodeExporter commented 9 years ago
I got the same problem ,how can i do?

Original comment by snam...@gmail.com on 16 Apr 2010 at 12:34

GoogleCodeExporter commented 9 years ago
Use the line:
var xmlDoc = getXmlDomObject();

Use the function defined here:

function getXmlDomObject()
{
  if (window.ActiveXObject)
  {
var axVersions=
["MSXML2.DOMDocument.6.0","MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSX
ML2.D
OMDocument.3.0","MSXML2.DOMDocument","Microsoft.XMLDOM"];
    for(var i=0,imax=axVersions.length;i<imax;i++)
    try{
      var xmldomdoc=new ActiveXObject(axVersions[i]);
      return xmldomdoc;
    }
    catch(ex){/* Do nothing */}
  }
  else {
    try{
      var xmldomdoc = new DOMParser();
      return xmldomdoc;
    }
    catch(ex){/* Do nothing */}
  }
  return null;
}

Original comment by jhuddles...@hughes.net on 22 Apr 2010 at 5:27

GoogleCodeExporter commented 9 years ago
Here is another way by adding the tagName
var styleNodes = theDomParser('Style',responseXML);
var placemarkNodes = theDomParser('Placemark',responseXML);
var groundNodes = theDomParser('GroundOverlay',responseXML);

where the code for theDomparser is:

theDomParser = function(tagName,responseXML) {
    var domNodes = responseXML.getElementsByTagName(tagName);
    if (domNodes.length === 0) {
        if (window.DOMParser) {
            var dParser = new DOMParser();
            xmlDoc = dParser.parseFromString(xhrText, "text/xml");
            domNodes = xmlDoc.getElementsByTagName(tagName);
        }
        else {
            var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
            xmlDoc.async = false;
            xmlDoc.loadXML(xhrText);
            domNodes = xmlDoc.getElementsByTagName(tagName);
        }
        return domNodes;
    }
}

If you still have trouble with a browser not in theDomParser, see my last post.

John Huddleston

Original comment by jhuddles...@hughes.net on 22 Apr 2010 at 6:16

GoogleCodeExporter commented 9 years ago
Where exactly should I put this code? Inside of the geoxml3.js file? If so, do 
I need to alter my geoxml.parse('file.kml'); code at all? Thanks.

Original comment by stephenr...@gmail.com on 29 Jun 2010 at 12:10

GoogleCodeExporter commented 9 years ago
Hi, sorry I don't understand comment 2,5,6 Is this a solution for working 
geoxml3 in IE. I am trying it and still get the same output - nothing in IE :-(

Original comment by pavelka....@gmail.com on 21 Jul 2010 at 10:53

GoogleCodeExporter commented 9 years ago
fixed in network_link branch.

Original comment by geocodezip on 22 Sep 2010 at 5:44

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi, I don't follow comments 2,5,6  where should this codes be placed?

Original comment by raphca...@gmail.com on 26 May 2015 at 6:28