![]() ![]() ![]() The stack order is specified depending on the type of an overlay by default, but can be changed. ![]() When multiple overlays are overlapped on the screen, an overlay with a higher stack order is displayed on top of those with lower stack orders. And if the memory usage is too high, the process will be terminated because of out of memory (OOM). If too many bitmap images are used for the map to handle, the map rendering becomes very slow with a log message saying "Overlay image atlas overflow" in Logcat. Marker4.icon = omResource(R.drawable.marker_icon) Marker3.icon = omResource(R.drawable.marker_icon) OK: marker3 and 4 each use different OverlayImage objects but refer to the same resource, so they share the same bitmap. val image = omResource(R.drawable.marker_icon) Good: marker1 and 2 share the same bitmap. The following code example creates an OverlayImage object from drawable resources. The view is rendered as soon as the method is called, and the rendered result is saved as a bitmap. fromView(): Creates an object from View.fromBitmap(): Creates an object from Bitmap.fromAsset(): Creates an object from assets.fromResource(): Creates an object from drawable resources.The list below describes some factory methods. Using the factory methods defined in the OverlayImage class, you can create an instance from Drawable resources, assets and bitmaps. OverlayImage is an immutable class representing a bitmap image that can be used as an icon. To use bitmap images for your overlays, you should create an OverlayImage object. Most overlays including markers, info windows, location overlays, ground overlays and path overlays use bitmap images. Background thread val markers = mutableListOf () Val handler = Handler(Looper.getMainLooper()) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |