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