javascript - Moving 3d Model in google earth? -


I am using Google Earth Web-Plugin API and I've got 3D model of Helicopter, I can make A 3D model using the following code:

var placemark = ge.createPlacemark ('');

placemark.setName ('model');

// placemark / model (geometry)

var model = ge.create model ('hail'); Placemark.setGeometry (model);

// placemark / model / link

var link = ge.createLink ('');

link.setHref ('');

model.setLink (link);

// placemark / model / location

var loc = ge.create location ('');

loc.setLatLngAlt (temp1, temp2, alt)

model.setLocation (local);

model.setAltitudeMode (ge.ALTITUDE_RELATIVE_TO_GROUND);

Every time there are new late-long coordinates, there is a way to move the 3D model into these coordinates, instead of creating a new one, after about 50 render, it becomes unresponsive! Any help would be appreciated

I think PlacePlacemark is required instead of MakePlacemark, but there is no mention of such a function in context.

Instead of creating a placemark every time - just update its coordinates you do this You can easily use a function when you want to update the position of the model, you can call the step model function with the desired coordinates every time.

var placemark = ge.createPlacemark (''); Var model = ge.create model ('hail'); Var link = ge.createLink (''); Placemark.setName ('model'); Placemark.setGeometry (model); Link.setHref ('http: //my.url/heli.dae'); Model.setLink (link); Move model (temp1, temp2, alt); // Your Location ... ge.getFeatures () AppendChild (placemark); Function lip modal (temp1, temp2, alt) {var loc = ge.create location (''); Loc.setLatLngAlt (temp1, temp2, alt) model.setLocation (local); Model.setAltitudeMode (ge.ALTITUDE_RELATIVE_TO_GROUND); }

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -