本文整理汇总了Java中com.amap.api.maps.model.MarkerOptions.title方法的典型用法代码示例。如果您正苦于以下问题:Java MarkerOptions.title方法的具体用法?Java MarkerOptions.title怎么用?Java MarkerOptions.title使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amap.api.maps.model.MarkerOptions
的用法示例。
在下文中一共展示了MarkerOptions.title方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addNodeMarks
import com.amap.api.maps.model.MarkerOptions; //导入方法依赖的package包/类
protected void addNodeMarks() {
aMap.clear();
MarkerOptions markerOptions = new MarkerOptions();
if (!list_p.isEmpty()) {
for (TransNode t : list_p) {
Position p = t.getPosition();
markerOptions.title(t.getNodename());
markerOptions.snippet("电话: " + t.getTelcode() + "\n" + "区域码: "
+ t.getRegioncode());
// 设置Marker的坐标,为我们点击地图的经纬度坐标
markerOptions.position(new LatLng(p.getX(), p.getY()));
// 设置Marker的可见性
markerOptions.visible(true);
// 设置Marker是否可以被拖拽,这里先设置为false,之后会演示Marker的拖拽功能
markerOptions.draggable(false);
// 将Marker添加到地图上去
aMap.addMarker(markerOptions);
}
} else {
Toast.makeText(getActivity(), "查询不到此网点哦~", Toast.LENGTH_SHORT)
.show();
}
}
示例2: createMarkerOptions
import com.amap.api.maps.model.MarkerOptions; //导入方法依赖的package包/类
private MarkerOptions createMarkerOptions() {
MarkerOptions options = new MarkerOptions();
if (anchorIsSet) options.anchor(anchorX, anchorY);
//if (calloutAnchorIsSet) options.infoWindowAnchor(calloutAnchorX, calloutAnchorY);
options.position(position);
options.title(title);
options.snippet(snippet);
options.rotateAngle(rotation);
options.setFlat(flat);
options.draggable(draggable);
options.zIndex(zIndex);
options.alpha(opacity);
options.icon(getIcon());
return options;
}
示例3: initMyPoint
import com.amap.api.maps.model.MarkerOptions; //导入方法依赖的package包/类
private void initMyPoint() {
MarkerOptions markerOption = new MarkerOptions();
markerOption.icon(BitmapDescriptorFactory
.fromResource(R.drawable.location_marker));
markerOption.title("我的位置")
;
mMyLocation = mAMap.addMarker(markerOption);
LocationModel.getInstance().registerLocationChange(location -> {
mMyLocation.setPosition(new LatLng(location.latitude,location.longitude));
mMyLocation.setSnippet(location.getAddress());
});
}
示例4: addMarker
import com.amap.api.maps.model.MarkerOptions; //导入方法依赖的package包/类
private void addMarker(LatLng lt, String des) {
// TODO Auto-generated method stub
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.title(des);
// 设置Marker的坐标,为我们点击地图的经纬度坐标
markerOptions.position(lt);
// 设置Marker的可见性
markerOptions.visible(true);
// 设置Marker是否可以被拖拽,这里先设置为false,之后会演示Marker的拖拽功能
markerOptions.draggable(false);
// 将Marker添加到地图上去
aMap.addMarker(markerOptions);
}
示例5: choose
import com.amap.api.maps.model.MarkerOptions; //导入方法依赖的package包/类
@Override
public void choose(MarkerOptions markerOptions, ClusterPoint clusterPoint) {
Context context = contextRef.get();
if (context != null) {
Resources res = context.getResources();
boolean isCluster = clusterPoint.size() > 1;
boolean hasTwoToasters = clusterPoint.containsInputPoint(twoToasters);
BitmapDescriptor icon;
String title;
if (isCluster) {
title = res.getQuantityString(R.plurals.count_points, clusterPoint.size(), clusterPoint.size());
int clusterSize = clusterPoint.size();
if (hasTwoToasters) {
icon = BitmapDescriptorFactory.fromBitmap(getClusterBitmap(res, R.drawable.ic_map_pin_cluster_toaster, clusterSize));
title = res.getString(R.string.including_two_toasters, title);
} else {
icon = BitmapDescriptorFactory.fromBitmap(getClusterBitmap(res, R.drawable.ic_map_pin_cluster, clusterSize));
title = res.getQuantityString(R.plurals.count_points, clusterSize, clusterSize);
}
} else {
MarkerData data = (MarkerData)clusterPoint.getPointAtOffset(0).getTag();
if (hasTwoToasters) {
icon = BitmapDescriptorFactory.fromResource(R.drawable.ic_map_pin_toaster);
title = data.getLabel();
} else {
icon = BitmapDescriptorFactory.fromResource(R.drawable.ic_map_pin);
title = res.getString(R.string.point_number_x, data.getLabel());
}
}
markerOptions.icon(icon);
markerOptions.title(title);
markerOptions.anchor(0.5f, 1.0f);
}
}