Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>If I switch this to clear everything and remove the ID from the create Placemark call, this at least doesn't crash.</p> </blockquote> <p>The issue is that you can't remove then add an object with the same ID that quickly. In simple terms it is the call to <code>ge.createPlacemark('DARTselectBox')</code> that is causing the crash because the ID <code>DARTselectBox</code> is still being used internally. You can eventually use it again, but the time is dependent on the WebBrowser control's garbage collection.</p> <p>To avoid the crash you could try <a href="http://code.google.com/apis/earth/documentation/reference/interface_kml_object.html#a3b5729a874f2a5fb8f3ce7699ac31038" rel="nofollow">calling release</a> on the placemark so that the ID is freed immediately. See this note on what calling <code>release</code> does (<em>My emphasis</em>)</p> <blockquote> <p>Permanently deletes an object, <em>allowing its ID to be reused</em>. Attempting to access the object once it is released will result in an error.</p> </blockquote> <p>Failing that you could simply toggle the visible state of the placemark, rather than adding and removing it each time.</p> <p>The actual issue with the ID reuse is listed as a bug and there is some <a href="https://code.google.com/p/earth-api-samples/issues/detail?id=253" rel="nofollow">more information on the problem here</a></p> <p><strong>Edit:</strong></p> <p>Looking at it looks like there could be a bug with the release method.</p> <p>If you read the link I posted <code>code.google.com/p/earth-api-samples/issues/detail?id=253</code> some of the comments at the bottom seem to suggest this.</p> <p>Anyhow, a hash would work, so would an incremental counter. But I don't understand why you don't simply set the visibility to false, or else create a Placemark without an ID at all and simply keep a reference to it during the operation. </p> <p>The display issue is possibly due to tessellation and altitude mode.</p> <p>Try calling <code>setTessellate(true)</code> on the Placemarks geometry object and also make sure the altitude mode is set to <code>clampToGround</code> - to do this you call <code>setAltitudeMode(ge.ALTITUDE_CLAMP_TO_GROUND)</code> - again on the Placemarks geometry object.</p> <p>So you have</p> <pre><code>var lineString = ge.createLineString(''); lineString.getCoordinates().pushLatLngAlt( ... ); lineString.setTessellate(true); lineString.setAltitudeMode(ge.ALTITUDE_CLAMP_TO_GROUND); </code></pre> <p>If that doesn't work, can you try turning the terrain layer off and checking if the lines are there or not?</p> <p>Also, I have written a free control library that does lots with the API - it is GPL so you can use it pretty much however you like. It does cover lots of things like this. <a href="http://code.google.com/p/winforms-geplugin-control-library/" rel="nofollow">http://code.google.com/p/winforms-geplugin-control-library/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload