GpsGate Server JavaScript API

Interface  1.0.0

GpsGate Server JavaScript API > Interface > Franson.Map.IMap
Search:
 
Filters

Class Franson.Map.IMap

Known Subclasses:
Franson.Map.GMap

Interface specification for the abstract Map interface.

Reference stub for creating a map interface compatible with GpsGate Server applications (v2.1.1+) Instantiated via the Custom Scripts plugin mechanism.

The interface is largely inspired by Google Maps since it is a proven and well documented technology for web-maps, thus most tile based web maps should be possible to fit to it.
ref: Google Maps API Reference

reference: - Franson.Geo module (Franson.Geo/geo.js) Vector math: - Franson.Common (Franson.Common/Vec2.js) other notes: - all external events are handled using MochiKit.Signal - ..

Constructor

Franson.Map.IMap(div)
Parameters:
div <string|div> if passsed a div the div must have an .id property

Properties

_container - private DIV

could extract from map also (if exposed)

_map - private NativeMapType


_mapSurface - private Franson.Map.MapSurface


id - string

per object

type - static final string

unique id for the map adapter type (per class level)

Methods

__connect__

private void __connect__()
you should not need to modify this
signal connection interceptor. currently only used to monitor delayed 'onload' connections.
called indirectly by MochiKit.Signal.connect() todo: should inject this as a mixin.
Returns: void

_restoreState

protected void _restoreState(state)
you should not need to modify this
not strictly necessary. Used by StateManager
Parameters:
state <object>
Returns: void

_saveState

protected object _saveState()
you should not need to modify this
not strictly necessary. Used by StateManager.
Returns: object
must be JSON-serializable.

addLayer

void addLayer(layer)
you should not need to modify this
Parameters:
layer <Franson.Map.ILayer>
Returns: void

checkResize

void checkResize()
Notifies the map of a change of the size of its container.
Call this method after the size of the container DOM object has changed, so that the map can adjust itself to fit the new size. see GMap.checkResize()
Returns: void

clearLayers

void clearLayers()
you should not need to modify this
note that this doesn't .destroy the layers (but it disconnects events from the layers)
Returns: void

closeInfoWindow

void closeInfoWindow()
[*not implemented yet*] Closes the currently open info window. see GMap.closeInfoWindow()
Returns: void

destroy

void destroy()
destructor
frees all used resources. Disconnects DOM-nodes, event-handlers etc destructor
Returns: void

getBounds

Franson.Geo.Bounds getBounds()
Returns the the visible rectangular region of the map view in geographical coordinates. see GMap.getBounds()
Returns: Franson.Geo.Bounds

getBoundsZoomLevel

integer getBoundsZoomLevel(bounds)
Returns the zoom level at which the given rectangular region fits in the map view. The zoom level is computed for the currently selected map type. If no map type is selected yet, the first on the list of map types is used. see GMap.getBoundsZoomLevel() or just expose a zoomToFit(bounds) ? todo: we need some way of signalling wheter the bounds/zoom fit our not.. (other maps will quite often "fail" here due to lack of resolution..)
Parameters:
bounds <Franson.Geo.Bounds>
Returns: integer

getCenter

LatLng getCenter()
Returns the geographical coordinates of the center point of the map view. see GMap.getCenter()
Returns: LatLng

getContainer

DOM getContainer()
you should not need to modify this
Returns the DOM object that contains the map see GMap.getContainer()
Returns: DOM

getLayer

Franson.Map.ILayer getLayer(id)
you should not need to modify this
currently O(N)
Parameters:
id <string>
Returns: Franson.Map.ILayer

getLayers

Franson.Map.ILayer[] getLayers()
you should not need to modify this
Returns: Franson.Map.ILayer[]

getNativeMap

NativeMapType getNativeMap()
you should not need to modify this
returns the wrapped map-type.
(should rarely need to be used, typically users inspects the .type property also)
Returns: NativeMapType

getProjection

Franson.Map.IProjection getProjection()
you should not need to modify this
Returns: Franson.Map.IProjection

getSize

(w, h) getSize()
Returns the size of the map view in pixels. see GMap.getSize()
Returns: (w, h)

getSurface

Franson.Map.MapSurface getSurface()
you should not need to modify this
Returns: Franson.Map.MapSurface

getZoom

integer getZoom()
Returns the current zoom level. see GMap.getZoom()
Returns: integer

isLoaded

boolean isLoaded()
Returns: boolean

openInfoWindow

void openInfoWindow(latlng, node, [options])
[*not implemented yet*] Opens a simple info window at the given point. Pans the map such that the opened info window is fully visible. The content of the info window is given as a DOM node. see GMap.openInfoWindow() note that we don't support tabs etc (and currently not the html version)
Parameters:
latlng <LatLng>
node <DOM> content DOM node
[options] <object>
Returns: void

panBy

void panBy(distance)
Parameters:
distance <(w,h)> .w and .h params default to 0, i.e you can supply only .w for example
Returns: void

panDirection

void panDirection(dx, dy)
Starts a pan animation by half the width of the map in the indicated directions. +1 is right and down, -1 is left and up, respectively. see GMap.panDirection()
Parameters:
dx <integer>
dy <integer>
Returns: void

panTo

void panTo(center)
Parameters:
center <LatLng>
Returns: void

removeLayer

void removeLayer(layer)
you should not need to modify this
currently O(N)
Parameters:
layer <Franson.Map.ILayer|string> a layer object or a string (layer-id)
Returns: void

setCenter

void setCenter(center, [zoom])
Parameters:
center <LatLng>
[zoom] <number>
Returns: void

setZoom

void setZoom(zoom)
set zoom level. larger values => zoom in see GMap.setZoom()
Parameters:
zoom <integer>
Returns: void

zoomIn

void zoomIn()
Returns: void

zoomOut

void zoomOut()
Returns: void

Events

onaddlayer

onaddlayer ( layer )
fired in addLayer()
Parameters:
layer <Franson.Map.ILayer> the added layer

onclearlayers

onclearlayers ( )
fired in clearLayers()

onclick

onclick ( latlng )
Parameters:
latlng <LatLng>

ondblclick

ondblclick ( latlng )
Parameters:
latlng <LatLng>

oninfowindowclose

oninfowindowclose ( )

oninfowindowopen

oninfowindowopen ( )

onload

onload ( )
fired when map setup is complete and isLoaded() would return true.
see GMap.load

onmousemove

onmousemove ( latlng )
Parameters:
latlng <LatLng>

onmouseout

onmouseout ( latlng )
Parameters:
latlng <LatLng>

onmouseover

onmouseover ( latlng )
Parameters:
latlng <LatLng>

onremovelayer

onremovelayer ( layer )
fired in removeLayer()
Parameters:
layer <Franson.Map.ILayer> the removed layer

onzoomend

onzoomend ( oldLevel , newLevel )
fired in setZoom(), zoomIn(), zoomOut() (and setCenter() if zoom was changed)
see GMap.zoomend
Parameters:
oldLevel <integer>
newLevel <integer>


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