Class M.MapMarkerView
Extends
M.View.
M.MapMarkerView is the prototype of a map marker view. It defines a set
of methods for adding, removing and managing the markers of a M.MapView.
The M.MapMarkerView is based on google maps markers.
Defined in: map_marker.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
This property contains a reference to a google maps info window that is
connected to this map marker.
|
|
This property can be used to store additional information about a marker.
|
|
This property can be used to specify a custom marker icon.
|
|
This property specifies whether the marker is draggable or not.
|
|
This property specifies the location for this map marker view, as an M.Location
object.
|
|
This property contains a reference to the marker's map view.
|
|
This property is used to save a reference to the actual google map marker.
|
|
This property can be used to specify the animation type for this map marker
view.
|
|
This property specifies the message of a map marker view respectively for
its annotation.
|
|
This property specifies the recommended events for this type of view.
|
|
This property can be used to specify whether or not to show the annotation,
if title and / or message are defined, automatically on click event.
|
|
This property specifies the title of a map marker view.
|
|
The type of this object.
|
- Fields borrowed from class M.View:
- childViews, computedValue, contentBinding, contentBindingReverse, cssClass, cssClassOnError, cssClassOnInit, cssStyle, events, hasFocus, html, id, isInline, isView, modelId, parentView, triggerActionOnChange, triggerActionOnEnter, triggerActionOnKeyUp, value
Method Attributes | Method Name and Description |
---|---|
init(options)
This method initializes an M.MapMarkerView.
|
|
This method is responsible for registering events for view elements and its child views.
|
|
remove()
This method can be used to remove a map marker from a map view.
|
|
showAnnotation(id, event, nextEvent)
This method can be used to show a map markers annotation.
|
- Methods borrowed from class M.View:
- addCssClass, attachToObservable, clearHtml, clearValue, clearValues, computeValue, contentDidChange, delegateValueUpdate, design, getChildViewsAsArray, getIds, getValue, getValues, gotFocus, lostFocus, nl2br, removeCssClass, removeCssProperty, renderUpdate, secure, setCssProperty, setValueFromDOM, style, tab2space, theme, themeChildViews
- Methods borrowed from class M.Object:
- bindToCaller, create, destroy, extend, get, include, set
Field Detail
{Object}
annotation
This property contains a reference to a google maps info window that is
connected to this map marker. By calling either the showAnnotation() or
the hideAnnotation() method, this info window can be toggled.
Additionally the info window will be automatically set to visible if the
showAnnotationOnClick property is set to YES.
{Object}
data
This property can be used to store additional information about a marker.
Since this property is an object, you can store pretty much anything in
this property.
This can be useful especially if you are using the click event for map
markers. So you can store any information with a marker and retrieve
this information on the click event.
{String}
icon
This property can be used to specify a custom marker icon. Simply pass a valid
path to an image and it will be shown instead of google's default marker.
{Boolean}
isDraggable
This property specifies whether the marker is draggable or not. If set
to NO, a user won't be able to move the marker. For further information
see the google maps API specification:
http://code.google.com/intl/en-US/apis/maps/documentation/javascript/reference.html#MarkerOptions
{M.Location}
location
This property specifies the location for this map marker view, as an M.Location
object. Its latitude and longitude properties are directly mapped to the position
property of a google maps marker. For further information see the google maps API
specification:
http://code.google.com/intl/en-US/apis/maps/documentation/javascript/reference.html#MarkerOptions
{M.MapView}
map
This property contains a reference to the marker's map view.
{Object}
marker
This property is used to save a reference to the actual google map marker.
It is set automatically when the map marker is firstly initialized.
{String}
markerAnimationType
This property can be used to specify the animation type for this map marker
view. If this property is set, the markerAnimationType property of the parent
map view is ignored. The following three values are possible:
M.MAP_MARKER_ANIMATION_NONE --> no animation
M.MAP_MARKER_ANIMATION_DROP --> the marker drops onto the map
M.MAP_MARKER_ANIMATION_BOUNCE --> the marker constantly bounces
{String}
message
This property specifies the message of a map marker view respectively for
its annotation.
{Array}
recommendedEvents
This property specifies the recommended events for this type of view.
{Boolean}
showAnnotationOnClick
This property can be used to specify whether or not to show the annotation,
if title and / or message are defined, automatically on click event.
{String}
title
This property specifies the title of a map marker view. It can be used in
an annotation.
{String}
type
The type of this object.
Method Detail
init(options)
This method initializes an M.MapMarkerView. It connects a map marker directly with
the parent map view and returns the created M.MapMarkerView object.
Note: By calling this method, the map marker won't be displayed on the map. It only gets
initialized and can no be displayed by using the map view's addMarker() method or via
content binding.
- Parameters:
- {Object} options
- The options for the map marker view.
registerEvents()
This method is responsible for registering events for view elements and its child views. It
basically passes the view's event-property to M.EventDispatcher to bind the appropriate
events.
It extend M.View's registerEvents method with some special stuff for list item views and
their internal events.
remove()
This method can be used to remove a map marker from a map view.
showAnnotation(id, event, nextEvent)
This method can be used to show a map markers annotation.
- Parameters:
- id
- event
- nextEvent