# Class: Ol3Map

## bemap.Ol3Map(context, target)

Base class for OpenLayers v3.

## Constructor

#### new Ol3Map(context, target)

##### Parameters:

Name | Type | Description
--- | --- | ---
`context` | bemap.Context | BeMap-JS-API Context.
`target` | string | HTML element.
`options.` |  |

Source:
  - bemap-ol/bemap-map-ol3.js, line 17

### Extends

- bemap.Map

### Members

#### (protected) callback

Inherited From:
  - bemap.Map#callback
Source:
  - bemap-map.js, line 43

#### (protected) ctx

Inherited From:
  - bemap.Map#ctx
Source:
  - bemap-map.js, line 18

#### (protected) events

Inherited From:
  - bemap.Map#events
Source:
  - bemap-map.js, line 33

#### (protected) layers

Inherited From:
  - bemap.Map#layers
Source:
  - bemap-map.js, line 28

#### (protected) native

Inherited From:
  - bemap.Map#native
Source:
  - bemap-map.js, line 23

### Methods

#### addLayer(layer, options) → {bemap.Map}

Add a layer to the map

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` | bemap.Layer |
`options` | object |

Inherited From:
  - bemap.Map#addLayer
Source:
  - bemap-map.js, line 219

##### Returns:

this

Type
  bemap.Map

#### (abstract) addMarker(marker, options) → {bemap.Map}

Add a marker to the layer

##### Parameters:

Name | Type | Description
--- | --- | ---
`marker` | bemap.Marker |
`options` | object |

Inherited From:
  - bemap.Map#addMarker
Source:
  - bemap-map.js, line 376

##### Returns:

this

Type
  bemap.Map

#### (abstract) addMultiMarker(multipoint, options) → {bemap.Map}

Add a multipoint to the layer

##### Parameters:

Name | Type | Description
--- | --- | ---
`multipoint` | bemap.MultiPoint |
`options` | object |

Inherited From:
  - bemap.Map#addMultiMarker
Source:
  - bemap-map.js, line 399

##### Returns:

this

Type
  bemap.Map

#### (abstract) addPolyline(Polyline, options) → {bemap.Map}

Add a Polyline to the layer

##### Parameters:

Name | Type | Description
--- | --- | ---
`Polyline` | bemap.Polyline |
`options` | object |

Inherited From:
  - bemap.Map#addPolyline
Source:
  - bemap-map.js, line 434

##### Returns:

this

Type
  bemap.Map

#### addPopup(popup, options) → {bemap.Map}

Add a popup to the map

##### Parameters:

Name | Type | Description
--- | --- | ---
`popup` | bemap.Popup |
`options` | object |

Inherited From:
  - bemap.Map#addPopup
Source:
  - bemap-map.js, line 655

##### Returns:

this

Type
  bemap.Map

#### backgroundLayers(geoservers) → {bemap.Map}

Create a background layer for each geoserver name.

##### Parameters:

Name | Type | Description
--- | --- | ---
`geoservers` | array | List of geoserver name.

Inherited From:
  - bemap.Map#backgroundLayers
Source:
  - bemap-map.js, line 167

##### Returns:

this

Type
  bemap.Map

#### (abstract) buildIcon(icon, options) → {bemap.Map}

Build icon resource.

##### Parameters:

Name | Type | Description
--- | --- | ---
`icon` | bemap.Icon |
`options` | object |

Inherited From:
  - bemap.Map#buildIcon
Source:
  - bemap-map.js, line 364

##### Returns:

this

Type
  bemap.Map

#### (abstract) buildLineStyle(LineStyle, options) → {bemap.Map}

Build LineStyle resource.

##### Parameters:

Name | Type | Description
--- | --- | ---
`LineStyle` | bemap.LineStyle |
`options` | object |

Inherited From:
  - bemap.Map#buildLineStyle
Source:
  - bemap-map.js, line 422

##### Returns:

this

Type
  bemap.Map

#### (abstract) clearLayer(layer) → {bemap.Map}

Remove all objects from a layer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` | bemap.Layer | the layer object to clear.

Inherited From:
  - bemap.Map#clearLayer
Source:
  - bemap-map.js, line 466

##### Returns:

this

Type
  bemap.Map

#### clearPopup() → {bemap.Map}

Remove all the popups from the map.

Inherited From:
  - bemap.Map#clearPopup
Source:
  - bemap-map.js, line 683

##### Returns:

this;

Type
  bemap.Map

#### defaultLayers(options) → {bemap.Map}

Add default layers.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | object | ###### Properties
Name | Type | Description
--- | --- | ---
`markerAsCluster` | boolean |

Inherited From:
  - bemap.Map#defaultLayers
Source:
  - bemap-map.js, line 109

##### Returns:

this

Type
  bemap.Map

#### defaultOverlayLayers(options) → {bemap.Map}

Add default overlay layers, like dedicated for markers or polyline, etc.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | object | ###### Properties
Name | Type | Description
--- | --- | ---
`markerAsCluster` | boolean |

Inherited From:
  - bemap.Map#defaultOverlayLayers
Source:
  - bemap-map.js, line 129

##### Returns:

this

Type
  bemap.Map

#### (protected) draggableMarker(marker, callback, options) → {bemap.Listener}

Define the draggable capability for bemap.Marker.

##### Parameters:

Name | Type | Description
--- | --- | ---
`marker` | bemap.Marker | bemap object.
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | Options. ###### Properties
Name | Type | Description
--- | --- | ---
`layerFilter` | bemap.Layer | set the bemap layer used as filter.

Inherited From:
  - bemap.Map#draggableMarker
Source:
  - bemap-map.js, line 595

##### Returns:

bemap.listener.

Type
  bemap.Listener

#### (protected) draggableMarkers(callback, options) → {bemap.Listener}

Define the draggable capability for all bemap.Marker.

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | Options. ###### Properties
Name | Type | Description
--- | --- | ---
`layerFilter` | bemap.Layer | set the bemap layer used as filter.

Inherited From:
  - bemap.Map#draggableMarkers
Source:
  - bemap-map.js, line 607

##### Returns:

bemap.listener.

Type
  bemap.Listener

#### (protected) draggableMultiMarkers(callback, options) → {bemap.Listener}

Define the draggable capability for all bemap.MultiMarkers.

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | Options. ###### Properties
Name | Type | Description
--- | --- | ---
`layerFilter` | bemap.Layer | set the bemap layer used as filter.

Inherited From:
  - bemap.Map#draggableMultiMarkers
Source:
  - bemap-map.js, line 619

##### Returns:

bemap.listener.

Type
  bemap.Listener

#### (protected) draggablePolyline(polyline, callback, options) → {bemap.Listener}

Define the draggable capability for bemap.Polyline.

##### Parameters:

Name | Type | Description
--- | --- | ---
`polyline` | bemap.Polyline | bemap object.
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | Options. ###### Properties
Name | Type | Description
--- | --- | ---
`layerFilter` | bemap.Layer | set the bemap layer used as filter.

Inherited From:
  - bemap.Map#draggablePolyline
Source:
  - bemap-map.js, line 632

##### Returns:

bemap.listener.

Type
  bemap.Listener

#### (protected) draggablePolylines(callback, options) → {bemap.Listener}

Define the draggable capability for all bemap.Polyline.

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | Options. ###### Properties
Name | Type | Description
--- | --- | ---
`layerFilter` | bemap.Layer | set the bemap layer used as filter.

Inherited From:
  - bemap.Map#draggablePolylines
Source:
  - bemap-map.js, line 644

##### Returns:

bemap.listener.

Type
  bemap.Listener

#### getBoundingBox() → {bemap.BoundingBox}

Get the limits of the map on the current zoom.

Inherited From:
  - bemap.Map#getBoundingBox
Source:
  - bemap-map.js, line 711

##### Returns:

the bounding box containing the limits.

Type
  bemap.BoundingBox

#### getCenter() → {bemap.Coordinate}

Get the center of the map in bemap.Coordinate.

Inherited From:
  - bemap.Map#getCenter
Source:
  - bemap-map.js, line 703

##### Returns:

the center of the map.

Type
  bemap.Coordinate

#### getLayerByName(name) → {bemap.Layer}

Search the layer by name.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | of layer.

Inherited From:
  - bemap.Map#getLayerByName
Source:
  - bemap-map.js, line 232

##### Returns:

Return the layer or null if not found.

Type
  bemap.Layer

#### getRotation() → {int}

Get current rotation angle of map.

Inherited From:
  - bemap.Map#getRotation
Source:
  - bemap-map.js, line 341

##### Returns:

-1 if not supported.

Type
  int

#### getZoom() → {int}

Get current zoom of map.

Inherited From:
  - bemap.Map#getZoom
Source:
  - bemap-map.js, line 320

##### Returns:

-1 if not supported.

Type
  int

#### (abstract) isDragPan() → {boolean}

Return the satus of drag pan of map.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options.dragPan.` | Object |

Inherited From:
  - bemap.Map#isDragPan
Source:
  - bemap-map.js, line 250

##### Returns:

true to enable the drag pan of map, otherwise false.

Type
  boolean

#### (abstract) move(lon, lat, zoom, options) → {bemap.Map}

Move map to new coordinate.

##### Parameters:

Name | Type | Description
--- | --- | ---
`lon` | double | Longitude in degres decimal (WGS84).
`lat` | double | Latitude in degres decimal (WGS84).
`zoom` | int | Zoom level (optional).
`options` | Object | Options (optional).

Inherited From:
  - bemap.Map#move
Source:
  - bemap-map.js, line 277

##### Returns:

this

Type
  bemap.Map

#### moveToBoundingBox(boundingBox, options) → {bemap.Map}

Set the center and the zoom of the map to fit the bounding box.

##### Parameters:

Name | Type | Description
--- | --- | ---
`boundingBox` | bemap.BoundingBox | the bounding box to fit.
`options` | Object | Options (optional).

Inherited From:
  - bemap.Map#moveToBoundingBox
Source:
  - bemap-map.js, line 287

##### Returns:

this.

Type
  bemap.Map

#### (abstract) moveToLayerData(layer, options) → {bemap.Map}

Move map and zoom on data contains in layers.

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` | bemap.Layer | Layer.
`options` | Object | Options (optional).

Inherited From:
  - bemap.Map#moveToLayerData
Source:
  - bemap-map.js, line 299

##### Returns:

this

Type
  bemap.Map

#### (abstract) on(eventType, callback, options) → {bemap.Listener}

Set the listner when an specified eventType occur on bemap.Map.

##### Parameters:

Name | Type | Description
--- | --- | ---
`eventType` | bemap.Map.EventType | Event type.
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | options.

Inherited From:
  - bemap.Map#on
Source:
  - bemap-map.js, line 502

##### Returns:

this.

Type
  bemap.Listener

#### onGetFeatureInfo(layer, options) → {bemap.Listener}

Set get feature info call back.

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` | bemap.Layer | set the bemap layer.
`options` | object | options. ###### Properties
Name | Type | Description
--- | --- | ---
`beforeCallback` | function | callback called at data reception and before display the popup.
`afterCallback` | function | callback called after display the popup.

Inherited From:
  - bemap.Map#onGetFeatureInfo
Source:
  - bemap-map.js, line 581

##### Returns:

listener;

Type
  bemap.Listener

#### (abstract) onMarker(marker, eventType, callback, options) → {bemap.Listener}

Set the listner when an specified eventType occur on bemap.Marker.

##### Parameters:

Name | Type | Description
--- | --- | ---
`marker` | bemap.Marker |
`eventType` | bemap.Map.EventType | Event type.
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | options.

Inherited From:
  - bemap.Map#onMarker
Source:
  - bemap-map.js, line 516

##### Returns:

this.

Type
  bemap.Listener

#### (abstract) onMarkers(eventType, callback, options) → {bemap.Listener}

Set the listner when an specified eventType occur on all bemap.Marker.

##### Parameters:

Name | Type | Description
--- | --- | ---
`eventType` | bemap.Map.EventType | Event type.
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | options.

Inherited From:
  - bemap.Map#onMarkers
Source:
  - bemap-map.js, line 529

##### Returns:

this.

Type
  bemap.Listener

#### (abstract) onMultiMarkers(eventType, callback, options) → {bemap.Listener}

Set the listner when an specified eventType occur on all bemap.MultiMarker.

##### Parameters:

Name | Type | Description
--- | --- | ---
`eventType` | bemap.Map.EventType | Event type.
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | options.

Inherited From:
  - bemap.Map#onMultiMarkers
Source:
  - bemap-map.js, line 542

##### Returns:

this.

Type
  bemap.Listener

#### (abstract) onPolyline(polyline, eventType, callback, options) → {bemap.Listener}

Set the listner when an specified eventType occur on bemap.Polyline.

##### Parameters:

Name | Type | Description
--- | --- | ---
`polyline` | bemap.Polyline |
`eventType` | bemap.Map.EventType | Event type.
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | options.

Inherited From:
  - bemap.Map#onPolyline
Source:
  - bemap-map.js, line 556

##### Returns:

this.

Type
  bemap.Listener

#### (abstract) onPolylines(eventType, callback, options) → {bemap.Listener}

Set the listner when an specified eventType occur on all bemap.Polyline.

##### Parameters:

Name | Type | Description
--- | --- | ---
`eventType` | bemap.Map.EventType | Event type.
`callback` | function | Function will be called when the specified eventType is occur.
`options` | object | options.

Inherited From:
  - bemap.Map#onPolylines
Source:
  - bemap-map.js, line 569

##### Returns:

this.

Type
  bemap.Listener

#### (abstract) refresh(options) → {bemap.Map}

Refresh map.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | Options (optional).

Inherited From:
  - bemap.Map#refresh
Source:
  - bemap-map.js, line 352

##### Returns:

this

Type
  bemap.Map

#### refreshLayer(layer) → {bemap.Map}

Refresh all objects from a layer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` | bemap.Layer | the layer object to refresh.

Inherited From:
  - bemap.Map#refreshLayer
Source:
  - bemap-map.js, line 455

##### Returns:

this

Type
  bemap.Map

#### (abstract) removeLayer(layer) → {bemap.Map}

Remove a layer from the map.

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` | bemap.Layer | layer to remove from the map.

Inherited From:
  - bemap.Map#removeLayer
Source:
  - bemap-map.js, line 489

##### Returns:

this.

Type
  bemap.Map

#### (abstract) removeMarker(marker) → {bemap.Map}

Remove a marker from the layer

##### Parameters:

Name | Type | Description
--- | --- | ---
`marker` | bemap.Marker |

Inherited From:
  - bemap.Map#removeMarker
Source:
  - bemap-map.js, line 387

##### Returns:

this

Type
  bemap.Map

#### (abstract) removeMultimarker(multimarker) → {bemap.Map}

Remove a multimarker from the layer

##### Parameters:

Name | Type | Description
--- | --- | ---
`multimarker` | bemap.MultiMarker |

Inherited From:
  - bemap.Map#removeMultimarker
Source:
  - bemap-map.js, line 410

##### Returns:

this

Type
  bemap.Map

#### (abstract) removePolyline(polyline) → {bemap.Map}

Remove a polyline from the layer

##### Parameters:

Name | Type | Description
--- | --- | ---
`polyline` | bemap.Polyline |

Inherited From:
  - bemap.Map#removePolyline
Source:
  - bemap-map.js, line 445

##### Returns:

this

Type
  bemap.Map

#### removePopup(popup) → {bemap.Map}

Remove a popup from the map.

##### Parameters:

Name | Type | Description
--- | --- | ---
`popup` | bemap.Popup | the popup to remove from the map.

Inherited From:
  - bemap.Map#removePopup
Source:
  - bemap-map.js, line 665

##### Returns:

this;

Type
  bemap.Map

#### (abstract) rotation(angle, options) → {bemap.Map}

Rotation of map, set new angle of map.

##### Parameters:

Name | Type | Description
--- | --- | ---
`angle` | int | in degrees.
`options` | Object | Options (optional).

Inherited From:
  - bemap.Map#rotation
Source:
  - bemap-map.js, line 332

##### Returns:

this

Type
  bemap.Map

#### setCoordinatePopup(popup, coordinate, options) → {bemap.Map}

Set the coordinate of the popup.

##### Parameters:

Name | Type | Description
--- | --- | ---
`popup` | bemap.Popup | the popup of wich to set the coordinate.
`coordinate` | bemap.Coordinate | the new coordinate.
`options` | object | Options. ###### Properties
Name | Type | Description
--- | --- | ---
`panningMap` | bemap.Layer | enable the map panning animation. move map from the current position to the popup anchor at the center of map.

Inherited From:
  - bemap.Map#setCoordinatePopup
Source:
  - bemap-map.js, line 695

##### Returns:

this.

Type
  bemap.Map

#### (abstract) setDragPan(active) → {bemap.Map}

Enable or disable the drag pan of map.

##### Parameters:

Name | Type | Description
--- | --- | ---
`active` | boolean | true to enable the drag pan of map, otherwise false.
`options.dragPan.` | Object |

Inherited From:
  - bemap.Map#setDragPan
Source:
  - bemap-map.js, line 262

##### Returns:

this

Type
  bemap.Map

#### setVisiblePopup(popup, visible) → {bemap.Popup}

Set the visiblility of the popup.

##### Parameters:

Name | Type | Description
--- | --- | ---
`popup` | bemap.Popup | the popup.
`visible` | Boolean | true for visible and false for hidden.

Inherited From:
  - bemap.Map#setVisiblePopup
Source:
  - bemap-map.js, line 675

##### Returns:

this.

Type
  bemap.Popup

#### switchBackgroundLayer(geoserver) → {bemap.Map}

Switch bytween several background layers.

##### Parameters:

Name | Type | Description
--- | --- | ---
`geoserver` | String | Name of geoserver.

Inherited From:
  - bemap.Map#switchBackgroundLayer
Source:
  - bemap-map.js, line 195

##### Returns:

this

Type
  bemap.Map

#### (abstract) visibleLayer(layer) → {bemap.Map}

Set the visibility of the layer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`layer` | bemap.Layer | the layer of wich to set the visibility.
`visible.` | boolean |

Inherited From:
  - bemap.Map#visibleLayer
Source:
  - bemap-map.js, line 478

##### Returns:

return this.

Type
  bemap.Map

#### (abstract) zoom(zoom, options) → {bemap.Map}

Zoom on map, set new zoom level.

##### Parameters:

Name | Type | Description
--- | --- | ---
`zoom` | int | Zoom level (optional).
`options` | Object | Options (optional).

Inherited From:
  - bemap.Map#zoom
Source:
  - bemap-map.js, line 311

##### Returns:

this

Type
  bemap.Map