<head>
</head>
<!--
<!--
Event Graph ROUTE Table
shows event connections
-->
<!--
Index for DEF nodes:
BehaviorScript,
GeometryGroup,
MetadataHolderPlaceMark,
MetadataHolderPoint,
PlaceMarkBalloon,
PlaceMarkMaterial,
PlaceMarkName,
PointScript,
SnippetTranslation,
SwitchVisible
Index for Viewpoint node:
Viewpoint_1
Index for ProtoDeclare definitions:
PlaceMark,
Point
-->
<Scene>
<ProtoDeclare name='PlaceMark' appinfo='A Placemark with a Point has an icon associated with it that marks a point on the earth in the 3D viewer.'
documentation='
http://code.google.com/apis/kml/documentation/kml_tags_21.html#placemark
'
>
<ProtoInterface>
<field name='id' type='SFString' accessType='initializeOnly'/>
<field name='name' type='MFString' accessType='inputOutput'
appinfo='Label for the object'
/>
<field name='description' type='SFString' accessType='inputOutput'
appinfo='User-supplied text that appears in the description balloon'
/>
<field name='coordinates' type='SFVec3d' value='0 0 0' accessType='initializeOnly'
appinfo='longitude latitude and altitude'
/>
<field name='address' type='MFString' accessType='inputOutput'
appinfo='A string value representing an unstructured address written as a standard street city state address and/or as a postal code.'
/>
<field name='visibility' type='SFBool' value='true' accessType='initializeOnly'
appinfo='. Specifies whether the feature is drawn in the 3D viewer when it is initially loaded'
/>
<field name='set_visibility' type='SFBool' accessType='inputOnly'/>
<field name='visibility_changed' type='SFBool' accessType='outputOnly'/>
<!-- TODO: is the 'open' parameter appropriate for X3D? Maintain value for round-trip conversions. -->
<field name='open' type='SFBool' value='true' accessType='initializeOnly'
appinfo='Specifies whether a Folder appears closed or open when first loaded'
/>
<!-- TODO: need LookAt Prototype -->
<field name='snippet' type='MFString' accessType='initializeOnly'
appinfo='A short description of the feature'
/>
<field name='set_snippet' type='MFString' accessType='inputOnly'/>
<field name='snippet_changed' type='MFString' accessType='outputOnly'/>
<!-- TODO: AddressDetails, phoneNumber, TimePrimitive, styleUrl, StyleSelector, Region -->
<!-- TODO: Geometry prototypes for KML Point,LineString,LinearRing, Polygon,MultiGeometry,Model -->
<field name='geometry' type='MFNode' accessType='inputOutput'
appinfo='Shape or (KML) Point LineString LinearRing Polygon MultiGeometry Model'
>
<!-- default NULL node -->
</field>
<field name='diffuseColor' type='SFColor' value='0.2 0.8 0.4' accessType='inputOutput'
appinfo='Default color for PlaceMark'
/>
<field name='metadata' type='SFNode' accessType='inputOutput'>
<!-- default NULL node -->
</field>
</ProtoInterface>
<ProtoBody>
<!-- TODO: is Switch needed to choose between balloon and provided geometry, or are both shown? -->
<Anchor>
<IS>
<connect nodeField='url' protoField='address'/>
<connect nodeField='description' protoField='description'/>
</IS>
<GeoLocation containerField='children'>
<GeoOrigin>
<IS>
<connect nodeField='geoCoords' protoField='coordinates'/>
</IS>
</GeoOrigin>
</GeoLocation>
<Shape DEF='PlaceMarkBalloon'>
</Shape>
<Transform DEF='PlaceMarkName' translation='0 1.2 0'>
<Shape>
<Text>
<IS>
<connect nodeField='string' protoField='name'/>
</IS>
<FontStyle justify='"MIDDLE" "MIDDLE"' size='0.2'/>
</Text>
<Appearance>
</Appearance>
</Shape>
</Transform>
<Shape>
<Text>
<IS>
<connect nodeField='string' protoField='snippet'/>
</IS>
<FontStyle justify='"MIDDLE" "MIDDLE"' size='0.2'/>
</Text>
<Appearance>
</Appearance>
</Shape>
</Transform>
<Group DEF='GeometryGroup'>
<IS>
<connect nodeField='children' protoField='geometry'/>
</IS>
</Group>
</Anchor>
</Switch>
<!-- remaining nodes in ProtoBody are not rendered -->
<WorldInfo>
<IS>
<connect nodeField='title' protoField='id'/>
</IS>
</WorldInfo>
<Group DEF='MetadataHolderPlaceMark'>
<IS>
<connect nodeField='metadata' protoField='metadata'/>
</IS>
</Group>
<field name='visibility' type='SFBool' accessType='initializeOnly'/>
<field name='set_visibility' type='SFBool' accessType='inputOnly'/>
<field name='visibility_changed' type='SFBool' accessType='outputOnly'/>
<field name='visibilityChoice' type='SFInt32' accessType='outputOnly'/>
<field name='open' type='SFBool' accessType='initializeOnly'/>
<field name='snippet' type='MFString' accessType='initializeOnly'/>
<field name='set_snippet' type='MFString' accessType='inputOnly'/>
<field name='snippet_changed' type='MFString' accessType='outputOnly'/>
<field name='snippetOffset' type='SFVec3f' accessType='outputOnly'/>
<IS>
<connect nodeField='visibility' protoField='visibility'/>
<connect nodeField='set_visibility' protoField='set_visibility'/>
<connect nodeField='visibility_changed' protoField='visibility_changed'/>
<connect nodeField='open' protoField='open'/>
<connect nodeField='snippet' protoField='snippet'/>
<connect nodeField='set_snippet' protoField='set_snippet'/>
<connect nodeField='snippet_changed' protoField='snippet_changed'/>
</IS>
<![CDATA[
ecmascript:
function initialize ()
{
Browser.println ('visibility=' + visibility);
if (visibility == false) visibilityChoice = -1;
// TODO: if (open == false) open_changed = -1;
adjustSnippetOffset ();
}
function set_visibility (value, timestamp)
{
visibility = value; // remember change
visibility_changed = value; // send eventOut
if (visibility == false) visibilityChoice = -1;
else visibilityChoice = 0;
}
function set_snippet (value, timestamp)
{
snippet = value; // remember change
snippet_changed = value; // send eventOut
adjustSnippetOffset ();
}
function adjustSnippetOffset () // TODO
{
// snippetOffset = new SFVec3f (0.0, (snippet.length * 0.3), 0.0);
// Browser.println ('snippet.length=' + snippet.length + ', snippetOffset=' + snippetOffset);
}
function set_open (value, timestamp) // TODO
{
}
]]>
</ProtoDeclare>
<ProtoDeclare name='Point' appinfo='A geographic location defined by longitude latitude and (required) altitude.'
documentation='
http://code.google.com/apis/kml/documentation/kml_tags_21.html#point
'
>
<ProtoInterface>
<field name='id' type='SFString' accessType='initializeOnly'/>
<field name='altitudeMode' type='SFString' value='clampToGround' accessType='initializeOnly'
appinfo='allowed values: clampToGround relativeToGround absolute'
/>
<field name='coordinates' type='SFVec3d' value='0 0 0' accessType='initializeOnly'/>
<field name='set_coordinates' type='SFVec3d' accessType='inputOnly'/>
<field name='coordinates_changed' type='SFVec3d' accessType='outputOnly'/>
<field name='extrude' type='SFBool' value='false' accessType='initializeOnly'/>
<field name='tessellate' type='SFBool' value='false' accessType='initializeOnly'/>
<field name='metadata' type='SFNode' accessType='inputOutput'>
<!-- default NULL node -->
</field>
</ProtoInterface>
<ProtoBody>
<Script DEF='PointScript'>
<field name='altitudeMode' type='SFString' accessType='initializeOnly'/>
<field name='coordinates' type='SFVec3d' accessType='initializeOnly'/>
<field name='set_coordinates' type='SFVec3d' accessType='inputOnly'/>
<field name='coordinates_changed' type='SFVec3d' accessType='outputOnly'/>
<field name='extrude' type='SFBool' accessType='initializeOnly'/>
<field name='tessellate' type='SFBool' accessType='initializeOnly'/>
<IS>
<connect nodeField='altitudeMode' protoField='altitudeMode'/>
<connect nodeField='coordinates' protoField='coordinates'/>
<connect nodeField='set_coordinates' protoField='set_coordinates'/>
<connect nodeField='coordinates_changed' protoField='coordinates_changed'/>
<connect nodeField='extrude' protoField='extrude'/>
<connect nodeField='tessellate' protoField='tessellate'/>
</IS>
<![CDATA[
ecmascript:
function initialize ()
{
if (altitudeMode == '') altitudeMode = 'clampToGround';
if ((altitudeMode != 'clampToGround') &&
(altitudeMode != 'relativeToGround') &&
(altitudeMode != 'absolute'))
{
warningString = '[Point';
if (id != '') warningString += ' ' + id;
warningString += '] illegal value ';
warningString += 'altitudeMode=' + altitudeMode;
Browser.println (warningString);
}
}
function set_coordinates (value)
{
coordinates = value;
coordinates_changed = value;
}
// TODO: how to handle extrude, tessellate
]]>
</Script>
<WorldInfo>
<IS>
<connect nodeField='title' protoField='id'/>
</IS>
</WorldInfo>
<Group DEF='MetadataHolderPoint'>
<IS>
<connect nodeField='metadata' protoField='metadata'/>
</IS>
</Group>
</ProtoBody>
</ProtoDeclare>
<!-- ========== Examples ========== -->
<Viewpoint description='Placemark example' position='0 0 4'/>
<!-- <?xml version="1.0"
encoding="UTF-8"?> <kml "xmlns=http://earth.google.com/kml/2.1>"
<Placemark> <name>Simple placemark</name> <description>Attached to the ground. Intelligently places itself at the height of the underlying terrain.</description> <Point> <coordinates>-122.0822035425683,37.42228990140251,0</coordinates> </Point> </Placemark> </kml> -->
<ProtoInstance name='PlaceMark'>
<fieldValue name='name' value='"Simple placemark"'/>
<fieldValue name='description' value='Attached to the ground. Intelligently places itself at the height of the underlying terrain.'/>
<fieldValue name='coordinates' value='-122.0822035425683 37.42228990140251 0'/>
<fieldValue name='address' value='
"https://www.web3d.org/x3d-earth"
'/>
</ProtoInstance>
</Scene>