Class: ToolTip

ToolTip

Class for tooltip, a tooltip used for showing some useful infomation attached to geometries on the map.

new ui.ToolTip(content, optionsopt) [source]

Parameter Type Default Description
content String content of tooltip
options opt Object null options defined in ToolTip
Extends:
Fires:

Members

  • (constant) options

  • Properties:
    Name Type Description
    options Object
    Properties
    Name Type Default Description
    width opt Number 0 default width
    height opt Number 0 default height
    animation opt String 'fade' default fade, scale | fade,scale are an alternative to set
    cssName opt String maptalks-tooltip tooltip's css class name
    showTimeout opt Number 400 timeout to show tooltip
    eventsPropagation opt Boolean false whether stop ALL events' propagation.
    eventsToStop opt Boolean null UI's dom events to stop propagation if eventsPropagation is true.
    dx opt Number 0 pixel offset on x axis
    dy opt Number 0 pixel offset on y axis
    autoPan opt Boolean false set it to false if you don't want the map to do panning animation to fit the opened UI.
    autoPanDuration opt Boolean 600 duration for auto panning animation.
    single opt Boolean true whether the UI is a global single one, only one UI will be shown at the same time if set to true.
    animationDuration opt Number 300 animation duration, in milliseconds.
    pitchWithMap opt Boolean false whether tilt with map
    rotateWithMap opt Boolean false whether rotate with map
    Overrides:
    Source:

    Methods

  • addTo(owner) [source]

  • Adds the UI Component to a geometry UIMarker Other graphic elements
    Parameter Type Description
    owner Geometry geometry to add.
    Fires:
    Returns:
    UIComponent: this
  • setStyle(css) [source]

  • set ToolTip's content's css class name.
    Parameter Type Description
    css String class name - set for ToolTip's content.

  • getStyle() [source]

  • get ToolTip's content's css class name
    Returns:
    String: css class name - set for ToolTip's content.
  • getContent() [source]

  • get the UI Component's content
    Returns:
    String: tooltip's content
  • onRemove() [source]

  • remove the tooltip, this method will be called by 'this.remove()'

  • _getViewPoint() [source]

  • override UIComponent method ignore altitude calculation

  • (inherited) getMap() [source]

  • Get the map it added to
    Inherited From:
    Returns:
    Map: map instance
  • (inherited) show(coordinateopt) [source]

  • Show the UI Component, if it is a global single one, it will close previous one.
    Parameter Type Default Description
    coordinate opt Coordinate null coordinate to show, default is owner's center
    Inherited From:
    Fires:
    Returns:
    ui.UIComponent: this
  • (inherited) hide() [source]

  • Hide the UI Component.
    Inherited From:
    Fires:
    Returns:
    ui.UIComponent: this
  • (inherited) isVisible() [source]

  • Decide whether the ui component is open
    Inherited From:
    Returns:
    Boolean: true|false
  • (inherited) remove() [source]

  • Remove the UI Component
    Inherited From:
    Fires:
    Returns:
    ui.UIComponent: this
  • (inherited) getSize() [source]

  • Get pixel size of the UI Component.
    Inherited From:
    Returns:
    Size: size
  • (inherited) on(eventsOn, handler, contextopt) [source]

  • Register a handler function to be called whenever this event is fired.
    foo.on('mousedown mousemove mouseup', onMouseEvent, foo);
    Parameter Type Default Description
    eventsOn String event types to register, seperated by space if more than one.
    handler function handler function to be called
    context opt Object null the context of the handler
    Mixes From:
    Inherited From:
    Returns:
    Any: this
  • (inherited) addEventListener(eventTypes, handler, contextopt) [source]

  • Alias for on
    Parameter Type Default Description
    eventTypes String event types to register, seperated by space if more than one.
    handler function handler function to be called
    context opt Object null the context of the handler
    Mixes From:
    Inherited From:
    Returns:
    : this
  • (inherited) once(eventTypes, handler, contextopt) [source]

  • Same as on, except the listener will only get fired once and then removed.
    foo.once('mousedown mousemove mouseup', onMouseEvent, foo);
    Parameter Type Default Description
    eventTypes String event types to register, seperated by space if more than one.
    handler function listener handler
    context opt Object null the context of the handler
    Mixes From:
    Inherited From:
    Returns:
    : this
  • (inherited) off(eventsOff, handler, contextopt) [source]

  • Unregister the event handler for the specified event types.
    foo.off('mousedown mousemove mouseup', onMouseEvent, foo);
    Parameter Type Default Description
    eventsOff String event types to unregister, seperated by space if more than one.
    handler function listener handler
    context opt Object null the context of the handler
    Mixes From:
    Inherited From:
    Returns:
    : this
  • (inherited) removeEventListener(eventTypes, handler, contextopt) [source]

  • Alias for off
    Parameter Type Default Description
    eventTypes String event types to unregister, seperated by space if more than one.
    handler function listener handler
    context opt Object null the context of the handler
    Mixes From:
    Inherited From:
    Returns:
    : this
  • (inherited) listens(eventType, hanlderopt, contextopt) [source]

  • Returns listener's count registered for the event type.
    Parameter Type Default Description
    eventType String an event type
    hanlder opt function null listener function
    context opt Object null the context of the handler
    Mixes From:
    Inherited From:
    Returns:
    Number:
  • (inherited) copyEventListeners(target) [source]

  • Copy all the event listener to the target object
    Parameter Type Description
    target Object target object to copy to.
    Mixes From:
    Inherited From:
    Returns:
    : this
  • (inherited) fire(eventType, param) [source]

  • Fire an event, causing all handlers for that event name to run.
    Parameter Type Description
    eventType String an event type to fire
    param Object parameters for the listener function.
    Mixes From:
    Inherited From:
    Returns:
    : this
  • (inherited) callInitHooks() [source]

  • Visit and call all the init hooks defined on Class and its parents.
    Inherited From:
    Returns:
    Class: this
  • (inherited) setOptions(options) [source]

  • Merges options with the default options of the object.
    Parameter Type Description
    options Object options to set
    Inherited From:
    Returns:
    Class: this
  • (inherited) config(conf) [source]

  • 1. Return object's options if no parameter is provided.
    2. update an option and enable/disable the handler if a handler with the same name existed.
    // Get marker's options;
    var options = marker.config();
    // Set map's option "draggable" to false and disable map's draggable handler.
    map.config('draggable', false);
    // You can update more than one options like this:
    map.config({
        'scrollWheelZoom' : false,
        'doubleClickZoom' : false
    });
    Parameter Type Description
    conf Object config to update
    Inherited From:
    Returns:
    Class: this
  • (inherited) onConfig() [source]

  • Default callback when config is called
    Inherited From:

    Events

  • (inherited) add [source]

  • add event.
    Inherited From:
    Properties:
    Name Type Description
    type String add
    target ui.UIComponent UIComponent
    Inherited From:
    Source:

  • (inherited) showstart [source]

  • showstart event.
    Inherited From:
    Properties:
    Name Type Description
    type String showstart
    target ui.UIComponent UIComponent
    Inherited From:
    Source:

  • (inherited) showend [source]

  • showend event.
    Inherited From:
    Properties:
    Name Type Description
    type String showend
    target ui.UIComponent UIComponent
    Inherited From:
    Source:

  • (inherited) hide [source]

  • hide event.
    Inherited From:
    Properties:
    Name Type Description
    type String hide
    target ui.UIComponent UIComponent
    Inherited From:
    Source:

  • (inherited) remove [source]

  • remove event.
    Inherited From:
    Properties:
    Name Type Description
    type String remove
    target ui.UIComponent UIComponent
    Inherited From:
    Source: