Adding a custom Google map in Android development - android

Hey I am trying to find a way to create a golf cart map for android devices using the Google API's and Google Maps. I have an API key from google and did the basic tutorial already. I create a custom Google map that I want to implement in the application (all i really had to do was turn the bicycle map on). So what I am trying to do is program my custom map into an android application so people can use it as a GPS while driving on Golf Carts. I would greatly appreciate any advice to get me started because I haven't been able to find out how to do this in the Google API reference.

You will have to create your own extended version of MapView. override the onDraw method when you extend and apply your logic.
http://developer.android.com/guide/topics/ui/custom-components.html :documentation link which can help you creating a custom control.

I would suggest extending the MapActivity class and use Overlays to draw any additional 'Golf' features you want to add e.g. the location of the user. As they move about in the golf cart you could keep their position static, with respect to the screen e.g. keep them centered, and scroll the map in whatever direction they are travelling. An additional aspect to keeping them centred is to also keep the map with North pointing upwards, and provide some additional directional feedback to the user such as an arrow showing their direction of travel e.g. if the user was travelling east, an icon showing their location would be in the center of the screen with an arrow pointing east, with the map scrolling from right to left.

Related

Make android google maps polyline appear above street names?

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.

Indoor Maps for IOS/android

I want to create indoor map for a mall. I am using Beacons for getting positions and navigating for shortest paths. I dont need gps or any other wifi. What i need is:
I need to know how to create maps which can zoom in and zoom out like google maps.
I want to draw paths dyanamically when the user searches for it, so i need to keep in mind this functionality while creating maps.
Any body helps, Thanks in advance.
[Note: I studied google maps , but i cant use google map indoor functionality for some reasons. I also dont want to use any API which needs to be subscribed]
I want to create indoor map for a mall.
For creating an indoor map for any specific place (your example: mall store), you can draw your map and include it as a background image. Then using beacons you have to calculate your distance from them and draw your path based on x and y coordinates.
I need to know how to create maps which can zoom in and zoom out like google maps.
You can implement zoom on pinch on your image (map image)
I want to draw paths dyanamically when the user searches for it, so i need to keep in mind this functionality while creating maps.
As i mentioned above, you have to draw your path based on x and y coordinates. You can suppose that image's top-left corner is the intial coordinate(0,0) and assign that to x=0, y=0. While you are moving, you make a calculation based on those coordinates and update UI
One alternative to Google's tools for drawing and rendering maps (indoor or otherwise) would be Mapbox, who just recently updated their mobile SDK offering. https://www.mapbox.com/developers/

Questions about Citymaps on Android Studio

At today's development, I have some new questions and as follows:
1、When I open GPS service,call the method mapView.startUpdatingLocation(),it is locating the current position very well,but if I close the GPS and does not set the default position,is it can locating automatic by network and show an blue arrow in the map?
2、I create a class which implements LocationSource interface and then call
mapView.setLoactionSource and set the locate way is network,but when I open the application to load the map,I found the position is United States. It does not locate the current position where I am. is that right?
3、Sometimes,loading the map too slowly to loading the data timely, are there offline map to use?
4、In your office website,there some introduce for the region layer like this:
After zooming out a certain amount, the Business Layer will disappear and the Region Layer will appear. The Region Layer displays a set of hand-picked cities and towns, with a custom image for each place. Tapping one of the pins will zoom you into that place, giving you an overview of the area.
What is mean "the business layer will disappear and the region layer will appear"?I did't find the phenomenon.
I am a developer on the Citymaps SDK, I will do my best to answer your questions.
1) If you use the default location source built into the SDK, it will never find your location with GPS off.
2) If you implement LocationSource yourself, it is up to you to determine the user's location and tell the LocationChangeListener when the position has changed. Have a look here at the default implementation of LocationSource for more details: https://bitbucket.org/citymaps/citymaps-android-map-library/src/5a8bafc9638a99c122ba671683299185f9796a48/src/com/citymaps/citymapsengine/CitymapsLocationSource.java?at=master
3) We do not currently have offline maps, but it is a feature we are working on. It should be released within the next month or so.
4) If you look at the Citymaps application in the Play Store, or the SDK sample, you will see what this means if you zoom the map in and out. It is difficult to explain further than what was stated above, so you should check out these two examples and see for yourself.

Make my own "Google Maps" using device location

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.

How do i implement falling pins animation for markers in android map view

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);

Categories

Resources