android-maps

Google Maps Android - set too many markers

不羁的心 提交于 2019-12-11 18:56:53
问题 My question is, What is the best way to set to many markers on google maps on android program? I have a sqlite database with longitude and latitude for every markers. For example add all markers 1km around the current location Get the range of longitude and latitude on moving map and display markers between that range How can i get the range of longitude and latitude? 回答1: Based on the comments from above you will need to do the following: 1) Use the Google Api maps reference for Android to

How to pass several variables of different types from one function to another on android?

我是研究僧i 提交于 2019-12-11 15:27:41
问题 I have getFilmsBrowse function and it should return the following field: name (String) description (String) year (Int) etc. Results of this function to be used in another function displayMovies. How can I pass them and be able to use names of fields in displayMovies? Wanted to use Map for the same, but it is not clear for me how to initialize that. 回答1: You can use Bundle class for this. It's like a Map , but it can contain values of different types. 回答2: You could use a collection, but why

Drop Pin on Default Google Maps from My App in Android?

可紊 提交于 2019-12-11 14:54:11
问题 i have an address for a location. when i click some button in my app. it should redirect to default google map in android and drop the pin to that particular location. how to do that? Any Idea? 回答1: The Android documentation describes the various Intents that the Google Maps application will respond to, if it exists on a given device. You will presumably want a geo:0,0?q=my+street+address Uri on an ACTION_VIEW Intent . 回答2: Here is an example of how I did it using a " View on map " button.

Using multiple inheritence of activity

ⅰ亾dé卋堺 提交于 2019-12-11 10:57:04
问题 Is there way to inherit two different activities in android. I have to display the Map on my activity which inherit from some other activity. i want to display a map on that activity but i can't display the map without inheriting MapActivity. Is there any other way to display the map without using MapActivity. 回答1: No, android is java based. And java do not support multiple inheritance. Java supports multiple interfaces. Maybe using fragments will help. Fragments could simulate multiple

Searching for locations with Google Maps API for Android

核能气质少年 提交于 2019-12-11 10:07:57
问题 I am making an Android app that stores 3 million city markers in MongoDB. Depending on the current google map view, I make a geospatial box query to Mongo to get all markers within the current view on the screen. If the user wants to change the view, he/she can also perform a text search for a city and this will query three name fields across the markers collection and show the results. I currently use Mongo for this but due to naming conventions it is not working well at all (case

Calculation for latitude and longitude from start to destination point

混江龙づ霸主 提交于 2019-12-11 04:13:07
问题 Hi I am new to android development. I am on college project its based on location which is need to find list of latitude and longitude in between two points. Given Starting position is 12.990143,80.215784 and destination position is 12.992595,80.217618. Over the past days i search the google, i found so many links to find distance between locations and mid point. I cant able to find solution for my problem. Please suggest some solution for this problem. I am struggling over days to find

FragmentActivity with a Fragment Containing a MapView

狂风中的少年 提交于 2019-12-11 03:33:31
问题 I know there are a few questions like this but what I'm looking for is slightly different the way I see it. THE PROBLEM I have one Activity and I am only ever going to have one Activity . I do however have multiple Fragments ; one of which contains a MapView . I have successfully got this working in API level 3.0 and greater. However, the problems start when I want to go lower than this using the compatibility library as I then need to make my Activity extend FragmentActivity to get Fragments

Geocoder works in 1.6 but not in 2.2 emulator

不羁岁月 提交于 2019-12-11 03:25:29
问题 getFromLocationName() alsways throws a NullPointerException in the Android 2.2 emulator but it's working fine in the Android 1.6 emulator. This is my code snippet: Geocoder geo = new Geocoder(GeocoderAppActivity.this, Locale.getDefault()); try { List<Address> add = geo.getFromLocationName("Tagore Road,Rajkot", 1); while (add.size() == 0) { Log.e("Girish", "in while"); add = geo.getFromLocationName("Tagore Road,Rajkot", 1); } } What is wrong? 回答1: In the emulator, are you using the regular

GoogleMapsDemo gives IllegalStateException

你。 提交于 2019-12-11 02:56:37
问题 I have did all steps which is give at google but lastly it give's this errorCaused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4132500 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> AndroidManifest.xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns

Why are my overlays on a mapview not shown?

旧时模样 提交于 2019-12-11 02:46:49
问题 I followed the instructions from the google hellomapview tutorial. I get a working mapview etc. But the two items that are added to the map are not shown. It seems they are there somewhere because tapping at the specified location shows the message that was added to the items. Edit Here is my source code. It should be very close to the google tutorial source code. public class MapOverlay extends ItemizedOverlay<OverlayItem> { private List<OverlayItem> overlays = new ArrayList<OverlayItem>();