Class: MapPois

cercaliagl.MapPois


Javascript ES5

const map = new cercaliagl.Map({ ... });

Class to get POIs while user is interaction with map. So, when cercaliagl.MapPois is enabled and has defined some POI categories, automatically POIs will be drawn on the map once server responds all requests which are launched on moveend or zoomend events.

If you need a list of public categories or you need to publish your own POIs, contact suport please.

Example usage:

const map = new cercaliagl.Map({map: map});
const mapPois = new cercaliagl.MapPois({
  map,
  categories: ['D00CAM', 'D00ESC'],
});
mapPois.enable();

new MapPois(options)

Name Type Description
options

Options

Name Type Description
map module:cercaliagl/Map~Map

Map.

categories Array.<string>

Cercalia POI categories id list.

createMarkersFunction function

Create markers function. If is preferred to use a custom function to create markers. It is useful when you want to change default icon or default popups

layer module:cercaliagl/layer/Marker~Marker

Add custom layer.

Methods

appendCategories(categories)

Append active categories

Name Type Description
categories Array.<string>

disable()

Disable interaction

enable()

Enable interaction

getCategories(){Array.<strirng>}

Returns:
Current active id categories.

removeAllMarkers()

removeCategories(categories)

Remove active categories.

Name Type Description
categories Array.<string>

Categories to remove

requestPoisByCurrentExtent_()

setCategories(categories)

Name Type Description
categories Array.<string>

Categories