Android Map Real-time tagging

Source: Internet
Author: User

============ Problem Description ============


I use Baidu map to the top of the time, use a bit of the main code:
Class Myoverlayitem extends itemizedoverlay<overlayitem>{private arraylist<overlayitem> mOverlayList = New Arraylist<overlayitem> ();p rivate double mLat1 = 34.0358298501404; Point1 Latitude private double mLon1 = 108.7622674067471; Point1 Longitude private Double mLat2 = geopointlist.get (0). Getlat (); Private double mLon2 = geopointlist.get (0). Getlongi (); Public Myoverlayitem (drawable drawable) {super (drawable); GeoPoint GeoPoint = new GeoPoint ((int) (MLAT1 * 1E6), (int) (MLon1 * 1E6)); GeoPoint Geopointbaidu = Coordinateconvert.fromwgs84tobaidu (GeoPoint); Moverlaylist.add (New Overlayitem (Geopointbaidu, "point", "point"));p opulate ();

The problem arises, if using mlat1,mlon1 as coordinates can be correctly, but instead of Mlat2,mlon2 on the point hit, mlat2,mlon2 in fact, the value of Mlat1,mlon1 is the same. Here Mlat2,mlon2 is also not a null value. I'm calling in handler in Mainactivity.
Mmapview.getoverlays (). Add (New Myoverlayitem (drawable));
To achieve. Solve, tangled up a day, first thanked.

============ Solution 1============


Refreshes the bottom canvas.

Android Map Real-time tagging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.