Skip to main content

%DeepSee.Component.mapView

Class %DeepSee.Component.mapView Extends (%ZEN.Component.component, %ZEN.Component.dataView) [ System = 4 ]

A specialized Zen component that displays a google map.
Use the height and width attributes to control the size of the map container.

Parameters

NAMESPACE

Parameter NAMESPACE = "http://www.intersystems.com/deepsee";

INCLUDEFILES

Parameter INCLUDEFILES As COSEXPRESSION = """script:https://maps.googleapis.com/maps/api/js?""_..%GetUrlAPIKey()";

Properties

latitude

Property latitude As %ZEN.Datatype.float [ InitialExpression = 42.36 ];

Initial latitude (as a decimal number).

longitude

Property longitude As %ZEN.Datatype.float [ InitialExpression = 288.92 ];

Initial longitude (as a decimal number).

zoom

Property zoom As %ZEN.Datatype.integer [ InitialExpression = 12 ];

Initial zoom level (0 shows entire globe).

mapType

Property mapType As %ZEN.Datatype.string(VALUELIST = ",ROADMAP,SATELLITE,HYBRID,TERRAIN") [ InitialExpression = "ROADMAP" ];

Initial map display.

markersDraggable

Property markersDraggable As %ZEN.Datatype.boolean [ InitialExpression = 0 ];

If true, then the markers on this map are draggable.

latitudeProperty

Property latitudeProperty As %ZEN.Datatype.string [ InitialExpression = "Latitude" ];

Name of property in data source that provides the latitude value for a marker.

longitudeProperty

Property longitudeProperty As %ZEN.Datatype.string [ InitialExpression = "Longitude" ];

Name of property in data source that provides the longitude value for a marker.

isListing

Property isListing As %ZEN.Datatype.boolean [ InitialExpression = 0, Internal ];

Optional. Flag used by DeepSee widget to indicate that this map is only used for geolistings.

onclickmarker

Property onclickmarker As %ZEN.Datatype.eventHandler;

onclickmarker event handler: If defined, this event is fired when the user clicks on a marker within the map.

infoProperties

Property infoProperties As list Of %DeepSee.Component.SVG.scoreCardColumn(XMLPROJECTION = "ELEMENT", XMLREF = 1, XMLTYPECONSTRAINT = "CHOICE", ZENSETTING = 0);

Define a set of property value to be displayed within the default "info box" when the user clicks on a map marker. This only uses a relevant subset of the properties in the scoreCardColumn class. Currently only the label, dataValue, style, format, and align properties are used.

Methods

renderContents

ClientMethod renderContents() [ Language = javascript ]

Client-side method to render control.

initMap

ClientMethod initMap(mapDiv) [ Language = javascript ]

Initialize the map

zoomChangedHandler

ClientMethod zoomChangedHandler() [ Internal, Language = javascript ]

Callback for zoom-changed event.

dragendHandler

ClientMethod dragendHandler() [ Internal, Language = javascript ]

Callback for map dragend event.

getMapObject

ClientMethod getMapObject() [ Language = javascript ]

Return the google map API object used by the map view.

getMapTypeId

ClientMethod getMapTypeId(type) [ Language = javascript ]

Given the name of a map type, convert to a map type id.

adjustContentSize

ClientMethod adjustContentSize(load, width, height) [ Language = javascript ]

Called when page is loaded or widget is resized.

adjustMapBounds

ClientMethod adjustMapBounds() [ Language = javascript ]

Adjust the map to show all the current markers

setProperty

ClientMethod setProperty(property, value, value2) [ Language = javascript ]

Set the value of a named property.

notifyViewHandler

ClientMethod notifyViewHandler(reason, data1, data2, data3) [ Language = javascript ]

Notification that the dataController associated with this dataView has raised an event.

getDataSet

ClientMethod getDataSet() [ Language = javascript ]

Return the dataSet object associated with this view.

addMarker

ClientMethod addMarker(id, latitude, longitude, title) [ Language = javascript ]

Add a marker to the map at given coordinates.
id is a user-defined identifier associated with the marker.
Returns the marker object.

getMarker

ClientMethod getMarker(index) [ Internal, Language = javascript ]

Find marker in marker list by index # (0-based).

markerDragEndHandler

ClientMethod markerDragEndHandler(index) [ Internal, Language = javascript ]

Callback for marker dragend event.

markerClickHandler

ClientMethod markerClickHandler(index) [ Internal, Language = javascript ]

Callback for marker click event.

createInfoWindow

ClientMethod createInfoWindow(marker, content) [ Internal, Language = javascript ]

Create and show an info window for a given marker.

getInfoPropContent

ClientMethod getInfoPropContent(index) [ Internal, Language = javascript ]

Using the infoProperties defined for this map, construct and return the HTML to display the properties within an infoBox.

removeMarker

ClientMethod removeMarker(marker) [ Language = javascript ]

Remove a marker from the map. marker is the marker to remove.

acquireData

ClientMethod acquireData() [ Internal, Language = javascript ]

Internal method: acquire data for this view and store a copy in a local cache.

syncMarkers

ClientMethod syncMarkers() [ Internal, Language = javascript ]

Internal method: sync markers to data from controller.

clearMarkers

ClientMethod clearMarkers() [ Internal, Language = javascript ]

Internal method: clear markers from map.

panToAddress

ClientMethod panToAddress(address) [ Language = javascript ]

Invoke the google geocoder api to lookup an address string and move the map to view it. Applications that call this are responsible for adhering to the google geocoder api terms of use.

geocodeAddressHandler

ClientMethod geocodeAddressHandler(results, status) [ Internal, Language = javascript ]

Callback for geocoder API.

showGeoMarkers

ClientMethod showGeoMarkers() [ Internal, Language = javascript ]

Show set of markers for a geolisting.

%GetUrlAPIKey

ClassMethod %GetUrlAPIKey() As %String [ Internal, Private ]

Load the GoogleMaps API key stored in the namespace settings.