Click or drag to resize

JavaScript API Reference

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Overview

GeoStream delivers GeoBase functionality over the Internet. JavaScript is one method of tapping into this functionality as it is a cross-platform language broadly supported across many mobile devices.

Getting Started

The GeoStream server is typically configured when GeoBase is installed - you can quickly check that your server is functioning as expected here.

If you have not yet used JavaScript as a GeoStream client, we suggest you work through the included JavaScript Tutorials.

Namespaces and Classes
NameDescription
Telogis.GeoBase

The encompassing namespace for the entire GeoStream v2.0 JavaScript API. This serves largely as a container for other packages targeted for a more specific role, but also contains common types and utility functions that affect the functionality of the entire library. There are two main types of entity in this library: classes and namespaces. Classes are constructor functions that should be called with the new keyword (managed classes will throw an exception if they are called without it) to create an object with all the properties specified by the class. Most GeoBase classes are managed: they can be inherited from, and undergo several small automatic validations. However, some small classes that are intended to be constructed repeatedly in performance-critical contexts (such as LatLon and Point) are unmanaged, and lack these features. Methods of a class instance should only be called as properties of that instance (or with an apply or call scope adjustment). The following usage is invalid and will generally result in an error:

JavaScript
var instance = new SomeClass ();
var writeCallback = instance.write;
...
writeCallback ('text');

and instead, the following should be written:

JavaScript
var instance = new SomeClass ();
var writeCallback = function (text) {instance.write (text);};
...
writeCallback ('text');

Namespaces are groupings of items with a common purpose. Functions in a namespace are scope-independent, so they may be called by direct reference rather than as properties of the namespace itself (although this latter approach is more common). That is, the following is valid (though it would not be for a class instance):

JavaScript
var writeCallback = SomeNamespace.write;
...
writeCallback ('text');

Notice that many GeoBase objects and classes contain internal properties, marked with a leading '_' character. These objects and classes should never be used directly. Such properties are made inaccessible wherever possible, but sometimes true-private variables are not viable with the use of JavaScript prototypes, in order to allow faster class instantiation.

AbstractDOMEntity

An abstract base class for constructs that are based on a DOM element, such as map layers and widgets. Primarily, this combines the features of MapLayers.AbstractLayer and Widgets.AbstractWidget to allow code re-use. Note that because of the varying treatments of top-level DOM nodes between these, creation of a base element is left to the derived class.

Addresses

Contains functions for formatting the addresses found by geocodes for different cultures.

Addresses.AddressFormatter

Contains methods that format address objects over GeoStream, using the GeoStream.Server.JSONAddressFormatter.

Addresses.GeoCodeResult

Represents both the input address and the address found from the input.

Addresses.OneLineAddressData

A class that inherits Addresses.IAddressData. Represents an address that is structured at the suburb level and above, however the street address (building name, street number, street name, etc) is a single string. Structured forward geocodes will store the RawAddress as an Addresses.IStreetAddressData.

Addresses.StreetAddressData

A class that inherits Addresses.IAddressData. Represents an address that is structured at the suburb level and above, however the street address (building name, street number, street name, etc) is a single string. Structured forward geocodes will store the RawAddress as an Addresses.IStreetAddressData.

Addresses.StructuredAddressData

StructuredAddressData represents an address that has been fully structured and allows specific details of the address to be stored and retrieved.

Arrays

A namespace enclosing GeoBase functions for manipulating arrays. Normally, these would be attached to the Array prototype, but this is avoided to maintain compatibility with some other libraries.

Authenticator

Used to provide authentication services with GeoStream servers using only JavaScript. Necessary when providing GeoStream authentication from non .NET environments or services.

AutocompleteGeocoder

Contains functions for sending the GeoStream server a partial address query while the user is typing, in order to return region or street suggestions for the user to choose from. Note that you can enable the GeocodingLogging option to monitor GeoStream geocoding performance. For more information see web.config

AutocompleteGeocoder.ACGeoCoderSearchResult

Represents the values returned from the GeoStream server as the result of an auto-complete geocoding operation. Contains the search status (whether the search was completed or indeterminate) and an array of AutocompleteGeocoder.Suggestions.

AutocompleteGeocoder.Suggestion

Two suggestion types are supported by this class: regions and street addresses. Region suggestions come with a bounding box value to be zoomed to on the map. A street address suggestion can be a street-name-only suggestion, which enables the user to select a whole street name instead of having to type it to the end, or a full address suggestion, which can describe a particular LatLon on the map along with the full name of the address.

BoundingBox

Represents a rectangular area between top-left and bottom-right corners, specified as latitude-longitude coordinates. Potentially useful for zooming, or hit-testing a given area.

JavaScript
// Create a BoundingBox in Los Angeles, Ca
var BBox = new Telogis.GeoBase.BoundingBox(
    new Telogis.GeoBase.LatLon(33.587137,-117.742878),
    new Telogis.GeoBase.LatLon(33.575037,-117.724762)
);
Canvas

A utility for managing and rendering primitive shapes to a VML (Internet Explorer v8 or less) or SVG (Webkit) element. Shapes are managed as individual entities, as is the style of vector-graphics implementations like VML and SVG, for performance reasons. That is, to draw on a canvas once it has been created, methods to create these primitives should be called (e.g. Canvas.circle, Canvas.rect), but if further manipulation of them is desired (e.g. to clear the Canvas), references to the objects returned by these functions should be kept and have appropriate methods called.

JavaScript
// Create a Canvas instance on a parent DOM element (DIV 'main_map')
var myCanvas = new Telogis.GeoBase.Canvas({
    fillColor: new Telogis.GeoBase.Color(0,18,255,0.5),
    id: 'new_canvas',
    lineColor: new Telogis.GeoBase.Color(0,18,255,0.9),
    lineWidth: 1,
    parent: 'main_map', // DOM entity. In this example the DIV 'main_map'
    size: new Telogis.GeoBase.Size(640,480) // Not needed if already defined
});
Canvas.Group

A class for managing and rendering a group of primitive shapes to a VML (Internet Explorer v8 or less) or SVG (Webkit) element. This class renders to a <group> element in VML or <g> element in SVG. Shapes can be added to or removed from a group. A group of shapes can be shown/hidden altogether.

Canvas.Shapes

A namespace containing the classes for the different types of primitive shape that can be constructed on a Canvas object.

Canvas.Shapes.AbstractShape

An abstract base class for every type of primitive, defining the basic functionality and structure common to all. Derivations of this should be created and returned by Canvas drawing calls, and never constructed explicitly. Their properties may be manipulated directly, but changes to them will only be made visible once Canvas.Shapes.AbstractShape.draw is called (usually from Canvas.update. This constructor performs the registration of the Canvas.Shapes.AbstractShape within the calling Canvas, and also sets up the DOM sub-tree for the shape, if necessary.

Canvas.Shapes.Ellipse

Represents an ellipse of standard (horizontal) orientation, as displayed in a Canvas renderer. This should not be constructed explicitly, but rather generated as the result of a call to Canvas.ellipse or Canvas.circle.

Canvas.Shapes.Image

Represents an image, as displayed in a Canvas renderer. This should not be constructed explicitly, but rather generated as the result of a call to Canvas.image.

Canvas.Shapes.Label

Represents a label, as displayed in a Canvas renderer. This should not be constructed explicitly, but rather generated as the result of a call to Canvas.Label.

Canvas.Shapes.Path

Represents an arbitrary figure described by a sequence of commands, as displayed in a Canvas renderer. This should not be constructed explicitly, but rather generated as the result of a call to Canvas.path.

Canvas.Shapes.PolyLine

Represents a polyline between a collection of arbitrary points, as displayed in a Canvas renderer. This should not be constructed explicitly, but rather generated as the result of a call to Canvas.polyline.

Canvas.Shapes.Rect

Represents a rectangle of standard (horizontal-vertical) orientation, as displayed in a Canvas renderer. This should not be constructed explicitly, but rather generated as the result of a call to Canvas.rect.

Canvas.Util

Contains useful functions for manipulating the array of pixel points prior to rendering.

CDOLT

Contains helper methods for sending requests to the GeoStream CDOLT server. Internal use only.

Class

Contains functions for manipulating and validating managed GeoBase classes.

Clustering

Provides classes to support generating and displaying map features in clusters when they are close together.

Clustering.Cluster

A cluster that represents multiple items on the map that are spatially close together relative to the map zoom.

Clustering.ClusterSet

The ClusterSet class represents a collection of Clusters.

Color

Represents a set of color components in RGB-space, with an optional alpha-value.

Console

Manages a diagnostic console for displaying messages about program execution and flow throughout the lifetime of the application.

Constants

Internal use only.

DataQuery

Contains RPC methods used to fetch miscellaneous GIS data from the GeoStream server.

DataSet

Contains information about a data set available on the current GeoStream server.

DistanceUnit

A collection of values representing the various distance units that can be used with MathUtil. While each of these values should be used primarily as a code to represent its corresponding unit, it is also the string abbreviation of the unit and can thus be used for labelling.

Errors

A namespace containing the various custom error classes -- all of which are derivations of the built-in Error class -- that may be thrown by the API.

Errors.AJAXError

Represents an exception thrown due to a problem requesting and/or receiving dynamic content, either with an XML HTTP request or script inclusion.

Errors.ArgumentTypeError

Represents an error thrown when a parameter passed to a function is of an invalid type.

Errors.ArgumentValueError

Represents an error thrown when a parameter passed to a function is of an invalid value.

Errors.AuthError

Represents an exception that has occurred due to an authentication failure.

Errors.ClassError

Represents an exception occurring during the definition of a class using the Class subsystem.

Errors.ConfigurationError

Represents an exception arising from an invalid construction of a configured class.

Errors.EnumValueError

Represents an exception thrown when an invalid number was found where an enumerated value was expected.

Errors.GeoBaseError

The derivation of the built-in Error type from which all GeoBase API exceptions are derived.

Errors.JSONError

Represents an exception thrown due a problem serializing or deserializing JSON data used to communicate with the server.

Errors.LayoutError

Represents an exception arising from invalid layout of some DOM element on the page.

Errors.NotReadyError

Represents an exception thrown when a method is called on an object before the object is sufficiently initialized to perform that action.

Errors.RPCError

Represents an exception thrown by a server-side invocation (a remote procedure call).

Errors.ScopeError

Represents an exception thrown when this is of an unexpected type, i.e. a function is being executed in an invalid scope.

Errors.TimeoutError

Represents an exception arising from a timeout in fetching some resource.

Errors.XMLError

Represents an exception that occurred while performing operations on an XML document.

EventHandler

Provides a way to organize a collection of functions and call them all at once when a certain event occurs. Other EventHandlers can also be queued for execution once the calling handler has been triggered, but less flexibility is available than for functions.

FeatureInfo

A wrapper class to contain information about a point of interest in the map data.

GeoCoder

Contains functions for sending forward- and reverse-geocoding requests to the GeoStream server. Note that you can enable the GeocodingLogging option to monitor GeoStream geocoding performance. For more information see web.config

GeoCoder.Address

Represents the physical address returned by reverse geocoding.

GeoCoder.GeoCodeAddress

Represents a LatLon and a physical address, returned as the result of GeoCoding.

GeoCoder.GeoCodeFull

A composite object that represents the result of a reverse geocoding call.

GeoCoder.HMMGeoCodeAddress

Represents a LatLon and a physical address, returned as the result of GeoCoding.

GeoCoder.UnknownGeoCodeAddress

Represents a generic (or 'unknown') LatLon and a physical address. It contains no more than a street address, city, zip code and region.

GeoCoder.USGeoCodeAddress

Represents a LatLon and a physical address, returned as the result of GeoCoding in the United States.

Geometry

Contains geometry classes.

Geometry.LineString

A geometric line described by a string of points.

Geometry.Polygon

Represents the physical shape of a closed polygonal area such as a lake or national park. Not to be confused with a Polygon, which is an object containing an array of geometries such as Geometry.Polygons.

Geometry.Ring

Represents a closed curve that forms part of a polygon. This may be the outer perimeter or a ring around a "gap" such as an island in a lake.

GeomUtil

Contains mathematical utility functions for manipulating spatial data.

GeoStream

Contains helper methods for sending requests to the GeoStream server.

GeoStream.JSONRequest

A wrapper class for containing data relating to GeoStream server requests. This is used as a container to implicitly pass method and authentication information to the server.

GeoStream.JSONResponse

A wrapper class that contains information returned from the GeoStream server.

GeoStream.Server

Contains functions for formatting the addresses found by geocodes for different cultures.

GeoStream.Server.CustomDataColumn

Represents a column in a Telogis.Geobase.GeoStream.Server.CustomDataTable.

GeoStream.Server.CustomDataTable

Represents a table in the layer.

GeoStream.Server.CustomLayer

Represents a layer of custom data on a CDOLT server.

GeoStream.Server.Index

Represents an index in the layers data.

GeoStream.Server.QueryResult

The result returned from an index query on a layer.

GeoStream.ServerExceptionInfo

A class to be filled with error information from the server.

LatLon

Represents a latitude-longitude coordinate pair, expressed in degrees (WGS84 World Geodetic System projection).

Line

Represents a non-street line feature, such as a railway, stream or custom line data.

MapLayers

Contains all types of layer that can be added to a GeoStream map. This also acts as a global hash for all instantiated derivations of MapLayers.AbstractLayer, so that if a reference is not kept to such an object, it can be accessed like so:

JavaScript
var MapLayers   = Telogis.GeoBase.MapLayers;
var Map         = Telogis.GeoBase.Widgets.Map;
var ObjectLayer = Telogis.GeoBase.MapLayers.ObjectLayer;

var map = new Map ({id: 'main_map'});
new ObjectLayer ({id: 'pin_layer', map: map});

var layer = MapLayers ['pin_layer'];
MapLayers.AbstractLayer

An abstract class for handling layers on a GeoStream map. Any such map in GeoStream is composed of a number of these layers which should all derive from this class. A MapLayers.TileLayer is added implicitly with the creation of the map, but other types need to be added separately. Note also that the layer created by this constructor is automatically added to the map if one is specified.

MapLayers.AbstractObject

An abstract class for map objects that can be displayed in a MapLayers.ObjectLayer. Should not typically be called directly, but instead inherited by objects created using MapLayers.ImageObject and MapLayers.IndexedImageObject.

JavaScript
// ** This example displays a balloon on a map. The balloon text, when clicked, will trigger a function (an alert).
// At the top of your .aspx file, add a script reference to "/scripts/skin.balloon.greygradient.js". This defines a default balloon skin style.
// Create a Telogis.GeoBase.MapLayers.BalloonSkin with default properties to apply to AbstractObject.config.balloonConfig.skin.
var myBalloonSkin = new Telogis.GeoBase.MapLayers.BalloonSkin();

// Create content and an arbitrary function to call using AbstractObject.config.balloonConfig.contentFunc
var newDiv = document.createElement('Div');
newDiv.appendChild(document.createTextNode('Click Me'));
newDiv.onclick = function() {alert('You clicked the balloon!')}; // Click the balloon to activate an alert

// Create an AbstractObject instance on the map ('map') with a balloon containing text
// No image (src) can be specified: use Telogis.GeoBase.MapLayers.ImageObject for this functionality.
// AbstractObject is typically used only to provide inheritance.
var myAbstractObject = new Telogis.GeoBase.MapLayers.AbstractObject({
    anchorPoint: new Telogis.GeoBase.Point(0.5,0.0),
    balloonConfig: {
        //content: 'This is plain text', // Text content for the balloon.
        // --- either content or contentFunc should be used, not both
        contentFunc: function() {return newDiv}, // A function to provide balloon content as HTML
        show: true, // Show on initial loading
        hAlign: Telogis.GeoBase.MapLayers.Balloon.ALIGN_RIGHT, // Horizontal alignment of the balloon
        vAlign: Telogis.GeoBase.MapLayers.Balloon.ALIGN_BOTTOM, // Vertical alignment of the balloon
        skin: myBalloonSkin // The skin to apply to the balloon
    },
    dragEnabled: false,
    location: new Telogis.GeoBase.LatLon(33.587137,-117.742878), // The location (Los Angeles). Overridden if also specified in balloonConfig
    map: map, // May also be referenced as 'parent'. This example assumes a map named 'map' exists
});

See MapLayers.BalloonSkin for an example of customising a balloon skin.

MapLayers.Balloon

A simple balloon that can be associated with a marker on a map and used to display a small amount of text or HTML content.

JavaScript
// ** This example displays a balloon on a map. The balloon text, when clicked, will trigger a function (an alert)
// Create a Telogis.GeoBase.MapLayers.BalloonSkin to apply to balloon.config.skin.
var myBalloonSkin = new Telogis.GeoBase.MapLayers.BalloonSkin({
    bodyStyle: { // specify the style of the balloon and its text
        backgroundColor: "#ffffff",
        border:          "1px solid black",
        color:           "#000000",
        fontFamily:      "sans-serif",
        fontSize:        "20px",
        fontWeight:      "normal",
        padding:         "10px",
        textAlign:       "center",
        verticalAlign:   "middle",
        width:           "150px"
    },
    folder: "http://localhost/GeoStream/scripts/images/skins/balloon/directedwhite/", // specify the default images folder
    tagAnchorPoint: new Telogis.GeoBase.Point(0.0, 1.0), // specify the bottom-left image position
    tagOverlap: -7, // adjust the vertical position of the balloon tag (move bottom-left image and tag closer/further apart)
    bottomLeftTagSrc: 'tag-bottom-left.png', // image used for bottom-left balloon tag corner (relative to 'folder')
    bottomRightTagSrc: 'tag-bottom-right.png', // image used for bottom-right balloon tag corner
    topLeftTagSrc: 'tag-top-left.png', // image used for top-left balloon tag corner
    topRightTagSrc: 'tag-top-right.png' // image used for top-right balloon tag corner
});

// Create an arbitrary function to call using balloon.config.contentFunc
var newDiv = document.createElement('Div');
newDiv.appendChild(document.createTextNode('Click Me'));
newDiv.onclick = function() {alert('You clicked me!')}; // Click the balloon to activate an alert

// Create a Balloon instance on the map ('map') with a balloon containing text
var myBalloon = new Telogis.GeoBase.MapLayers.Balloon({
    dragEnabled: true,
    //content: "<a href='http://www.telogis.com'>Telogis</a>", // Text or HTML content for the balloon.
    // --- either content or contentFunc should be used, not both
    contentFunc: function() {return newDiv}, // A function to provide balloon content as HTML
    hAlign: Telogis.GeoBase.MapLayers.Balloon.ALIGN_RIGHT, // Horizontal alignment of the balloon
    location: new Telogis.GeoBase.LatLon(33.587137,-117.742878),
    show: true, // Show on initial load
    skin: myBalloonSkin, // The skin to apply to the balloon
    vAlign: Telogis.GeoBase.MapLayers.Balloon.ALIGN_BOTTOM, // Vertical alignment of the balloon
    map: map // May also be referenced as 'parent'
});
MapLayers.BalloonSkin

A simple class that combines all the information describing the appearance of a balloon. Several predefined instances are available as static properties of the MapLayers.BalloonSkin class, and can be used to theme balloons reasonably painlessly.

JavaScript
var myBalloonSkin = new Telogis.GeoBase.MapLayers.BalloonSkin({
    bodyStyle: { // specify the style of the balloon and its text
        backgroundColor: "#ffffff",
        border:          "1px solid black",
        color:           "#000000",
        fontFamily:      "sans-serif",
        fontSize:        "20px",
        fontWeight:      "normal",
        padding:         "10px",
        textAlign:       "center",
        verticalAlign:   "middle",
        width:           "150px"
    },
    folder: "images/skins/balloon/directedwhite", // specify the default images folder
    tagAnchorPoint: new GeoBase.Point(0.0, 1.0), // specify the bottom-left image position
    tagOverlap: 1, // adjust the vertical position of the balloon tag (move bottom-left image and tag closer/further apart)
    bottomLeftTagSrc: 'tag-bottom-left.png', // image used for bottom-left balloon tag corner (relative to 'folder')
    bottomRightTagSrc: 'tag-bottom-right.png', // image used for bottom-right balloon tag corner
    topLeftTagSrc: 'tag-top-left.png', // image used for top-left balloon tag corner
    topRightTagSrc: 'tag-top-right.png' // image used for top-right balloon tag corner
});
MapLayers.CanvasLayer

A class for displaying primitive drawing objects with VML / SVG on a layer.

JavaScript
// Create a CanvasLayer
myCanvasLayer = new Telogis.GeoBase.MapLayers.CanvasLayer({
    id: 'canvas_layer',
    parent: map,
    fillColor: new Telogis.GeoBase.Color(0,18,255,0.5),
    lineColor: new Telogis.GeoBase.Color(0,18,255,0.9),
    lineWidth: 2,
    show: true
});
MapLayers.CircleFence

A circular form of geofence, as described by a coordinate-pair center point and a distance radius in some fixed units.

JavaScript
// Create a CircleFence in Los Angeles with a radius of half a mile
myCircleFence = new Telogis.GeoBase.MapLayers.CircleFence({
    id: 'circle_fence',
    parent: map,
    center: new Telogis.GeoBase.LatLon(33.575131,-117.778007),
    radius: 0.5,
    units: Telogis.GeoBase.DistanceUnit.MILES,
    fillColor: new Telogis.GeoBase.Color(0,18,255,0.2),
    lineColor: new Telogis.GeoBase.Color(0,18,255,0.9),
    lineWidth: 1,
    show: true
});
MapLayers.ClusterLayer

Creates a layer to contain multiple MapLayers.ImageObject instances, which displays cluster icons for clusters obtained from a given datasource.

MapLayers.DivObject

A class for displaying arbitrary HTML in a DIV on an MapLayers.ObjectLayer.

MapLayers.FenceCollection

An extension of a MapLayers.LayerCollection specifically for MapLayers.GeoFences that also provides a MapLayers.FenceCollection.contains method.

MapLayers.GeoFence

A class used for displaying a customizable (not necessarily rectangular, as is the restriction of a MapLayers.RegionShadeLayer) region on a map, so as to indicate an area not accessible for routing or one that has some other significance.

MapLayers.ImageObject

A class for displaying images on a map via an MapLayers.ObjectLayer.

JavaScript
// Render an image on the map ('map') with a balloon containing text
var myImageObject = new Telogis.GeoBase.MapLayers.ImageObject({
    scalable: true, // true to allow the image size to be changed, false to lock size
    src: 'images/pin-red.png', // The path to the image file used
    balloonConfig: { // Configuration options for the balloon
        content: 'Balloon Text', // text to display in the balloon
        show: true // true to display the balloon on load
    },
    anchorPoint: new Telogis.GeoBase.Point(0.5,0.0),
    map: map,
    location: new Telogis.GeoBase.LatLon(33.587137,-117.742878), // Where the image will be drawn
});
MapLayers.IndexedImageObject

Functionally the same as an MapLayers.ImageObject, except that it displays a small index associated with the object over the image.

MapLayers.LayerCollection

A wrapper class that contains multiple map layers so that they can be treated as a single layer. While such a collection can be referenced by ID, it is not bound to any specific map.

MapLayers.ObjectLayer

Creates a layer to contain multiple Telogis.GeoBase.MapLayer.AbstractObject instances, which allow icons to be displayed on a map. An R-tree may be used to store the objects and cull those that do not lie on the map. All objects placed on the layer can be accessed by subscripting the MapLayers.ObjectLayer instance with their IDs, like so:

JavaScript
var ImageObject = Telogis.GeoBase.MapLayers.ImageObject;
var LatLon      = Telogis.GeoBase.LatLon;
var Map         = Telogis.GeoBase.Widgets.Map;
var ObjectLayer = Telogis.GeoBase.MapLayers.ObjectLayer;

var map   = new Map         ({id: 'main_map'});
var layer = new ObjectLayer ({id: 'pin_layer', map: map});

new ImageObject ({

    id:       'pushpin',
    layer:     layer,
    location:  new LatLon (34.067, -118.000),
    src:      'pin.png'
});
var pin = layer ['pushpin'];
MapLayers.PolygonFence

A variant of MapLayers.GeoFence that represents a region defined by the closure of an arbitrary polyline.

MapLayers.RegionShadeLayer

A class for displaying a shaded rectangular region on a map.

MapLayers.RouteLayer

A class used for displaying a path or route described by a sequence of latitude-longitude coordinates. This may be constructed with the directions generated by a routing call. Note also that this layer can be used for any arbitrary path: not necessarily ones generated by routing calls.

JavaScript
// Method 1:
// First create a route (myRoute) and a map object (map)
// Then use getDirections or getQuickDirections to retrieve directions
myRoute.getQuickDirections(function (result) {
    // Wrap the RouteLayer constructor within the callback function
    directionsRouteLayer = new Telogis.GeoBase.MapLayers.RouteLayer({
        id: 'route_directions',
        map: map,
        // Pass the directions object to the RouteLayer
        directions: result,
        lineColor: new Telogis.GeoBase.Color(0,18,255,0.5),
        lineWidth: 4,
        show: true
    });
    }, function (error) {alert(error)}
);

// Method 2:
// Or, alternatively, create a RouteLayer object without directions
myRouteLayer = new Telogis.GeoBase.MapLayers.RouteLayer({
    id: 'route_directions',
    map: map,
    lineColor: new Telogis.GeoBase.Color(0,18,255,0.5),
    lineWidth: 4,
    show: true
});

// Then use getDirections or getQuickDirections to set the points of the RouteLayer
// setPoints may also be used with an arbitrary array of LatLons
myRoute.getQuickDirections(function (result) {
    myRouteLayer.setPoints(result.getPoints());
    myRouteLayer.show();
    }, function (error) {alert(error)}
);
MapLayers.TileLayer

Creates a layer that is responsible for displaying the generated tiles from the tile server.

MapLayers.TileZoom

Creates a layer that displays a scaled transition in place of some existing MapLayers.TileLayer when it is zoomed.

MapLayers.TrafficLayer

Creates a layer that is responsible for displaying traffic tiles from the tile server.

MapLayers.ViewportReferenceLayer

A class for displaying a shaded rectangular region on a map to correspond to the viewport of another map.

MapLayers.WMSTileLayer

Creates a layer that is responsible for displaying displaying WMS overlay tiles from the tile server. This class can be used to display tiles generated from a single WMS source, or from two WMS sources composited together and served as a single set of tiles.

MapLayers.XSLTObjectLayer

Creates a layer to contain a large number of objects that are read from an XML file and displayed. It uses XSLT for handling object clipping to the viewport, which loads more quickly than the RTree used in MapLayers.ObjectLayer at the cost of flexibility. Markers are loaded cell-by-cell in a grid (whose pitch may be specified with the MapLayers.XSLTObjectLayer.config.cellCount configuration property) and are specified by data read from the XML by specified XPath expressions (relative to each marker tag). Note: In IE9, you must add the following header to the HTML file when using XSLTObjectLayer:

JavaScript
<meta http-equiv="X-UA-Compatible" content="IE=8">
MapLayers.ZoomIndicator

A map object used to briefly display a zooming image at the focal point of a map's zoom, making it clear how the map is being centered.

MathUtil

Contains mathematical utility functions for manipulating spatial data.

Objects

A namespace enclosing GeoBase functions for manipulating objects. Normally, these would be attached to the Object prototype, but this is avoided to maintain compatibility with some other libraries.

POI

A description of a point of interest returned by the server, grouping additional information about it such as name and phone number.

JavaScript
// Create a BoundingBox in Los Angeles
var QueryBox = new Telogis.GeoBase.BoundingBox(
    new Telogis.GeoBase.LatLon(33.893487,-118.252747),
    new Telogis.GeoBase.LatLon(33.886426,-118.234481)
);

var list = '';
var myQuery = ''; // An empty string or null returns all POIs.
// Also accepts partial matches to POI names (not types), for example 'Airport' or 'Museum'.
// Or a full name, such as 'Acme Fish Market' or 'Tasty Cupcakes By Angelo'.

// Query every POI within the BoundingBox
Telogis.GeoBase.DataQuery.queryPOI(QueryBox, null, myQuery, function (result) {
    for (var i = 0; i < result.length; i++) {
        var checkFood = result[i].getFoodType();
        if (checkFood == 'UNKNOWN'){
            checkFood = ' Unknown (this POI does not serve food, or the food available is unknown)';
        }
        list +=  '' + result[i].getName() +
        ' at ' + result[i].getLocation() +
        ' is a POI of type ' +
        result[i].getType() + '\n' +
        ' -- POI summary with phone number: ' + result[i].toString() + '\n' +
        ' -- POI food type: ' + checkFood + '\n' ;
    } alert (list);
}, function (error) {alert(error)});
Point

Represents a 2D spatial coordinate pair.

PointFeature

A PointFeature may be a city from a GeoBase data file, or a point feature from a custom dataset.

PoiRestaurantType

A sub-type enumeration representing various types of restaurant.

POIType

An enumeration of the various valid type descriptions for points of interest. These can be used for filtering the results of DataQuery invocations.

Polygon

Represents a closed polygonal map feature such as a lake or national park. Not to be confused with a Geometry.Polygon, which is the physical shape of the Geometry object contained in the geometries array.

Rectangle

A class to contain a pair of x- and y- coordinates that represent the corners of a rectangle. Analogous to the Rectangle .NET class.

RemoteStreetLink

A wrapper class for containing data about a single street link.

Routing

Contains classes related to vehicle routing and getting driving directions.

Routing.ArrivalMovementEvent

A wrapper class to be filled server-side that represents an arrival movement.

Routing.ArriveEvent

A wrapper class to be filled server-side that represents an arrival event.

Routing.DepartEvent

A wrapper class to be filled server-side that represents a departure event.

Routing.DepartureMovementEvent

A wrapper class to be filled server-side that represents a departure movement.

Routing.Direction

A wrapper class to be filled server-side, representing a single instruction in a Routing.Route.

Routing.Directions

A representation of a driving route through a number of stops. This is a wrapper class to be filled server-side.

Routing.DrivingEvent

A base class, populated server-side, that represents an event that occurs en route -- such as a driving direction or movement.

Routing.DrivingNote

A wrapper class to be filled server-side that represents a note attached to a direction.

Routing.FerryMovementEvent

A wrapper class to be filled server-side that represents a ferry movement.

Routing.FFRampMovementEvent

A wrapper class to be filled server-side that represents an FF ramp movement.

Routing.FreewayEndsNoteEvent

A wrapper class to be filled server-side that represents a Routing.DrivingNote, denoting a street name change.

Routing.FSRampMovementEvent

A wrapper class to be filled server-side that represents an FS ramp movement.

Routing.LoadElementType

Describes a type of load

Routing.Movement

A wrapper class to be filled server-side that represents a driving direction instructing the driver to turn at an intersection.

Routing.MovementEvent

A wrapper class to be filled server-side that represents a Routing.DrivingEvent that happens during a movement.

Routing.NameChangeNoteEvent

A wrapper class to be filled server-side that represents a Routing.DrivingNote, denoting a street name change.

Routing.Note

A wrapper class to be filled server-side that represents a note attached to a direction.

Routing.RampMovement

A base class representing a movement event along a freeway ramp.

Routing.RoundAboutMovementEvent

A wrapper class to be filled server-side that represents a roundabout movement.

Routing.Route

A class for constructing point-to-point directions and optimizing multi-stop routes.

JavaScript
var LatLon = Telogis.GeoBase.LatLon;
var RouteStop = Telogis.GeoBase.Routing.RouteStop;

// Create three route stops
var RouteStop1 = new RouteStop(new LatLon(33.587512,-117.741400));
var RouteStop2 = new RouteStop(new LatLon(33.553872,-117.728464));
var RouteStop3 = new RouteStop(new LatLon(33.537614,-117.687859));

// Create an array of route stops
var StopsArray = [RouteStop1, RouteStop2, RouteStop3];

// Specify a routing strategy --  RoutingStrategyFastest is the default
var RoutingStrategyFastest = new Telogis.GeoBase.Routing.RoutingStrategyFastest();

// Create a new route
var myRoute = new Telogis.GeoBase.Routing.Route({
        stops: StopsArray,
        strategy: RoutingStrategyFastest
});

// Was the route created? Check that there are three stops...

// document.onclick = myTestFunction;
function myTestFunction() {
        alert ('There are ' + myRoute.getStopCount() + ' stops in this route.');
};
Routing.RouteStop

A wrapper class for containing a route stop in a format understood by the server. In all other situations, LatLons should be used instead, and since the conversion between the two is handled by the Routing.Route class, this class need not be used directly.

JavaScript
var myRouteStop = new Telogis.GeoBase.Routing.RouteStop(new Telogis.GeoBase.LatLon(33.612914,-117.745395));
Routing.RoutingProfile

A class used to determine the speed profile (the permitted speed of travel), based on either speed category or a custom speed profile generated using an array of 48 speed values (one for each functional class and speed combination). This array is constructed using six consecutive blocks of eight elements. Each block represents a functional class (1-6), the first block represents functional class 1, the second block functional class 2, etc. The first element in the each block corresponds to speed category 1, the second element speed category 2, etc. These profiles are used when routing, and applied as a Routing.RoutingStrategy.

JavaScript
var speed = Telogis.GeoBase.SpeedUnit.MilesPerHour;
var strategy = new Telogis.GeoBase.Routing.RoutingStrategyFastest();
var profile = new Telogis.GeoBase.Routing.RoutingProfile();
// For every speed category (1-8)
for (speedCat = 1; speedCat <9; ++speedCat) {
    // And every functional class (1-6)
    for (var funcClass = 1; funcClass < 7; ++funcClass) {
    // Set the profile speed to 10mph
    profile.setSpeed(speedCat, funcClass, 10, speed);
    }
}
// Apply the routing profile to the strategy in the UK
strategy.setProfile("UK", profile);
Routing.RoutingStrategy

Describes a set of constraints to which the routing engine should adhere when calculating a route.

JavaScript
// Create a strategy that allows u-turns, road crossings and travel along toll roads.
var myStrategy = new Telogis.GeoBase.Routing.RoutingStrategy({
    allowUTurns: true,
    extraProcessingRatio: 1,
    roadCrossingBehavior: 'Telogis.GeoBase.Routing.RoadCrossingBehavior.ALLOWED',
    // ALLOWED is the default. Alternative options are 'DISCOURAGED' and 'FORBIDDEN'
    useTollRoads: true
});

// Create a route
var myRoute = new Telogis.GeoBase.Routing.Route();

// Apply the strategy to the route
myRoute.setStrategy(myStrategy);
Routing.RoutingStrategyFastest

A type of Routing.RoutingStrategy that specifies a custom callback on the server to favor faster routes.

JavaScript
var fastest_strategy = new Telogis.GeoBase.Routing.RoutingStrategyFastest();
route.setStrategy(fastest_strategy);
Routing.RoutingStrategyShortest

A type of Routing.RoutingStrategy that specifies a custom callback on the server to favor shorter routes.

JavaScript
var shortest_strategy = new Telogis.GeoBase.Routing.RoutingStrategyShortest();
route.setStrategy(shortest_strategy);
Routing.SFRampMovementEvent

A wrapper class to be filled server-side that represents an SF ramp movement.

Routing.SplitMovementEvent

A wrapper class to be filled server-side that represents a split movement.

Routing.StateChangesNoteEvent

A wrapper class to be filled server-side that represents a Routing.DrivingNote, denoting a street name change.

Routing.TollwayBeginsNoteEvent

A wrapper class to be filled server-side that represents a Routing.DrivingNote, denoting a street name change.

Routing.TollwayEndsNoteEvent

A wrapper class to be filled server-side that represents a Routing.DrivingNote, denoting a street name change.

Routing.TurnMovement

A wrapper class to be filled server-side that represents a turn movement.

Routing.VehicleSpec

Used to describe a vehicle's specifications.

JavaScript
// Create a new vehicle specifications object
var VehSpec = new Telogis.GeoBase.Routing.VehicleSpec();

// Set some vehicle properties (weight, height, length, width etc.)
VehSpec.GrossWeight_kg = 30000; // 30 tonnes
VehSpec.Height_cm = 410; // 4.1 meters high
VehSpec.Length_cm = 1800; // 18 meters long
VehSpec.Width_cm = 260; // 2.6 meters wide

// Apply the VehicleSpec to a route --
// Routes will now be generated that are safe for a vehicle with
// the described specifications. For example, avoiding bridges
// that are too low or too narrow, or that cannot support the
// vehicle's weight
myRoute.setVehicleSpec(VehSpec);
Routing.VehicleType

Describes a type of vehicle. When applied to a route as a vehicle specification, routes suitable for the specified vehicle type will be generated. For example, Emergency vehicles will be routed using emergency vehicle lanes and directions; and Taxi, CarPool and Bus vehicle types will be routed along suitable restricted traffic lanes where available.

JavaScript
// Create a new vehicle specifications object
var VehSpec = new Telogis.GeoBase.Routing.VehicleSpec();

// Set the vehicle type (tractor semi trailer)
VehSpec.VehicleType = Telogis.GeoBase.Routing.VehicleType.TractorSemiTrailer;

// Apply the VehicleSpec to a route --
// Routes will now be generated that are legal for the vehicle type
myRoute.setVehicleSpec(VehSpec);
Routing.VehicleType.LoadType

Describes a load carried by a vehicle. Hazardous loads should be categorized using a HAZMAT category.

Routing.Waypoint

A wrapper class for containing a waypoint in a format understood by the server. In all other situations, LatLons should be used instead, and since the conversion between the two is handled by the Routing.Route class, this class need not be used directly.

Routing.WayPointEvent

A wrapper class to be filled server-side that represents a waypoint event.

Size

Represents the 2D spatial dimensions of an object.

Skin

An abstract base class defining functionality common to all types of more specific skin. Primarily, it will manage loading the skin's constituent images.

SpeedUnit

A collection of values representing the various speed units that can be used with MathUtil. While each of these values should be used primarily as a code to represent its corresponding unit, it is also the string abbreviation of the unit and can thus be used for labelling.

Street

Represents a physical street.

TimeUnit

A collection of values representing the various time units that can be used with MathUtil. While each of these values should be used primarily as a code to represent its corresponding unit, it is also the string abbreviation of the unit and can thus be used for labelling.

Transitions

Contains classes and functions for dealing with image transitions.

Transitions.TimeLine

Provides a simple way to handle transitions.

Transitions.Transition

A class for wrapping together all the different factors involved in performing a transition. Once constructed, it can be passed to a Transitions.TimeLine for execution.

Widgets

Contains all widgets and widget-related functions for the JavaScript GeoStream API. This also acts as a global hash for all instantiated derivations of MapLayers.AbstractLayer, so that if a reference is not kept to such an object, it can be accessed like so:

JavaScript
var Widgets = Telogis.GeoBase.Widgets;
var Map     = Telogis.GeoBase.Widgets.Map;

new Map ({id: 'main_map'});
var map = Widgets ['main_map'];
Widgets.AbstractWidget

A class from which elements such as maps and map controls are derived.

Widgets.Dock

A map widget designed to contain others, such as a slider and scale, to neatly dock them against one edge of the map.

Widgets.DockSkin

A near-trivial skin wrapper describing the customizable appearance of a Widgets.Dock. Since such a dock is skinned merely by an unsized background image and a border style, it is not necessary to wait for this skin to load before use.

Widgets.Map

Represents a displayed map on the page -- the main component of the GeoStream mapping framework. A MapLayers.TileLayer is implicitly created with the map; other layers can be constructed later. All layers belonging to the map can be accessed by subscripting the map variable with their IDs, like so:

JavaScript
var Map         = Telogis.GeoBase.Widgets.Map;
var ObjectLayer = Telogis.GeoBase.MapLayers.ObjectLayer;

var map = new Map ({id: 'main_map'});
new ObjectLayer ({id: 'pin_layer', map: map});

var layer = map ['pin_layer'];
Widgets.MapControl

An abstract skinnable map widget.

Widgets.Scale

A widget to show the distances represented by a map.

Widgets.ScaleSkin

A simple class that combines all the information describing the appearance of a map-scale widget, and can be used to theme map-scales reasonably painlessly.

Widgets.Slider

A skinnable widget used to control zoom levels on a map.

Widgets.SliderSkin

A small class collecting all the customizable appearance information for a zoom / slider map control and presenting some simple methods to help apply it.

XMLDoc

A class that provides a wrapper around all of the basic required XML functionality to abstract the differences in implementations between web browsers.