本文整理汇总了Java中com.amap.api.maps2d.model.CameraPosition类的典型用法代码示例。如果您正苦于以下问题:Java CameraPosition类的具体用法?Java CameraPosition怎么用?Java CameraPosition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CameraPosition类属于com.amap.api.maps2d.model包,在下文中一共展示了CameraPosition类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: locationAddressInfo
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
private void locationAddressInfo(double lat, double lng, String address) {
LatLng latlng = new LatLng(lat, lng);
CameraUpdate camera = CameraUpdateFactory.newCameraPosition(new CameraPosition(latlng, amap.getCameraPosition().zoom, 0, 0));
amap.moveCamera(camera);
addressInfo = address;
latitude = lat;
longitude = lng;
setPinInfoPanel(true);
}
开发者ID:newDeepLearing,项目名称:decoy,代码行数:11,代码来源:LocationAmapActivity.java
示例2: onCameraChangeFinish
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
@Override
public void onCameraChangeFinish(CameraPosition cameraPosition) {
if (!locating) {
queryLatLngAddress(cameraPosition.target);
} else {
latitude = cameraPosition.target.latitude;
longitude = cameraPosition.target.longitude;
}
updateMyLocationStatus(cameraPosition);
}
开发者ID:newDeepLearing,项目名称:decoy,代码行数:11,代码来源:LocationAmapActivity.java
示例3: updateMyLocationStatus
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
private void updateMyLocationStatus(CameraPosition cameraPosition) {
if(Math.abs(-1 - cacheLatitude) < 0.1f) {
// 定位失败
return;
}
LatLng source = new LatLng(cacheLatitude, cacheLongitude);
LatLng target = cameraPosition.target;
float distance = AMapUtils.calculateLineDistance(source, target);
boolean showMyLocation = distance > 50;
btnMyLocation.setVisibility(showMyLocation ? View.VISIBLE:View.GONE);
updateSendStatus();
}
开发者ID:newDeepLearing,项目名称:decoy,代码行数:13,代码来源:LocationAmapActivity.java
示例4: initMap
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
public void initMap(){
if (aMap == null) {
aMap = mapView.getMap();
aMap.setOnMarkerClickListener(this);
addMarkersToMap();
changeCamera(
CameraUpdateFactory.newCameraPosition(new CameraPosition(
new LatLng(32.012354, 119.106243), 10, 30, 30)));
}
}
开发者ID:vinx13,项目名称:hack-nanjing-2017,代码行数:11,代码来源:MeFragment.java
示例5: onLocationChanged
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
@Override
public void onLocationChanged(AMapLocation location) {
// this.location = location;
if (mListener != null && location != null) {
mListener.onLocationChanged(location);
}
if (!locationChange) {
if (location != null) {
LatLng latlng = new LatLng(location.getLatitude(),
location.getLongitude());
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(latlng).zoom(18).build();
map.animateCamera(CameraUpdateFactory
.newCameraPosition(cameraPosition));
if (latlng != null) {
String keyWord = location.getCity();
PoiSearch.Query query = new PoiSearch.Query(
keyWord,
"汽车服务|汽车销售|汽车维修|摩托车服务|餐饮服务|购物服务|生活服务|体育休闲服务|医疗保健服务|风景名胜|商务住宅|政府机构及社会团体|科教文化服务|交通设施服务|金融保险服务|公司企业|道路附属设施|地名地址信息|公共设施",
"");// (第三个参数)这里可以传空字符串,空字符串代表全国在全国范围内进行搜索
query.setPageNum(1);
query.setPageSize(40);
PoiSearch poiSearch = new PoiSearch(getActivity(), query);
poiSearch.setBound(new SearchBound(new LatLonPoint(
latlng.latitude, latlng.longitude), 3000));
poiSearch.setOnPoiSearchListener(this);
poiSearch.searchPOIAsyn();
}
locationChange = true;
}
}
}
开发者ID:wangcantian,项目名称:Mobile-Office,代码行数:34,代码来源:MapFragment.java
示例6: onCameraChangeFinish
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
@Override
public void onCameraChangeFinish(CameraPosition cameraPosition) {
LatLng latLng = cameraPosition.target;
double lat = latLng.latitude;
double lon = latLng.longitude;
String locationStr = changeLocationStr(lon,lat);
AbLogUtil.d(mContext, "移动后的坐标:" + locationStr);
Intent locationChange = new Intent();
locationChange.setAction(Global.EShow_Broadcast_Action.ACTION_LOCATION_CHANGED);
locationChange.putExtra(AroundPlaceFragment.INTENT_CURRENT_LOCATION,locationStr);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(locationChange);
}
开发者ID:bangqu,项目名称:eshow-android,代码行数:14,代码来源:ChooseLocationActivity.java
示例7: lookAt
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
public void lookAt(double latitude, double longitude, String title, String snippet) {
LatLng latLng = new LatLng(latitude, longitude);
AMap map = this.getMap();
map.clear();
MarkerOptions markerOptions = new MarkerOptions().position(latLng).title(title).snippet(snippet)
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
Marker marker = map.addMarker(markerOptions);
if (title != null) {
marker.showInfoWindow();
}
map.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(latLng, 15, 0, 0)));
}
开发者ID:wavinsun,项目名称:MUtils,代码行数:13,代码来源:AMapView.java
示例8: onLocationChanged
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
@Override
public void onLocationChanged(AMapLocation aLocation) {
if (mListener != null && aLocation != null) {
mListener.onLocationChanged(aLocation);// 显示系统小蓝点
//获取位置信息
geoLat = aLocation.getLatitude();
geoLon = aLocation.getLongitude();
LocationInfo.setLat(geoLat);
LocationInfo.setLon(geoLon);
LocationInfo.setCityName(aLocation.getCity());
LocationInfo.setCityCode(aLocation.getCityCode());
LocationInfo.setAddress(aLocation.getAddress());
if (geoLon == null || geoLat == null) return;
//添加用户覆盖物
userCurrentLatLng = new LatLng(geoLat, geoLon);
if (myMark != null) {
myMark.destroy();
}
//设置圆形范围,颜色等参数
aMap.addCircle(new CircleOptions().center(userCurrentLatLng).radius(1000).strokeColor(Color.GREEN).strokeWidth(1.0f));
//设置缩放级别
aMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(userCurrentLatLng, 18, 0, 30)));
if (isFirstGetPost && (LocationInfo.getLat() != 0.0 || LocationInfo.getLon() != 0.0)) {
getPost();
isFirstGetPost = false;
}
}
}
开发者ID:chenjunqian,项目名称:here,代码行数:33,代码来源:MainMapFragment.java
示例9: onCameraChangeFinish
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
/**
* 当地图的可视区域改变结束时
*
* @param cameraPosition
*/
@Override
public void onCameraChangeFinish(CameraPosition cameraPosition) {
shouldGetMorePost = true;
//latLonPoint参数表示一个Latlng,第二参数表示范围多少米,GeocodeSearch.AMAP表示是国测局坐标系还是GPS原生坐标系
currentCameraLatLng = new LatLonPoint(cameraPosition.target.latitude,
cameraPosition.target.longitude);
//为了不频繁的请求数据,限定移动地图视野停止3秒后再获取数据
handler.sendEmptyMessageDelayed(message.what = GET_MAP_CAMERA_LOCATION_INFO, 3000);
}
开发者ID:chenjunqian,项目名称:here,代码行数:15,代码来源:MainMapFragment.java
示例10: onCameraChange
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
@Override
public void onCameraChange(CameraPosition arg0) {}
开发者ID:newDeepLearing,项目名称:decoy,代码行数:3,代码来源:LocationAmapActivity.java
示例11: onCameraChange
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
@Override
public void onCameraChange(CameraPosition cameraPosition) {
}
开发者ID:bangqu,项目名称:eshow-android,代码行数:5,代码来源:ChooseLocationActivity.java
示例12: onCameraChange
import com.amap.api.maps2d.model.CameraPosition; //导入依赖的package包/类
/**
* 当地图的可视区域改变时
*
* @param cameraPosition
*/
@Override
public void onCameraChange(CameraPosition cameraPosition) {
shouldGetMorePost = false;
}
开发者ID:chenjunqian,项目名称:here,代码行数:10,代码来源:MainMapFragment.java
注:本文中的com.amap.api.maps2d.model.CameraPosition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论