The icon class allows you to implement custom labels, and the following example is set by the icon property of the parameter markeroptions.
You can also use the Marker.seticon () method.
<script type="Text/javascript">//Baidu Map API function varMap =NewBmap.map ("Allmap");//Create a map instanceMap.centerandzoom (NewBmap.point (116.323066,39.989956), -);//Initialize map, set center point coordinates and map levelMap.addcontrol (NewBmap.maptypecontrol ());//Add a map type controlMap.setcurrentcity ("Beijing");//Set map to show the city this entry is mandatoryMap.enablescrollwheelzoom (true);//Turn on mouse wheel zoom varpoints = [[116.316967,39.990748], [116.323938,39.989919], [116.328896,39.988039], [116.321135,39.987072], [116.332453,39.989007], [116.324045,39.987984], [116.322285,39.988316], [116.322608,39.986381] ];//Add labels to the map for(vari =0; i < points.length; i++) {varMyicon =NewBmap.icon ("Http://7xic1p.com1.z0.glb.clouddn.com/markers.png",NewBmap.size ( at, -), {//Specify positioning locationOffsetNewBmap.size (Ten, -),//When you need to intercept a section from a larger picture as a callout icon, you need to specify the offset position of the large imageImageoffset:NewBmap.size (0,0I -)//Set picture offset});varPoint =NewBmap.point (points[i][0],points[i][1]);//Create dimension object and add to map varMarker =NewBmap.marker (Point,{icon:myicon}); Map.addoverlay (marker); };</script>
Pictures used:
Demo Address: click
Itmyhome
Baidu Map API Custom Callout icon