API map coordinate conversion (batch conversion coordinates)

Source: Internet
Author: User

"' HTML

Converting coordinates in batches(said to have 50 times/second limit OH)

Google Maps

The Google coordinates of the mouse click are:

Baidu Map

Mouse click on the Baidu coordinates are:()

```

' JavaScript//(function () {function load script (Xyurl, callback) {var head = document.getElementsByTagName (' head ') [0]; var script = Document.createelement (' Script '); Script.type = ' Text/javascript '; SCRIPT.SRC = Xyurl; Using the script cross-domain method of jquery script.onload = Script.onreadystatechange = function () {if (!this.readystate | | this.readystate = = = "Loaded" | | This.readystate = = = "complete") {callback && callback ();//Handle memory leak in IE script.onload = Script.onrea Dystatechange = null; if (head && script.parentnode) {head.removechild (script);}} }; Use InsertBefore instead of appendchild to circumvent an IE6 bug. Head.insertbefore (script, head.firstchild); } function Transmore (Points,type,callback) {for (Var index in points) {if (Index >) {return;} var xyurl = "HTTP://API.M Ap.baidu.com/ag/coord/convert?from= "+ type +" &to=4&x= "+ points[index].lng +//Here to loop the LNG data into the array points, Until the points.length is finished. "&y=" + Points[index].lat + "&callback=callback"; Dynamically creating a script tag load Script (Xyurl); } }

Window. BMap = window. BMap | | {}; Bmap.convertor = {}; BMap.Convertor.transMore = Transmore; })(); ```

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.