google-maps-android-api-2

Replace getMap with getMapAsync

旧时模样 提交于 2019-12-27 10:22:07
问题 I want to replace the deprecated getMap Method with getMapAsync , but I didn't use MapFragment but GoogleMap like this: private GoogleMap googleMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map); try { if(googleMap == null) { googleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); } googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID); googleMap.setMyLocationEnabled(true);

How Google Maps Android API v2 handle markers outside the view are

。_饼干妹妹 提交于 2019-12-25 18:35:08
问题 During the CameraChange event I add new markers to the map, so I want to know if they are removed automatically when they become invisible as the camera has moved. Does anyone have this information? 回答1: Do you mean, are markers removed when the map is panned such that the marker is no longer on the screen? If so, the answer is no, the markers are still "on the map" even when "off screen". If you would like to remove markers as they are moved off the map, please see my answer to this question

how to calculate distance and duration for multiple locations using Distance Matrix or other google APIs?

落花浮王杯 提交于 2019-12-25 09:11:36
问题 I want to calculate distance and time for below scenario, Start Point : A A to 1(via)(2 km)(2 min) A to 2(via)(5 km)(7 min) A to 3(via)(8 km)(13 min) A to B(16 km)(22 min) End Point : B because of this I get the path through Distance Matrix, then Google Map returns the shortest established path between points. But I don't want shortest, I want to calculate via. Please tell me hint or proper way. 回答1: public class DirectionsJSONParser { /** * Receives a JSONObject and returns a list of lists

blank map on my google maps v2 for android titanium module

百般思念 提交于 2019-12-25 08:28:59
问题 I am using the titanium Goggle Maps v2 for Android (version 2.1.3.) and I am using Titanium studio 3.1.3.201309132423. The sample code in the app.js file in the example folder IS WORKING for me. However, when I am trying to create my own map, I am receiving the Google logo, the zoom in and zoom out button, and the button, which takes a user to their current position. The map itself is BLANK however. THIS WAS working for me at first and stopped all of a sudden. I am using the switch statement

How to receive latitude and longitude data stored from Firebase and put it in a marker

北战南征 提交于 2019-12-25 07:45:37
问题 I'm making an app with firebase and google maps But I'm implementing this: In the AddActivity activity, you set the latitude and longitude by clicking on a certain part of the map by placing a marker When you press the "send" button these data are sent to the firebase And I would like to rescue the data of that marker that was sent as the title, And that it is placed in the map of the MainActivity with the latitude and longitude that is in the firebase This is how my database is organized I

Google maps API auto complete is not working

被刻印的时光 ゝ 提交于 2019-12-25 05:34:13
问题 I trying to get the google maps auto complete textview , I have taken resource from http://wptrafficanalyzer.in/blog/android-autocompletetextview-with-google-places-autocomplete-api/ I have compiled app , app runs but auto complete is not working ! it is like normal textview ! manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="in.wptrafficanalyzer.locationplacesautocomplete" android:versionCode="1" android:versionName=

Unable to add markers using latitude and longitude retrieved from Firebase and stored in ArrayList<String>

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 04:57:11
问题 I am developing an app which has an activity having map in it. When users open this activity from their devices, their current location coordinates is saved in the Firebase and then are retrieved instantly and a marker is shown on their current location. This procedure is happening successfully. Here's how I'm retrieving the latitude and longitude from firebase: acceptingUserReference.child(requestID).child(key).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void

SupportMapFragment make app crashed after getSupportFragmentManager()

被刻印的时光 ゝ 提交于 2019-12-25 04:19:12
问题 i have a problem to access SupportMapFragment, in this part of my code, its always returning NPE, googleMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); Here is my fragment_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft

Different markers show same infowindow content android google map v2

社会主义新天地 提交于 2019-12-25 02:44:06
问题 I have different Markers based on their different information to show in custom infowindow . For that I have use different class for each infowindow content. I can see different Markers in my map. But I tap on them, only the lastly built marker's information is showing. Basically the infowindow content is same. Also I noted that when I tap, it does not call the relevent infowindow instead its calling lastly created infowindow's getInfoContents(Marker arg0) . But I receive the correct marker

getMap() returning null

非 Y 不嫁゛ 提交于 2019-12-25 01:55:44
问题 My getMap() method is returning null. Why is this method returning null? I looked on the Android Developers documentation to make sure I'm using this method correctly. Here a the line of code that I'm using to get the map: mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.myMapView)).getMap(); Here is my Java code: private ProjectionProxy proxy = new ProjectionProxy(); private GoogleMap mMap; @Override protected void onCreate(Bundle load) { super.onCreate(load); setContentView