Pinch Zoom out in Google Maps in Android? - android

I am developing an application in Android in which I'm using google map using the Javascript V3 library with Phonegap. It works fine for me until I noticed that map is zooming in on touch event but couldn't able to zoom out when I tried for number of times.
I'll appreciate if someone suggest me how I can get the pinch zoom in and out without using the default zoom controls of Google Maps?

Unfortunately there is no built-in function for this (not yet anyway), so in order to make it work you will have to create your own custom control for this action. This means capturing the touch event and zooming according to the gesture.
To go into a little more details on this, have a control over the map canvas, and in it capture the touch events.
Your second option since you are building for Android native is to use google maps from android (however this is java not javascript). You can find a basic tutorial on this here: http://mobiforge.com/developing/story/using-google-maps-android
Hope this helps,
Vlad

Related

Add 3D object to map and pan around it

I am trying to make a Pokemon GO clone (educational work) and I know there are several possible ways to style the Google Maps using layout tricks or MapBox. My biggest challenge is to add a 3d object/model to the map and using gestures to zoom and pan around my character.
Somehow the camera should be fixed to the object (marker?) and panning/zooming should be disabled on the map but the gestures should rotate the camera around the character. I was wondering if someone can shoot me in the right direction on how to implement such feature using the native Android SDK and Google Maps/MapBox
Since Pokemon GO is not using Google Maps, I am wondering how they implemented their own map stuff, but this is outside the scope of this question.
(I am not looking for a paid solution such as here.com or nutiteq )
Mapbox Android SDK doesn't currently support 3D object, In this use case, i'd recommend using Mapbox alongside Unity instead which is made for these purposes. Here's a great blog post showing off how to do this.

Circle menu for mapview Marker in Android google maps API V2

I'm looking to create a circle menu for markers in my app that uses Google maps.
I've found this online example of what I am trying to do:http://demo-ee.com/index.php/examples/view/circle-menu-for-marker-with-mx-google-maps-for-expressionengine#
The problem is that this is for google maps in a webview, I'm looking to do this on Android.
Does anyone know if this is possible to achieve with google maps for Android and if it is, how much work would be involved to do it?
Is it possible to rebuild this example code in java to use in an Android app?
thanks
I put this as an answer and not as a comment, but I don't think you can achieve the same.
First of all, on android you don't have the "hover" callback for maps, you can only use the onMarkerClick listener.
You could try to build a custom infowindow (there are a few tutorial online but never followed, so I can't give you a trusted one, you have to try :( ) and check if the iw can be placed around your item. Unfortunately on android there is a limited set of functionalities, but to be honest, I would explore a different UX for that (cards, dialogfragment or other).
Check how google maps behaves when clicking on a place (a view scrollable from bottom with details).
You can also think about using a toolbar/expandingtoolbar

Simultaneous pan and zoom with Android MapView

Is it possible to handle simultaneous zoom and pan events using a MapView?
The Google Maps app for Android allows the map to be panned while a pinch-to-zoom gesture is already underway. This is helpful for making fine adjustments while you zoom in on a region of the map. The default MapView does not seem to support this.
I am prepared to implement this functionality myself, but I would prefer to use the built-in mechanisms.
I solved this problem using an Overlay. By overriding the overlay's onTouchEvent() and detecting when zoom and pan events happen, those events can be handled in parallel.
For anyone facing this problem, I have posted a sample project based on my solution.
EDIT:
The new Google Maps v2 library supports simultaneous zoom and pan. Unless there is a need to customize the event handling algorithm, I strongly recommend upgrading to the new library.

Any way to change the Map used by Google Maps API in Android?

I'm trying to make an Android application that will display a map of a local area only (a big building and surroundings), and I want to know if it's possible to take the Google Maps API and modify the map it's using to be the map I made myself.
If this cannot be done, I will ask my question in a broader sense: How can I create an interactive map app for Android that will use an image made by myself?
I want to know if it's possible to take the Google Maps API and modify the map it's using to be the map I made myself.
Not through the Google Maps add-on for Android.
How can I create an interactive map app for Android that will use an image made by myself?
The same way you implement 2D games: draw it yourself, probably using the Canvas 2D API.
It is possible that there is a third-party library for handling this. For example, you might peek at the OSMDroid code, as that is open source and handles map tiles coming from OpenStreetMap. In theory, one should be able to create a general purpose "map" widget with pluggable tile sources, where the widget handles pan, zoom, etc.
I note that you have the app-inventor tag on this question -- App Inventor is going to be incapable of doing this any time soon.

android pinch-zoom in Google Maps

Is pinch zoom functionality in Google map is possible, i have made several search but didn't get any solution, please give your view.
Or need to write the api for implementing these functionality.
Are you using ScaleGestureDetector to achieve Pinch and Zoom?
http://developer.android.com/reference/android/view/ScaleGestureDetector.html
Refer to this blog post on how to leverage multi touch in Android
http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html

Categories

Resources