Android 3.0+ Baidu Map API Map How to move to a specified latitude and longitude

Source: Internet
Author: User

Because the Baidu map api,2.0+ and 3.0+ changes relatively big, API basically was completely changed, some students may 2.0+ API use is very familiar with, but update to 3.0+, but will encounter some small trouble (because the API has changed, you need to re-learn its API, the code will be re-written , which is more painful than egg). So here are some small examples, I hope to upgrade to the 3.0+ of the students have some help.

1. How does the Baidu map API map move to the specified latitude and longitude? As shown in the code

Private voidChoosemylocation (DoubleLaDoublelo) {        //turn on the positioning functionBaidumap.setmylocationenabled (true); //Constructing positioning DataMylocationdata Locationdata =NewMylocationdata.builder (). Latitude (LA). Longitude (LO). Build (); //Setting location dataBaidumap.setmylocationdata (Locationdata); //Customize to chartBitmapdescriptor marker =bitmapdescriptorfactory. Fromresource (R.drawable.trip_icon_mark_address_point); //set the configuration of the anchor layer, set the icon to follow the status (icon is always in the center of the map)mylocationconfiguration config =Newmylocationconfiguration (locationmode.following,true, marker);        Baidumap.setmylocationconfigeration (config); //turn off the anchor layer when no positioning is required//baidumap.setmylocationenabled (false);    }

Of course there is no animation effect, the need for students can add their own animation effect (when changing the status of the map to execute)

Android 3.0+ Baidu Map API Map How to move to a specified latitude and longitude

Related Article

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.