Welcome! Our Tools - BpBrowser
- BpControl
- BpDownloadUrl
- BpLabel
- BpMarker
- BpMarkerLight
- BpMarkerList
- BpWindow
About Us Licensing Fees Support Contact Us

808-281-3359


BpMarker Reference

Introduction

Download

BpMarker is intended to be a full-featured marker class with all the trimmings. For a lighter-weight alternative try BpMarkerLight.
BpMarker objects inherit all of the methods and properties of GMarker objects, can interact with BpMarkerList objects, do image swapping, support tooltips, etc.

BpMarker version 0.17 uses Google's setImage method instead of its own. This BpMarker version only works for Google Maps API versions >= 2.75.

new BpMarker()

Code:
var marker = new BpMarker(latlng,opts?);


Remarks:

Since BpMarkers are GMarkers, and so can be used exactly as you would use GMarkers. They also provide other features that GMarkers don't, which is the point of using them: tooltips, image swapping, interfacing with BpMarkerList objects, etc.

Notes:
  • The arguments are the same as new GMarker().
Examples:

blink()

Code:
marker.blink(src?,millisecs?);


Remarks:

If the first argument is false, the marker will be transitioned between being hidden and shown. If it's a URL, the marker will transition between that image and its current image. The first argument defaults to false. The second argument determines how fast the marker will be transitioned between the two states, in 1/1000ths of 1 second. It defaults to 100, or 1/10 of 1 second.

Notes:
  • Use isBlinking() to determine if a marker is blinking.
  • Use stopBlinking() to stop a marker from blinking.

display()

Code:
marker.display(bool);
marker.show();
marker.hide();


Notes:
  • This does not remove/add the marker from the map.
  • Recent versions of GMarker have undocumented show and hide methods. BpMarker provides this functionality for less recent versions.
Examples:

getId()

Code:
var id = marker.getId();

Remarks:

This is included so as to work well with BpMarkerList objects.

get/setHoverImage()

Code:
marker.setHoverImage(src);
var src = marker.getHoverImage();


Remarks:

Sets the mouseover image for the marker.

Notes:
  • If you have any difficulty with this, or other image-management methods, consider using different icons for different markers.

Examples:

get/setImage()

Code:
var src = marker.getImage();
marker.setImage(src);


Notes:
  • With the 0.15 release, previous recent image manipulation issues should be resolved.
  • If you have any difficulty with this, or other image-management methods, consider using different icons for different markers.

getId()

Code:
var id = marker.getId();


get/setMaintainTooltip()

Code:
marker.setMaintainTooltip(bool);
var bool = marker.getMaintainTooltip();


Remarks:

Use these methods to manage tooltip visiblity regardless of mouse movement.

Notes:
  • Call marker.show/hideTooltip() to initiate showing/hiding.

getMap()

Code:
var map = marker.getMap();


Remarks:

Returns the current map.
Examples:

get/setSidebarDiv()

Code:
var div = marker.getSidebarDiv(tag);
marker.setSidebarDiv(tag,div);


Remarks:

This is included for use with BpMarkerList objects.
Use it to access the div which represents this marker in the sidebar specified by tag.
tag is the second argument to new BpMarkerList().

getSidebarDivs()

Code:
var obj = marker.getSidebarDivs();


Remarks:

This returns the object which holds all of the sidebar divs.

get/setTooltipClass()

Code:
marker.setTooltipClass(class);
var class = marker.getTooltipClass();


Examples:

get/setTooltipHtml()

Code:
marker.setTooltipHtml(html);
var html = marker.getTooltipHtml();


Notes:
  • Calling this method will automatically create the tooltip object.

Examples:

getTooltipLabel()

Code:
var label = marker.getTooltipLabel();


Remarks:

Tooltips are implemented using BpLabel.

Notes:
  • Tooltips are created automatically after calling marker.setTooltipHtml().
Examples:

get/setUserData()

Code:
var data = marker.getUserData();
marker.setUserData(data);


Remarks:

This is included for use with BpMarkerList objects.
While you can store any data that you like, it's generally more useful to store objects. You can then sort sidebars according to these objects' properties.

Examples:

isBlinking()

Code:
var bool = marker.isBlinking();



isMapped()

Code:
var bool = marker.isMapped();



isVisible()

Code:
var bool = marker.isVisible();



show/hide()

Code:
marker.show();
marker.hide();


Remarks:

Manage the visibility of the marker. These methods do not add/remove the marker from the map.

Notes:
  • Calling these methods will stop a marker from blinking.

Examples:

show/hideTooltip()

Code:
marker.showTooltip();
marker.hideTooltip();


Notes:
  • Use these to show/hide a tooltip immediately when calling marker.setMaintainTooltip()