API Getting Started


Mapworks Studio is a rich Geographic Information System (GIS) mapping Application Programming Interface (API). It provides simple and advanced mapping components, which can be used or customised within an end user’s application.

The Mapworks Studio JavaScript library is divided into two portions; the Core and the App. The Core provides the essentials, such as map controls, scale bars, tooltips, and so forth. The App provides feature rich components such as, layer trees, query builders, analysis tools and so forth.

Interactivity

The essence of Mapworks Studio is to have data at the user’s fingertips, with an emphasis on interactivity. This implies that the real underlying data is pushed to the client, in contrast to rendering a bitmap representation of a map on the server and then sending it to the client. Pushing data to the client is an intentional design philosophy, which permits the user to interact, style, manipulate data and create unique robust applications that utilise this data.

Styling

Styling is a fundamental and powerful feature that Mapworks Studio provides out of the box. Mapworks Studio’s powerful styling API allows the user, map designer or programmer to update specific styles in real-time without the need to re-download data from the server.

This is significantly different from tiled based mapping solutions as styling can be done in real-time on the client, as opposed to saving and retrieving modified tiles from the server.

Vector, Vectors, Vectors...

The Mapworks Studio API also provides a way for developers to create various map features, such as lines, polygons, circles, and points.

These features can be added, modified and removed in real-time, the following is an example of basic client side path-finding and drawing of client side features.

Real-time visualisations can be created by adding or removing features. The following is a simple example of this.

The Mapworks Studio API

Basic Diagram

The following diagram illustrates the basic components that make up a Mapworks Studio map. 

Maps and Tree Nodes

A map contains a single root tree node, which in itself can contain a hierarchy of layers, groups and map references.

Map

  • Loads and saves maps from the server.
  • Emits map related events (panning, zooming, etc).
  • Maintains the root tree node.
  • Maintains map controls.
  • Maintains map modules.

Tree Node

  • The model representation of layers, groups and map references.
  • The order of the nodes equal the draw order.
  • Provides utilities to find, traverse and or remove nodes from the map.

Vector Layers and Features

A vector layer can contain multiple features, such as circles, polygons, polylines or points.

Vector Layer

  • Contains a feature set, that represents a table in a database.
  • Can contain zero or more features.
  • Can be styled.

Feature

  • Abstract feature class.
  • Corresponds to a single row in a database table.
  • Has a geometry.
  • Either a circle, polygon, polyline or point..
  • Cannot be styled independently of a layer.

Now that you have some of the basic concepts, lets learn how to embed your own Mapworks map

Next: Embedding a Mapworks Map