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


Java TencentLocation.getLongitude方法代码示例

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


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

示例1: onLocationChanged

import com.tencent.map.geolocation.TencentLocation; //导入方法依赖的package包/类
@Override
public void onLocationChanged(TencentLocation tencentLocation, int i, String s) {
    if (i == tencentLocation.ERROR_OK) {
        LatLng latLng = new LatLng(tencentLocation.getLatitude(), tencentLocation.getLongitude());
        if (myLocation == null) {
            myLocation = mTencentMap.addMarker(new MarkerOptions().position(latLng).icon(BitmapDescriptorFactory.fromResource(R.mipmap.arm)).anchor(0.5f, 0.8f));
        }
        if (accuracy == null) {
            accuracy = mTencentMap.addCircle(new CircleOptions().center(latLng).radius(tencentLocation.getAccuracy()).fillColor(0x440000ff).strokeWidth(0f));
        }
        myLocation.setPosition(latLng);
        accuracy.setCenter(latLng);
        accuracy.setRadius(tencentLocation.getAccuracy());
        mTencentMap.animateTo(latLng);
        mTencentMap.setZoom(16);
        search(latLng);
        //取消定位
        mLocationManager.removeUpdates(MyLocationActivity.this);
    } else {
        LogUtils.sf("location failed:" + i);
    }
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:23,代码来源:MyLocationActivity.java

示例2: onLocationChanged

import com.tencent.map.geolocation.TencentLocation; //导入方法依赖的package包/类
@Override
public void onLocationChanged(TencentLocation location, int error,
		String reason) {
	if (error == TencentLocation.ERROR_OK) {
		double latitude = location.getLatitude();
		double longitude = location.getLongitude();
		double dirction = location.getExtra().getDouble(TencentLocation.EXTRA_DIRECTION);
		// System.out.println(latitude + " " + longitude + " " + dirction);
		mStatus.setText("纬度=" + latitude + ",经度=" + longitude + "\n方向=" + (int)dirction);
		mView.updateDirection(dirction);
	} else {
		mView.updateDirection(0);
	}
}
 
开发者ID:tencentlocation,项目名称:TencentLocationDemo,代码行数:15,代码来源:DemoDirectionActivity.java

示例3: of

import com.tencent.map.geolocation.TencentLocation; //导入方法依赖的package包/类
private static GeoPoint of(TencentLocation location) {
	GeoPoint ge = new GeoPoint((int) (location.getLatitude() * 1E6),
			(int) (location.getLongitude() * 1E6));
	return ge;
}
 
开发者ID:tencentlocation,项目名称:TencentLocationDemo,代码行数:6,代码来源:DemoMapActivity.java

示例4: of

import com.tencent.map.geolocation.TencentLocation; //导入方法依赖的package包/类
public static GeoPoint of(TencentLocation location) {
	GeoPoint ge = new GeoPoint((int) (location.getLatitude() * 1E6),
			(int) (location.getLongitude() * 1E6));
	return ge;
}
 
开发者ID:tencentlocation,项目名称:TencentLocationDemo,代码行数:6,代码来源:Utils.java


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