Map rotation on smartphone - android

We are developing an indoor application on iOS and Android using MapKit and Cloudmade for the mapping.
The mapping we have should be able to work both online and offline. My mapping expect is having troubles on how to make the map rotate to face the same way the user is facing.
So we are able to do real-time tracking and display it on a pre-plotted route on the map, but we need to have the direction the person is walking as displayed on the map to face the same direction the user is facing.
How can we do this ?

The technique and Android SDK sample for Google maps described below also works for osmdroid.
Rotate MapView in Android

Related

How to integrate Location based Augmented Reality in Android

I have been searching seens long about augmented reality examples or documents which covers location based services.
For Example i have to create such type of app which gives location based marker on camera view.Whenever i move camera to the direction of latitude and longitude i need to display AR marker on that direction.some thing like it is used to navigate user to that direction.
There are many SDKs available for this like.
GoogleCore,
Vuforia,
Wikitude
But main problem of Google Core is it is not supported with all devices and i have also checked other example which needs compass sensor but which is also i dont want because compass sensor also not available in all devices
Also,I have searched in Vuforia and Wikitude but i am not getting how to display AR object with respect to latitude and longitude
There are lots off calculation available but i am not able to identify actual one to use.Please help if anyone knows about it
Thanks in advance!!!

Android markers without using Google maps

I am very new to android, and I basically have almost no experience. Recently my client got an idea where he wants to have a custom map (in .png/.jpg/.jpeg format) on which, using GPS only, will be displayed his location using a marker, and location where he is supposed to get. Those two markers have to be connected with a "path", that will be like some sort of navigation from one marker to another. One of the requests is that it must be done without any usage of Google maps. My question here is - is that even possible to be done like this?
The only idea that I got is to get coordinate from GPS, make a proportion pixels on the image to coordinates and put a marker on where the user is supposed to be. Is there a better option than this?
I think you can try out this method in the below link.
Which can turn your images into interactive map layers that can be displayed in websites, used in mobile phones, tablets, GPS devices, map mashups or opened in the desktop GIS software, Google Maps or Google Earth.
http://www.maptiler.com/

Integrating HERE sdk into android app

I started developing an app using HERE api. Basically I have to navigate from one point to another using HERE sdk offline as well as online. Also I have to be able to rotate the map according to orientation of the mobile as we navigate, while showing the remaining distance to be covered in real-time. Next, I have to integrate a compass with the HERE map so compass tells the direction in which user is moving.
Here are full working Android projects for all of your tasks using the HERE MobileSDK for Android:
Basic Map application: https://tcs.ext.here.com/sdk_examples/BasicMapSolutionGradle.zip
Positioning, Routing and turn by turn voice guidance:
https://tcs.ext.here.com/sdk_examples/TtsAndNavigation.zip
Compass and custom position marker rotating to compass north:
https://tcs.ext.here.com/sdk_examples/CustomPositionMarker.zip
What you want to achieve is possible with the Premium SDK variant of the HERE Mobile SDK as offline support is not available in the Starter SDK.
However, integrating a compass is possible using the Starter edition: You can use the CustomPositionMarker example (https://tcs.ext.here.com/sdk_examples/CustomPositionMarker.zip) with a few modifications since it was build for Premium SDK:
Remove LocalMesh, MapLocalModel, MapOverlayType since these are suitable only for 3D Vector Maps which are not available in starter edition.
Rotate the map according to current yaw like shown here. Place this code inside the onSensorChanged()-callback of Android's SensorEventListener (as shown by the example). This will rotate the map according to the sensor's azimuth.
To render a compass needle or just a map center circle use for example HERE's
MapCircle (double radius, GeoCoordinate center). Note that the constructor takes different arguments in the starter edition of the SDK.

StreetView gyroscope functionality

In the official Google Maps application when a user rotates the device, StreetView is rotated. I made a research and didn't find how to enable gyroscope functionality in Google Maps v2 API for StreetView. I can implement this by myself, but maybe there IS such functionality and I just haven't find it?
There isn't any built-in features in StreetView to enable this functionality. If you would like to do it by yourself you can check following links:
Set the camera orientation point of view
Animate the camera movements
It looks like Google recently updated their API to include accelerometer-based tracking in the street view point of view. Try this example on your phone.
From the documentation on Motion tracking on mobile devices:
On devices that support device orientation events, the API offers users the ability to change the Street View point of view based on the movement of the device. Users can look around by moving their devices. This is called motion tracking or device rotation tracking.
More information (like how to disable it) is in that link.

How to implement 3D / tilt mode in mapview?

If you check the Google Maps application for Android, there are 3 modes available to display the listview. One of the modes available in Google Maps is the tilt mode wherein the map is displayed in 3D. The map also rotates when the user changes his direction.
How can I achieve this functionality?
If you're referring to an Android MapView allowing you to do that, you currently do not have those capabilities available via the SDK.
You should use accelerometer/gyroscope to achieve that.
please check out Sensor Manager and its examples!

Categories

Resources