Skip to main content

Map Layers rendering

OsmAnd Map is rendered by layers from bottom to top. Some layers cover full map screen, some are rendered with transperancy but the order of layers is consistent, so it's important to keep track of what and in which order is rendered.

Order of layers​

Android. Most layers in Android are instance of in the method createLayers of MapLayers class. Order of each layer is depend from zOrder property during instance and set in the method getBaseOrderof OsmAndMapLayer class. Other layers are instance in the plugins.

iOS. Most layers in iOS are instance of in the method createLayers of OAMapLayers.
Order of each layer is set direcly by baseOrder property in createLayers. Other layers are instance in the plugins.

Order of icons and text​

Order of vector map icons (iconOrder) and text (textorder) are mainly set in the style, for example Default OsmAnd style.
Order of layers icons and text depends from order of layer and can be not so different than layer order. Additionally we increase order of road shields for show their above.

Android. Order tables​

Android. Map Icons order​

MapTileLayer (underlay)-50 000MapRaster tiles underlay
MapVectorLayer0MapMap vector tiles
MapTileLayer (main layer)5 000MapMap raster tiles
MapTileLayer (overlay)70 000MapRaster tiles overlay
DownloadedRegionsLayer50 000PolygonsShow downloaded regions
TerrainLayer60 000MapBase for raster tiles
GPXLayer (lines)90 000LinesOrder for track lines
RouteLayer100 000LinesNavigation route
PreviewRouteLineLayer150 000-Not used OpenGL
OsmBugsLayer200 000PointsOSM notes and fixme
POIMapLayer300 000PointsPOI overlay
Audio Video Layer350 000Points
OsmEditsLayer350 000PointsEdit OSM plugin
FavouritesLayer400 000PointsFavorites overlay
TransportStopsLayer500 000PointsPublic transport stops
MapTextLayer595 000-Not used OpenGL
PointNavigationLayer700 000PointsFinish / start points
MapMarkersLayer (lines)729 999LinesEach line -1
ImpassableRoadsLayer750 000PointsAvoid roads
RadiusRulerControlLayer780 000-Not used OpenGL
DistanceRulerControlLayer (lines)790 000??Not used OpenGL ?
ContextMenuLayer800 000PointsPin of context menu
PointLocationLayer800 000PointsMy location point
MapInfoLayer900 000?????
MapillaryVectorLayer1 000 000Points / Lines ??Mapillary points / lines

Android. Icons order​

Icons - VectorMapLayer1 - 255PointsVector map, iconOrder in style, 100 by default
GPX track start, finish90 101PointsGPXLayer
GPX track waypoint90 300PointsGPXLayer
GPX track chart icon90 500PointsGPXLayer
GPX track selected icon90 600PointsGPXLayer
OSM notes200 000PointsOSM notes
POI300 000PointsPOI overlay icons
Audio Video notes350 000Points
Favourites400 000PointsFavorites overlay
Transport stops500 001PointsPublic transport
My location600 000PointsMy location
Navigation (start,via,end)700 000PointsNavigation points
Navigation selected point700 600PointsNavigation points
MapMarkersLayer (markers)730 000Points
Avoid roads750 000PointsImpassableRoadsLayer

Android.Text and shield order​

Text / shieldOrder/RangeDescription
Text - VectorMapLayer1 - 255Vector map texts, textOrder from style, 100 by default
GPXLayer (wpt text)90 300Order waypoints text in GPX
Shields - VectorMapLayer180 000 +Shields over roads, textOrder + 180 000
POI (name)300 000POI overlay name
MapMarkersLayer (text on line)730 000
DistanceRulerControlLayer (text)790 000Not used OpenGL
Fixme1 000 000OSM fixme text

Android. Overlay controls​

MeasurementToolLayer460 000
MapControlsLayer1 100 000
MapQuickActionLayer1 200 000

iOS. Order tables​

iOS. Layers order​

LayerReal orderDescription
OADownloadedRegionsLayer10 000Show downloaded green regions
OAPOILayer90 000POI overlay
OAGPXLayer (lines)100 000Order for track lines
OAGPXRecLayer110 000
OAPreviewRouteLineLayer120 000
OATransportStopsLayer (lines)120 000Public transport
OAOsmEditsLayer120 000Edit OSM plugin
OAOsmBugsLayer120 000OSM notes and fixme
OARouteLayer150 000Navigation route
OAFavoritesLayer160 000Favorites overlay
OAMeasurementToolLayer160 000
OARulerByTapControlLayer170 000
OAMyPositionLayer206 000My location
OAImpassableRoadsLayer206 000Avoid roads
OADestinationsLayer207 000Navigation points
OARoutePointsLayer209 000Navigation points
OAContextMenuLayer210 000

iOS. Raster layers order​

LayerLayer indexDescription

iOS. Icons order​

Icons1 - 255Vector map, iconOrder in style, 100 by default
POI90 000POI overlay icons
GPX waypoint100 003OAGPXLayer
GPX track start, finish120 000OAGPXLayer
OSM notes120 000OSM notes and fixme (OAOsmBugsLayer)
OSM edits120 000Edit OSM plugin
Transport stops121 000Public transport
Favourites160 000Favorites overlay icons
Avoid roads205 998Avoid roads (OAImpassableRoadsLayer)
My location206 001My location
Navigation (start,via)206 998Navigation points (OARoutePointsLayer)
Navigation (end)207 000Navigation end point (OADestinationsLayer)
Map markers207 000Map markers (OADestinationsLayer)
Navigation route, points207 015(OARouteLayer)
Navigation route, my location207 025(OARouteLayer)
Navigation route, arrows208 000(OARouteLayer)

iOS. Text / sheilds order​

Text / shieldOrder/RangeDescription
Text - VectorMapLayer1 - 255Vector map texts, textOrder from style, 100 by default
POI (name)90 000POI overlay name
GPX waipoint100 000GPX track waypoint text
Fixme120 000OSM fixme text
OARulerByTapControlLayer (text)170 000
Shields180 000 +Shields over roads, textOrder + 180 000
Map markers (text on line)207 000