jordoncm / earth-api-samples

Automatically exported from code.google.com/p/earth-api-samples
0 stars 0 forks source link

Placemark balloons crashing GE plugin #633

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load simple GE page with a single placemark that includes a call to 
setName() and/or setDescription().  

2.  Clicking on the placemark (sometimes the first time, sometimes after 
clicking repeatedly) will intermittently crash the GE plugin

3. Only way to avoid crashing is to completely disable balloons by overriding 
the default click action, e.g. - 

google.earth.addEventListener(placemark, "click", function(event) {
    event.preventDefault();
});

What is the expected output or behavior? What do you see instead?
Expect the balloon to function normally. 

Which plugin version are you using?
GE 1.0.0.1 last updated May 17, 2011

Which browsers and operating systems are affected?
Browser: FF 4.0.1
OS: Windows 7 x86_64

Please provide any additional information (code snippets/links) below.

Sample page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML lang="en">
<HEAD>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        html { height: 100% }
        body { height: 100%; margin: 0px; padding: 0px }
    </style>

    <script src="https://www.google.com/jsapi?key=<%=sGEMapKey%>"></script>

    <SCRIPT type="text/javascript" charset="utf-8">

    var ge;

    google.load("earth", "1");

    function init() {
      google.earth.createInstance('map3d', initCallback, failureCallback);
    }

    function initCallback(instance) {
      ge = instance;
      ge.getWindow().setVisibility(true);

      // add a navigation control
      ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);

      // add some layers
      ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
      ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);

            // Create the placemark.
        var placemark = ge.createPlacemark('');
        placemark.setName("Fort Huachuca, AZ");
        placemark.setDescription("Intelligence Systems Integration Laboratory (ISIL)");
            // Define a custom icon.
        var icon = ge.createIcon('');
        icon.setHref('http://maps.google.com/mapfiles/kml/paddle/red-circle.png');
        var style = ge.createStyle('');  //create a new style
        style.getIconStyle().setIcon(icon);     //apply the icon to the style
        placemark.setStyleSelector(style);  //apply the style to the placemark
            // Set the placemark's location.
        var point = ge.createPoint('');
        point.setLatitude(31.56697137467802);
        point.setLongitude(-110.34528486137697);
        placemark.setGeometry(point);
            // Add the placemark to Earth.
        ge.getFeatures().appendChild(placemark);

         var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
          lookAt.setLatitude(31.5669);
          lookAt.setLongitude(-110.3452);
          lookAt.setRange(12000);
        ge.getView().setAbstractView(lookAt);

    }

    function failureCallback(errorCode) {
    }

    </SCRIPT>

</HEAD>

<BODY onload="init()">

    <div id="map3d" style="height: 100%; width: 100%;"></div>

</BODY>

</HTML>

Original issue reported on code.google.com by woodywal...@gmail.com on 27 May 2011 at 1:21

GoogleCodeExporter commented 9 years ago
I had an opportunity to test with an instance of Google Earth Enterprise Server 
(as opposed to the public GE servers) and found that the same bit of placemark 
code doesn't crash the plugin; different GE connection code but the same 
placemark code.  

Original comment by woodywal...@gmail.com on 14 Jun 2011 at 10:01

GoogleCodeExporter commented 9 years ago
I observed this behavior as well, though I cannot test against an Enterprise 
server. It seems to affect both FeatureBalloons and HtmlString balloons. I 
haven't yet determined what exactly causes the crash. In the playground, I 
modified the line string example to popup an html balloon on a click event; 
sometimes the plugin page would crash immediately, sometimes (usually right 
after it had crashed and been restarted) it would work (open, close, repeat) 
for a long time before it crashed. It doesn't seem to matter if you hand it 
text or text with markup. 

Original comment by oldshag...@gmail.com on 12 Jul 2011 at 8:42

GoogleCodeExporter commented 9 years ago
Actually, I'm thinking this is duplicate of issue 609 - general FF 4+ issue.

Original comment by oldshag...@gmail.com on 14 Jul 2011 at 12:49

GoogleCodeExporter commented 9 years ago
Not sure about that - the same code worked in FF 4 with the standalone GE 
server, but will try IE when I get a moment to test this again ( had to keep 
moving forward so I switched over to using World Wind )

Original comment by woodywal...@gmail.com on 14 Jul 2011 at 1:56

GoogleCodeExporter commented 9 years ago
Issue 639 has been merged into this issue.

Original comment by bcke...@google.com on 27 Jul 2011 at 7:31

GoogleCodeExporter commented 9 years ago
Yes, this should be fixed along with 609. They appear to be different ways of 
triggering the same underlying issue.

Original comment by bcke...@google.com on 27 Jul 2011 at 7:43