Adding business information to an overlay in a MapView - android

On the Google maps web interface if you zoom in enough you can see businesses that are clickable. When you click the business you get the a speach bubble with a brief description of the business.
Even on the native android Google map you can tap businesses and get a link to the business information.
My question is that within a MapView is it possible to add my own overlay that when tapped loads the business info of a pre existant business? Is it possible to associate my overlay with a business in some way. I imagine that I could do this if I duplicated the html found on the google map in some way into my overlay, but I was hoping to avoid this.

In the past I have used this. https://github.com/jgilfelt/android-mapviewballoons Not sure how to pull info though.

My question is that within a MapView is it possible to add my own overlay that when tapped loads the business info of a pre existant business?
Assuming you find a source for the data, sure.
I imagine that I could do this if I duplicated the html found on the google map in some way into my overlay, but I was hoping to avoid this.
I highly doubt that will work.
First, you must find a Web service or something that has the data you seek. Then, you need to license that data. Then, you need to figure out how you want to render that data on the map overlay. The first two of those steps are the tricky ones.

Related

OSMdroid and MBTiles: get area information

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.

Custom map for my android app

I want to create a custom map for my app.
the things i want are:
it will be a custom map designed by us for a event location(not google map).
all the locations will be displayed on the map like google markers.
just like google map i want users to select a location and get direction from his/her current location to selected destination within that area(my main concern).
Are there any possible solutions to this? Any links, suggestions to start with please let me know.
This is very imp. for me..thank you.
I suggest you look at the OpenStreetMap project. They have all the components you need but it is not going to be a simple task for an area of any size

I need help to integrate OpenStreetMap with Android

Good Morning,
Part of my question uses the word OpenStreetMap instead of osmdroid because part of what I need is a map visual reference/preference for users of my app but I need a grid reference of a map not just lat/long. I believe it was a link from SO that lead me to this: http://dhost.info/usngweb/USNG_OL.html. This is very much what I had in mind for the visual side of my app. The grid is right there. In other words part of what I need has already been created.
The author of the grid in above link uses JavaScript to create the grid of the Military Grid Reference System, which I am familiar with from IBM's tutorial - and zip j-coordconvert.
My question:
1.) In the above link there are radio buttons to switch from the type of map and also the meter zoom. Would it be good advice to use an Action Bar to allow user's to adjust these preference's? Has this also already been done?
2.) If the advice is to use an Action Bar - once user has selected a preference he/she will go to another choice with the original selection seldom changing - would I build that Action Bar up so that I have http interface with the above OpenStreetMap? If your advice was not to re-invent the wheel and use http to reference the already created grid, I would want to grab user's preference is there a code snippet to get the selected preference from http into Sqllite?
This last question my end up being the biggest part of this set off questions - getting the zoom level from http into Sqllite.
Of note:
-Will, at first only be needing one rather big city in U.S. so can cut tiles needed down
-Need rather quick solution on map side as other parts of app will take longer, so can build up my own map grid over time
-Could cut out the selecting of different map types but not grid zoom
-Using latest version of Android Studio
-Familiar with retrofit
-Referencing Busy Coder's Guide 6.6
-Would prefer to stay in Java rather than JavaScript
-Will be targeting newer phones/Android version above 3
I know this is a lot to ask but I am rather new to Android and my head is swimming with the amount of information out there (a good thing).
Thanks,
Terry
There is no "preference from map source to sqlite".
If you need to provide a TOC (that selector on top right) you need to build up your UI and do the logic for enabling/changing layers (what you see on the map).
You can use Google Maps API (v2) to have the map (just set the map type to NONE and add openstreetmap as a TileProvider, there's a lot of examples, just google it).
For the grid, a brief look at the page source code seems that the grid is created by javascript and is not a webservice that provides tiles (isn't it?). If so you have to create your logic that creates the tiles given the coordinates, this is a bit long to do, but you could look at some code online, for example Google I/O app has something with SVG files:
https://github.com/google/iosched/blob/master/android%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fsamples%2Fapps%2Fiosched%2Fui%2FSVGTileProvider.java
About preferences on enabled layers you can use SharedPreferences.

How to let Android users search for closest points of interest created by me on Google Maps?

I want to mark historical 'points of interest' across the globe on a mapping solution such as Google Maps (or something else).
I'll be getting an Android app created in which I want to be able to provide the users the ability to search for and locate the nearest such 'point of interests' around their current location.
Should I be using Google Maps or something else like OSM?
How should I be marking them on Google or elsewhere?
(a) I want to be able to mark these places with pictures as well and
(b) I want to store them at my end in a generic format as well, just in case!
How should the Android app search for the closest such points?
As I understand, Google Maps can show its own map overlaid with my data when I provide a KML file (http://code.google.com/apis/kml/documentation/kmlSearch.html). Can that be shown "within an Android app"? (ie, I know it can be shown on a webpage, but can it be shown in a native app?)
I will suggest google maps. Reason is google maps is updated often and part
of the maps from osm is not as latest.
Probably store this marking in your own datastore called point_of_interest.
The info window is also a special kind of overlay for displaying content
(usually text or images) within a popup balloon on top of a map at a given
location. read here for more information.
your android app should detect current user location and send the information
such as latitude and longitude to your server. Hence the query to search
for point of interest is done by the server and process the data and send
back to user android app. For example, the query would be something like
select * from point_of_interest where distance < 10km limit 5;
yes, read this link
Ok, for an app I built for a customer, we had a similar requirement. Basically, I needed to display the locations of interest withing 200miles of my current location. The way this worked for me was that I took my current location and made a Web Services call to their servers where they did the Geographic calculation and returned a list of results to me.
I would have the Android app just use the MapView and then user Overlays to display icons on the map. The problem with displaying the items using kml is that they will not be clickable by the user so their will be no interactivity. If you do choose to do it with kml, there is some example code located in this project: https://github.com/sunlightlabs/congress
I prefer google maps. Google maps SDK looks good and the sdk performs well. I don't know a SDK that has something like a OSMMapView that offers the same performance and features like google maps does (please correct me). But OSM can be as visual appealing as google maps. Cloudmade has tons of different styles for OSM data.
If you want to display maps by google, you have to use the Maps Library that ships with the Android SDK.
You can display any Views on top of the google maps. I.e. use mapviewballoons on github.
If you have lots of POIs that you want to display you should definitely persist you data with a spatial index. So that nearest neighbour searches are fast. One solution would be to use sqlite R*Trees. I did not use them on android and they work not out of the box you have to build sqlite-android yourself (see this question). Or use Perst, or ...
If you have few data, that fits into the phone memory you can use a Quadtree. This would be even faster than the db when searching it. You will find lots of examples when you google it. You could store the data as xml, json or even serialize the whole quadtree with the java Serializable interface.
There are tons of possibillities this question is way too broad. Some random ideas:
Create a server that responds to bounding box searches over HTTP and store the POIs in a Quadtree.
Deliver all your POIs with the app. As database, xml, json or a serialized Quadtree.
I don't have experience with kml on Android.

Using pre-defined overlays in Google map

well i was able to find loads of information on how to create my own custom overlays onto the map, but none on how can i use the ones that google already has put on.
I basically want to use all the overlays of one type (say the Hotel overlay icons) and get their geoPoints and then use them in any way i want...right now i have to manually get the geoPoint of every such hotel overlay and then use them, which is pretty painful considering google has already marked them out...but i have no idea how can i use them..
Any idea how can i do this?
Those are not available to Android SDK developers -- they are part of the proprietary Google Maps application. The only pre-built overlay available to SDK developers is MyLocationOverlay.

Categories

Resources