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
_layers
- private Franson.Map.ILayer[]
wrap the incoming projection to
handle our margins (essentially creating our own divpixels version)
Methods
private
Franson.Geo.Bounds
_getCullBounds()
bounds including the margin
- Returns:
Franson.Geo.Bounds
private
void
_setupEventHandlers()
void
addLayer(layer)
- Parameters:
-
layer
<Franson.Map.ILayer>
- Returns:
void
void
clear()
todo: or skip this? (should use clearOverlays, clearLayers)
void
clearLayers()
note that this doesn't .destroy the layers (but it disconnect events from layers)
void
destroy()
destructor
Franson.Geo.Bounds
getBounds()
should be the same as the map's bounds (viewport bounds)
- Returns:
Franson.Geo.Bounds
LatLng
getCenter()
should be the same as the map's center
dojox.gfx.Surface
getGfxSurface()
- Returns:
dojox.gfx.Surface
Franson.Map.ILayer
getLayer(id)
currently O(N)
- Parameters:
-
id
<string>
- Returns:
Franson.Map.ILayer
Franson.Map.ILayer[]
getLayers()
- Returns:
Franson.Map.ILayer[]
Projection
getProjection()
normally (but not necessarily) same as map's projection
dojox.gfx.Creator(Group)
getRoot()
- Returns:
dojox.gfx.Creator(Group)
- root group
(w,h)
getSize()
should be the same as the map's size
void
init(parentDivOrId, [size=size(parentDivOrId)])
- Parameters:
-
parentDivOrId
<DOM|string>
-
[size=size(parentDivOrId)]
<(w,h)>
- Returns:
void
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
void
removeLayer(layer)
currently O(N)
- Parameters:
-
layer
<Franson.Map.ILayer|string>
a layer object or a string (layer-id)
- Returns:
void
void
resize(size)
- Parameters:
-
size
<(w,h)>
- Returns:
void