Android map development-selection of maps, android map development

Source: Internet
Author: User

Android map development-selection of maps, android map development

I have been developing lbs for almost two years, and there have been almost three map-related products. I have used google Maps, AMAP map, Baidu map, map bar, And Osmdroid, today, we will summarize how to select a suitable map for your development.

First of all, the positioning module selection, AMAP and Baidu map now all have their own status sdks and support global positioning, which is a very good choice. My current project has high positioning requirements. Now I choose gps positioning using the system positioning method. The base station positioning using Baidu positioning. The system positioning interface is successfully used for gps connection, gps disconnected to Baidu base station positioning.

Gps positioning has been used by Baidu and autonavi, but the test shows that the accuracy of statistics on similar products is not high, and there are often problems with some models, such as some Mobile Phone Positioning, the status of the status bar is always flashing, often dropped, and the recording track is relatively large. After being changed to the system interface, it is much more stable, and the user also reports that the recorded track is much more accurate. There is also the positioning sdk currently used by Baidu map, and the returned data does not have altitude data. This is also one reason that Baidu gps is not used for positioning.

When the base station locates, it feels that Baidu returns faster and faster than AMAP data. The address resolution or search is the same. I don't know if Baidu's data retrieval and big data processing capabilities are strong, but I didn't perform a careful comparison test, it may be inaccurate.

Next, let's talk about the map selection. My current products use Baidu vector maps and Osmdroid raster maps. Because they are mainly used for outdoor maps, satellite maps and contour maps are essential, considering that the vector map has a small amount of data, we can now achieve one-click switching between Baidu vector, google satellite map, and OpenCycleMap. Using two map frameworks, the interface encapsulation is quite painful.

Baidu and autonavi are good choices if they are just map products in China. These two interfaces are basically the same as those of googel, therefore, switching between three users can be very fast. In terms of stability, I felt like google Maps> AMAP> Baidu. I developed an application and started to use google Maps. Later, google was replaced by AMAP, in the past, there was no problem with google. After switching, an exception was reported. Some restrictions were added. For example, to add a track to a map, the track point must be greater than 2 and the icon must be set, otherwise, an exception is reported. However, google can add the data first and then set the data (when recording the track, there is no track point at the beginning, so a track will be added to the map first, then locate and constantly update the track point data ). Baidu has a very fast iteration in recent times. Sometimes a version is updated in 2-3 weeks. There are some problems after frequent updates, and several interface changes are very large (this is the most pitfall, it has brought a lot of extra work for development), basically it is to deny the previous Baidu interface, and then change it to the google interface. In terms of interfaces, google is still a bit better, the API has become a reference standard. In addition, when a colleague recently used AMAP, he found that there was no MapViewLayoutParams. I did not find the AMAP interface, and there were no examples for official reference, in this way, it is very difficult to add a complex View to a coordinate of a map. I don't know if there are other methods.

If you want to make global service-oriented products, there seems to be no special choice on Android. Google is walled, and mobile phones must have Google Service Framework, Baidu, AMAP, and other domestic maps only have data in China. It seems that only OpenStreetMap supports global data. OpenStreetMap supports many graphic sources and data is available globally, but it is mainly for outdoor use, city maps are not as precise as other maps (of course, you can also add map sources for google's common and satellite tile maps), and then you can customize some other map sources, if you are interested, you can refer to an open-source framework osmdroid on github. This framework has some articles on the Internet.

Map map: Previously, several products of the company used map maps, which were maintained for a period of time. It seems that there is no vector map yet, the sdk has not been updated for a long time.

Finally, let's make a summary of these maps:

Googel map: gps coordinate system, the most stable, satellite map is fine, but in China services are walled, and mobile phones must have Google Service Framework, in China basically not FQ not root unavailable;

AMAP: the coordinate system of Mars (gcj). It is stable and supports global positioning. satellite maps are not precise (many outdoor areas are enlarged without satellite data). However, some colleagues recently reported that MapViewLayoutParams is not supported, it may be difficult to add a complex view to a coordinate of a map. I don't know if there are any updates or other implementation methods. You can study it first. In addition, the default UI is not as elegant as Baidu.

AMAP has an open-source small project on github, TheSceneryAlong: https://github.com/john-chen/thesceneryalong. For more information, see;

Baidu map: Baidu coordinate system, satellite maps are not precise (many outdoor areas do not have satellite data), version iterations are frequent, but the latest version is stable and supports global positioning, fast feature iteration, map Data is quickly loaded.

Osmdroid: raster map, gps coordinate system, you can customize to add other map sources (maybe other map sources must first convert the coordinate system, for example, google map source must first convert the gps coordinate to the Mars coordinate, and then display it on the map ), there is an open-source framework.

In addition to using the sdk to load and display maps, you can also use webView to load maps and use js to control maps. You can simply consider map layers.

Well, let's summarize it here, and then add other ones. If you have any questions, please contact us.

 

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.