How to change the layering of KML and Tile Overlays in Google Maps?

I'm working on a project where I am utilizing tile overlays (visual) to display a rendering of the space, building names, accessibility, and parking spaces as well as KML polygons (functionality) to allow the user to click on various buildings or points of interest to bring up further information. My current issue lies in the organization of these various elements.

At the moment, the KML polygons are appearing above all the tile overlays, including building names and parking which I would prefer to be on top of the KML polygons as they are otherwise partly obscured by the polygons. In short, here is the current layering:

    <li>KML Polygons</li> <li>Building Names (Transparent)</li> <li>Accessibility (Transparent)</li> <li>Parking (Transparent)</li> <li>Space Rendering (Opaque)</li> <li>Google Maps</li> </ul>

    Ideally, I would prefer to have the KML polygons appear within these tile overlays, namely right above the rendering of the space. Thus, I wish to obtain this layering:

      <li>Building Names (Transparent)</li> <li>Accessibility (Transparent)</li> <li>Parking (Transparent)</li> <li>KML Polygons</li> <li>Space Rendering (Opaque)</li> <li>Google Maps</li> </ul>

      Is there anyway to rearrange the KML the tile overlay layers to achieve this?

      Tile Overlays:

      map.overlayMapTypes.insertAt(0, renderMapType); map.overlayMapTypes.insertAt(1, parkingMapType); map.overlayMapTypes.insertAt(2, accessMapType); map.overlayMapTypes.insertAt(3, nameMapType);


      Allow me to explain the map a bit more clearly.

      When Google Maps is in "Map", the rendering is displayed and most of the KML polygons are invisible, those unrepresented on the render remaining visible so that the user is still aware of their presence. When Google Maps is in "Satellite", the rendering isn't displayed and all the KML polygons are visible and overlay their respective elements on the satellite image, making them easier for the user to see.

      In either case, the accessibility, parking, and name overlays can be used and, as there is always at least some KML polygons which must be visible, I've resorted to looking for a way to reorder the layers.


      To actually change the layer ordering, you'll need to use a custom tile overlay and place it in the proper pane. This is the implementation I authored which is free to use. Most of the features it was created for now exist in the maps API.


      You'll probably need to adjust in which pane the overlay gets drawn. Here's the applicable source line:



      You cannot easily change the layer ordering, but you can use transparent polygons in your KML to get the same effect.


  • cURL / PHP / JSON - Why am I unable to parse results? [duplicate]
  • Graph database modelling: Should i use a collection node to avoid to many rel on a node
  • Tap command on a button not working in UIAutomation
  • How to create struct based properties with Roslyn
  • Rails 4 Nested Attributes with fields_for Don't Save to Database
  • iOS - Can I disable accessibility on cell.textLabel.text?
  • How does Lastpass autofill work in Android?
  • Access textfield of UIAlertController - swift ios8
  • Android Studio cannot resolve getDefaultProguardFile
  • Solid Shadow in All Directions
  • general concept-java code and cycle clocks
  • Exit from a loop that contains time delay immediately after a key is pressed
  • Tracking screen recorder in windows app
  • javafx 3d performance large data set
  • eC (Ecere) how to not worry about private data fields of a class
  • substitute period from abbreviation (single letter + period) unless followed by a capital letter
  • Moving Google Chart column annotation position
  • removing the default blue color on focus
  • Pass nested C++ vector as built-in style multi-dimensional array
  • How can I print out a large table of symbols from MATLAB to form a cross-stitch chart?
  • PHPStorm Namespace support not working for Symfony2 projects
  • Rails 5 - Google Maps - Javascript error - initMap is not a function - fixing one js issue creates a
  • Embedded Google Maps in Rails not responsive
  • Cross platform UI spacing/padding
  • Find JSON nested nodes using multiple string values
  • How to render a pixel array most efficiently to a window in c++?
  • How do I remove all but some records based on a threshold?
  • Django model inheritance, filtering models
  • AndEngine Applying Transparancy to AndEngine View
  • Installed module is empty
  • Google Custom Search with transparent background
  • CSS Linear-gradient formatting issue accross different browsers
  • Display issues when we change from one jquery mobile page to another in firefox
  • Splitting given String into two variables - php
  • How to show dropdown in excel using jrxml (jasper api)?
  • 0x202A in filename: Why?
  • VB.net deserialize, JSON Conversion from type 'Dictionary(Of String,Object)' to type '
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • How does Linux kernel interrupt the application?
  • Unable to use reactive element in my shiny app