API Docs for: 1.0.0
Show:

ImajnetIntegrationDemo Class

Imajnet SDK integration example in an Leaflet based application

Imajnet plugin integration

Methods

activateImajnet

()

Defined in js/map.js:574

Activates the imajnet plugin

addActiveState

(
  • container
)

Defined in js/map.js:511

Sets the active state for a map tool. Customizable according to the application needs, usually this is similar to a button press.

Parameters:

  • container Object

    the html container of the map tool

addFeature

(
  • pointsArray
  • featureOptions
)

Defined in js/map.js:193

Adds a feature to the given vector layer

If featureOptions.type is LineString or Polygon pointsArray will be an array of objects({x, y}) If featureOptions.type is MultiPolygon pointsArray will be an array of arrays(objects({x, y}).

Parameters:

  • pointsArray Object

    the points that compose the feature geometry

  • featureOptions Object

    the parameter options for creating the feature

Returns:

FeatureWrapper object that contains added feature object ex: featureOptions(type: 'Point, LineString, Polygon', 'Multipolygon', zIndex, fillColor: color, fillOpacity: 0.5).

addImajnetLayerToMap

()

Defined in js/map.js:145

Adds the imajnet tile layer to the map.

Returns:

the added layer object

addMarker

(
  • markerData
)

Defined in js/map.js:312

Adds a marker to the markerLayer,

Parameters:

  • markerData Width, height

    object with properties: lon(wgs84 longitude), lat: wgs84 latitude, imagePath: path to the marker image, size: , objectId: unique identifier for the marker(add this property to marker object), onMouseOver handler function for mouse over, onMouseOut: handler function for mouseout, onClick handler function for click event.

    This function will add to map imajbox marker at the specified lon, lat coordinates. Example: function addMarker(markerLayer, markerData) { var marker = L.marker([markerData.lat, markerData.lon], {icon: L.icon({iconUrl: markerData.imagePath, iconSize: [markerData.size.width, markerData.size.height]})}).addTo(map); marker.objectId = markerData.objectId;
    marker.on('mouseover', function(event) { markerData.onMouseOver(event, marker.objectId); }); marker.on('mouseout', function(event) { markerData.onMouseOut(event, marker.objectId); }); marker.on('click', function(event) { markerData.onClick(event, marker.objectId); });

    return marker;
    

    }

addMarkerFeature

(
  • markerLayer
  • markerData
)

Defined in js/map.js:287

Adds a feature to the given marker layer

Parameters:

  • markerLayer Object

    the layer

  • markerData Object

    the marker options

addMarkerLayerToMap

(
  • name
)

Defined in js/map.js:277

Adds a marker layer to the map.

Parameters:

  • name Object

    the name of the layer

addVectorLayerToMap

(
  • name
  • opacity
  • options
)

Defined in js/map.js:181

Adds a vector layer to the map.

Parameters:

  • name Object

    the name of the vector layer to be created and added to the map

  • opacity Object

    the opacity of the layer

  • options Object

    initialization ofptions for the layer

afterImajnetLayersAddedToMap

()

Defined in js/map.js:173

Hook callback called after the imajnet layers are added to the map. It is expected that the application will perform here any additional intialization required by its business logic.

centerMapToPosition

(
  • position
  • onlyIfNotVisible
)

Defined in js/map.js:129

Centers the map on the given imajnet position

Parameters:

  • position Object

    the imajnet position

  • onlyIfNotVisible Object

    if true then the operation needs to be performed only if the object is not visible on the map(is outside of the visible extent), otherwise the operation is performed all the time

deactivateImajnet

()

Defined in js/map.js:603

Deactivates the imajnet plugin

getCurrentZoomLevel

()

Defined in js/map.js:120

Returns the current map zoom level.

getMapScale

() Boolean

Defined in js/map.js:32

Returns the current map scale

Returns:

Boolean:

Returns the current map scale;

hideImajnetItem

(
  • id
)

Defined in js/map.js:436

Hides the imajnet image container given by it's id

Parameters:

  • id Object

    the id of the html element that contains the imajnet container

initMap

()

Defined in js/map.js:555

Initializes the map component and configures imajnet.

onDragEnd

()

Defined in js/map.js:465

onImajnetClose

()

Defined in js/map.js:531

Optional hook callback provided for implementing actions to execute after imajnet logout is performed/plugin is deactivated.

onImajnetControlPressed

()

Defined in js/map.js:541

onImajnetIsActive

()

Defined in js/map.js:445

Callback to the application called when the imajnet plugin is activated

onImajnetLogin

()

Defined in js/map.js:502

Optional hook callback provided for implementing actions to execute after imajnet login is performed.

onMapClick

(
  • event
)

Defined in js/map.js:454

Callback fired on each map click, the calls need to be forwarded to the ImajnetMap module click handler. This is intended to be seen as wrapper call used to convert between the underlying mapping component event data structure and imajnet lat/lon. Here is where any coordinate projection is done(from map projection system to imajnet WGS84)

Parameters:

  • event Object

    the click event that contains the map coordinates, its contents need to be

onZoomEnd

()

Defined in js/map.js:472

registerMapEvents

()

Defined in js/map.js:481

Registers the imajnet map events to the underlying map component.

removeActiveState

(
  • container
)

Defined in js/map.js:521

Sets the active state for a map tool. Customizable according to the application needs, usually this is similar to a button un-press.

Parameters:

  • container Object

    the html container of the map tool

removeAllFeatures

(
  • vectorLayer
)

Defined in js/map.js:245

Removes all the features contained by the given vector layer.

Parameters:

  • vectorLayer Object

    the vector layer

removeAllMarkersFromLayer

()

Defined in js/map.js:379

removeFeatures

(
  • vectorLayer
  • featuresWrapper
)

Defined in js/map.js:89

Removes a list of features from the given vector layer.

Parameters:

  • vectorLayer Object

    the layer from which the objects need to be removed

  • featuresWrapper Object

    the array of features to be removed. The features are wrapped inside imajnet FeatureWrapper objects.

removeLayerFromMap

()

Defined in js/map.js:164

Removes a layer from the map

removeMarker

()

Defined in js/map.js:362

removeMarkerFeatures

(
  • vectorLayer
  • markersWrapper
)

Defined in js/map.js:298

Removes a list of features(markers) from the given layer.

Parameters:

  • vectorLayer Object

    the layer from which the features need to be removed

  • markersWrapper Object

    the list of markers

selectFeature

(
  • vectorLayer
  • featureWrapper
)

Defined in js/map.js:255

Selects a feature on the map

Parameters:

  • vectorLayer Object

    the vector layer to which the feature belongs to

  • featureWrapper Object

    the feature to be selected.

selectMarker

()

Defined in js/map.js:405

setFeatureColor

(
  • vectorLayer
  • featureWrapper
  • color
)

Defined in js/map.js:108

Sets the feature color for a given feature. Used for selection/unselection and highlight of features.

Parameters:

  • vectorLayer Object

    the layer to which the feature belongs to

  • featureWrapper Object

    the feature concerned by the operation

  • color Object

    the desired color

setLayerZIndex

(
  • layer
  • zIndex
)

Defined in js/map.js:43

Sets the zIndex for a given map layer

Parameters:

  • layer Layer

    The layer for which to set the zIndex

  • zIndex ZIndex

    The zIndex of the layer

setMarkerOpacity

()

Defined in js/map.js:392

showImajnetItem

(
  • id
  • width
  • height
)

Defined in js/map.js:424

Makes visible the imajnet image component container

Parameters:

  • id Object

    the id of the html element that will contain the imajnet container

  • width Object

    the desired width of the imajnet container

  • height Object

    the desired height of the imajnet container

unregisterMapEvents

()

Defined in js/map.js:491

Unregisters the imajnet map event handlers

unselectFeature

(
  • vectorLayer
  • featureWrapper
)

Defined in js/map.js:266

Unselects a map feature

Parameters:

  • vectorLayer Object

    the vector layer to which the feature belongs to

  • featureWrapper Object

    the feature to be un-selected.

unselectMarker

()

Defined in js/map.js:414

zoomMapTo

(
  • zoom
)

Defined in js/map.js:69

Zooms the underying map to the given zoom level

Parameters:

  • zoom Object

    the desired zoom level

zoomMapToFetaureWrapper

(
  • featureWrapper
  • onlyIfNotVisible
)

Defined in js/map.js:78

Zooms the map on top of the feature described by the given feature wrapper

Parameters:

  • featureWrapper Object

    the imajnet wrapper around the feature object

  • onlyIfNotVisible Object

    if true then the zoom operation needs to be performed only if the object is not visible on the map(is outside of the visible extent), otherwise the zoom is performed all the time