# GraffitiMapViewer
Class Inherits GraffitiWebUIControl
## About
GraffitiMapViewer provides Google Maps in a easy to use and manage class with support for markers, popups, symbols, heatmaps, and more.
## Compatibility
### Framework API Version
| 1.0 | 2.0 |
| :---: | :---: |
| True | True |
### Desktop
| 32-Bit | 64-Bit |
| :---: | :---: |
| True | True |
## Enumerations
| Name | Value | Description |
| --- | :---: | --- |
| GestureHandlingTypes | Auto <br > None <br > Cooperative <br > Greedy | Possible ways the map can interpret gestures. |
| MapStyles | Standard <br > Silver <br > Retro <br > Dark <br > Night <br > Aubergine <br > Custom | Supported map display styles. |
| MapTypes | Roadmap <br > Hybrid <br > Satellite <br > Terrain | Supported map display types. |
| ZoomLevels | World = 1 <br > Continent = 5 <br > City = 10 <br > Streets = 15 <br > Buildings = 20 | Supported zoom levels. |
## Event Definitions
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| DoublePressed | x as Integer <br> y as Integer <br> position as GraffitiMap.Point | (None) | Raised when the user has double-pressed or -clicked the map. |
| FocusLost | (None) | (None) | (None) |
| FocusReceived | (None) | (None) | (None) |
| ImageOverlayDoublePressed | overlay as GraffitiMap.Overlays.Image <br> point as GraffitiMap.Point | (None) | Raised when an image overlay is double-pressed. |
| ImageOverlayPressed | overlay as GraffitiMap.Overlays.Image <br> point as GraffitiMap.Point | (None) | Raised when an image overlay is pressed. |
| MapTypeChanged | (None) | (None) | Raised when the user has changed the map type. |
| MarkerContextPressed | marker as GraffitiMap.Marker <br> pageX as Integer <br> pageY as Integer | (None) | Raised when the user had right-clicked the specified marker. |
| 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. |
| Opening | (None) | (None) | (None) |
| 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 <br> y as Integer <br> position as GraffitiMap.Point | (None) | Raised when the user has pressed or clicked on the map's display. |
| Ready | (None) | (None) | Map is displayed and ready for interaction. |
| RouteChanged | route as GraffitiMap.Directions.Route | (None) | Raised when the Route has been edited by the user. |
| RouteError | route as GraffitiMap.Directions.Route <br> message as String | (None) | Raised when an error was encountered while the Directions API attempting to create the specified Route. |
| ShapeChanged | shape as GraffitiMap.Shapes.Shape | (None) | Raised when a shape has been altered or repositioned the user. |
| ShapeContextPressed | shape as GraffitiMap.Shapes.Shape <br> pageX as Integer <br> pageY as Integer | (None) | Raised when the user has right-clicked or long-pressed on a shape. |
| 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
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| AddHeatmap | heatmap as GraffitiMap.Overlays.Heatmap | (None) | Adds a new heatmap to map. |
| AddImageOverlay | imageOverlay as GraffitiMap.Overlays.Image | (None) | Add the specified image overlay to the current map. |
| AddMapStyle | name as String <br> style as JSONItem | (None) | Adds a new MapStyle (set MapStyle to Custom). |
| AddMarker | marker as GraffitiMap.Marker | (None) | Adds the specified marker to the map. |
| AddPopup | popup as GraffitiMap.Popup | (None) | Adds the specified popup instance to the map (hidden until explicitly shown). |
| AddRoute | route as GraffitiMap.Directions.Route | (None) | Adds the specified route to the map. |
| AddShape | shape as GraffitiMap.Shapes.Shape | (None) | Adds the specified shape to the map. |
| FitBounds | bounds as GraffitiMap.Bounds <br> padding as Integer = 0 | (None) | Pans and Zooms the map to display the specified area. |
| HeatmapAt | index as Integer | GraffitiMap.Overlays.Heatmap | Returns the heatmap at the specified index within the internal array. |
| LastImageOverlayIndex | (None) | Integer | Index of the final image overlay present in the internal array. |
| LastMarkerIndex | (None) | Integer | Index of the final marker present in the internal array. |
| LastPopupIndex | (None) | Integer | Index of the final popup present in the internal array. |
| LastRouteIndex | (None) | Integer | Index of the final route present in the internal array. |
| LastShapeIndex | (None) | Integer | Index of the final shape present in the internal array. |
| MarkerAt | index as Integer | GraffitiMap.Marker | Marker object at the specified index. |
| PanBy | offset as Xojo.Point | (None) | Pans the map's display by X/Y in pixels. |
| PanTo | position as GraffitiMap.Point | (None) | Scrolls the map to show the specified position. Alternatively, set the Position property. |
| PopupAt | index as Integer | GraffitiMap.Popup | Returns the popup as the specified index. |
| RemoveAllHeatmaps | (None) | (None) | Removes all heatmaps from the component. |
| RemoveAllImageOverlays | (None) | (None) | Removes all image overlays from the component. |
| RemoveAllMarkers | (None) | (None) | Removes all markers from the component. |
| RemoveAllPopups | (None) | (None) | Removes all popups from the component. |
| RemoveAllRoutes | (None) | (None) | Removes all routes from the component. |
| RemoveAllShapes | (None) | (None) | Removes all shapes from the component. |
| RemoveHeatmap | heatmap As GraffitiMap.Overlays.Heatmap | (None) | Removes the specified heatmap from the component. |
| RemoveImageOverlay | overlay As GraffitiMap.Overlays.Image | (None) | Removes the specified image overlay. |
| RemoveMarker | marker as GraffitiMap.Marker | (None) | Removes the specified marker. Use MarkerAt in conjunction with RemoveMarker to remove by index. |
| RemovePopup | popup as GraffitiMap.Popup | (None) | Removes the specified popup. Use PopupAt in conjunction with RemovePopup to remove by index. |
| RemoveRoute | route as GraffitiMap.Directions.Route | (None) | Removes the specified route. Use RouteAt in conjunction with RemoveRoute to remove by index. |
| RemoveShape | shape as GraffitiMap.Shapes.Shape | (None) | Removes the specified shape. Use ShapeAt in conjunction with RemoveShape to remove by index. |
| RouteAt | index as Integer | GraffitiMap.Directions.Route | Returns the route at the specified index. |
| ShapeAt | index as Integer | GraffitiMap.Shapes.Shape | Returns the shape at the specified index. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| APIKey | String | (None) | (None) |
| BackgroundColor | Color | (None) | (None) |
| CanDoubleClickToZoom | Boolean | (None) | (None) |
| CanMouseWheelToZoom | Boolean | (None) | (None) |
| CanUseKeyboard | Boolean | (None) | (None) |
| DirectionsSidebarWidth | Integer | (None) | (None) |
| GestureHandlingType | GestureHandlingTypes | (None) | (None) |
| HasBicyclingLayer | Boolean | (None) | (None) |
| HasDirectionsSidebar | Boolean | (None) | (None) |
| HasFullScreenControl | Boolean | (None) | (None) |
| HasPanControl | Boolean | (None) | (None) |
| HasRotateControl | Boolean | (None) | (None) |
| HasScaleControl | Boolean | (None) | (None) |
| HasStreetViewControl | Boolean | (None) | (None) |
| HasThreeWordsLayer | Boolean | (None) | (None) |
| HasTrafficLayer | Boolean | (None) | (None) |
| HasTransitLayer | Boolean | (None) | (None) |
| HasZoomControl | Boolean | (None) | (None) |
| Heading | Integer | (None) | (None) |
| IsTilted | Boolean | (None) | (None) |
| MapStyle | MapStyles | (None) | (None) |
| MapStyleName | String | (None) | (None) |
| MapType | MapTypes | (None) | (None) |
| PerformThreeWordsLookups | Boolean | (None) | (None) |
| Position | GraffitiMap.Point | (None) | (None) |
| PositionW3W | GraffitiW3W.MapPoint | (None) | (None) |
| ZoomLevel | Integer | (None) | (None) |
| ZoomLevelMaximum | Integer | (None) | (None) |
| ZoomLevelMinimum | Integer | (None) | (None) |