Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize Local loading and moving of Base Map in Android

Shulou Source: shulou.com Published: 2022-06-01 00:17:27 09月29日 Update

This article mainly introduces "how to realize the local loading movement of the base map in Android". In the daily operation, I believe that many people have doubts about how to achieve the local loading movement of the base map in Android. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubt of "how to achieve the local loading movement of the base map in Android". Next, please follow the editor to study!

The specific code is as follows:

Public class MapMgr {public static MapMgr mapMgr = null; private int map_num = 28; private int breadx = 0; private int bready = 0; private int width = 0; private int height = 0; private Bitmap bmpView = null; / / create by danielinbiti, the premise is that your picture is indeed larger than the screen, if not larger than the screen, the following comments can be modified. Public static void init (int width,int height) {if (mapMgr==null) {mapMgr= new MapMgr (width,height);}} public static MapMgr getInstance () {return mapMgr;} public MapMgr (int width,int height) {this.width = width; this.height = height; Bitmap bmp = PicMgr.getInstance (). GetBackGroundBitmap (); bauxx = (bmp.getWidth ()-width) / 2 / / make sure the picture is bigger than the screen. Bready = (bmp.getHeight ()-height) / 2; bmpView = Bitmap.createBitmap (bmp, breadx, bounty, width, height);} public void logic () {} public void mapDown () {Bitmap bmp = PicMgr.getInstance (). GetBackGroundBitmap (); if (b_y+heightbmp.getHeight ()) {baugh = bmp.getHeight ()-height }} bmpView = Bitmap.createBitmap (bmp, bauxx, bounty, width, height);} public void mapUp () {Bitmap bmp = PicMgr.getInstance (). GetBackGroundBitmap (); if (bauy > 0) {ballery = bounty-bmp.getHeight () / map_num; if (b_y0) {bauxx = bounx-bmp.getWidth () / map_num; if (biconx)

Tags: Partial mobile learning screen picture more help practical next code premise article method annotation theory knowledge article website material follow Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Redmi MariaDB NVidia Microsoft