Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1048489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:27:51+00:00 2026-05-16T16:27:51+00:00

I am trying to use the Google Earth API to create a simple view

  • 0

I am trying to use the Google Earth API to create a simple view of the globe with a search field in which the user can type a location. When they hit go, the globe will zoom in on the location they typed in.

I would like the view to be looking straight down on the location they specified. I have tried the following code:

var lookAt = ge.createLookAt('');
lookAt.set(point.y, point.x, 600, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 00, 0);
ge.getView().setAbstractView(lookAt);

But this always goes to slightly the wrong location,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:27:52+00:00Added an answer on May 16, 2026 at 4:27 pm

    Could it be simply that you have point.y and point.x the wrong way around?

    // latitude, longitude, altitude, altitudeMode, heading, tilt, range
    lookAt.set(point.x, point.y, 600, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 0, 0);
    

    Failing that, when you say ‘the user can type a location’ do you mean you are geocoding an entry? For example are the users entering “New York” or “M20 1LL” for example? If so you should realise that geocoding is not an exact science and that the results are not always accurate (especially with free geocoding services).

    There are two real solutions if this is the case;

    1) Pay to use a commercial geocoding service to guarantee accuracy.

    2) Build your own database or cache that contains pre-computed geocoder responses of ‘key’ places.
    http://code.google.com/apis/maps/documentation/javascript/v2/services.html#Geocoding_Caching

    BTW the code looks AOK…apart from the double zero (00) for the tilt…

    var lookAt = ge.createLookAt('');
    
    // latitude, longitude, altitude, altitudeMode, heading, tilt, range
    lookAt.set(point.y, point.x, 600, ge.ALTITUDE_RELATIVE_TO_GROUND, 0, 0, 0);
    
    ge.getView().setAbstractView(lookAt);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use Google's Images API to search an image and put it
I'm trying to use Google's AJAX (JSON) Web Search API in Python. I'm stuck
I'm trying to use Google Federated Login REST API. I can succesfully reach out
i am trying to use Google OAuth to import a user 's contacts. In
I'm trying to use Google Analytics API to query internal searches that happen on
I am trying to use the Google Map API- I've successfully managed to add
I am trying to use Google's OAuth2 API. In their generic documentation, they mention
I am trying to use Google Custom Search (Business Edition) on my site. I
I am trying to use the Google Wave Active Robot API fetch_wavelet() and I
I'm trying to use the google translate api's to... well translate some text, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.