bbbfly. Map class control

new bbbfly.Map (def, ref, parent)

Map control providing easy way to handle Leaflet map.

Parameters

Name Type Description
def bbbfly.Map.Definition optional Descendant definition
ref object optional Reference owner
parent object | string optional Parent DIV element or its ID

Properties

Name Type Default Description
Crs bbbfly.Map.crs PseudoMercator Default map coordinate reference system
BoundsPadding padding | px null Use this padding to fit bounds or coords
MaxBounds mapBounds null Keep map within these bounds
MinZoom number null Map minimal zoom level
MaxZoom number null Map maximal zoom level
Animate number true If map animation is allowed
Layers Array.<bbbfly.Map.Layer> [] Map layers definition
DefaultLayer bbbfly.Map.Layer Overrides layer type values
Examples
var appForm;
function ngMain(){
  appForm = new ngControls({
    Map: {
      Type: 'bbbfly.Map',
      L:0,T:0,R:0,B:0,
      Data: {
        Layers: [
          ...
        ]
      }
    }
  });
  appForm.Update();
}

Extends

In Packages

Type Definitions

attribution object

Layer attribution.
Properties:
Name Type Description
Name string optional
Attributions Array.<string>

layer object

Leaflet layer wrapper.
Properties:
Name Type Description
Id string
Display bbbfly.Map.Layer.display
NameRes string optional Layer name resource ID
Name string | object optional Layer name by language in format {lang: 'name'}
Visible boolean
Layer mapLayer

listener object

Map Events listener.
Properties:
Name Type Description
Listen Array.<string> Names of events to listen
EventName... function Event function implementations

Interfaces

Members

static crs enum string

Supported coordinate reference systems.
Name Type Default Description
WorldMercator string EPSG3395
PseudoMercator string EPSG3857
WGS84 string EPSG4326

Methods

inherited AddChildControl (ctrl)

Parameters:
Name Type Description
ctrl ngControl optional Child control reference
See:

AddLayer (def){boolean}

Add new map layer.
Parameters:
Name Type Description
def bbbfly.Map.Layer
See:
Returns:
Type Description
boolean - If layer was added

AddLayers (defs){boolean}

Add new map layers.
Parameters:
Name Type Description
defs Array.<bbbfly.Map.Layer>
See:
Returns:
Type Description
boolean - If all layers were added

inherited CreateControl (def){object|null}

Parameters:
Name Type Description
def ngControl.Definition optional Child control definition
See:
Returns:
Type Description
object | null Created control
Create Leaflet layer wrapper.
Parameters:
Name Type Description
def bbbfly.Map.Layer
See:
Returns:
Type Description
bbbfly.Map.layer

CreateMap (){object}

Create Leaflet map.
See:
Returns:
Type Description
object Leaflet Map

DestroyMap (){boolean}

Destroy Leaflet map.
See:
Returns:
Type Description
boolean If map was destroyed

inherited DisposeControls ()

See:

DoCreateMap (options){object}

Do reate Leaflet map from its options.
Parameters:
Name Type Description
options object Leaflet Map options
See:
Returns:
Type Description
object Leaflet Map

DoGetLayerName (layer){string|null}

Get layer name for current language.
Parameters:
Name Type Description
layer bbbfly.Map.layer
Returns:
Type Description
string | null

EnableAnimation (enable){boolean}

Enable or disable map animation.
Parameters:
Name Type Description
enable boolean
Returns:
Type Description
boolean If state has changed

FitBounds (bounds, padding){boolean}

Pan and zoom map to fit certain bounds with padding.
Parameters:
Name Type Description
bounds mapBounds Bounds to fit
padding padding Padding between map edge and bounds
See:
Returns:
Type Description
boolean If fit was successful

FitCoords (coords, padding){boolean}

Pan and zoom map to fit certain bounds with padding.
Parameters:
Name Type Description
coords mapPoint Coordinates to fit
padding padding Padding between map edge and coords
See:
Returns:
Type Description
boolean If fit was successful

inherited GetAlt (){string|null}

See:
Returns:
Type Description
string | null
Get all layers attributions.
See:
Returns:
Type Description
bbbfly.Map.attribution

GetBoundsPadding (padding){padding}

Get map bounds padding.
Parameters:
Name Type Description
padding padding optional Bounds padding
See:
Returns:
Type Description
padding Bounds padding

GetCenter (){mapPoint|null}

Get map position.
See:
Returns:
Type Description
mapPoint | null Center point

inherited GetClassName (suffix){string}

Parameters:
Name Type Description
suffix string optional Control part class name
Returns:
Type Description
string Control class name

inherited GetControlsHolder (){object}

See:
Returns:
Type Description
object ControlsPanel control or self

inherited GetControlsPanel (){object|null}

See:
Returns:
Type Description
object | null ControlsPanel control

inherited GetFrame (){bbbfly.Renderer.frame}

Returns:
Type Description
bbbfly.Renderer.frame Frame definition

inherited GetFrameDims (){object}

Returns:
Type Description
object Frame dimensions

inherited GetFramePanel (){object|null}

See:
Returns:
Type Description
object | null FramePanel control
Get map layer.
Parameters:
Name Type Description
id string
See:
Returns:
Type Description
bbbfly.Map.layer

GetLayerName (id){string|null}

Get layer name for current language.
Parameters:
Name Type Description
id string
Returns:
Type Description
string | null

GetLayers (){Array.<bbbfly.Map.layer>}

Get map layers.
See:
Returns:
Type Description
Array.<bbbfly.Map.layer>

GetMap (){object}

Get Leaflet map.
See:
Returns:
Type Description
object Leaflet Map

GetMapLayerName (mapLayer){string|null}

Get map layer name for current language.
Parameters:
Name Type Description
mapLayer L.Layer
Returns:
Type Description
string | null

GetMaxZoom (){number|null}

Get map maximal zoom level.
See:
Returns:
Type Description
number | null zoom - Zoom level

GetMinZoom (){number|null}

Get map minimal zoom level.
See:
Returns:
Type Description
number | null zoom - Zoom level

inherited GetState (){bbbfly.Renderer.state}

Returns:
Type Description
bbbfly.Renderer.state Control state

GetZoom (){number|null}

Get map zoom level.
See:
Returns:
Type Description
number | null zoom - Zoom level

inherited RemoveChildControl (ctrl)

Parameters:
Name Type Description
ctrl ngControl optional Child control reference
See:

RemoveLayer (id){boolean}

Remove map layer.
Parameters:
Name Type Description
id string
See:
Returns:
Type Description
boolean - If layer was removed

RemoveLayers (ids){boolean}

Remove map layers.
Parameters:
Name Type Description
ids Array.<string> optional All layers will be removed if no ID is passed
See:
Returns:
Type Description
boolean - If all layers were removed

inherited SetAlt (alt, update)

Parameters:
Name Type Default Description
alt string | null Value to set
update boolean true optional If update control
See:

SetBoundsPadding (padding){boolean}

Set map bounds padding.
Parameters:
Name Type Description
padding padding | px Bounds padding
See:
Returns:
Type Description
boolean If padding was set

SetCenter (coords){boolean}

Set map position.
Parameters:
Name Type Description
coords mapPoint Center point
See:
Returns:
Type Description
boolean If center was set

inherited SetEnabled (enabled, update){boolean}

Parameters:
Name Type Default Description
enabled boolean true optional Value to set
update boolean true optional If update control
See:
Returns:
Type Description
boolean False if change was denied

inherited SetInvalid (invalid, update){boolean}

Parameters:
Name Type Default Description
invalid boolean true optional Value to set
update boolean true optional If update control
See:
Returns:
Type Description
boolean False if change was denied

SetLayerVisible (id, visible){boolean}

Shows or hides map layer.
Parameters:
Name Type Description
id string
visible boolean
See:
Returns:
Type Description
boolean - If layer visibility was set

SetMaxBounds (bounds){boolean}

Set maximal map bounds.
Parameters:
Name Type Description
bounds mapBounds | array Maximal bounds
See:
Returns:
Type Description
boolean If bounds were set

SetMaxZoom (zoom){boolean}

Set maximal map zoom level.
Parameters:
Name Type Description
zoom number Zoom level
See:
Returns:
Type Description
boolean If zoom was set

SetMinZoom (zoom){boolean}

Set minimal map zoom level.
Parameters:
Name Type Description
zoom number Zoom level
See:
Returns:
Type Description
boolean If zoom was set

inherited SetOverflow (overflowX, overflowY, update){boolean}

Parameters:
Name Type Default Description
overflowX bbbfly.Renderer.overflow hidden optional Horizontal value to set
overflowY bbbfly.Renderer.overflow hidden optional Vertical value to set
update boolean true optional If update control
See:
Returns:
Type Description
boolean False if change was denied

inherited SetReadOnly (readonly, update){boolean}

Parameters:
Name Type Default Description
readonly boolean true optional Value to set
update boolean true optional If update control
See:
Returns:
Type Description
boolean False if change was denied

inherited SetSelected (selected, update){boolean}

Parameters:
Name Type Default Description
selected boolean true optional Value to set
update boolean true optional If update control
See:
Returns:
Type Description
boolean False if change was denied

SetView (coords, zoom){boolean}

Set map position and zoom level.
Parameters:
Name Type Description
coords mapPoint Center point
zoom number Zoom level
See:
Returns:
Type Description
boolean If view was set

SetZoom (zoom){boolean}

Set map zoom level.
Parameters:
Name Type Description
zoom number Zoom level
See:
Returns:
Type Description
boolean If zoom was set

inherited TrackChildControls ()

inherited TrackControl (ctrl, track)

Parameters:
Name Type Default Description
ctrl ngControl optional Tracked control reference
track boolean true optional Pass false to cancel tracking

ZoomIn (zoomBy){boolean}

Zoom map in.
Parameters:
Name Type Description
zoomBy number Number of zoom levels
See:
Returns:
Type Description
boolean If map was zoomed

ZoomOut (zoomBy){boolean}

Zoom map out.
Parameters:
Name Type Description
zoomBy number Number of zoom levels
See:
Returns:
Type Description
boolean If map was zoomed

Events

inherited IsTrackedControlChanged (ctrl, options)

Parameters:
Name Type Description
ctrl ngControl optional Tracked control reference
options object optional Per tracker options
See:

inherited OnChildControlAdded (ctrl)

Parameters:
Name Type Description
ctrl ngControl optional Child control reference
See:

inherited OnChildControlRemoved (ctrl)

Parameters:
Name Type Description
ctrl ngControl optional Child control reference
See:

inherited OnEnabledChanged ()

See:

inherited OnInvalidChanged ()

See:

OnLayersChanged ()

See:

inherited OnOverflowChanged ()

See:

inherited OnReadOnlyChanged ()

See:

inherited OnSelectedChanged ()

See:

inherited OnSetAlt (alt, update){boolean}

Parameters:
Name Type Default Description
alt boolean Value to set
update boolean true optional If update control
See:
Returns:
Type Description
boolean Return false to deny value change

inherited OnSetEnabled (enabled){boolean}

Parameters:
Name Type Description
enabled boolean Value to set
See:
Returns:
Type Description
boolean Return false to deny value change

inherited OnSetInvalid (invalid){boolean}

Parameters:
Name Type Description
invalid boolean Value to set
See:
Returns:
Type Description
boolean Return false to deny value change

inherited OnSetOverflow (overflowX, overflowY){boolean}

Parameters:
Name Type Description
overflowX bbbfly.Renderer.overflow optional Horizontal value to set
overflowY bbbfly.Renderer.overflow optional Vertical value to set
See:
Returns:
Type Description
boolean Return false to deny values change

inherited OnSetReadOnly (readonly){boolean}

Parameters:
Name Type Description
readonly boolean Value to set
See:
Returns:
Type Description
boolean Return false to deny value change

inherited OnSetSelected (selected){boolean}

Parameters:
Name Type Description
selected boolean Value to set
See:
Returns:
Type Description
boolean Return false to deny value change

inherited OnTrackedControlChanged (ctrl)

Parameters:
Name Type Description
ctrl ngControl optional Tracked control reference

OnZoomChanged (zoom)

Parameters:
Name Type Description
zoom number Actual zoom level
See: