I am creating my first android app and I have a Google map using the MapFragment and now I need to extract an image of the map so I can place that in a ListView.
I have both a full screen Google map in one activity and a smaller Google map that fills about half a screen on another, taking a bitmap for any of them would be fine, preferably extracting a bitmap from the smaller one.
Please without this my app is pretty much useless. I heard that it is possible in Google maps APIv1 by using getRootView(), is there anything that I can do to get a bitmap or a static map in APIv2.
Follow this link
public final void snapshot (GoogleMap.SnapshotReadyCallback callback)
Takes a snapshot of the map. You can use snapshots within your application when an interactive map would be difficult, or impossible,
to use. For example, images produced with the snapshot() method can be
used to display a thumbnail of the map in your app, or a snapshot in
the notification center.
AFAIK as of now you cannot take a screenshot of the map. The reason is that the Google map v2 for android is based of an extended class of GLSurfaceView(and so is protected by Pro-guard). Because of this the usual method of taking screenshot is not supported.
There is an enhancement request open on Google bug list for this and hope this will be added as a feature soon.
For now, I would suggest to move down to API v1(if you can, because Google has also stopped giving out API v1 keys).
Related
In my app I added the map of Google Maps and you can navigate within a given area (which can not be done through maps as it is not drawn). Now I would like to customize the map and add image overlays to the buildings so as to better target people. Let me explain with an example:
In the picture is the image of the building that I customized.
Now I want place the image over the google map. I saw that there GroundOverlay but I can not place it properly.
Does anyone have any tips?
I would recommend using Polygon Shapes instead of Images. Working with Images like you intend to do, would probably be very hard later on.
You might want to look at:
https://developers.google.com/maps/documentation/android-api/shapes
I need to implement a map for a shopping mall in my app. This map needs to have a way to visually mark the fastest path to go from one place to another.
I currently have two options in mind. I could use the Google Maps API, overlay the shopping mall's picture and try to use some algorithm to mark the best route. Or, I could just place the picture and manually make an algorithm to mark the path (probably Dijkstra).
Yet, it's my first time working with Android, and I don't really know which one could work the best, and which libraries I could use.
I'd appreciate any tip or suggestion.
Google map has an android api that you can directly embed google maps into your application. You can also draw overlays using its api. Take a look at
google map android api
Im using the latest Google Map API. What I would like to do is that I have an image of plan of a building. I would like to put this on the correct location and display this image instead of the normal map. It would kinda be like if you zoom in alot on a train station and you get more details.
Is there any way to do this?
There is an example with the official Google Maps for Android API sample code (installation how-to) called GroundOverlayDemoActivity.java.
You could try this and check if it is a starting point for further investigations.
Here is a screenshot of this activity:
I am working on making a interactive campus map. I am wanting to take an image (below) and overlay it onto Google maps and then add interactive points of interests. I am not seeing how to add or merge the image to the map. Can this be done? Are there any examples out there I missed?
If you want to replace the google map background.
From my experience, I could say no. It can't be done
But if you want to make it like transparent you can put Your map on top of google map and just set transparent.
However, somebody already been done this before. you might got some idea if you see this
http://www.maplib.net/
http://lifehacker.com/213627/embed-any-image-into-a-google-map
Google Maps Developer Documentation
I am using android 2.9 or something for my project.
Now the project is an image button on the main activity and when a user clicks on it, the user will see a google static map.
Problem is, each tutorial I have seen until now uses GOOGLE MAP API in the project, which I think is not possible for me, as am using android 2.9, not Google APIs,
and I don't know how to add as it just gives option for one only.
So is it possible to show just a static map without using google maps in ones application?
thanks a lot.
yes thats quite possible but in that case you will only get a static image without zoom in/out options... u can also add markers on it...
just send a Http request with/without your markers to http://code.google.com/apis/maps/documentation/staticmaps/
save the reply in a file and that would be the map.
I'm not sure I understand your question completely - but Google Static Maps API is simply a web-service.
Ie - you hit a URL, where the parameters describe what map you are after and you are returned (by HTTP) an image of the map rendered for use in your application.
Check out the Static Maps documentation. There are plenty of examples. You'll see you don't need to use any API in your project at all, you just need to construct a URL that describes the map you would like and catch the response!
Edit:
Here is a simple example of a URL your app could generate:
http://maps.google.com/maps/api/staticmap?center=London,%20England&zoom=14&size=512x512&maptype=roadmap&sensor=false
URL parameters pass in values to the web service to describe the map you would like to generate.
The URL above generates a map centered on London, England. The zoom level is set to 14 (higher numbers = a closer zoom), and the map is 512x512 pixels. If you look in the static Maps API documentation, you'll see there are many many other options you can pass into the service place markers and annotations on the map.
I hope this helps!
N