javascript - Make google maps polyline appear below street names? -


I'm making a subway map "transit" option on official Google Maps indicates your polyline beneath road / city name But I do not understand how to do this, changing zIndex for 0 (or negative number) does not work. Does anyone know how to do it? Thank you.

There are many places in Google Maps where map components are being kept. Unfortunately for you the map tiles are placed under all the pan if something is in high pane then the Z-index has no effect, it only affects the order of the overlay in the same pane. Apart from this map tiles are single images where all map data is provided. Therefore, you can not place an overlay below some of the data provided on the map tile.

Theoretically, there can be a way of achieving this, but it is very difficult and I'm not sure it will work. You can create a base map type and an overlay map type. And then you can try to apply polyline between those two map types. Make sure there are many drawbacks:

  1. I have not tried using a style map as an overlay map type, so I'm not sure it will work.
  2. The overlay map type is placed in the minimum map pane just below the base map. But the polylines provided by Google Maps are sung in a high pane and you can not keep them in the lowest map pane.
  3. That's a lot of work to make your special overlay layer or overlay map type with polyline! And then add it to the lowest map view under the overlay map type.

    Well, this theory is very hacking and uncertain results. I will not do that!

Comments