IDE API Sample Google Map

From MemberWiki

Jump to: navigation, search

This is a sample transference of Google's GMap2 class documentation into the API XML format. This is taken from the following reference:

http://code.google.com/apis/maps/documentation/reference.html#GMap2

GMap2 class (partial) described using API XML format

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ns.openajax.org/api" version="..." apiType="javascript">
<class type="google.maps.Map2" superclass="Object">
    <constructors>
        <constructor scope="instance">
            <description>
                Creates a new map inside of the given HTML container, which is typically a DIV element. If no
                set of map types is given in the optional argument opts.mapTypes, the default set G_DEFAULT_MAP_TYPES is used.
                If no size is given in the optional argument opts.size, then the size of the container is used. If opts.size
                is given, then the container element of the map is resized accordingly. See class GMapOptions.
            </description>
            <parameters>
                <parameter name="container" required="true" type="String"> <!-- see IDE Issue 13 -->
                    <description>The HTML container</description>
                </parameter>
                <parameter name="opts" required="false" type="Object" valueType="google.maps.GMapOptions">
                    <description>GmapOptions (passed as an object literal)</description>
                </parameter>
            </parameters>
            <return-types>
                <return-type type="Object" valueType="google.maps.Map2"/>
            </return-types>
        </constructor>
    </constructors>
    <properties>
        <property name="propertyInstance" readonly="false" scope="instance" type="String">
            <description>Property description</description>
        </property>
        <property name="propertyStatic" readonly="false" scope="static" type="String">
            <description>Property description</description>
        </property>
    </properties>
    <methods>
        <method name="enableDragging" scope="instance">
            <description>Enables the dragging of the map (enabled by default).</description>
        </method>
        <method name="disableDragging" scope="instance">
            <description>Returns true iff the dragging of the map is enabled.</description>
        </method>
        <method name="draggingEnabled" scope="instance">
            <description>Enables info window operations on the map (enabled by default).</description>
            <return-types>
                <return-type type="Boolean"/>
            </return-types>
        </method>
        <method name="infoWindowEnabled" scope="instance">
            <description>Returns true iff the info window is enabled.</description>
            <return-types>
                <return-type type="Boolean"/>
            </return-types>
        </method>
        <method name="openInfoWindow" scope="instance">
            <description>
                Opens a simple info window at the given point. Pans the map such that the
				opened info window is fully visible. The content of the info window is given as a DOM node.
            </description>
            <parameter name="point" required="false" type="Object" valueType="google.maps.GPoint">
                <description>The point at which to open the map.</description>
            </parameter>
            <parameter name="node" required="false" type="String"> <!-- see IDE Issue 13 -->
                <description>The content of the info window.</description>
            </parameter>
            <parameter name="opts" required="false" type="Object" valueType="google.maps.GMapOptions">
                <description>GmapOptions (passed as an object literal)</description>
            </parameter>
            <return-types />
        </method>
    </methods>
</class>
</api>

Notes

  • jsType seems confusing. It seems we should use type as the main attribute, and then have additional attributes as "additional" metadata items JON (20080102): The draft spec of 20080102 takes the approach advocated by Ingo, where type= takes a core JavaScript type and additional attribute valueType= provides additional information so that tools can know what custom editors to use (e.g., an enum becomes a popup menu).
Personal tools