I'm working on a project, which is basically to track a person in real-time via GPS. His position has to be updated at all times on Google maps (or any other). Here is how it looks like:
We are already set to receive the co-ordinates of the person (via GPS).
We want the maps available offline. (We're receiving GPS co-ordinates (X,Y) through a wire so lack of internet won't be a problem in that aspect).
Then we code in Java, such that the map is visible to us and the position of the person is marked by a dot (or circle).
My questions are:
Is it possible to download the Google maps (or any other) and then work on them to achieve what I've mentioned?
I'll be making the framework in swing. But for the dot-action, which other components will be required?
How will be the co-ordinates that I receive from GPS, interpreted on the maps? I mean in code I'll have to tell the program where to draw the dot, right? As of now I'm thinking, I'll program the position of the dot, such that (co-ordinates received from GPS = co-ordinates on google maps). But I've a feeling it won't be as simple. So please guide how can this be achieved.
From my research, no. It is not possible. The only 'offline' features is offline map caching INSIDE the Google Maps App for iOS and Android. If you're on Windows, you may want to try these applications that claim they can grab the maps. I'm on OSX, so I can't test them.
Since you'll have the offline map (a folder with an HTML), in Swing you will simply create a Browser component (it exists in SWT, don't know if they are in Swing too). The browser should have APIs like setUrl or/and setHtml. You will extract the HTML from the maps, draw the dots directly in the HTML code (with JavaScript), then include the resulting HTML in the Swing browser.
This is the easiest part. You can draw on the map with JavaScript (with GoogleMarker components - google it). When you instantiate those markers, you pass a latitude and a longitude from your GPS. Then the map will know where to draw them.
Related
I would like to create a circular route from distance. First, I get current position, and then create a circular route based on the specified distance. But I don't know how to achieve this at all. I couldn't find any helpful methods in Google Maps API.
Is there any way to achieve this?
It sounds like you want to draw a Circle on a map, and based on your tags you might want to use the Maps SDK for Android. Here's the documentation for creating Circles on a Google Map for Android. https://developers.google.com/maps/documentation/android-sdk/shapes
If you want a polygon of exact points on roads based on distance from a center point, you might be looking for an Isodistance. Here is some open source code in JavaScript for building an isodistance polygon. You would use the same strategy in Java to do this in the Maps SDK for Android. https://github.com/dugwood/isochrone-isodistance-with-google-maps
I've done a bit of searching and I don't think this has been asked yet (if it has, then I have been searching with the wrong terminology)
I'm trying to find out how to record touch gestures/actions done on Android touchscreen (with respect to time), then use the path of that gesture as the path for a graphic to follow (using android's tweening capabilities)
I'm also looking to be able to save the animation so that it can be loaded later on or exported as a file.
My thoughts around this are to take the point of touch's (x,y) coordinates and save the pair across a set interval of time. Then the coordinates can be loaded from the file later on for an ImageView (or some other view) to be tweened across the device.
Plus, I figure a method like this could make it cross-compatible on screens of different sizes if I saved the coordinates as percents instead of actual values, they can then be loaded depending on the screen size of the device
My questions are: Am I on the right track? Or would this be an inefficient way of doing it?
If this is the right idea, what is the best way of recording the positions and then using the tweening capabilities to animate the object (or is there a better method than tweening to provide a smooth animation)?
And if not, what would be the suggested solution to my problem?
All answers appreciated!
Bitwize
There is a tool to record gestures in the devloper application examples. You can find on the emulator : GestureBuilder.
Here is a tutorial about gestures.
Though, gestures have been provided to be recognized as gestures not like an animation path. But I believe you can extract data from gestures and get the "path" of given single touch gesture. Here is the main class to represent a gesture.
It has a toPath() method that could be useful to you.
I am writing an android application that needs to display street data only, stuff like max-speed etc. For this reason I want to extract all street data within a bounding box that I pass to the API of OSM.
Right now I get a rather large file that includes all the information that is stored in OSM. Is there a way to only query street data?
According to the API documentation, the only parameters for bounding box are the left, bottom, right, and top. There appears to be no other way to retrieve regions of the map. You could get nodes individually by ID, but I think that will be tremendously useless.
You could implement your own webservice that hits the OSM api and strips it down, then hit your own webservice from your app. Extra work, but takes load off your mobile client.
http://wiki.openstreetmap.org/wiki/API_v0.6
I am using eclipse with the adk android plugin and I am completely lost
That would depend on what do you mean by displaying their location:
Relative to each other on a blank screen.
Read up on distance calculation in coordinates and draw the locations relative to their distance from each other.
On a map, each one separately from the other or together.
Use a web/binary API for map display like Google Maps (don't want to spam and post links with my reputation), or write your app to display Open map data from sources like OpenStreetMap.
On a satellite/aerial images.
Pretty much the same as #3 just you have less options to investigate and try.
If you were a bit clearer in your question, I could have been more specific with the answers, if you edit your question and clarify more, I could be more specific.
I need to solve a simple problem regarding Showing Map on Swing based application in java.
I am having list of latitudes and longitudes (GPS Tracks) , I need to draw some routes using these routes and probably want to draw maps like GoogleMaps.
Is it possible to draw Google Maps using GPS info (latitude, longitude) via OpenMapStreet API. Based on different user selection over JFrame control (e.g Row containing Route Info) one of specific area (panel) a map should be drawn (probably a Google Map).
I read the OpenMapStreet API. But I don't found a concrete example drawing the map over the Swing application using given latitudes/longitudes (GPS Info).
Any idea (probably some code sample) I would be obliged and thankful.
Edit:
Let say I have the following longitudes/latitudes info.
Longitudes Latitudes
2546789.510 ,7894125.10 ( Linhaeim)
1547897.111 ,4569872.10 ..
2546789.510 ,2365478.79 ..
2314561.510 ,7894125.11
5467891.510 ,7894125.22
4578933.510 ,2647835.33
6547891.510 ,2254776.44
3211457.510 ,7899901.37
6987888.510 ,2010009.78
3654789.510 ,9876510.61
5547890.510 ,3145678.39
1789000.510 ,4698333.58
2778900.510 ,3254788.97
7455555.510 ,3378945.27 ( XYZ )
Moreover some StopNames of Journey also associates with these gps coordinates ( like Linhaeim, Im Saal, KreiserStr, ABC,XYZ, ........)
I have above data stored inside databases with some other additional information ( e.g JourneyId,JourneyStartTime,JourneyEndTime.....). So, I need the map like which shows above coordinates as route connecting these coordinates.
If GoogleMap API works for this , then it would too be acceptable for me. Usage of Google Maps API for this context , Please point me small tutorial even to look for for incarporating above map problem.
If still not clear, I would happy to edit it again :-)