GpsGate Server JavaScript API

Map  1.0.0

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

static Class Franson.GUtil

namespace

Google Map utilities todo: split in separate modules, many functions here are perfect examples of functionality that could be added as CustomScripts plugins. todo: rename Franson.GMap? (and put in a Franson.Map sub module?)

Methods

addPartialZoomControl

void addPartialZoomControl(map, [smallControl=false])
zoom control but without the panning arrows (does anyone use them?) (must always reside in top-left corner)
Parameters:
map <GMap2>
[smallControl=false] <boolean>
Returns: void

enableDragZoom

void enableDragZoom(map)
front-end to DragZoom todo: should write our own, only using map-surface.
Parameters:
map <GMap2>
Returns: void

enableOverviewMap

void enableOverviewMap(map)
enables the GOverviewMapControl but makes it initially hidden
Parameters:
map <GMap2>
Returns: void

getDivPixelOffset

(x,y) getDivPixelOffset(map)
coordinates of UL (origo) of the viewport relative to the overlay div.
Parameters:
map <GMap2>
Returns: (x,y)

getProjection

Franson.Map.IProjection getProjection(map)
extracts the GProjection object as a closure (for use in GMapGraphicsAdapter etc) see fromContainerPixelToLatLng and see fromLatLngToPixel
Parameters:
map <GMap2>
Returns: Franson.Map.IProjection

getVersion

[number, number, string] getVersion([version=G_API_VERSION])
normalizes the version so it can more easily be compared example [2, 153, 'c']
Parameters:
[version=G_API_VERSION] <string>
Returns: [number, number, string]

in3dMode

boolean in3dMode(map)
is map currently set to use the Google Earth plugin? see G_SATELLITE_3D_MAP and Google Earth API
Parameters:
map <GMap2>
Returns: boolean

isGMapScriptLoaded

boolean isGMapScriptLoaded([minVersion])
Parameters:
[minVersion] <string>
Returns: boolean

listenOnce

EventHandler listenOnce(source, event, callback)
same as GEvent.addListener but automatically unhooks on first call todo: support context obj? see Franson.Event.listenOnce()
Parameters:
source <GObject>
event <string>
callback <function>
Returns: EventHandler
typically ignored (the purpose of this function..). but might be useful if cancelling is needed.

reverseGeocode

Deferred reverseGeocode(pos)
note that this doesn't need an instantiated GMap to work needs GMap v2.133d+ todo: create a separate rev-geocode package that wraps several impl. (geonames etc) (and then move to .Geo module)
Parameters:
pos <LatLng>
Returns: Deferred

setupMap

GMap2 setupMap(div, [options])
convenience to setup "everything" at once a mix of the standard flags and settings and our custom functionality note: also handles the GUnload on page-unload.
Parameters:
div <DOM|string> (a div must have an id)
[options] <literal> (todo: document)
Returns: GMap2
Google Map object (todo: perhaps return GMapAdapter? (or wrap another level))


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