GoogleMaps

Last Updated On 2021-07-16

Version 1MinSDK 7Tutorial Video

Visible component that show information on Google map.


Properties

You can set the below properties in the UI part of the builder.

  • HeihMargin - it's a four value which is set to 0,0,0,0 by default.
  • HeihPadding - it's a four value which is set to 0,0,0,0 by default.
  • MarginBottom - it's a non negative float value which is set to 0 by default.
  • MarginLeft - it's a non negative float value which is set to 0 by default.
  • MarginRight - it's a non negative float value which is set to 0 by default.
  • MarginTop - it's a non negative float value which is set to 0 by default.
  • PaddingBottom - it's a non negative float value which is set to 0 by default.
  • PaddingLeft - it's a non negative float value which is set to 0 by default.
  • PaddingRight - it's a non negative float value which is set to 0 by default.
  • PaddingTop - it's a non negative float value which is set to 0 by default.
  • Visible - it's a visibility value which is set to true by default.

Block Properties

You can set the below blocks properties in the blocks section of the builder.

CompassEnabled

Indicates whether the compass widget is currently enabled in the map ui


Height

Specifies the vertical height of the NiotronGoogleMaps, measured in pixels.


HeightPercent

Specifies the vertical height of the NiotronGoogleMaps as a percentage of the height of the Screen.


MapCameraChangedListenerEnabled

Indicates if the map camera's position changed listener is currently enabled


MapClickListenerEnabled

Indicates if the mapClick event listener is currently enabled


MapLongClickListenerEnabled

Indicates if the map longClick listener is currently enabled


MapType

Indicates the current map type


MarginBottom

Property for MarginBottom


MarginLeft

Property for MarginLeft


MarginRight

Property for MarginRight


MarginTop

Property for MarginTop


MyLocationEnabled

Indicates whether my locaiton UI control is currently enabled for the Google map.


PaddingBottom

Property for PaddingBottom


PaddingLeft

Property for PaddingLeft


PaddingRight

Property for PaddingRight


PaddingTop

Property for PaddingTop


RotateEnabled

Indicates whether the capability to rotate a map on the ui is currently enabled


ScrollEnabled

Indicates whether the capability to scroll a map on the ui is currently enabled


Visible

Specifies whether the NiotronGoogleMaps should be visible on the screen. Value is true if the NiotronGoogleMaps is showing and false if hidden.


Width

Specifies the horizontal width of the NiotronGoogleMaps, measured in pixels.


WidthPercent

Specifies the horizontal width of the NiotronGoogleMaps as a percentage of the width of the Screen.


ZoomControlEnabled

Indicates whether the zoom widget on the map ui is currently enabled


ZoomGestureEnabled

Indicates whether the zoom gesture is currently enabled



Methods

You can set the below method blocks in the blocks section of the builder.

AddCircle

Create a circle overlay on the map UI with specified latitude and longitude for center. "hue" (min 0, max 360) and "alpha" (min 0, max 255) are used to set color and transparency level of the circle, "strokeWidth" and "strokeColor" are for the perimeter of the circle. Returning a unique id of the circle for future reference to events raised by moving this circle. If the circle isset to be draggable, two default markers will appear on the map: one in the center of the circle, another on the perimeter.

AddMarkers

Adding a list of YailLists for markers. The representation of a maker in the inner YailList is composed of: lat(double) [required], long(double) [required], Color, title(String), snippet(String), draggable(boolean). Return a list of unqiue ids for the added markers. Note that the markers ids are not meant to persist after the app is closed, but for temporary references to the markers within the program only. Return an empty list if any error happen in the input

AddMarkersFromJson

Adding a list of markers that are represented as JsonArray. The inner JsonObject represents a markerand is composed of name-value pairs. Name fields for a marker are: "lat" (type double) [required], "lng"(type double) [required], "color"(type int)[in hue value ranging from 0~360], "title"(type String), "snippet"(type String), "draggable"(type boolean)

AddMarkersHue

Adding a list of YailList for markers. The inner YailList represents a marker and is composed of lat(Double) [required], long(Double) [required], color(int)[in hue value ranging from 0-360], title(String), snippet(String), draggable(boolean). Return a list of unique ids for the markers that are added

BoundCamera

Transforms the camera such that the specified latitude/longitude bounds are centered on screen at the greatest possible zoom level. Need to specify both latitudes and longitudes for both northeast location and southwest location of the bounding box

EnableCompass

Enables/disables the compass widget on the map's ui. Call this only after event "MapIsReady" is received

EnableMapCameraPosChangeListener

Enable/Disable to listen to map's camera position changed event

EnableMapClickListener

Enable/Disable to listen to map's click event

EnableMapLongClickListener

Enable/disable to listen to map's long click event

EnableMyLocation

Enable or disable my location widget control for Google Map. One can call GetMyLocation() to obtain the current location after enable this."

EnableRotate

Enables/disables the capability to rotate a map on the ui. Call this only after the event "MapIsReady" is received.

EnableScroll

Enables/disables the capability to scroll a map on the ui. Call this only after the event "MapIsReady" is received

EnableZoomControl

Enables/disables the zoom widget on the map's ui. Call this only after the event "MapIsReady" is received

EnableZoomGesture

Enables/disables zoom gesture on the map ui. Call this only after the event "MapIsReady" is received.

GetAllCircleIDs

Get all circles Ids. A short cut to get all the references for the eixisting circles

GetAllMarkerID

Get all the existing markers's Ids

GetMarkers

Add a list of markers composed of name-value pairs. Name fields for a marker are: "lat" (type double) [required], "lng"(type double) [required], "color"(type int)[in hue value ranging from 0~360], "title"(type String), "snippet"(type String), "draggable"(type boolean)

GetMyLocation

Get current location using Google Map Service. Return a YailList with first item beingthe latitude, the second item being the longitude, and last time being the accuracy of the reading.

MoveCamera

Move the map's camera to the specified position and zoom level

RemoveCircle

Remove a circle for the map. Returns true if successfully removed, false if the circle does not exist with the specified id

RemoveMarker

Remove a marker from the map

SetMapType

Set the layer of Google map. Default layer is "normal", other choices including "hybrid","satellite", and "terrain"

UpdateCircle

Set the property of an existing circle. Properties include: "alpha"(number, value ranging from 0~255), "color" (nimber, hue value ranging 0~360), "radius"(number in meters)

UpdateMarker

Set the property of a marker, note that the marker has to be added first or else will throw an exception! Properties include: "color"(hue value ranging from 0~360), "title", "snippet", "draggable"(give either true or false as the value).

addOverlay

Method for addOverlay

addPolygon

Method for addPolygon

addTileOverlay

Method for addTileOverlay

clearAllPolygons

Method for clearAllPolygons

drawCentralSquare

Method for drawCentralSquare

getBoundingBox

Method for getBoundingBox

getMapCenter

Method for getMapCenter

getZoomLevelInfo

Method for getZoomLevelInfo


Events

You can set the below event blocks in the blocks section of the builder.

CameraPositionChanged

Called after the camera position of a map has changed.

FinishedDraggingCircle

Event been raised after the action of moving a draggable circle is finished. Possible a user drag the center of the circle or drag the radius marker of the circle

InfoWindowClicked

When the marker's infowindow is clicked, returning marker's id

MapIsReady

Indicates that the map has been rendered and ready for adding markers or changing other settings. Please add or updating markers within this event

OnLocationChanged

Triggers this event when user location has changed. Only works when EnableMylocation is set to true

OnMapClick

Called when the user makes a tap gesture on the map

OnMapLongClick

Called when the user makes a long-press gesture on the map

OnMarkerClick

When a marker is clicked

OnMarkerDrag

When a marker is been dragged

OnMarkerDragEnd

When the user drags a marker and finish the action, returning marker's id and it's latest position

OnMarkerDragStart

When a marker starts been dragged