mohitsgw / earth-api-samples

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

Exaggeration of the land #619

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Is it possible to completely eliminate the exaggeration of the land?
 I want to keep the field is viewed with relief possible?

Original issue reported on code.google.com by mortegam...@gmail.com on 5 Apr 2011 at 10:00

GoogleCodeExporter commented 8 years ago
Hi,

Please be sure to ask these types of questions in the forum before filing 
feature requests.  In this case you can just set the terrain exaggeration to 
zero, as noted in the docs at 
http://code.google.com/apis/earth/documentation/options.html#terrain_exaggeratio
n 

Original comment by jli...@google.com on 5 Apr 2011 at 6:30

GoogleCodeExporter commented 8 years ago
Ok, I'm sorry and thank you very much. I know that document but there says that 
the range is 1 to 3(Values outside of the allowed range will be clipped to the 
closest allowable value.) 
However, I tried to 0 before asking but I do not work properly. Deputy an 
example for yourself to see. I have only changed the value of ge.getOptions (). 
SetTerrainExaggeration (1); to 0 

Sorry for the inconvenience 

<html> 
<head> 
  <title>terrainexaggeration_example.html</title>
  <link href="http://code.google.com/intl/es/apis/earth/documentation/samples/terrainexaggeration_example.css" rel="stylesheet" type="text/css" />
    <script src="http://www.google.com/jsapi?key=ABQIAAAArCZgeQ8ddm8YbeJQqqHN5BTYrZjdppbykE52CdH9dtH9wJ0VsBQSgm6ZbaTJsaMARyyYkz_JttmHMQ"></script>
  <script type="text/javascript"> 
    var ge;
    google.load("earth", "1");

    function init() {
      google.earth.createInstance('map3d', initCB, failureCB);
    }

    function initCB(instance) {
      ge = instance;
      ge.getWindow().setVisibility(true);
      ge.getNavigationControl().setVisibility(ge.VISIBILITY_SHOW);
      //ge.getOptions().setTerrainExaggeration(1);
      ge.getOptions().setTerrainExaggeration(0);

      var la = ge.createLookAt('');
      la.set(48.761, -121.794, 0, ge.ALTITUDE_RELATIVE_TO_GROUND, -8.541, 66.213, 8000);
      ge.getView().setAbstractView(la);
      showCurrentValue();
            addClickListeners();
    }

    function failureCB(errorCode) {
    }

    function updateTerrainExaggeration() {
            var exag_value = Number(this.id);
      ge.getOptions().setTerrainExaggeration(exag_value);
      showCurrentValue();
    }

    function showCurrentValue() {
      var div = document.getElementById('current_value');
      var currentValue = ge.getOptions().getTerrainExaggeration();
      currentValue = Math.round(currentValue * 100.0) / 100.0;
      div.innerHTML = "Current value: <strong>" + currentValue + "</strong>";
    }

        function addClickListeners() {
          var list = document.getElementById('terrain_exag_values');
            var values = list.getElementsByTagName('li');
            for (var i = 0; i < values.length; i++) {
                var value = values[i];
                if (value.addEventListener)
            value.addEventListener('click', updateTerrainExaggeration, false);
         else if (value.attachEvent)
            value.attachEvent('onclick', updateTerrainExaggeration);
            }
        }

    google.setOnLoadCallback(init);
 </script> 

</head> 
<body> 

  <div id="map3d" style="height:400px; width:600px;"></div>

  <div id="terrain_exag_values">
    <p><strong>Terrain Exaggeration value:</strong></p>
    <ul>
      <li id="0">Zero</li>
      <li id="1">One</li>
      <li id="2">Two</li>
      <li id="3">Three</li>
    </ul>
  </div>

  <div id="current_value"></div>

</body> 
</html> 

Please check your example in 
http://code.google.com/apis/earth/documentation/samples/terrainexaggeration_exam
ple.html  
I think not working properly. 

Original comment by mortegam...@gmail.com on 5 Apr 2011 at 10:37

GoogleCodeExporter commented 8 years ago
Ah my apologies for the misinformation on my part.  I am re-opening this 
feature request.

Original comment by jli...@google.com on 5 Apr 2011 at 10:44

GoogleCodeExporter commented 8 years ago
Thank you very much

Original comment by mortegam...@gmail.com on 5 Apr 2011 at 10:47