How do I add markers to streets only - Android Development - android

After plenty of searching, I haven't yet found a solution that works for me and I'm really hoping someone here could help me. First I'll explain my problem, and then I'll mention some of the approaches I've attempted/considered so far.
Basically, I'm developing an Android app where markers randomly appear around the user's location. The catch is, the markers need to be placed on streets only.
I've been working with Google Maps Android API V2 but I'm trying to work around using anything with "limitations" such as 'geocoding'.
I've considered using different map API's such as Nutiteq but I've had some trouble implementing them. It would be nice to stick to Google since I've become familiar with it but I'm willing to try any suggestions you may have.
I have even considered loading up Google Maps API V3 in an html file so that I can use GDirections to load a path from one point to itself and then parse this data to Google Maps Android API V2 using JS but turns out GDirections has a limit as well.
Anyone have any idea how I can go about doing this? Even if the solution is hacky, it's still something.
I'm fairly new to Android Development.

Funny what you want to achieve. You don't need to load API V3 html. You can use directions api directly: http://maps.googleapis.com/maps/api/directions/json?origin=51,19&destination=51,19&sensor=false
It still has limitations, but is was like 2000 or something a day a device. And you don't want to put more than 2000 markers on single user's screen, do you?
This is easy to parse, for example with Gson.

Related

SnapRoads - how to?

I've implemented a Google Location Api on my app to track my routes. I record my coordinates in a sqlite Db and then save these coordinates as a GPX file to see on map parsing and build via polylines.
There are a lot of points.
I see that unfortunately the position not seems follows the road even if I drive/walk in the middle of it.
Searching with google I've founded SnapToRoads as part of Google map API but, unfortunately not for Android, even if it seems that is possible to implements (but I don't know in which manner).
I wonder if someone knows how to solve this problem or some workarounds
At the end, I implemented SnapToRoad API to solve this problem, even if I have to use my key on source code (if I don't want implement a web site with Javascript)

MapBox Find terrain class by coordinates in Android

I spent several hours looking for simple solution and still haven't found one.
MapBox style editor uses this simple feature. That you can hover and click over map, and it shows small popup stating all terrain classes you enabled in your map.
Question, how to do it in Android version of MapBox given I have installed my style. Now I want click on any place in the map and get the same popup stating, for example, that this is building, woods, background here. Or other place would satte, that this is major road.
This IS doable as MapBox studio itself shows. i can't believe it uses some API not available for anyone, as this is one API no map provider gives, while still able correctly draw terrain. What so complex to add this API?
And NO I am not interested in address. I am interested exactly on terrain, for simple task - distinguiosh water from non-water, road from non-road, building, from non-building, don't care where it is by address, so reverse geolocation does not work. Or simpler - I need SIMPLER geolocation, than address.
Your questions kind of confusing but I'll try and help. If I'm reading correctly, you are trying to create an Android app that uses an API similar to Mapbox Studio that allows the user to select/distinguish the difference between objects on the map such as buildings, water, forest, etc.
If this is the case, then first you must understand that Mapbox Studio is using OpenStreetMap data to distinguish between objects. These objects are stored in a database with tags. It's tough to explain so i'll just leave a brief reading wiki page that might help.
To my knowledge, there isn't any API's specific to Android that will give you the kind of information you're looking for. However, if I was in your dilemma I'd take a look at the Overpass API as it's a complex query tool that allows you to send coordinates to it and it will return all the tags (such as building or water) at that location within a JSON object. From there you can parse and use the data in your app. It is very powerful so I suggest reading up on how to use it and test using a website called Overpass Turbo, that's if you decide to use it.
Nevertheless, I hope this helps and I understood your question correctly.

Offline map (.obf file) in android?

I want to include a MapView in my Application. I have been playing around with the Google Api a bit and it worked quite well.
But now I want to have a map completely offline. I know there are a lot of possibilities to do this.
The problem is that I have maps with .obf extension not zip. It should be possible to zoom in and out and to set markers at specific locations.
I know that there are things like Osmdroid. But I can't find any tutorial to load .obf file.
Thank you in advance.
I suggest you to have a look at OsmAnd.
It works with .obf format and provides you offline navigation.
OsmAnd

Implementing Google Places API with updated Google maps v2

Over the past few days, I am trying to find a step - by - step tutorial to implement google places with the updated version of google maps (in eclipse for Android) with no success.
In the old tutorials I find , the map doesn't appear, because it is not updated in the v2.
Can anyone suggest a way to proceed? I feel lost with all the scattered information I get, and I don't have the experience to change the old examples by myself.
I want to make a simple app, that finds my current location and displays the cafes and restaurants, within 3Km distance. At this point I have tha map showing my location, and I need a tutorial to guide me into implementing Google Places from scratch.
Please help!
I'm actually making an app quite similar to yours! I haven't updated to v2 yet but from what I can tell, the only major difference in implementation is the use of a MapFragment as opposed to a MapActivity.
So you have the map up, yes? Then you should be able to make calls to Google Places the same way you did with the v1 Maps (since they're separate components and don't depend on each other). If Places is what's giving you trouble, I suggest following this tutorial: http://ddewaele.blogspot.com/2011/05/introducing-google-places-api.html. It's pretty good and only needs a couple of tweaks to get things up and running.
If you're still having trouble, post back and I might be able to help you out with some code.
i found this post helpful,i hope you will find it too,
http://mobile.tutsplus.com/tutorials/android/android-sdk-working-with-google-maps-map-setup/

Totally confused attempting to integrate a map...Best way forwards?

I have been looking to implement a map in my website, and have really hit a brick wall - Have read so much, but am very confused. I just wonder if someone could offer a little help?
I have developed an Android App which generates a list of lat/long pairs and stores them in a remote MySQL DB. All I want to do is mark these points on a map, with a little pop up when clicked, indicating some other information about the user.
I have so far looked at Google Maps API and OpenStreetMap, although I really don't know where to begin! I don't know whether I should use Google Maps, as I'm concerned about the API query limit? Should I be?
Would really appreciate it if someone could point me in the right direction!
Thank you
Showing some markers and popups isn't really complicated with OpenStreetMap and OpenLayers:
simple OpenLayers marker example
dynamic markers from a database (example result)
Use google maps javascript v3 and make the required changes
Please refer
https://developers.google.com/maps/documentation/javascript/
The Google Maps API limit is something like 25k (or was it 250k?) per day - so unless the app you're making proves to be really popular, you won't have to worry about it

Categories

Resources