• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
      • Statement Format Symbols
      • Alphabetical List of Functions and Statements
      • List of Reserved Words
      • Deprecated Features
      • Declaration Statements
      • Symbol Functions
      • Item Functions
      • Array Object
      • Audio Object
      • Barcode and QR Codes
      • Case Object
      • Document Object
      • File Object
      • Freq Object
      • Geometry Object
      • HashMap Object
      • Image Object
      • List Object
      • Map Object
        • Map Statement
        • Map.show Function
        • Map.hide Function
        • Map.clear Function
        • Map.setTitle Function
        • Map.setBaseMap Function
        • Map.zoomTo Function
        • Map.showCurrentLocation Function
        • Map.saveSnapshot Function
        • Map.setOnClick Function
        • Map.getLastClickLatitude Function
        • Map.getLastClickLongitude Function
        • Map.addMarker Function
        • Map.removeMarker Function
        • Map.clearMarkers Function
        • Map.setMarkerImage Function
        • Map.setMarkerText Function
        • Map.setMarkerDescription Function
        • Map.setMarkerOnClick Function
        • Map.setMarkerOnClickInfoWindow Function
        • Map.setMarkerOnDrag Function
        • Map.setMarkerLocation Function
        • Map.getMarkerLatitude Function
        • Map.getMarkerLongitude Function
        • Map.addGeometry Function
        • Map.removeGeometry Function
        • Map.clearGeometry Function
        • Map.addTextButton Function
        • Map.addImageButton Function
        • Map.removeButton Function
        • Map.clearButtons Function
        • Base Map Specification
        • Offline Maps
      • Path
      • Pff Object
      • SystemApp Object
      • ValueSet Object
      • Program Control Statements
      • Assignment Statements
      • Data Entry Statements and Functions
      • Batch Edit Statements
      • Numeric Functions
      • String Functions
      • Multiple Occurrence Functions
      • General Functions
      • Date and Time Functions
      • External File Functions
      • Synchronization Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Map.setMarkerText Function

Format
b = map_name.setMarkerText(markerId, textʃ, backgroundColor, textColorʅ]);
Description
The Map.setMarkerText sets the icon for the marker with id markerId on Map map_name to an icon with the specified text and color. The icon will contain the text surrounded by a small outline. markerId is the id that was returned by Map.addMarker when the marker was added to the map. text is the phrase to display as the marker icon. You can optionally set the color of the text and the background color of the icon by specifying the backgroundColor and textColor. Colors can be given by the names of common colors ("blue", "red", etc.) or using an HTML RGB color specification that starts with "#" such as "#404040". If no colors are specified the text will be black on a white background.
Map.setMarkerText sets the text used in the marker icon. The icon text should be kept short to avoid making the map crowded. To associate a longer description with a marker use Map.setMarkerDescription instead to display additional text in the marker list and in a popup on the map when the user taps the marker.
The text may contain the following HTML tags:
  • <b> - bold
  • <i> - italic
  • <ul> - underline
  • <strike> or <s> - strikethrough
  • <sup> - superscript
  • <sub> - subscript
  • <font> - font (including color)
  • <br/> - line break
If the marker icon was previously set with Map.setMarkerImage, calling Map.setMarkerText will replace the marker image with the new text.
Return Value
The function returns a logical value of 1 (true) if the marker was found and the text was set successfully and 0 (false) if there is an error.
Example
// Declare a map
Map mymap;

// Add a marker to the map at latitude 38.84839, longitude -76.931098
numeric markerId = mymap.addMarker(38.84839, -76.931098);

// Set the icon
mymap.setMarkerText(markerId, maketext("%v", HH_NUMBER), "white", "black");

// Display the map
mymap.show();
See also: Map Object, Map.addMarker Function, Map.setMarkerImage Function