Baidu Map Open API sample finishing-overlay

Source: Internet
Author: User
Tags polyline


Abstract base class for OverLay coverings cannot be instantiated


is shown for its subclass implementation.

Http://developer.baidu.com/map/reference/index.php?

Title=class:%e8%a6%86%e7%9b%96%e7%89%a9%e7%b1%bb/pointcollection

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/53/7D/wKioL1RpUsuwT3sxAAGManAPEOc033.jpg "title=" Qq20141117093418.jpg "alt=" Wkiol1rpusuwt3sxaagmanapeoc033.jpg "/>

Map.addoverlay Adding coverings

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/53/7C/wKioL1RpUR3zHElPAAKth6xCbeI910.jpg "title=" Qq20141117093418.jpg "alt=" Wkiol1rpur3zhelpaakth6xcbei910.jpg "/>

Add a basic overlay code:

Var marker = new bmap.marker (New bmap.point (116.404, 39.915)); //  Create a point Var polyline = new bmap.polyline ([New bmap.point (116.399, 39.910),new  Bmap.point (116.405, 39.920), New bmap.point (116.425, 39.900)], {strokecolor: "Blue",  strokeweight:2, strokeopacity:0.5});    //create Polyline var circle = new  Bmap.circle (point,500,{strokecolor: "Blue",  strokeweight:2, strokeopacity:0.5});  //Create Circle var  Polygon = new bmap.polygon ([New bmap.point (116.387112,39.920977), New BMap.Point ( 116.385243,39.913063), New bmap.point (116.394226,39.917988), New bmap.point (116.401772,39.921364), new  bmap.point (116.41248,39.927893)], {strokecolor: "Blue",  strokeweight:2, strokeopacity:0.5} );   //Create Polygon Var pstart = new bmap.point (116.392214,39.918985);var pEnd  = new bmap.point (116.41478,39.911901); Var rectangle = new bmap.polygon ([New bmap.point (PStart.lng,pStart.lat ), New bmap.point (Pend.lng,pstart.lat), New bmap.point (Pend.lng,pend.lat), New bmap.point ( Pstart.lng,pend.lat)], {strokecolor: "Blue",  strokeweight:2, strokeopacity:0.5});   // Create a rectangle//Add Overlay Function add_overlay () {map.addoverlay (marker);             //Add point Map.addoverlay (polyline);           //add polyline map.addoverlay (circle);             // Increase round map.addoverlay (polygon);            // Add Polygon Map.addoverlay (Rectangle),          //add rectangle}//Clear Overlay function  remove_overlay () {map.clearoverlays ();          }

Set the bounce animation for a point

Marker.setanimation (bmap_animation_bounce); Bouncing animations//bmap_animation_drop//falling animations

Creating a new icon is primarily building an icon and then specifying it at construction time.

/Create Little fox var pt = new Bmap.point (116.417, 39.909); var myicon = new Bmap.icon ("http://developer.baidu.com/map/jsdemo/img/  Fox.gif ", New Bmap.size (300,157)), var marker2 = new Bmap.marker (Pt,{icon:myicon});              Create callout Map.addoverlay (MARKER2); Add a callout to a map

Is it possible to drag

Marker.disabledragging (); No drag

Marker.enabledragging () //Can be dragged

Refer to the API documentation for the prompt window polyline block.

This article is from the "Send2ocean" blog, make sure to keep this source http://3409736.blog.51cto.com/3399736/1577259

Baidu Map Open API sample finishing-overlay

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.