GpsGate Server JavaScript API

Map  1.0.0

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

Class Franson.Map.GMap - extends Franson.Map.IMap

basic interface very similar to GMap, should be possible to implement ontop of most underlying map implementations. todo: create an instantiator (plugin factory) for all map-types todo: more event forwarding see Franson.GUtil for other GMap specific helpers

Constructor

Franson.Map.GMap(div, [options])
Parameters:
div <DOM|string> (is supplied a div it must have an .id)
[options] <literal> see Franson.GUtil.setupMap:options for spec.

Properties

_events - private GEvent[]


_gmapOverlay - private object

should rarely need to be accessed

_map - private object


_mapSurface - private object


id - string

Default Value: 'gmap'

type - static final string

Default Value: 'gmap'

Properties inherited from Franson.Map.IMap:

Methods

__connect__

private void __connect__()
Returns: void

_restoreState

protected void _restoreState()
for StateManager
Returns: void

_saveState

protected void _saveState()
for StateManager
Returns: void

addLayer

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

checkResize

void checkResize()
Returns: void

clearLayers

void clearLayers()
Returns: void

closeInfoWindow

void closeInfoWindow()
see GMap.closeInfoWindow (note that this is not supported for custom maps yet (uses native GMap infowin))
Returns: void

destroy

void destroy()
destructor
Returns: void

getBounds

Franson.Geo.Bounds getBounds()
Returns: Franson.Geo.Bounds

getBoundsZoomLevel

number getBoundsZoomLevel(bounds)
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: number

getCenter

LatLng getCenter()
Returns: LatLng

getContainer

DOM getContainer()
Returns: DOM

getLayer

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

getLayers

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

getNativeMap

GMap2 getNativeMap()
Returns: GMap2

getProjection

Projection getProjection()
Returns: Projection

getSize

(w, h) getSize()
Returns: (w, h)

getSurface

Franson.Map.MapSurface getSurface()
Returns: Franson.Map.MapSurface

getZoom

number getZoom()
Returns: number

isLoaded

boolean isLoaded()
see GMap.isLoaded todo: should fire the 'onload' signal also (though not sure if we can trust GMap to re-fire it.. (can only be done if we create a complete wrapper))
Returns: boolean

openInfoWindow

void openInfoWindow(latlng, node, [options])
see GMap.openInfoWindo note that we don't support tabs etc (and currently not the html version) (also note that this is currently not supported for custom maps)
Parameters:
latlng <LatLng>
node <DOM>
[options] <object>
Returns: void

panBy

void panBy(distance)
Parameters:
distance <(w,h)>
Returns: void

panTo

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

removeLayer

void removeLayer(layer)
todo: should this be able to take both a layer and a string? (id)
Parameters:
layer <Franson.Map.ILayer>
Returns: void

setCenter

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

setZoom

void setZoom(zoom)
Parameters:
zoom <number>
Returns: void

zoomIn

void zoomIn()
Returns: void

zoomOut

void zoomOut()
Returns: void

Events

onaddlayer

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

onremovelayer

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


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