ThinkGeo.com    |     Documentation    |     Premium Support

Setting ZIndex in Layer/Feature

Hi Teams,

Is there any zIndex property for layer/features?
My project will have 4 layer,

  1. Map layer (Color map, Grey Scale)
  2. Point feature layer
  3. Polygon feature layer
  4. Line feature layer

How can I make sure that map layer zindex order from bottom to top like below

  1. Map layer
  2. Polygon layer
  3. Line layer
  4. Point layer

Thank you

Hi Jimmy,

You are drawing those layers using a LayerOverlay, right? The first layer you add to LayOverlay.Layers will be drawn first, meaning it will show on the bottom. So you just need to make sure adding those layers in this right order you want.

You can also create a LayerOverlay for each layer, and add the LayerOverlays in the similar order to the map. This operation is heavier though (each overlay will be drawn on a separate image, 4 overlays would create 4 images while one overlay with 4 layers only create 1 image) and it is usually not recommended unless you do need it in some scenarios. (For example when you need to update the data in a layer without redrawing the other layers. )

Let us know if you still see any other issues.

Thanks,
Ben