Class: LeafletMap

bemap.LeafletMap(context, target)

Base class for Leaflet.

Constructor

new LeafletMap(context, target)

Parameters:
Name Type Description
context bemap.Context BeMap-JS-API Context.
target string HTML element.
options.
Source:

Extends

Members

(protected) callback

Inherited From:
Source:

(protected) ctx

Inherited From:
Source:

(protected) events

Inherited From:
Source:

(protected) layers

Inherited From:
Source:

(protected) native

Overrides:
Source:

(protected) target

Source:

Methods

addCircle(options) → {bemap.LeafletMap}

Add a bemap.Circle to the layer
Parameters:
Name Type Description
bemap.Circle. bemap.Circle
options object
Source:
Returns:
Type
bemap.LeafletMap

addLayer(layer, options) → {bemap.LeafletMap}

Add a layer to the Leaflet map.
Parameters:
Name Type Description
layer bemap.Layer
options object
Overrides:
Source:
Returns:
this
Type
bemap.LeafletMap

addMarker(marker, options) → {bemap.LeafletMap}

Add a marker to the layer
Parameters:
Name Type Description
marker bemap.Marker
options object
Overrides:
Source:
Returns:
this
Type
bemap.LeafletMap

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

Add a multipoint to the layer
Parameters:
Name Type Description
multipoint bemap.MultiPoint
options object
Inherited From:
Source:
Returns:
this
Type
bemap.Map

addPolygon(options) → {bemap.LeafletMap}

Add a bemap.Polygon to the layer
Parameters:
Name Type Description
bemap.Polygon. bemap.Polygon
options object
Source:
Returns:
Type
bemap.LeafletMap

addPolyline(options) → {bemap.LeafletMap}

Add a bemap.Polyline to the layer
Parameters:
Name Type Description
bemap.Polyline. bemap.Polyline
options object
Overrides:
Source:
Returns:
Type
bemap.LeafletMap

addPopup(popup, options) → {bemap.LeafletMap}

Add a popup to the map
Parameters:
Name Type Description
popup bemap.Popup
options object
Overrides:
Source:
Returns:
this
Type
bemap.LeafletMap

backgroundLayers(geoservers) → {bemap.Map}

Create a background layer for each geoserver name.
Parameters:
Name Type Description
geoservers array List of geoserver name.
Inherited From:
Source:
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:
Source:
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:
Source:
Returns:
this
Type
bemap.Map

clearLayer(layer) → {bemap.LeafletMap}

Remove all objects from a layer.
Parameters:
Name Type Description
layer bemap.Layer the layer object to clear.
Overrides:
Source:
Returns:
this
Type
bemap.LeafletMap

clearPopup() → {bemap.LeafletMap}

Remove all the popups from the map.
Overrides:
Source:
Returns:
this;
Type
bemap.LeafletMap

defaultLayers(options) → {bemap.Map}

Add default layers.
Parameters:
Name Type Description
options object
Properties
Name Type Description
markerAsCluster boolean
Inherited From:
Source:
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:
Source:
Returns:
this
Type
bemap.Map

(protected) draggableCircle(circle, callback, options) → {bemap.Listener}

Define the draggable capability for bemap.Circle.
Parameters:
Name Type Description
circle bemap.Circle 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.
Source:
Returns:
bemap.listener.
Type
bemap.Listener

(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.
Overrides:
Source:
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:
Source:
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:
Source:
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:
Source:
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:
Source:
Returns:
bemap.listener.
Type
bemap.Listener

getBoundingBox() → {bemap.BoundingBox}

Get the limits of the map on the current zoom.
Overrides:
Source:
Returns:
the bounding box containing the limits.
Type
bemap.BoundingBox

getCenter() → {bemap.Coordinate}

Get the center of the map in bemap.Coordinate.
Overrides:
Source:
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:
Source:
Returns:
Return the layer or null if not found.
Type
bemap.Layer

getRotation() → {int}

Get current rotation angle of map.
Inherited From:
Source:
Returns:
-1 if not supported.
Type
int

getZoom() → {int}

Get current zoom level of map.
Overrides:
Source:
Returns:
current zoom level of map.
Type
int

(abstract) isDragPan() → {boolean}

Return the satus of drag pan of map.
Parameters:
Name Type Description
options.dragPan. Object
Inherited From:
Source:
Returns:
true to enable the drag pan of map, otherwise false.
Type
boolean

move(lon, lat, zoom, options) → {bemap.LeafletMap}

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).
Properties
Name Type Description
animate String Enable the animation.
fly String Enable the animation (same as animate).
Overrides:
Source:
Returns:
this
Type
bemap.LeafletMap

moveToBoundingBox(boundingBox) → {bemap.LeafletMap}

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.
Overrides:
Source:
Returns:
this.
Type
bemap.LeafletMap

(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:
Source:
Returns:
this
Type
bemap.Map

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

Set the listner when an specified eventType occur on bemap.LeafletMap.
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.
Overrides:
Source:
Returns:
listner.
Type
bemap.Listener

onCircle(circle, eventType, callback, options) → {bemap.Listener}

Set the listner when an specified eventType occur on bemap.Circle.
Parameters:
Name Type Description
circle bemap.Circle
eventType bemap.Map.EventType Event type.
callback function Function will be called when the specified eventType is occur.
options object options.
Source:
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:
Source:
Returns:
listener;
Type
bemap.Listener

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.
Overrides:
Source:
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:
Source:
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:
Source:
Returns:
this.
Type
bemap.Listener

onPolygon(polygon, eventType, callback, options) → {bemap.Listener}

Set the listner when an specified eventType occur on bemap.Polygon.
Parameters:
Name Type Description
polygon bemap.Polygon
eventType bemap.Map.EventType Event type.
callback function Function will be called when the specified eventType is occur.
options object options.
Source:
Returns:
this.
Type
bemap.Listener

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.
Overrides:
Source:
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:
Source:
Returns:
this.
Type
bemap.Listener

(abstract) refresh(options) → {bemap.LeafletMap}

Refresh map.
Parameters:
Name Type Description
options Object Options (optional).
Overrides:
Source:
Returns:
this
Type
bemap.LeafletMap

refreshLayer(layer) → {bemap.LeafletMap}

Refresh all objects from a layer.
Parameters:
Name Type Description
layer bemap.Layer the layer object to refresh.
Overrides:
Source:
Returns:
this
Type
bemap.LeafletMap

removeCircle(circle)

Remove a circle from his layer.
Parameters:
Name Type Description
circle bemap.Circle the circle object to remove.
Source:

removeLayer(layer) → {bemap.LeafletMap}

Remove a layer from the map.
Parameters:
Name Type Description
layer bemap.Layer layer to remove from the map.
Overrides:
Source:
Returns:
this.
Type
bemap.LeafletMap

(protected) removeListener(listener, options) → {bemap.LeafletMap}

Remove listener.
Parameters:
Name Type Description
listener bemap.Listener Function will be called when the specified eventType is occur.
options object Options.
Source:
Returns:
this.
Type
bemap.LeafletMap

removeMarker(marker) → {bemap.LeafletMap}

Remove a marker from his layer.
Parameters:
Name Type Description
marker bemap.Marker the marker object to remove.
Overrides:
Source:
Returns:
this
Type
bemap.LeafletMap

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

Remove a multimarker from the layer
Parameters:
Name Type Description
multimarker bemap.MultiMarker
Inherited From:
Source:
Returns:
this
Type
bemap.Map

removePolygon(polygon)

Remove a polygon from his layer.
Parameters:
Name Type Description
polygon bemap.Polygon the polygon object to remove.
Source:

removePolyline(polyline)

Remove a polyline from his layer.
Parameters:
Name Type Description
polyline bemap.Polyline the polyline object to remove.
Overrides:
Source:

removePopup(popup) → {bemap.LeafletMap}

Remove a popup from the map.
Parameters:
Name Type Description
popup bemap.Popup the popup to remove from the map.
Overrides:
Source:
Returns:
this;
Type
bemap.LeafletMap

(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:
Source:
Returns:
this
Type
bemap.Map

(protected) setCoordinateCircle(circle) → {bemap.LeafletMap}

Set the coordinates of the circle.
Parameters:
Name Type Description
circle bemap.Circle the circle object to remove.
Source:
Returns:
this
Type
bemap.LeafletMap

(protected) setCoordinateMarker(marker) → {bemap.LeafletMap}

Set the coordinates of the marker.
Parameters:
Name Type Description
marker bemap.Marker the marker object to remove.
Source:
Returns:
this
Type
bemap.LeafletMap

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

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.
Overrides:
Source:
Returns:
this.
Type
bemap.OlMap

(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:
Source:
Returns:
this
Type
bemap.Map

(protected) setRadiusCircle(circle) → {bemap.LeafletMap}

Set the radius of the circle.
Parameters:
Name Type Description
circle bemap.Circle the circle object to remove.
Source:
Returns:
this
Type
bemap.LeafletMap

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:
Source:
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:
Source:
Returns:
this
Type
bemap.Map

visibleLayer(layer) → {bemap.LeafletMap}

Set the visibility of the layer.
Parameters:
Name Type Description
layer bemap.Layer the layer of wich to set the visibility.
visible. boolean
Overrides:
Source:
Returns:
return this.
Type
bemap.LeafletMap

zoom(zoom, options) → {bemap.LeafletMap}

Zoom on map, set new zoom level.
Parameters:
Name Type Description
zoom int Zoom level (optional).
options Object Options (optional).
Overrides:
Source:
Returns:
this
Type
bemap.LeafletMap