Add Baidu map coordinate pick-up in jqueryboxy _ jquery

Source: Internet
Author: User
This article mainly introduces how to add notes for Baidu map coordinate pick-up in jqueryboxy. If you need a friend, you can refer to this document as a developer. This document is only used as a personal backup, it would be nice if I could help (I used php for development, but this is not much affected by js itself)

Here are several questions:

1. The script tag cannot be displayed on the page called by boxy. Otherwise, it cannot be displayed.

2. Pay attention to the process when calling boxy. First load the boxy and then render the map to the boxy page.

3. The loading js of Baidu map should be placed on the pop-up boxy page.

Note: The boxy page uses $. get ('/index. php? R = comm/map_coordinate ', function (data) {} method to call the page

The key trigger js is as follows:

The Code is as follows:


(Function (){
$ (Document). ready (function (){

$ ("# Mechine_mec_points"). click (function (){

_ MC. Map_coordinate.getcorrdinate ();

});
});

_ MC. Map_coordinate = {
Getcorrdinate: function (){

$. Get ('/index. php? R = comm/map_coordinate ', function (data) {// call the corresponding boxy page, there is only one id = allmap p



New Boxy (data, {// js with Baidu map AIP loaded outside
'Title': 'map coordinate picking ',
'Modal': true,
'Draggable': false,
'Unloadonhide ': true,
'Aftershow': function (){


Var map = new BMap. Map ("allmap ");
Map. centerAndZoom (new BMap. Point (106.566872, 29.536861), 17 );
Map. enableScrollWheelZoom (); // enables scroll wheel zoom in and out, which is disabled by default.
Map. enableContinuousZoom (); // enable map inertial drag and drop. disabled by default.
Function showInfo (e ){
$ ("# Mechine_mec_points"). val (e. point. lng + "," + e. point. lat );
}
Map. addEventListener ("click", showInfo );

} // Aftershow ends
});

Return false;
});

},
}
})();

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.