Skip to content

Bindable Properties

TorbenK edited this page Dec 18, 2015 · 1 revision

Bindable Properties of TKCustomMap

CustomPins

Lets you bind an ObservableCollection<TKCustomMapPin>>. Adding and removing pins from the collection will automatically update the map. TKCustomMapPin has the following properties available:

  • IsVisible
  • Gets/Sets visibility of a pin
  • Title
  • Gets/Sets title of the pin displayed in the callout
  • Subtitle
  • Gets/Sets the subtitle of the pin displayed in the callout
  • ShowCallout
  • Gets/Sets if the callout should be displayed when a pin gets selected
  • Position
  • Gets/Sets the position of the pin
  • Image
  • Gets/Sets the image of the pin. If null the default platform markers are used
  • IsDraggable
  • Gets/Sets if the pin is draggable
  • DefaultPinColor
  • Gets/Sets the color of the default pin. Only applies when no Image is set

SelectedPin

Gets/Sets the currently selected pin on the map.

MapCenter

Gets/Sets the current center position of the map. If this gets set the map will move to the new center position without changing the current zoom level.

AnimateMapCenterChange

Gets/Sets if a change of MapCenter should be animated.

MapRegion

Gets/Sets the currently visible region of the map. When this gets set, the map will move to the new MapSpan.

Routes

Lets you bind a collection of TKRoute. If the collection implements INotifyCollectionChanged adding and removing routes from the collection will automatically update the map. Route calculation is performed automatically. On Android the calculation is done via the Google Maps Directions API. Set your api key once in your app constructor:

public App()
{
	GmsDirection.Init("YOUR GOOGLE MAPS DIRECTIONS API KEY");

	// The root page of your application
}

On iOS no api key is needed. A route calculation will be performed by the MKDirections API.

Route calculation is asynchronous, you can bind the RouteCalculationFinishedCommand and/or RouteCalculationFailedCommand to get informed when the calculation is finished or failed.

TKRoute exposes the following properties:

  • Source
  • Gets/Sets the source position of the route
  • Destination
  • Gets/Sets the destination position of the route
  • LineWidth
  • Gets/Sets the width of the drawn line
  • Color
  • Gets/Sets the color of the drawn line
  • Selectable
  • Gets/Sets if the route is selectable
  • TravelMode
  • Gets/Sets the travel mode for the route calulation. Possible values are: Driving, Walking and Any

The following properties of TKRoute are read only and getting set by the renderer when a calculation is done.

  • Bounds
  • The boundary of the route
  • Steps
  • The single steps of a route containing text instructions and distance information.
  • Distance
  • The full distance of the route
  • TravelTime
  • The full estimated travel time of the route

Circles

Lets you bind a collection of TKCircles. If the collection implements INotifyCollectionChanged adding and removing circles from the collection will automatically update the map. TKCircleexposes the following properties:

  • Radius
  • Gets/Sets the radius of the circle
  • Color
  • Gets/Sets the fill color of the circle
  • StrokeColor
  • Gets/Sets the stroke color of the circle
  • Center
  • Gets/Sets the center position of the circle
  • StrokeWidth
  • Gets/Sets the width of the stroke

Polylines

Lets you bind a collection of TKPolyline. If the collection implements INotifyCollectionChanged adding and removing polylines from the collection will automatically update the map. TKPolylineexposes the following properties:

  • Color
  • Gets/Sets the color of the line
  • LineCoordinates
  • Gets/Sets the all coordinates to connect to a polyline
  • LineWidth
  • Gets/Sets the width of the drawn line

Polygons

Lets you bind a collection of TKPolygone. If the collection implements INotifyCollectionChanged adding and removing polygons from the collection will automatically update the map. TKPolygon exposes the following properties:

  • Color
  • Gets/Sets the fill color of the polygon
  • Coordinates
  • Gets/Sets all coordinates of the polygon
  • StrokeColor
  • Gets/Sets the color of the stroke
  • StrokeWidth
  • Gets/Sets the width of the stroke

PinSelectedCommand

Is getting executed once a pin on the map gets tapped.

MapClickedCommand

Is getting executed when the map gets tapped.

MapLongPressCommand

Is getting executed when the map gets long-pressed.

PinDragEndCommand

Is getting executed when a drag of a pin ended.

PinsReadyCommand

Is getting executed once a full update of all pins is finished.

CalloutClickedCommand

Is getting executed when a callout of a pin gets tapped.

RouteClickedCommand

Is getting executed when a selectable route gets tapped.

RouteCalculationFinishedCommand

Is getting executed when a route calculation finished successfully.

RouteCalculationFailedCommand

Is getting executed when a route calculation failed.