1

Currently I get elevation by click on autocomplete search input.

async function searchByAddressHandler( place_id ) {
    await geocoder
      .geocode( {placeId: place_id} )
      .then( async ( {results} ) => {
        if( results[ 0 ] ) {
          const elevationResponse = await elevationService.getElevationForLocations( {
            locations: [results[ 0 ].geometry.location],
          } );
          if( !(elevationResponse.results && elevationResponse.results.length) ) {
            useGrowl( 'error', `Insufficient elevation data for place: ${results[ 0 ].formatted_address}` )
          }
          const elv = elevationResponse.results[ 0 ].elevation;
          elevation = elv;
          resolution = elevationResponse.results[ 0 ].resolution
          rotateCameraAround(
            results[ 0 ].geometry.location,
            results[ 0 ].geometry.viewport,
            elv
          );
        } else {
          useGrowl( 'error', 'No result found' );
        }
      } ).catch( ( e ) => {
        useGrowl( 'error', `Geocoder failed due to: ${e}` );
      } );
    autocompleteLists = [];
    showAutoCompleteList = false;
  }

Is there any way to get elevation by click on building or terrain in Cesium.js ?

I also tried to understand from this PR and read docs but it cannot help

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.