- Version
- 0.49.2
Methods
(static) addFeatures(features)
| Name | Type | Description |
|---|---|---|
features | Features | Object containing the features to be added. |
Add a point annotation.
map.addFeatures({
geoJson: [{
type: "Feature",
geometry: {
type: "Point",
coordinates: [-122.126986, 47.639754],
},
}],
});(static) enableMeasurementPanel(enabled, callbackopt)
| Name | Type | Attributes | Description |
|---|---|---|---|
enabled | boolean | True to enable the measurement panel, false to disable. | |
callback | function | <optional> | Called after successfully disabling toggling the measurement panel. |
map.enableMeasurementPanel(false, () => console.log('Measurement panel disabled'));(static) enableSearchBar(enabled, callbackopt)
| Name | Type | Attributes | Description |
|---|---|---|---|
enabled | boolean | True to enable the search bar, false to disable. | |
callback | function | <optional> | Called after successfully toggling the search bar. |
map.enableSearchBar(false, () => console.log('Search bar disabled'));(static) enableSidebar(enabled, callbackopt)
| Name | Type | Attributes | Description |
|---|---|---|---|
enabled | boolean | True to enable the sidebar, false to disable. | |
callback | function | <optional> | Called after successfully disabling toggling the sidebar. |
map.enableSidebar(false, () => console.log('Sidebar disabled'));(static) enableTimeline(enabled, callbackopt)
| Name | Type | Attributes | Description |
|---|---|---|---|
enabled | boolean | True to enable the timeline, false to disable. | |
callback | function | <optional> | Called after successfully disabling toggling the timeline. |
map.enableTimeline(false, () => console.log('Timeline disabled'));(static) enableToolsPanel(enabled, callbackopt)
| Name | Type | Attributes | Description |
|---|---|---|---|
enabled | boolean | Set the value to true to enable the compass in the tools panel, and false to disable it. | |
callback | function | <optional> | Triggered after the compass has been successfully enabled or disabled in the tools panel. |
map.enableToolsPanel(false, () => console.log('Tools panel disabled'));(static) getAppVersion() → {string}
- Type:
- string
// returns 1.0.0
map.getAppVersion();(static) getFeatures() → {Features}
- Type:
- Features
Retrieve all the feature.
map.getFeatures();(static) getLayers() → {Array.<Layer>}
- Type:
- Array.<Layer>
example of getLayers api response:
[{
id: 3680,
groupId: 1,
groupName: 'Group1',
name: 'AAA_polygon_web_hook',
visible: false
},
{
id: 3681,
groupId: 1,
groupName: 'Group1',
name: 'web_hook',
visible: false
}]map.getLayers();
map.on('onLayersDataLoad', (layerData)=>{ console.log('Layer results:',layerData)});(static) getPreferences() → {Object}
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
imageDisplay | Object | Image display settings objectProperties
|
- Type:
- Object
const currentPrefs = map.getPreferences();
console.log('Main pane:', currentPrefs.imageDisplay.mainPane);
console.log('Auxiliary pane:', currentPrefs.imageDisplay.auxiliaryPane);// Check if main pane is in oblique mode
if (map.getPreferences().imageDisplay.mainPane === 'oblique') {
console.log('Main pane is showing oblique imagery');
}// Example of complete getPreferences() response structure
const preferences = map.getPreferences();
// Returns:
{
"oblique_border": true,
"ortho_tilt": true,
"blue_outline": true,
"compass_controls_north_up": false,
"my_location_marker": true,
"imageDisplay": {
"mainPane": "ortho",
"auxiliaryPane": "ortho"
},
"selectedMeasurementTool": "distance",
"lastSelectedAreaShape": "area",
"selectedAnnotationTool": "shape",
"distanceAttribution": {
"groundDistanceEnabled": false,
"groundSlopeEnabled": false,
"polylineUnit": {
"unit": "feet",
"groundSlopeElevDifferenceUnit": "feet"
}
},
"areaAttribution": {
"fillStyle": { "color": "#FFFF00", "opacity": 0.3 },
"lineStyle": { "color": "#FFFF00", "width": 2, "opacity": 1 },
"polygonUnit": { "areaUnit": "feet", "perimeterUnit": "feet" }
},
"circularAreaAttribution": {
"fillStyle": { "color": "#FFFF00", "opacity": 0.3 },
"lineStyle": { "color": "#FFFF00", "width": 2, "opacity": 1 },
"circleUnit": { "areaUnit": "feet", "perimeterUnit": "feet" }
},
"circleAttribution": {
"fillStyle": { "color": "#FFFF00", "opacity": 0.3 },
"lineStyle": { "color": "#FFFF00", "width": 2, "opacity": 1 }
},
"rulerAttribution": {
"length": 100,
"unit": "feet",
"color": "#FFFF00",
"width": 2,
"opacity": 1
},
"heightAttribution": {
"heightUnit": "feet",
"color": "#FFFF00",
"width": 2,
"opacity": 1
},
"slopeAttribution": {
"slopeUnit": {
"slopeDistanceUnit": "feet",
"elevDifferenceUnit": "feet"
},
"color": "#FFFF00",
"width": 2,
"opacity": 1
},
"shapeAttribution": {
"fillStyle": { "color": "#FFFF00", "opacity": 0.3 },
"lineStyle": { "color": "#FFFF00", "width": 2, "opacity": 1 }
},
"lineAttribution": {
"color": "#FFFF00",
"width": 2,
"opacity": 1
},
"contourLayerAttribution": {
"units": "feet",
"opacity": 0.8,
"majorLineColor": "#8B4513",
"majorLineWeight": 2,
"minorLineColor": "#D2B48C",
"minorLineWeight": 1,
"textColor": "#000000",
"textOutlineColor": "#FFFFFF"
},
"searchbar": {
"selectedLayerId": -1
},
"exportAttribution": {
"type": "jpeg",
"pdfFormat": "single",
"backgroundImagery": true,
"compass": true,
"imageDate": true,
"fileName": true,
"scale": true
},
"identifyTool": {
"enabledLayers": [],
"selectedTool": "identifyBox",
"buffer": "",
"unit": "feet"
},
"layersTab": {
"displayLayerToggleSwitch": true,
"enabledLayers": []
},
"userConfigured": false,
"markerAttribution": {
"fontSize": 24,
"color": "#FF0000",
"fontName": "FaMapMarkerAlt"
},
"textAttribution": {
"fontSize": 14,
"color": "#000000",
"fontFamily": "Arial"
},
"isGPSAcknowledged": false,
"pendingRequests": []
}(static) layerSearch(searchObject, callbackopt)
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
searchObject | Object | Search parameters.Properties
| |||||||||||||||||
callback | function | <optional> | (features) => {} callback function returns a GeoJSON feature collection and the response format will be like { features: [ { geometry: { coordinates: [], type: '' }, properties: {}, type: '', } ] } |
LayerSearch with event listener
map.on('layerSearch', (features)=>{ console.log('Layer search results:',features)});
map.layerSearch({ id: 3598, searchString: '15', searchProperties:['apn', 'object_id'] });LayerSearch with callback function
map.layerSearch({ id: 3263, searchString: '15', searchProperties:['address'] }, (features)=>{console.log(features)});example of layersearch api response:
{ features: [
{
"id": 123456,
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[-119.10137799599994, 38.364409468000076],
[-119.09784600699999, 38.36741644700004],
[-119.09938722199996, 38.368532781000056],
[-119.10291920199995, 38.36552575700006],
[-119.10137799599994, 38.364409468000076]
]
},
"properties": {
"addr": null,
"apn": "15",
"apn2": "15",
}
},
]
}(static) off(eventName)
| Name | Type | Description |
|---|---|---|
eventName | 'onViewUpdate' | | Name of event |
Stop handling onViewUpdate events.
map.off('onViewUpdate');Stop handling layerSearch events.
map.off('layerSearch');Stop handling Errors events.
map.off('Errors');Stop handling onMapReady events.
map.off('onMapReady');Stop handling onLayersDataLoad events.
map.off('onLayersDataLoad');Stop handling feature drag end events.
map.off('featureDragEnd');(static) on(eventName, listener)
An 'onViewUpdate' event is dispatched when a view change action has complete.
An 'featureClick' event is dispatched when annotations on the map are clicked. This will be a collection of features, as they may overlap. Features on top will be the first elements in the array
An 'Errors' event is dispatched when an error occurs within an API call.
An 'layerSearch' event is dispatched when layer search API return features.
An 'onMapReady' event is dispatched when map load complete and ready to use.
An 'onLayersDataLoad' event is dispatched when layers fetch API return layers and groups detail after load complete.
A featureDragEnd event is triggered when the dragging of a marker feature is completed. This event applies exclusively to marker features and will not work with other feature types.
| Name | Type | Description |
|---|---|---|
eventName | 'onViewUpdate' | | Name of event |
listener | function | Listener handler function. |
Listening for the onViewUpdate event.
map.on('onViewUpdate', (updatedView) => {
console.log(`updated lat/lon: ${updatedView.lonLat.lat}, ${updatedView.lonLat.lon}`);
console.log(`updated zoom: ${updatedView.zoom}`);
console.log(`updated pitch: ${updatedView.pitch}`);
console.log(`updated rotation: ${updatedView.rotation}`);
});Listening for the featureClick event.
map.on('featureClick', (features) => {
for (feature in features) {
console.log(`Feature Clicked! ${feature.properties.eagleview.value`);
}
});Listening for the layerSearch event.
map.on('layerSearch', (features) => {
console.log(`layer search features! ${features`);
});Listening for the Errors event.
map.on('Errors', (error) => {
console.log(error);
});
Listening for the layer data loaded event.
map.on('onLayersDataLoad', (layerData) => {
console.log(layerData);
});
Listening for the map load complete event.
map.on('onMapReady', () => {
console.log(onMapReady);
});Listening for the feature drag end event for marker.
map.on('featureDragEnd', (features) => {
console.log(features);
});(static) removeFeatures(featureFilters)
| Name | Type | Description |
|---|---|---|
featureFilters | FeatureFilters | Object containing filter functions for removing annotation features. |
Remove all added annotation features.
map.removeFeatures();Remove all geoJson point features.
map.removeFeatures({ geoJson: (feature) => feature.geometry.type === "Point" })(static) searchAddress(value)
| Name | Type | Description |
|---|---|---|
value | String | Address String. |
(static) setAuthToken(token)
| Name | Type | Description |
|---|---|---|
token | string | New auth token to use. |
map.setAuthToken('authToken');(static) setLonLat(value, callbackopt)
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
value | Object | lonLat object {lon:, lat:}Properties
| |||||||||||||||||||||
callback | function | <optional> | Called after successfully setting lat lon. Receives the value passed to the function. For height above ellipsoidal(default) = zType: 'HEIGHT_REFERENCE_ELLIPSOIDAL' For height above orthometric = zType: 'HEIGHT_REFERENCE_ORTHOMETRIC' |
Navigate to and display address
map.setLonLat({ lat: 23, lon: 45 }, () => console.log(`Map location set`));Navigate to and display address with z-axis drawing
map.setLonLat({ lat: 23, lon: 45, z:100 }, () => console.log(`Map location set`));Navigate to and display address with z-axis drawing and zType option
map.setLonLat({ lat: 23, lon: 45, z:100, zType: 'HEIGHT_REFERENCE_ORTHOMETRIC' }, () => console.log(`Map location set`));(static) setPitch(value, callbackopt)
| Name | Type | Attributes | Description |
|---|---|---|---|
value | number | Map pitch in degrees. The value is clamped to between 0 and 60. | |
callback | function | <optional> | Called after successfully setting pitch. Receives the updated view object. |
map.setPitch(10, () => console.log('Map pitch set'));(static) setPreferences(preferences, callbackopt)
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
preferences | Object | Preference settings object (validated against schema)Properties
| |||||||||||||||||||||
callback | function | <optional> | Called after successfully setting preferences |
// Set image display preferences using pane keys
map.setPreference({
imageDisplay: {
'mainPane': 'oblique',
'auxiliaryPane': 'ortho'
}
}, () => console.log('Image preferences set successfully'));// This will fail validation - invalid key
map.setPreference({
invalidKey: 'someValue' // Error: Invalid key 'invalidKey' - not found in schema
});(static) setRotation(value, callbackopt)
| Name | Type | Attributes | Description |
|---|---|---|---|
value | number | Map rotation angle in degrees. | |
callback | function | <optional> | Called after successfully setting rotation. Receives the updated view object. |
map.setRotation(45, () => console.log('Map rotation set'));(static) setView(value, callbackopt)
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
value | Object | View parameters.Properties
| |||||||||||||||||||||||||||||||||||||||||
callback | function | <optional> | (view) => {} Called after successfully setting the view. Receives the updated view object. For height above ellipsoidal(default) = zType: 'HEIGHT_REFERENCE_ELLIPSOIDAL' For height above orthometric = zType: 'HEIGHT_REFERENCE_ORTHOMETRIC' |
map.setView({ lonLat: {lat: 23, lon: 45}, zoom: 20, pitch: 15, rotation: -75 }, (value) => console.log('View has been set.'));map.setView({ lonLat:{ lat: 23, lon: 45, z:100 }, zoom: 20, pitch: 15, rotation: -75}, (value) => console.log('View has been set.'));map.setView({ lonLat:{ lat: 23, lon: 45, z:100, zType: 'HEIGHT_REFERENCE_ORTHOMETRIC' },
zoom: 20, pitch: 15, rotation: -75, }, (value) => console.log('View has been set.'));(static) showToastMessages(show, callbackopt)
| Name | Type | Attributes | Description |
|---|---|---|---|
show | boolean | Set the value to true to show the toast messages, and false to hide it. | |
callback | function | <optional> | Triggered after the toast message has been successfully enabled or disabled. |
map.showToastMessages(false, () => console.log('Toasts are now visible'));(static) updateLayers(options)
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
options | Object | Options objectProperties
|
| Name | Type | Description |
|---|---|---|
visible | Boolean if true the layer is made visible on the map, if false the layer is hidden |
map.updateLayers({
filter: (layer) => {
if (layer.id === 1234) {
layer.visible = true;
}
}
});(static) zoomIn(valueopt, callbackopt)
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | number | <optional> | 1 | Steps to increase the zoom level by. |
callback | function | <optional> | Called after successfully zooming in. Receives the updated view object. |
map.zoomIn(2, () => console.log('Map zoom increased'));(static) zoomOut(valueopt, callbackopt)
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
value | number | <optional> | 1 | Steps to decrease the zoom level by. |
callback | function | <optional> | Called after successfully zooming out. Receives the updated view object. |
map.zoomOut(2, () => console.log('Map zoom decreased'));Type Definitions
Features
- Object
| Name | Type | Description |
|---|---|---|
geoJson | Array.<GeoJsonFeature> | Array of GeoJson features that had been added to the application. |
Layer
- Object
| Name | Type | Description |
|---|---|---|
id | number | Layer id |
groupId | number | group id of layer |
groupName | string | group name of layer |
name | string | layer name |
visible | boolean | visibility of layer on the map |
{
id: 3680,
groupId: 1,
groupName: 'Group1',
name: 'AAA_polygon_web_hook',
visible: false
}