天地图 android api,百度地图与天地图常用 API 对比
初始化地图var map = new BMap.Map("allmap");var map = new T.Map("allmap");将覆盖物添加到地图addOverlay(overlay: Overlay)addOverLay(overlay:OverLay)从 Map 的 click 事件中获取坐标点map.addEventListener("click", function (e) {Po
初始化地图var map = new BMap.Map("allmap");var map = new T.Map("allmap");
将覆盖物添加到地图addOverlay(overlay: Overlay)addOverLay(overlay:OverLay)
从 Map 的 click 事件中获取坐标点map.addEventListener("click", function (e) {
Point = e.point;
}map.addEventListener("click", function (e) {
LngLat = e.lnglat;
}
坐标点new BMap.Point(lng: Number, lat: Number)new T.LngLat(lng: Numbe, lat: Number)
像素点new BMap.Pixel(x: Number, y: Number)new T.Point(x: Number, y: Number)
文本标注new BMap.Label(content: String, {
offset: Size,
position: Point
})new T.Label({
text: string,
position: LngLat,
offset: Point
})
设置文本标注样式setStyle(styles: Object)每个样式使用单独的 set 方法实现
图像标注new BMap.Marker(Point, {
offset: Size,
icon: Icon,
enableMassClear: Boolean,
enableDragging: Boolean,
enableClicking: Boolean,
raiseOnDrag: Boolean,
draggingCursor: String,
rotation: Number,
shadow: Icon,
title: String
})new T.Marker(LngLat, {
icon: Icon,
draggable: boolean,
title: string,
zIndexOffset: number,
opacity: number
})
为图像标注添加文本标注Marker.setLabel(label: Label)无。
可借用 title(鼠标掠过显示)属性来实现,并通过 Marker.options.title 来获取值
从图像标注获取坐标点Point = Marker.getPosition();LngLat = Marker.getLngLat();
绘制折线new BMap.Polyline(points: Array, {
strokeColor: String,
strokeWeight: Number,
strokeOpacity: Number,
strokeStyle: String,
enableMassClear: Boolean,
enableEditing: Boolean,
enableClicking: Boolean,
icons: Array
})new T.Polyline(points:Array, {
color: string,
weight: number,
opacity: number,
lineStyle: string
})
绘制多边形new BMap.Polygon(points: Array, {
strokeColor: String,
fillColor: String,
strokeWeight: Number,
strokeOpacity: Number,
fillOpacity: Number,
strokeStyle: String,
enableMassClear: Boolean,
enableEditing: Boolean,
enableClicking: Boolean
})new T.Polygon(points:Array,{
color: string,
weight: number,
opacity: number,
fillColor: String,
fillOpacity: number,
lineStyle: string
})
设置多边形的点数组Polygon.setPath(points: Array)Polyline.setLngLats(lnglats: Array)
设置地图视野Map.setViewport(view: Array | Viewport, viewportOptions: ViewportOptions)Map.setViewport(view: Array)
更多推荐
所有评论(0)