GpsGate Server JavaScript API

Map  1.0.0

GpsGate Server JavaScript API > Map > Franson.Map.MapSurface
Search:
 
Filters

Class Franson.Map.MapSurface

generic map graphics surface
(no GMap or other map-type coupling, only projection), full setup is made in the .init() method.

Constructor

Franson.Map.MapSurface(projection, [options])
Parameters:
projection <Franson.Map.IProjection>
[options] <literal>

Properties

_div - private DOM


_layers - private Franson.Map.ILayer[]


_projection - private object

wrap the incoming projection to handle our margins (essentially creating our own divpixels version)

_surface - private dojox.gfx.Surface


Methods

_getCullBounds

private Franson.Geo.Bounds _getCullBounds()
bounds including the margin
Returns: Franson.Geo.Bounds

_setupEventHandlers

private void _setupEventHandlers()
Returns: void

addLayer

void addLayer(layer)
Parameters:
layer <Franson.Map.ILayer>
Returns: void

clear

void clear()
todo: or skip this? (should use clearOverlays, clearLayers)
Returns: void

clearLayers

void clearLayers()
note that this doesn't .destroy the layers (but it disconnect events from layers)
Returns: void

destroy

void destroy()
destructor
Returns: void

getBounds

Franson.Geo.Bounds getBounds()
should be the same as the map's bounds (viewport bounds)
Returns: Franson.Geo.Bounds

getCenter

LatLng getCenter()
should be the same as the map's center
Returns: LatLng

getContainer

DOM getContainer()
Returns: DOM

getGfxSurface

dojox.gfx.Surface getGfxSurface()
Returns: dojox.gfx.Surface

getLayer

Franson.Map.ILayer getLayer(id)
currently O(N)
Parameters:
id <string>
Returns: Franson.Map.ILayer

getLayers

Franson.Map.ILayer[] getLayers()
Returns: Franson.Map.ILayer[]

getProjection

Projection getProjection()
normally (but not necessarily) same as map's projection
Returns: Projection

getRoot

dojox.gfx.Creator(Group) getRoot()
Returns: dojox.gfx.Creator(Group)
root group

getSize

(w,h) getSize()
should be the same as the map's size
Returns: (w,h)
pixels

hide

void hide()
Returns: void

init

void init(parentDivOrId, [size=size(parentDivOrId)])
Parameters:
parentDivOrId <DOM|string>
[size=size(parentDivOrId)] <(w,h)>
Returns: void

isHidden

boolean isHidden()
Returns: boolean

redraw

void redraw(offset, [force=true])
Called by the map when the map display has changed.
Parameters:
offset <(x,y)> distance from the parent DIV's(pane) to the visible viewport. // todo: or should we've taken a function (similar to Projection) that returns the offset?
[force=true] <boolean> true if the zoom level or the pixel offset of the map view has changed, so that the pixel coordinates need to be recomputed.
Returns: void

remove

void remove()
Returns: void

removeLayer

void removeLayer(layer)
currently O(N)
Parameters:
layer <Franson.Map.ILayer|string> a layer object or a string (layer-id)
Returns: void

resize

void resize(size)
Parameters:
size <(w,h)>
Returns: void

show

void show()
Returns: void


Copyright © 2009 Franson Technology AB, Sweden. All rights reserved.