Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If anyone was having the same problem as I was, here is my problem and solution:</p> <p>I needed an OverlayView which would add tooltips to markers, but my popup overlay kept showing <em>behind</em> the markers.</p> <p>I implemented a subclass of the OverlayView as per the Google documentation: <a href="https://developers.google.com/maps/documentation/javascript/customoverlays" rel="nofollow noreferrer">https://developers.google.com/maps/documentation/javascript/customoverlays</a></p> <p>When you write your custom <code>OverlayView.prototype.onAdd</code> function, you need to specify to which Pane to attach your overlay. I just copied the code without actually reading the surrounding explanation.</p> <p>In their code, they attach the overlay to the <code>overlayLayer</code> pane:</p> <pre><code>var panes = this.getPanes(); panes.overlayLayer.appendChild(div); </code></pre> <p>But there are many different MapPanes you can use:</p> <blockquote> <p>"The set of panes, of type MapPanes, specify the stacking order for different layers on the map. The following panes are possible, and enumerated in the order in which they are stacked from bottom to top:"</p> </blockquote> <ul> <li>MapPanes.mapPane (Level 0)</li> <li>MapPanes.overlayLayer (Level 1)</li> <li>MapPanes.markerLayer (Level 2)</li> <li>MapPanes.overlayMouseTarget (Level 3)</li> <li>MapPanes.floatPane (Level 4)</li> </ul> <p>I wanted the overlay to hover over all other info on the map, so I used the <code>floatPane</code> pane and problem solved.</p> <p>So, instead of :</p> <pre><code>this.getPanes().overlayLayer.appendChild(div) </code></pre> <p>you use this :</p> <pre><code>this.getPanes().floatPane.appendChild(div); </code></pre>
    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. 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