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
- ArcGISEnterpriseLayer
- ArcGISOnlineLayer
- ArcGISServerLayer
- ColorLayer
- Definition
- ExternalLayer
- ImageLayer
- Layer
- MapboxStyleLayer
- MapboxTileLayer
- TileLayer
- WMSLayer
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 -
AddLayer (def){boolean}
-
Add new map layer.
Parameters:
Name Type Description def bbbfly.Map.Layer Returns:
Type Description boolean - If layer was added -
AddLayers (defs){boolean}
-
Add new map layers.
Parameters:
Name Type Description defs Array.<bbbfly.Map.Layer> 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 Returns:
Type Description object | null Created control -
CreateLayer (def){bbbfly.Map.layer}
-
Create Leaflet layer wrapper.
Parameters:
Name Type Description def bbbfly.Map.Layer Returns:
Type Description bbbfly.Map.layer -
CreateMap (){object}
-
Create Leaflet map.
Returns:
Type Description object Leaflet Map -
DestroyMap (){boolean}
-
Destroy Leaflet map.
Returns:
Type Description boolean If map was destroyed -
inherited DisposeControls ()
-
DoCreateMap (options){object}
-
Do reate Leaflet map from its options.
Parameters:
Name Type Description options object Leaflet Map options 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 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 -
GetAttributions (){bbbfly.Map.attribution}
-
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 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}
-
Returns:
Type Description object ControlsPanel control or self -
inherited GetControlsPanel (){object|null}
-
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}
-
Returns:
Type Description object | null FramePanel control -
GetLayer (id){bbbfly.Map.layer}
-
Get map layer.
Parameters:
Name Type Description id string 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.
Returns:
Type Description Array.<bbbfly.Map.layer> -
GetMap (){object}
-
Get Leaflet map.
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.
Returns:
Type Description number | null zoom - Zoom level -
GetMinZoom (){number|null}
-
Get map minimal zoom level.
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.
Returns:
Type Description number | null zoom - Zoom level -
inherited RemoveChildControl (ctrl)
-
Parameters:
Name Type Description ctrl ngControl optional Child control reference -
RemoveLayer (id){boolean}
-
Remove map layer.
Parameters:
Name Type Description id string 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 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 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 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 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 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 Returns:
Type Description boolean If zoom was set -
SetMinZoom (zoom){boolean}
-
Set minimal map zoom level.
Parameters:
Name Type Description zoom number Zoom level 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 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 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 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 Returns:
Type Description boolean If view was set -
SetZoom (zoom){boolean}
-
Set map zoom level.
Parameters:
Name Type Description zoom number Zoom level 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 Returns:
Type Description boolean If map was zoomed -
ZoomOut (zoomBy){boolean}
-
Zoom map out.
Parameters:
Name Type Description zoomBy number Number of zoom levels 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 -
inherited OnAltChanged ()
-
inherited OnChildControlAdded (ctrl)
-
Parameters:
Name Type Description ctrl ngControl optional Child control reference -
inherited OnChildControlRemoved (ctrl)
-
Parameters:
Name Type Description ctrl ngControl optional Child control reference -
inherited OnEnabledChanged ()
-
- See:
-
inherited OnInvalidChanged ()
-
- See:
-
OnLayersChanged ()
-
inherited OnOverflowChanged ()
-
inherited OnReadOnlyChanged ()
-
inherited OnSelectedChanged ()
-
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 Returns:
Type Description boolean Return false to deny value change -
inherited OnSetInvalid (invalid){boolean}
-
Parameters:
Name Type Description invalid boolean Value to set 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 Returns:
Type Description boolean Return false to deny values change -
inherited OnSetReadOnly (readonly){boolean}
-
Parameters:
Name Type Description readonly boolean Value to set Returns:
Type Description boolean Return false to deny value change -
inherited OnSetSelected (selected){boolean}
-
Parameters:
Name Type Description selected boolean Value to set 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