当前位置: 首页>>代码示例>>Java>>正文


Java MarkerOptions.setFlat方法代码示例

本文整理汇总了Java中com.amap.api.maps.model.MarkerOptions.setFlat方法的典型用法代码示例。如果您正苦于以下问题:Java MarkerOptions.setFlat方法的具体用法?Java MarkerOptions.setFlat怎么用?Java MarkerOptions.setFlat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amap.api.maps.model.MarkerOptions的用法示例。


在下文中一共展示了MarkerOptions.setFlat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMapLoaded

import com.amap.api.maps.model.MarkerOptions; //导入方法依赖的package包/类
@Override
public void onMapLoaded() {

	MarkerOptions markerOptions = new MarkerOptions();
	markerOptions.setFlat(true);
	markerOptions.anchor(0.5f, 0.5f);
	markerOptions.position(new LatLng(0, 0));
	markerOptions
			.icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory
					.decodeResource(getResources(),
							R.drawable.icon_loaction_start)));
	mPositionMark = mAmap.addMarker(markerOptions);

	mPositionMark.setPositionByPixels(mMapView.getWidth() / 2,
			mMapView.getHeight() / 2);
	mLocationTask.startSingleLocate();
}
 
开发者ID:amapapi,项目名称:Android_UsingCar_Example,代码行数:18,代码来源:MainActivity.java

示例2: drawMarkers

import com.amap.api.maps.model.MarkerOptions; //导入方法依赖的package包/类
public void drawMarkers(List<BuildingPoint> buildingPointList) {
    for (int i = 0; i < buildingPointList.size(); i++) {
        BuildingPoint point = buildingPointList.get(i);
        MarkerOptions options = new MarkerOptions().position(point.getLatLng()).title(point.getBuildName());
        options.snippet("停留" + (point.getTime() / 1000 / 60) + "分钟");
        options.setFlat(true);
        Marker marker = mAmap.addMarker(options);
        marker.setInfoWindowEnable(true);
        marker.showInfoWindow();
    }
}
 
开发者ID:stdnull,项目名称:RunMap,代码行数:12,代码来源:MapDrawer.java

示例3: 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;
}
 
开发者ID:laoqiu,项目名称:react-native-amap,代码行数:16,代码来源:AMapMarker.java

示例4: initRoadData

import com.amap.api.maps.model.MarkerOptions; //导入方法依赖的package包/类
private void initRoadData() {
		// 116.504505 39.931057
		double centerLatitude = 39.916049;
		double centerLontitude = 116.399792;
		
/*		
		ArrayList<Points> points = new ArrayList<>();
		
		double a_x = 39.916049;
		double a_y = 116.399792;
		
		double b_x = 35.616049;
		double b_y = 120.339792;*/
		
		//我想写个循环求的这两个点之间的很多点
		
		PolylineOptions polylineOptions = new PolylineOptions();
		/*double deltaAngle = Math.PI / 180 * 5;
		double radius = 0.02;
		PolylineOptions polylineOptions = new PolylineOptions();
		for (double i = 0; i < Math.PI * 2; i = i + deltaAngle) {
			float latitude = (float) (-Math.cos(i) * radius + centerLatitude);
			float longtitude = (float) (Math.sin(i) * radius + centerLontitude);
			polylineOptions.add(new LatLng(latitude, longtitude));
			if (i > Math.PI) {
				deltaAngle = Math.PI / 180 * 30;
			}
			Log.e("TAG_POINT", "latitude-->" + latitude + "-----longtitude--》" + longtitude);
		}
		
		float latitude = (float) (-Math.cos(0) * radius + centerLatitude);
		float longtitude = (float) (Math.sin(0) * radius + centerLontitude);
		*/
		polylineOptions.add(new LatLng(centerLatitude, centerLontitude));
		 polylineOptions.add(new LatLng(39.528049, 117.589038));
		 distance = GetDistance(new LatLng(centerLatitude, centerLontitude),new LatLng(39.528049, 117.589038));
//		 TIME_INTERVAL = (int)(10/distance) * 10;
//		 polylineOptions.add(new LatLng(39.92515, 116.510997));
//		 polylineOptions.add(new LatLng(39.892198, 116.439449));
//		 polylineOptions.add(new LatLng(39.919324, 116.379367));
//		 polylineOptions.add(new LatLng(39.951704, 116.356708));
//		//
//		//
//		
//		//
//		 polylineOptions.add(new LatLng(39.970914, 116.408206));
//		
//		 polylineOptions.add(new LatLng(40.005899, 116.467601));
//		 polylineOptions.add(new LatLng(39.954368, 116.478038));
//		 polylineOptions.add(new LatLng(40.009368, 116.678038));
		polylineOptions.width(10);
		polylineOptions.color(Color.RED);
		
		mVirtureRoad = mAmap.addPolyline(polylineOptions);
		
		MarkerOptions markerOptions = new MarkerOptions();
		markerOptions.setFlat(true);
		markerOptions.anchor(0.5f, 0.5f);
		markerOptions.icon(BitmapDescriptorFactory
				.fromResource(R.drawable.marker));
		markerOptions.position(polylineOptions.getPoints().get(0));
		
		mMoveMarker = mAmap.addMarker(markerOptions);
		mMoveMarker.setRotateAngle((float) getAngle(0));

	}
 
开发者ID:KellenHu,项目名称:Amap-Move-Example,代码行数:67,代码来源:MainActivity.java


注:本文中的com.amap.api.maps.model.MarkerOptions.setFlat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。