Baidu Map using Notes

Source: Internet
Author: User

1. Determine the initial map by province + City + counties

Map.centerandzoom (Prv+city+dis, 15);

2. Initialize map with exact address

function Searchonmap (detail) {           if(detail! = "")            {varnew  Bmap.localsearch (map, {                renderoptions:{map:map}            });                    Alert (detail)            local.search (detail);        }   } // Initialize map map.centerandzoom (Prv+city+dis),searchonmap (detail), Chaoyang District, Beijing, No. 21st//xx Road

Results: a.xx road 21st was searched and marked out. No. 21st B.xx Road No search, show zoom range C. Search only XX road, display multiple labels.

3. Via Address dot

varMygeo =NewBmap.geocoder (); //displays address resolution results on the map and adjusts the map viewMygeo.getpoint (Detail,function(point) {if(point) {map.centerandzoom (point,18); //If there is an address at zoom before the call expires varMyicon =NewBmap.icon ("Http://developer.baidu.com/map/jsdemo/img/fox.gif",NewBmap.size (300,157)); varMarker2 =NewBmap.marker (Point,{icon:myicon});//Create a calloutMap.addoverlay (MARKER2);//add a callout to a map                            }Else{alert ("The address you chose did not resolve to the result!"); return NULL; }}, city);

Results: a.xx road 21st was searched and marked out. No. 21st B.xx Road No search, the label is displayed on the road C. Search only XX Road, the callout is displayed on the road.

Baidu Map using Notes

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.