Class: geocontext

mljs# geocontext

new geocontext()

Handles widgets that respond to a change in the area or interest, or locale. This could be a specific point on the Earth (lat,lon), town, county, area, or combination of these areas within an overall set of bounds. E.g. think of an interactive system where several points or areas are selected to define the maximum bounded context, rather than a specific part of the overall interface.

From cambridge english dictionary:- Locale Noun(c): an area or place, especially one where something special happens, such as the action in a book or a film: "The book's locale is a seaside town in the summer of 1958."

Deprecated:
  • use var db = new mljs(); var ctx = db.createGeoContext(); instead
    Source:

    Methods

    clear()

    Clears the array of search contexts to be updated with queries for. Chainable.

    Source:

    constraint(defaultConstraintName)

    Chainable function that sets the default constraint for all search contexts, if they don't specify one themselves

    Parameters:
    Name Type Description
    defaultConstraintName string

    The name of the constraint to alter in the linked search context objects, if they do not specify their own constraint name

    Source:

    contributeArea(contributor, areaOrArray)

    Contributes an area definition. Areas can be a point, circle, box or polygon JSON, or an array of a mix of those.

    Parameters:
    Name Type Description
    contributor string

    The contributor of this area

    areaOrArray JSON | Array

    The area JSON, or array of them, to add

    Source:

    home(areaOrArray, alwaysFallback)

    Where this context should initially use as a location. Fires an update. Chainable.

    Parameters:
    Name Type Description
    areaOrArray JSON | Array

    area, or array of areas, to include as a base location

    alwaysFallback boolean

    Whether this should be used just as a start position (false), or always used as a default location when no areas have been contributed (true).

    Source:

    homeRadius(lat, lon, radiusMiles_opt, alwaysFallback)

    Convenience method for home() to set home location to a point with an optional radius (defaults to 20 miles).

    Parameters:
    Name Type Description
    lat number

    latitude of home point

    lon number

    longitude of home point

    radiusMiles_opt number

    optional radius of home point location (default 20 miles)

    alwaysFallback boolean

    Whether this should be used just as a start position (false), or always used as a default location when no areas have been contributed (true).

    Source:

    inform(searchContext, name, constraint_opt)

    Instructs this geocontext to contribute a structured query (and query of geo constraint queries) to a search context.

    Parameters:
    Name Type Description
    searchContext searchcontext

    The search context to call contributeStructuredQuery on

    name string

    The contributor name to use

    constraint_opt string

    The optional constraint name to use. Will default to this context's defaultConstraintName (see constraint() ) if not specified

    Source:

    register(widget)

    Registers a widget or class with this context. Introspects the parameter passed for methods and relevant event listeners

    Parameters:
    Name Type Description
    widget JSON

    The widget or javascript instance to register

    Source:
    MLJS - A JavaScript wrapper for the MarkLogic REST API
    MarkLogic 2012-2014
    Documentation generated by JSDoc 3.2.3-dev on Mon Jul 18 2016 09:14:12 GMT+0100 (BST) using the DocStrap template.