Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I can't guarantee it's the simplest, but I like <a href="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/1.0.1/" rel="noreferrer"><strong>MarkerWithLabel</strong></a>. As shown in <a href="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/1.0.1/examples/basic.html" rel="noreferrer"><strong>the basic example</strong></a>, CSS styles define the label's appearance and options in the JavaScript define the content and placement.</p> <pre><code> .labels { color: red; background-color: white; font-family: "Lucida Grande", "Arial", sans-serif; font-size: 10px; font-weight: bold; text-align: center; width: 60px; border: 2px solid black; white-space: nowrap; } </code></pre> <p>JavaScript: </p> <pre><code> var marker = new MarkerWithLabel({ position: homeLatLng, draggable: true, map: map, labelContent: "$425K", labelAnchor: new google.maps.Point(22, 0), labelClass: "labels", // the CSS class for the label labelStyle: {opacity: 0.75} }); </code></pre> <p>The only part that may be confusing is the labelAnchor. By default, the label's top left corner will line up to the marker pushpin's endpoint. Setting the labelAnchor's x-value to half the width defined in the CSS width property will center the label. You can make the label float above the marker pushpin with an anchor point like <code>new google.maps.Point(22, 50)</code>.</p> <p>In case access to the links above are blocked, I copied and pasted the <a href="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/1.0.1/src/markerwithlabel_packed.js" rel="noreferrer">packed source</a> of MarkerWithLabel into this <a href="http://jsfiddle.net/yV6xv/36/" rel="noreferrer"><strong>JSFiddle demo</strong></a>. I hope JSFiddle is allowed in China :|</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload