Geographic Object Interface (GOI) for Heurist API
Previous Topic  Next Topic 


Note: for a full guide, visit the website: hapi.heuristscholar.org


As in the Heurist API, all classes and objects in the GOI are accessible through the global namespace, and also the GOI namespace, and also the HAPI.GOI namespace.  For example, HFooBar is also accessible as GOI.FooBar and HAPI.GOI.FooBar; internally all names use the former naming scheme.


HPointValue, HBoundsValue,  HCircleValue, HPolygonValue and HPathValue objects represent bibliographic details of the geographic variety.

class HPointValue extends HGeographicValue

Constructor

    HPointValue( wkt-string )

        Create a new point value, using the given raw geographic data

    HPointValue( x, y )

        Create a new point value with the specified coordinates

Methods

    getX()  =>  float

    getY()  =>  float

        Return the coordinate values of the point


class HBoundsValue extends HGeographicValue

Constructor

    HBoundsValue( wkt-string )

        Create a new bounds (rectangle) value, using the given raw geographic data

    HBoundsValue( xMin, xMax, yMin, yMax )

        Create a new bounds (rectangle) value with the specified coordinates

Methods

    getX0()  =>  float

    getX1()  =>  float

    getY0()  =>  float

    getY1()  =>  float

        Return the coordinate values of the rectangle


class HCircleValue extends HGeographicValue

Constructor

    HCircleValue( wkt-string )

        Create a new circle value, using the given raw geographic data

    HCircleValue( x, y, radius )

        Create a new circle value with centre at (x,y) and given radius

Methods

    getX()  =>  float

    getY()  =>  float

        Return the coordinates of the centre of the circle

    getRadius()  =>  float

        Return the radius of the circle


class HPolygonValue extends HGeographicValue

Constructor

    HPolygonValue( wkt-string )

        Create a new polygon value, using the given raw geographic data

    HPolygonValue( points )

        Create a new polygon value - points is a list of { x: X, y: Y } objects.  The last point must be the same as the first point.

Methods

    getPoints()  =>  Array[ [x,y] ]

        Return the polygon's points.  Return value is an array of arrays of x,y values


class HPathValue extends HGeographicValue

Constructor

    HPathValue( wkt-string )

        Create a new path (poly-line) value, using the given raw geographic data

    HPathValue( points )

        Create a new path value - points is a list of { x: X, y: Y } objects

Methods

    getPoints()  =>  Array[ [x,y] ]

        Return the polygon's points.  Return value is an array of arrays of x,y values




class Digitiser

Constructor

    Digitiser( map )


Methods

    digitisePoint()

    digitiseBounds()

    digitiseCircle()

    digitisePolygon()

    digitisePath()

        These functions start the digitisation process on the given Google Map.  Once invoked, the user double-clicks the map to start digitising.


    getShape()  =>  HGeographicValue

        Return the currently digitised shape, or null if there is no shape being digitised.




object google

This object provides convenience methods for creating Google Maps objects from HGeographicValue objects.


Methods

    getLatLng( value )  =>  GLatLng  throws HInvalidGeographicValueException

        Returns a new GLatLng object representing the given HGeographicValue.

        Behaviour for different types is as follows:

            HPointValue:  does the obvious thing.

            HBoundsValue: uses the bottom-left corner.

            HCircleValue: uses the centre point.

            HPolygonValue / HPathValue: uses the first point.


    getLatLngs( value )  =>  Array[GLatLng]  throws HInvalidGeographicValueException

        Returns an array of new GLatLng objects representing the given HGeographicValue.

        Note: for HCircleValues, 40 points around the circumference of the circle will be generated.


    makeMarker( pointValue, opts ? )  => GMarker  throws HInvalidGeographicValueException

        Returns new GMarker object representing the given HPointValue.

        The opts argument is as specified at http://code.google.com/apis/maps/documentation/reference.html#GMarkerOptions


    makePolyline( pathValue, color ?, weight ?, opacity ?, opts ? )  => GPolyline  throws HInvalidGeographicValueException

        Returns new GPolyline object representing the given HPathValue.

        The color, weight and opacity arguments are as specified at http://code.google.com/apis/maps/documentation/reference.html#GPolyline

        The opts argument is as specified at http://code.google.com/apis/maps/documentation/reference.html#GPolylineOptions


    makePolygon( value, strokeColor ?, strokeWeight ?, strokeOpacity ?, fillColor ?, fillOpacity ?, opts ? )  => GPolygon  throws HInvalidGeographicValueException

        Returns new GPolygon object representing the given HGeographicValue.

        The strokeColor, strokeWeight, strokeOpacity, fillColor and fillOpacity arguments are as specified at

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

        The opts argument is as specified at http://code.google.com/apis/maps/documentation/reference.html#GPolygonOptions


    getBounds( overlays, pad ? )  => GLatLngBounds

        Returns a new GLatLngBounds object that contains all the given overlays (GMarkers, GPolylines and GPolygons).

        If the optional pad argument is true, the bounds will be given some extra padding in all directions.