My app that I'm working on is mostly informational. I have a MapView setup right now to use MyLocationOverlay to track where the user is. I'm planning on having a list of coordinates for all of the buildings in the area. If a user wants to see where it is on the map, they can open up my dialog, find the building in the list, click it, and have an overlay drawn for it.
I'm not sure the correct way to go about for this. I already know how to create map overlays. Would the best approach be to have a HashMap for latitudes and one for longitudes, and then go out and grab the coordinates manually to store into those maps? By manually I mean having to find the coordinates myself and code them in by hand. If I do this, what is the best way to find them manually? I noticed by poking around in the javascript for Google Maps that there was a lat/lng value for the center of the map, but it would be a pain to do this for 100+ buildings.
Or should I be making a Google Maps query for the building and getting the coordinates for the overlay like that? I have done some searching, but have no clue what to do if this is the best way to do it. I was also thinking that I might run into some query limit by doing it this way rather than having the coordinates programmed directly into my app.
I'm not a beginner with Android or programming, but my data structures knowledge is a bit rusty. Any ideas would be greatly appreciated (maybe I'm approaching the whole thing wrong).
Related
This is the gist of my app idea:
When the user turns on the app, it calculates a position 100 ft in front of them, then overlays some kind of marker onto the camera, so that when the user looks at the position through the phone, they see the marker. Then they can walk towards the marker, which gets bigger (ie "closer") as they walk towards it.
The full idea for the app is more complicated than this, but I think that if I could create this, the rest would just be iterations.
What concepts of AR, mapping, images, Android API, hardware (and anything else I haven't thought of) does this bring to mind that I need to begin learning about? I have lots of programming experience, and some Android experience but next to no AR or vision experience.
Basically, I'm hoping you guys could give me a list of terms to Google so that I can begin forming concrete ideas of how to make this.
Isn't this a kind of 'Geo-Located" AR? To get search results matching what you are describing rather than methods that put the augmented content at a relative distance from the viewer, try searching "latitude", "longitude", "coordinates", "POI" etc., along with AR terms. I am currently looking into learning AWE.js because it offers true geo-located POIs (point(s) of interest) using coordinates.
I came across this (https://github.com/buildar/awe.js/issues/3) when trying to find for myself how to create geo-located POIs using AWE. For your purpose ("...calculates a position 100 ft in front of them, then overlays some kind of marker onto the camera...") you would need a way to leave the x and y axis as they are in the original 'geo_ar' demo (https://github.com/buildar/awe.js/tree/master/examples) - as relative to the user, not as lat/lon coordinates. However, for the user to be able to approach them, you would need to find a way to get them to initially appear as relative to the user (the default way), but then somehow be locked down. It normally wouldn't be necessary because in most apps geo-located POIs are placed near real physical places of some significance, so rather than the user having POIs appear near wherever he is, he goes to find them where they are. I don't know how locking down an initially-relative POI would be done - I am not a programmer, I just stalk programmers online. ;) Still, I hope that fills in some of your gaps to help you get started.
I believe there are games out there (though I haven't played them myself) that do this to spawn enemies like ghosts or zombies. They spawn a set distance away from you, but you have to run from them.
I am planning to build sort of a geography quiz app where you have to touch inside the borders of the searched country. So, I have to display a map (I want it to be offline) and be able to test the user click against the map in some way.
I've been searching a while now and found good OSM material from Natural Earth Data and TileMill for converting it to a MBTiles-file (sqlite-database containing all the png's and some meta-data too (using UTFGrid)).
On the Android-side, I would like to use OSMdroid for displaying the maps, mainly because it's open-source and highly maintained.
I've found some guides on how to use the MBTiles-database inside osmdroid but is there also an easy way to access the metadata or check otherwise if the user touched inside the right country area? I would like to avoid some sort of "boundary boxes"...
Any help is highly appreciated!
I'm pretty sure that bounding box calculation is best option.
Can you access metadata from the offline tile source? Yes, kind of. You can get a list of unique tile sources in the archive but that's it. There's an open issue regarding getting the bounds of a given offline archive. You can follow it here (or contribute)
https://github.com/osmdroid/osmdroid/issues/174
It's slightly complex because offline tiles are going to have a bounds per layer/source and per zoom level. There's also no guarantee that that bounds of that given zoom/layer is going to be contiguous. I.E. one zoom level can have both the US and western Europe in it.
Im on my final project in which I would like to build an android app especifically for the university context. Therefore I would like to use geolocation but for matters of detailed information (colors, shapes, buildings, etc) and gamefication I would like to draw my own map and the user should be able to see his position on this map. So I would have this drawn map and I would use the device's location service and transform the coordinates to a position on my map.
I'm kinda lost on this, didn't find much on the web. So I would apreciate if anyone could point me a direction or if anyone could tell me how hard would it be to implement. Would it be as simple as a function Point foo (double lat, double lon);?
Thanks in advance.
Drawing the whole map completely would be rather difficult and would involve loads of extra work, thus I would suggest you an alternative that would allow you to have your own drawings, on top of the already made Map.
You could for example use the groundoverlay, for items that you want to draw yourself. and then use the google maps under it to show the map, and to handle any positioning etc.
I'm trying to create an app that will tell a person what zone of a building they are in. I'm using bluetooth dongles to get an approximate location, as oppose to exact location, and show the user on a map whereabouts they are. I would like it just to highlight the zone they are in, instead of a specific location.
I can get my hands on a floor plan of the building I am using so I'm just wondering if there is an easy way to incorporate this into some kind of map with an existing API? I found a question here which states that they just use an overlay on the image to show a marker of where the person is. Would this be a bit easier?
This is for my final year project so I would like to have some sort of flashy map if possible but I'm not sure where to start looking or if it's possible.
I also found this question which gives a great variety of apps that implement and indoor map, but I don't think I can just take this small piece of functionality that I need out of them as they seem to be complete apps.
Any information would be a great help. Anyone with experience in this sort of thing please share your knowledge :)
It doesn't sound like it'd be too complicated to just write your own custom view for this. Draw the map image to the canvas. Then for the zone the user is in, draw another 'highlight' graphic on top of the map that you just drew.
If you're not sure how to do this, there's a rather basic guide on how to create your own drawable widgets which should point you in the right direction. There are plenty of examples on drawing images to the canvas, eg this one.
Can we use our own map(Like our house map) and then use GPS to show where we are in the map?
If it is possible then how to do it?
You can do anything you want, but if you are asking if there is an easy way to do this, no.
You would have to produce a scale drawing, then map the pixel space to the scale of the image, know what geopoints represented the corners of your map, then project that onto your scaled display image.
Some open source products use tiled images similar to google maps, but they use OSM data, I suppose if you were dedicated you could use that and turn your map into tiles but I would think for your purposes it would be easier to do this your self.
You might check the google code repository etc. and other open source venues and see if anyone has done anything similar to this.
Also the best accuracy you are going to get is about 2m, and certainly not indoors (if you got a signal at all)