View locations using the Google Earth API

I'm trying to use the Google Earth APIs to create a simple view of a globe with a search field where a user can enter a location. When they hit, the globe will zoom in on the spot where they scored.

I would like the performance to look right at the place they indicated. I 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 it always concerns a little wrong location,

+3
source share
1 answer

Maybe it’s just that you have point.y and point.x the wrong way?

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

, " ", , ? , , , "-" "M20 1LL"? , , ( ).

, ;

1) , .

2) , "" . http://code.google.com/apis/maps/documentation/javascript/v2/services.html#Geocoding_Caching

, AOK... (00) ...

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);
+2

Source: https://habr.com/ru/post/1711526/


All Articles