How to add a polyline to google map in android above street/area name?
I think this is not possible in an easy way due to how google maps API handles the "background".
If you set the background to normal or hybrid, the map is drawn as a background either in road view like your screenshot or in satellite view if hybrid is selected.
Then all the users features are drawn (and eventually overlays, lines, poligons, then points and lastly, street names. You can't really change this, but you could do a trick:
- Use just the satellite view (so no roads will be added).
- Remove the google background and add an alternative one (there are different services like Open Street Map, Mapnik ecc that allows it).
Following the second choice could also allow to add googlemaps background from web api, but I really don't advice to do it, since you are downloading tiles in a non standard way for google.
Related
I want to develop the above picture in android, which is already implemented in iOS.
I know how to add circle on google map. but as shown in picture the color should be filled on map not on the circle, circle must be fully transparent.
you can achieve what you want by using the google MapView (instead of a Map fragment) and adding another image on top of this map view.
having said that, do note that what you want is against the google maps usage terms and services.
(https://developers.google.com/maps/terms)
8.4 b. Restrictions. In using Google Brand Features, you will not:
viii remove, distort, or alter any element of a Google Brand Feature (including squeezing, stretching, inverting, or discoloring).
8.5 Proprietary Rights Notices. You will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices, Terms of Use links, or Brand Features) displayed or provided through the Service. Where such notices are not displayed or provided within the Service, you must display such notices according to the Maps APIs Documentation.
I have a good solution for your problem.
You can use an image which has a transparent circular area in the middle. Overlay the image on the map by using Relative Layout or FrameLayout.
That overlay will result in the map showing only in the middle circle.
A few years ago we wanted to add a custom map over Google Maps (like the World looks like Midearth), but back then it was not possible. Now, I can see multiple apps that have their own overlay over Google Maps.
I tried creating my own map via Google Maps using their suggestions, but this was only for pins and routes.
What I need is to have the real cities on the map (like Rome, London, Paris), but with my own custom graphics for everything (map tiles, pins, etc.).
What document shall I read for this? I am sure I missed something on Google Maps.
Yes! It is possible with Google Map V2. You should consider using TileOverlay.
Essentially, every time GoogleMap wants to draw tile for specific coordinate - it asks you to provide this tile. You can use either static tile (see TileProvider) or you can provide URL, so GoogleMap goes to your web server and downloads this tile automatically (see UrlTileProvider)
I think what you want is GroundOverlay which can be any bitmap image that will be displayed on top of the basemap. You can even control the translucency of your map.
You most likely want to have your map image oriented north up and be scaled according to Mercator projection if the scale of your map is large enough to include Rome, London, and Paris. But if your map covers a smaller area, you don't need to worry about Mercator projection.
I would like to develop an android application using Google Maps API v.2 is it possible to remove the default markers placed by Google such as bus markers.
Sorry for the basic question but this is my first time developing an android application.
is it possible to remove the default markers placed by Google such as bus markers.
There are no default markers. Whatever "markers" you are seeing are part of the map tiles, and cannot be removed.
What is your aim ? You dont use them, you dont need them to remove!!! In maps you have to show a POI like as a marker. Otherwise it does not make a sense.
You can replace the icon with a transparent drawable... :)
Is there any way to implement falling pins/markers animation for google maps in android like that in iPhone ???
Android has overlay markers (see ItemizedOverlay) that make it easy to add images to maps, BUT note that, in my experience at least, animated images do not work when added to overlays.
I found it necessary to add a View on top of the MapView, and add imagery to that, and I've successfully added animated drawable images to the map using that approach. For more details see here:
Can I use AnimationDrawable in an overlay on a MapView?
But to be honest, you should remember that it's Android, and copying every little feature from iOS is unnecessary. Google Maps on Android doesn't use a pin marker, it uses a static blue spot - I'd say it's best to replicate that and remember your users are Android users, not iOS users - they want consistency across Android apps.
You could have a look in this docmentation: https://developers.google.com/maps/documentation/javascript/overlays
Here is an example map.
Just add this in your code:
marker.setAnimation(google.maps.Animation.DROP);
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.