use of com.amap.api.maps.model.LatLng in project ride-read-android by Ride-Read.
the class MapFragment method addMoment2Map.
private void addMoment2Map(final MapMoment moment) {
final LatLng latLng = new LatLng(moment.getLatitude(), moment.getLongitude());
ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithSource(Uri.parse(moment.getPictures().get(0) + QiNiuUtils.CROP_SMALL_100)).setProgressiveRenderingEnabled(true).build();
ImagePipeline imagePipeline = Fresco.getImagePipeline();
DataSource<CloseableReference<CloseableImage>> dataSource = imagePipeline.fetchDecodedImage(imageRequest, Utils.getAppContext());
dataSource.subscribe(new BaseBitmapDataSubscriber() {
@Override
public void onNewResultImpl(@Nullable Bitmap bitmap) {
addMomentMarker(latLng, bitmap, moment);
}
@Override
public void onFailureImpl(DataSource dataSource) {
}
}, CallerThreadExecutor.getInstance());
}
use of com.amap.api.maps.model.LatLng in project YourEyes by SevenLJY.
the class MapActivity method updatePosition.
/**
* updatePosition():更新地图位置
* 在更新位置加上marker
* */
private void updatePosition(LatLng location) {
LatLng pos = location;
//创建一个设置经纬度的CameraUpdate
CameraUpdate cuLoc = CameraUpdateFactory.changeLatLng(pos);
//更新地图显示区域
aMap.moveCamera(cuLoc);
//清除地图所有覆盖物
aMap.clear();
//创建一个MarkerOptions对象并使用自定义图标
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(pos);
markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.smallplaceholder));
markerOptions.draggable(true);
//添加marker
Marker marker = aMap.addMarker(markerOptions);
}
use of com.amap.api.maps.model.LatLng in project Dxditor by kimi2009.
the class MapPageActivity method initGPSData.
private void initGPSData() {
try {
InputStream is = MapPageActivity.this.getAssets().open("devicetestdata.txt");
String jsonString = MyUtils.inputStream2String(is);
JSONObject js = new JSONObject(jsonString);
String re = js.getString("devices");
Gson gson = new Gson();
List<Device> devices = gson.fromJson(re, new TypeToken<List<Device>>() {
}.getType());
for (int i = 0; i < devices.size(); i++) {
LatLng latlng = convert(MapPageActivity.this, devices.get(i).getLocationy() + "", devices.get(i).getLocationx() + "");
addMarkersToMap(latlng, devices.get(i));
}
aMap.setOnMarkerClickListener(this);
} catch (Exception e) {
e.printStackTrace();
}
}
use of com.amap.api.maps.model.LatLng in project LivingInCampus by DulCoder.
the class BusLineOverlay method addToMap.
/**
* 添加公交线路到地图中。
*
* @since V2.1.0
*/
public void addToMap() {
try {
List<LatLonPoint> pointList = mBusLineItem.getDirectionsCoordinates();
List<LatLng> listPolyline = AMapServicesUtil.convertArrList(pointList);
mBusLinePolyline = mAMap.addPolyline(new PolylineOptions().addAll(listPolyline).color(getBusColor()).width(getBuslineWidth()));
if (mBusStations.size() < 1) {
return;
}
for (int i = 1; i < mBusStations.size() - 1; i++) {
Marker marker = mAMap.addMarker(getMarkerOptions(i));
mBusStationMarks.add(marker);
}
Marker markerStart = mAMap.addMarker(getMarkerOptions(0));
mBusStationMarks.add(markerStart);
Marker markerEnd = mAMap.addMarker(getMarkerOptions(mBusStations.size() - 1));
mBusStationMarks.add(markerEnd);
} catch (Throwable e) {
e.printStackTrace();
}
}
use of com.amap.api.maps.model.LatLng in project LivingInCampus by DulCoder.
the class BusRouteOverlay method checkBusToNextBusNoWalk.
/**
* 如果换乘没有步行 检查bus最后一点和下一个step的bus起点是否一致
*
* @param busStep
* @param busStep1
*/
private void checkBusToNextBusNoWalk(BusStep busStep, BusStep busStep1) {
LatLng endbusLatLng = AMapUtil.convertToLatLng(getLastBuslinePoint(busStep));
LatLng startbusLatLng = AMapUtil.convertToLatLng(getFirstBuslinePoint(busStep1));
if (startbusLatLng.latitude - endbusLatLng.latitude > 0.0001 || startbusLatLng.longitude - endbusLatLng.longitude > 0.0001) {
// 断线用带箭头的直线连?
drawLineArrow(endbusLatLng, startbusLatLng);
}
}
Aggregations