GraffitiMapViewer

View Categories

Enumerations #

Name Values
GestureHandlingTypes Auto
None
Cooperative
Greedy
MapStyles Standard
Silver
Retro
Dark
Night
Aubergine
Custom
MapTypes Roadmap
Hybrid
Satellite
Terrain
ZoomLevels World = 1
Continent = 5
City = 10
Streets = 15
Buildings = 20

Constants #

Name Type Value

This class exposes no constants.

Events #

Definition Parameters Return Type Description
DoublePressed x as Integer None Raised when the user has double-pressed or -clicked the map.
y as Integer
MapTypeChanged None None Raised when the user has changed the map type.
MarkerContextPressed marker as GraffitiMap.Marker None Raised when the user had right-clicked the specified marker.
pageX as Integer, pageY as Integer
MarkerMouseEnter marker as GraffitiMap.Marker None Raised when the user’s mouse has entered the specified marker’s display area.
MarkerMouseExit marker as GraffitiMap.Marker None Raised when the user’s mouse has exited the specified marker’s display area.
MarkerPositionChanged marker as GraffitiMap.Marker None Raised when the user has dragged the specified marker to a new position.
MarkerPressed marker as GraffitiMap.Marker None Raise the user has double-pressed or -clicked the specified marker.
MouseEnter None None Raised when user’s mouse has entered the map’s display area.
MouseExit None None Raised when user’s mouse has exited the map’s display area.
PopupHidden popup as GraffitiMap.Popup None Raised when user has closed the specified popup by clicking its close button.
PositionChanged None None Raised when the user has changed the map’s position by dragging or zooming.
Pressed x as Integer None Raised when the user has pressed or clicked on the map’s display.
y as Integer
position as GraffitiMap.Point
RouteChanged route as GraffitiMap.Directions.Route None Raised when the Route has been edited by the user.
RouteError route as GraffitiMap.Directions.Route None Raised when an error was encountered while the Directions API attempting to create the specified Route.
message as String
ShapeChanged shape as GraffitiMap.Shapes.Shape None Raised when a shape has been altered or repositioned the user.
ShapeContextPressed shape as GraffitiMap.Shapes.Shape None Raised when the user has right-clicked or long-pressed on a shape.
pageX as Integer
pageY as Integer
ShapeDoublePressed shape as GraffitiMap.Shapes.Shape None Raised when the user has double-pressed or -clicked on the specified shape.
ShapeMouseEnter shape as GraffitiMap.Shapes.Shape None Raised when the user’s mouse has entered the shape’s display area.
ShapeMouseExit shape as GraffitiMap.Shapes.Shape None Raised when the user’s mouse has exited the shape’s display area.
ShapePressed shape as GraffitiMap.Shapes.Shape None Raised when the user presses or clicks the specified shape.
ZoomChanged None None Raised when the user has changed the ZoomLevel.

Methods #

DefinitionParametersReturn TypeDescription
AddImageOverlayoverlay as GraffitiMap.Overlays.ImageNoneAdd the specified image overlay to the current map.
AddMapStylename as StringNoneAdds a new MapStyle (set MapStyle to Custom).
style as JSONItem
AddMarkermarker as GraffitiMap.MarkerNoneAdds the specified marker to the map.
AddPopuppopup as GraffitiMap.PopupNoneAdds the specified popup instance to the map (hidden until explicitly shown).
AddRouteroute as GraffitiMap.Directions.RouteNoneAdds the specified route to the map.
AddShapeshape as GraffitiMap.Shapes.ShapeNoneAdds the specified shape to the map.
FitBoundsbounds as GraffitiMap.BoundsNonePans and Zooms the map to display the specified area.
HeatmapAtindex as IntegerGraffitiMap.Overlays.HeatmapReturns the heatmap at the specified index within the internal array.
ImageOverlayAtindex as IntegerGraffitiMap.Overlays.ImageImage overlay at the specified index.
LastImageOverlayIndexNoneIntegerIndex of the final image overlay present in the internal array.
LastMarkerIndexNoneIntegerIndex of the final marker present in the internal array.
LastPopupIndexNoneIntegerIndex of the final popup present in the internal array.
LastRouteIndexNoneIntegerIndex of the final route present in the internal array.
LastShapeIndexNoneIntegerIndex of the final shape present in the internal array.
MarkerAtindex as IntegerGraffitiMap.MarkerMarker object at the specified index.
PanByoffset as Xojo.PointNonePans the map’s display by X/Y in pixels.
PanToposition as GraffitiMap.PointNoneScrolls the map to show the specified position. Alternatively, set the Position property.
PopupAtindex as IntegerGraffitiMap.PopupReturns the popup as the specified index.
RemoveAllHeatmapsNoneNoneRemoves all heatmaps from the component.
RemoveAllImageOverlaysNoneNoneRemoves all image overlays from the component.
RemoveAllMarkersNoneNoneRemoves all markers from the component.
RemoveAllPopupsNoneNoneRemoves all popups from the component.
RemoveAllRoutesNoneNoneRemoves all routes from the component.
RemoveAllShapesNoneNoneRemoves all shapes from the component.
RemoveHeatmapheatmap as GraffitiMap.Overlays.HeatmapNoneRemoves the specified heatmap from the component.
RemoveImageOverlaysoverlay as GraffitiMap.Overlays.ImageNoneRemoves the specified image overlay. Use MarkerAt in conjunction with RemoveMarker to remove by index.
RemoveMarkermarker as GraffitiMap.MarkerNoneRemoves the specified marker. Use MarkerAt in conjunction with RemoveMarker to remove by index.
RemovePopuppopup as GraffitiMap.PopupNoneRemoves the specified popup. Use PopupAt in conjunction with RemovePopup to remove by index.
RemoveRouteroute as GraffitiMap.Directions.RouteNoneRemoves the specified route. Use RouteAt in conjunction with RemoveRoute to remove by index.
RemoveShapeshape as GraffitiMap.Shapes.ShapeNoneRemoves the specified shape. Use ShapeAt in conjunction with RemoveShape to remove by index.
RouteAtindex as IntegerGraffitiMap.Directions.RouteReturns the route at the specified index.
ShapeAtindex as IntegerGraffitiMap.Shapes.ShapeReturns the shape at the specified index.

Properties #

NameTypeDefault ValueDescription
APIKeyString“”Google Maps API Key. To use Directions, your key must have the directions API enabled.
BackgroundColorColor&c000000Color to apply to the map’s backdrop.
CanDoubleClickToZoomBooleanTrueWhen True, double-clicking the map will cause ZoomLevel to increase.
CanMouseWheelToZoomBooleanTrueWhen True, the mousewheel will alter the ZoomLevel.
CanUseKeyboardBooleanTrueWhen True, keyboard shortcuts are enabled.
DirectionsSidebarWidthInteger30Size in rem (based on font-size) for directions sidebar.
GestureHandlingTypeGestureHandlingTypesAutoWhen a user scrolls a page that contains a map, the scrolling action can unintentionally cause the map to zoom. This behavior can be controlled using the gestureHandling map option. (https://developers.google.com/maps/documentation/javascript/interaction#controlling_gesture_handling)
HasBicyclingLayerBooleanFalseWhen True, the map will display known bicycle paths.
HasDirectionsSidebarBooleanTrueWhen True, setting a Directions.Route will cause the directions sidebar to display with a list of route steps.
HasFullScreenControlBooleanTrueWhen True, a button will be displayed that, when clicked, expands the map to fill the screen.
HasPanControlBooleanTrueWhen True, a pan control will be visible in applicable views.
HasRotateControlBooleanTrueWhen True, a rotate control will be visible in applicable views.
HasScaleControlBooleanTrueWhen True, a scale control will be visible in applicable views.
HasStreetViewControlBooleanTrueWhen True, the street view control will be visible in applicable views.
HasThreeWordsOverlayBooleanFalseWhen True and the map is sufficiently zoomed in, an overlay of What3Words grid squares will be drawn on the map. Requires a What3Words API key be supplied.
HasTrafficLayerBooleanFalseWhen True, the map will display current traffic conditions.
HasTransitLayerBooleanFalseWhen True, the map will display known public transit paths.
HeadingInteger0Value, in degrees, of the map’s display direction.
IsTiltedBooleanFalseWhen True, the map will tilt by 45 degrees for applicable views.
MapStyleMapStylesStandardThe display style to apply to the map and its element.
MapStyleNameString“”Map style to apply when MapStyle is set to Custom.
MapTypeMapTypesRoadmapType of map to display.
PerformThreeWordsLookupsBooleanFalseWhen true and an API key has been supplied to GraffitiW3W, the class will attempt to resolve map points to their W3W values.
PositionGraffitiMap.Point(0, 0)Center point of the map’s display.
PositionW3WGraffitiW3W.MapPointNilThe current W3W MapPoint position of the center of the map display. Setting this property will have no effect if an API key is not supplied to the GraffitiW3W module.
ZoomLevelInteger10While the value is an integer, there is a corresponding enumeration to assist with value selection.
ZoomLevelMaximumInteger20Limits the maximum zoom level that the user can achieve.
ZoomLevelMinimumInteger1Limits the minimum zoom level that the user can achieve.

Examples #

This object current has no examples.

API Key #

The APIKey property should be set in the IDE’s Inspector to ensure that it is available before it is needed due to the unreliability of event order.

Disposable Objects #

The following object instances should be considered disposable, and may be discarded at will by the component. It’s best not to keep references to these objects or assume that they will be reused when the user has made relevant changes in the browser:

  • GraffitiMap.Bounds
  • GraffitiMap.Point
  • GraffitiMap.Directions.Waypoint