Urgent! Clicking model

16 views
Skip to first unread message

damla

unread,
May 13, 2009, 3:01:46 PM5/13/09
to KML Developer Support - Google Earth Plug-in
I have many models
How can ı understand, which model ı clicked also listen it
thanks for help
damla

shsavage

unread,
May 14, 2009, 9:58:53 AM5/14/09
to KML Developer Support - Google Earth Plug-in
Hi Damla,

I don't believe there's a way to do this by clicking on the model.
You might try something with a drop-down list, allowing the user to
select the model that way. -Steve

damla

unread,
May 14, 2009, 3:02:57 PM5/14/09
to KML Developer Support - Google Earth Plug-in
I have read something on google.earth.documentation

http://code.google.com/intl/tr/apis/earth/documentation/reference/interface_g_e_plugin.html


KmlPlacemark GEPlugin.createPlacemark ( string id )

Creates a placemark on the globe. A Placemark is a feature with
associated Geometry. A Placemark with a Point has an icon associated
with it that marks a point on the Earth in the 3D viewer. (In the
Google Earth 3D viewer, a Point Placemark is the only object you can
click or roll over. Other Geometry objects do not have an icon in the
3D viewer. *******To allow the user to click in the 3D viewer, you
would need to create a MultiGeometry object that contains both a Point
and the other Geometry object.) *******

Parameters:
id ID of placemark.

from the sentence between stars,I understood that it is possible,but
how?
Thanks for care and reply..




On 14 Mayıs, 16:58, shsavage wrote:
> HiDamla,
> >damla- Alıntıyı gizle -
>
> - Alıntıyı göster -

dinther

unread,
May 14, 2009, 5:01:03 PM5/14/09
to KML Developer Support - Google Earth Plug-in
Interesting, I have the same requirements. The API reference
http://code.google.com/apis/earth/documentation/reference/interface_kml_model.html
suggests that a kmlModel inherits from a GEEVentEmitter. When you
click on "List of all members" you will see that the mouse click event
is there too. This would mean that the kmlModel implements a mouse
click event.

I tried to add an EventListener to the model like:

google.earth.addEventListener(mymodel, "click", handleModelClick);

function handleShipClick(event){
alert('clicked my model');
}

but this produces no results. Did anyone else try this?

On May 15, 7:02 am, damla wrote:
> I have read something on google.earth.documentation
>
> http://code.google.com/intl/tr/apis/earth/documentation/reference/int...

Markw65

unread,
May 14, 2009, 5:46:28 PM5/14/09
to KML Developer Support - Google Earth Plug-in

On May 14, 2:01 pm, dinther wrote:
>
> I tried to add an EventListener to the model like:
>
>
> but this produces no results. Did anyone else try this?

Yes. See issue 123: http://code.google.com/p/earth-api-samples/issues/detail?id=123

Mark

qq

unread,
Jun 29, 2009, 9:36:50 AM6/29/09
to KML Developer Support - Google Earth Plug-in
anyone know that?
Reply all
Reply to author
Forward
0 new messages