use of com.indooratlas.android.sdk.resources.IALatLng in project android-sdk-examples by IndoorAtlas.
the class MapsOverlayActivity method setupGroundOverlay.
/**
* Sets bitmap of floor plan as ground overlay on Google Maps
*/
private void setupGroundOverlay(IAFloorPlan floorPlan, Bitmap bitmap) {
if (mGroundOverlay != null) {
mGroundOverlay.remove();
}
if (mMap != null) {
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(bitmap);
IALatLng iaLatLng = floorPlan.getCenter();
LatLng center = new LatLng(iaLatLng.latitude, iaLatLng.longitude);
GroundOverlayOptions fpOverlay = new GroundOverlayOptions().image(bitmapDescriptor).zIndex(0.0f).position(center, floorPlan.getWidthMeters(), floorPlan.getHeightMeters()).bearing(floorPlan.getBearing());
mGroundOverlay = mMap.addGroundOverlay(fpOverlay);
}
}
use of com.indooratlas.android.sdk.resources.IALatLng in project android-sdk-examples by IndoorAtlas.
the class WayfindingOverlayActivity method setupGroundOverlay.
/**
* Sets bitmap of floor plan as ground overlay on Google Maps
*/
private void setupGroundOverlay(IAFloorPlan floorPlan, Bitmap bitmap) {
if (mGroundOverlay != null) {
mGroundOverlay.remove();
}
if (mMap != null) {
BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(bitmap);
IALatLng iaLatLng = floorPlan.getCenter();
LatLng center = new LatLng(iaLatLng.latitude, iaLatLng.longitude);
GroundOverlayOptions fpOverlay = new GroundOverlayOptions().image(bitmapDescriptor).zIndex(0.0f).position(center, floorPlan.getWidthMeters(), floorPlan.getHeightMeters()).bearing(floorPlan.getBearing());
mGroundOverlay = mMap.addGroundOverlay(fpOverlay);
}
}
use of com.indooratlas.android.sdk.resources.IALatLng in project android-sdk-examples by IndoorAtlas.
the class MultiLocationMapView method updateLocationInternal.
private void updateLocationInternal(LocationEvent event) {
final String identity = event.source.id;
final IALocation location = event.location;
IALatLng latLng = new IALatLng(location.getLatitude(), location.getLongitude());
PointF point = mFloorPlan.coordinateToPoint(latLng);
float accuracy = location.getAccuracy() * mFloorPlan.getMetersToPixels();
Log.d(TAG, "converted location (" + event.location.getLatitude() + "," + event.location.getLongitude() + ") to point: " + point + " with floorplan: " + mFloorPlan.getId() + ", name: " + mFloorPlan.getName());
mKnownLocations.put(identity, new LocationEntry(event.source, point, accuracy));
}
use of com.indooratlas.android.sdk.resources.IALatLng in project android-sdk-examples by IndoorAtlas.
the class OpenStreetMapOverlay method setupGroundOverlay.
/**
* Sets bitmap of floor plan as ground overlay on Open Street Map
*/
private void setupGroundOverlay(IAFloorPlan floorPlan, Bitmap bitmap) {
if (mGroundOverlay != null) {
mOsmv.getOverlays().remove(mGroundOverlay);
}
if (mOsmv != null) {
IALatLng iaLatLng = floorPlan.getCenter();
GroundOverlay overlay = new GroundOverlay();
overlay.setImage(new BitmapDrawable(getResources(), bitmap));
overlay.setPosition(new GeoPoint(iaLatLng.latitude, iaLatLng.longitude));
overlay.setDimensions(floorPlan.getWidthMeters(), floorPlan.getHeightMeters());
overlay.setBearing(floorPlan.getBearing());
mGroundOverlay = overlay;
mOsmv.getOverlays().add(mGroundOverlay);
}
}
Aggregations