recently in doing a mobile phone to open a URL, and then locate the specific location, it would have been very simple, HTML5 can solve the problem, and later found that there are many problems.
First of all, many Android phones do not support HTML5, Judge Navigator.geolocation is true, but is not return latitude and longitude information, check data found many countries do many mobile phones are so, GMS (Google mobile Service) was castrated. Solving this method can restore network positioning. But our mobile Web page is open to all users, obviously unreasonable.
Later check data found that some of the Android browser is OK, and then downloaded all the common Android browser test, to determine four browser can be, respectively, QQ browser, Baidu Browser, Dolphin Browser, Sogou browser, but these four browsers are not very common, especially the UC browser and Chrome browser, Some mobile phone comes with the browser with HTML5 can, but with the UC browser test incredibly not, depressed extremely.
Later thought can use IP location, if HTML5 can locate, with HTML5, not with IP location, this check Baidu interface, no, first IP location error is very large, Baidu's IP location interface only provides the user's city interface.
Also think of mobile phone number positioning, find two such agents, they are directly with the telecommunications Unicom mobile three operators cooperation, respectively, is good service and Vantery, with good service chat more, price is reasonable, call interface to 1 cents once, but that considering the security issues need to apply for authorization first, User application can be, can be positioned, this process is more headache, sometimes a day, sometimes two or three days, if you want to locate in time, that certainly not.
In the middle also thought a lot of methods, the development of the app, with the positioning, the development of a browser plug-ins, but feel not all bad. Finally in the Baidu Localization development document found a Web Location component interface, you can obtain the latitude and longitude, testing a lot of mobile phones (including the Android phone without the GMS package) are OK. Search data found This is Baidu this July just out of the interface, with the open webcomponent, that is, their own definition of the label, the back by invoking their own development of a JS plugin to achieve positioning. The specific underlying implementation principle also needs further exploration, has consulted Baidu related personnel, later will follow up the blog information. Baidu Positioning Components Example
Mobile Web location Solution Country Line Android Phone no GMS package