Google Map on Android in a Tab - android

I am trying to make an application in which there are few tabs & one of the tab contains map.
Till now I was able to create the tabs and map on one of the tab. So when I click on the 1st tab I can see the map which shows a default city (Las Vegas).
My question is if now I want to create the same menu items (Search, Directions, Places etc.) which already exists in the default Google Map application in the emulator, Do I need to write the logic for all those menu items?
Its like I want the whole google map application in one of my tab. Is it possible?
I have created the map with zoom-in / zoom-out functionality. Now I want to add the search feature which will search for the place and locate it on the map. So do I need to write the whole code and ui for it? I am feeling like its re-inventing the wheel.

yes, you have to write the logic for all those menu items... the google maps api gives you all the tools to make it, like the map itself, overlays, items, itemized overlays, geocoding, etc. But the higher level functionalitys must be writed by you, using the tools mentioned above.

Related

what are those tiny images in google map and is it possible to add your own?

I was working on the small project using google map and I am not able to get the details of the images, meaning what type of images are those (SVG, png or jpg), and is it possible to add your own custom image.if yes how to do it, please follow the attached image.
Those small icons are google registered places, It can be of various categories, You can't add your image ,it will be based on categories.
follow these step to add a google place.
Before you add a place, check if it exists on the map. If not, follow the steps below:
Open Map Maker.
In the top left, click Add New.
Select Add a Place.
Select the Satellite view and zoom in to the appropriate location.
Drop the marker on top of the building where your place exists.
From the drop-down menu, select a category.
You can also search for a category.
Enter the name of the place.
To add multiple names, click Add more names.
To add more details, click Continue. To discard your edit, click Cancel.
Click Save.
Sources:https://support.google.com/mapmaker/answer/1096044?hl=en
Use Google Place API for adding google place though your app..
Source : https://developers.google.com/places/web-service/add-place

How can we implement Google Map in AutoScrollViewPager?

I don't have much experience in Android and I am facing an issue related to Google map and AutoScrollViewPager. My requirement is like I want to display some screens and each screen has different data and different location on map.
All screens are swipable and swipes automatically too, so I used AutoScrollViewPager for this. In AutoScrollViewPager, I used AutoScrollViewPagerAdapter to add data on screens. Now I want different map on each screen which shows different locations for different screen.
I used SupportMapFragment, MapView for this but both does not allow me create different maps for each screen in adapter. Also Adapter does not have any method related to lifecycle of fragment or activity.
I don't think you would be needing fully functional maps in the ViewPaper. If you are just looking to show the location on the map, you can simply use images for that. Use the Google Static Maps API to get the images for the locations and show them in the ViewPager.

How to keep multiple marker bubble info open (shown) (HERE Android SDK)

I'm using HERE Android SDK and I can't seem to make multiple bubble info open. When I click on another marker and show the bubble info, the previous one is closed/hidden. I'd like to keep all the bubble info open if possible or manually close them.
Is there a setting for this or any workaround?
The built-in infobubble is designed to only show one marker at a time. If you want a custom solution you need to build them on your own, easiest with using the MapOverlay that enables your to put android views on fixed positions on the map:
https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics_api_nlp_hybrid_plus/com-here-android-mpa-mapping-mapoverlay.html

Android Interactive Map With Custom Image

I'm trying to make an android application that has an interactive map.
Then when the app is run and the user selects the map option it will enable location services to show the user where they are on the custom map- and notify them if they are outside of the bounds predetermined.
If they are within the predetermined bounds, I want to show their location on the map while the map is being viewed.
I'd also eventually like to add "areas" to the map that allows a button press or interaction. Example: a "button press" that would allow text to display.
I'm just looking to see if there a either a solution built into to the google map API already, or if there is another open-source solution that has already been made.
For your so called "areas" you can use markers that are clickable and can add listener to them to perform custom click (open new Fragment/Activity or show some info image text etc.). This is good place to start :
https://developers.google.com/maps/documentation/android-api/marker
For predetermined bounds you will need a projection that translate between screen location(coordinates) to geographic coordinates and vice versa.
Nice info for projection can be found here :
https://developers.google.com/android/reference/com/google/android/gms/maps/Projection
You checkout this example on github created by me Link to github

MapPolaris and showing point bubble using button maps

I'm using Polaris map library in my android app.
https://github.com/cyrilmottier/Polaris
I've Google Map with some geo points. I'm reading them from database. I've added two buttons on the map activity - "next" and "previous" to navigate between points.
mc.animateTo(geopoints.get(arrayID));
"arrayID" is the id of the next geo point and "mc" is map controller.
It works great but I want to add one more feature.
I want annotation to be visible by default while moving between points. After click on the "next" button I want to be moved to the next point on my map and it's annotation should be visible (not only after clicking on it).
Probably there is an easy way to do it.
I should probably do something with calloutView but I can't figure it out how to do that.
I made something like this. But it's not working properly.
MapCalloutView calloutView;
calloutView = new MapCalloutView(getApplicationContext());
calloutView.setDisclosureEnabled(true);
calloutView.setClickable(true); calloutView.setLeftAccessoryView(getLayoutInflater().inflate(R.layout.accessory, calloutView, false));
calloutView.show(mMapView, geopoints.get(arrayID), false);
calloutView.setData(annotations.get(arrayID));
It is showing me bubble but it creates new calloutView which is wrong I think. For example Polaris listeners are not working. I can't deselect callout etc...
My mistake! It was so easy...
I don't need to play with MapcalloutView in Polaris.
mMapView.setSelectedAnnotation(arrayID);

Categories

Resources