google-maps-api-2

What is the correct way to completely remove GoogleMaps Autocomplete?

心已入冬 提交于 2019-12-05 23:39:37
问题 I use GoogleMap v3 AutoComplete and I need to completely remove it and unbind all event listeners. My code for initializing and binding to events looks like the following: var autocomplete = new google.maps.places.Autocomplete($("input").get(0), { types: ["geocode"] }); google.maps.event.addListener(autocomplete, 'place_changed', function () { // handle events }); I don't find official way to correctly remove autocomplete and unbind all events. Please point me the right way. Thanks. 回答1: For

google map api v2 add icon from url android

只愿长相守 提交于 2019-12-05 23:37:55
I have a project that retrieves latitude and longitude from web service and I add them to google map markers. I want to add custom icon for the markers from url. mMap.addMarker(new MarkerOptions() .position(new LatLng(dlat,Dlong)) .title(m.group(9)) .draggable(false) .snippet(m.group(1)+" "+m.group(10))); How I can add .icon with a custom icon from a link? Use this method and use returned bitmap to display in map public Bitmap getBitmapFromURL(String imageUrl) { try { URL url = new URL(imageUrl); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoInput

Google Maps v2: how to display various markers with the same coordinates

痞子三分冷 提交于 2019-12-05 15:07:46
I'm using Google Maps JavaScript API V2 to mark locations saved in an array. Markers with different coordinates are displayed well, but I have no idea how to display various markers with the same coordinates. I need it because an array of locations can have the same coordinates, but with a different description. What is the way to display those different descriptions? The code where markers are added is: var map; function loadEarth(mapdiv) { if (GBrowserIsCompatible()) { if(!mapdiv) return true; map=new GMap2(document.getElementById("map")); map.enableDoubleClickZoom(); map

Google Play Services missing on Android 2.2 emulator while using Google Maps API v2

我的梦境 提交于 2019-12-05 13:40:37
Hey I am trying to use Google Maps on my emulator even though I've installed Google Play Services library when I run the app it says This app won't run without Google Play Services which are missing from your phone on LogCat I get the warning about it but not really sure why I am getting this. my MainActivity.java package com.mapsmaps; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.Menu; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; public class MainActivity extends FragmentActivity {

Cluster Marker not hiding when zoom in

泄露秘密 提交于 2019-12-05 13:40:09
I'm trying to implement a cluster marker on my map, and it is behaving a little strange, first, it shows me the cluster marker but also shows me the point markers, that shouldn't be happening, and when I zoom in the cluster marker still showing, i'll add some images to explain it better. public class MapaViagem extends FragmentActivity { private GoogleMap googleMap; private String rm_IdViagem; private List<ClienteModel> mClienteModel = new ArrayList<ClienteModel>(); private List<EnderecoModel> mEnderecoModel = new ArrayList<EnderecoModel>(); private ViagemModel mViagemModel = new ViagemModel()

How to cache/download google map v2 tile programmatically?

*爱你&永不变心* 提交于 2019-12-05 13:16:54
问题 How to cache/download google map v2 tile programmatically?, is it possible? Bcos according to this prntscr.com/3cyiqf its not possible but as I have seen this link TileProvider using local tiles I thought that if Android provides TileProvider class to load/use tile from the asset than it should be something available for caching/downloading a tile programmatically/run time My Actual requirement is : If user is connected with internet at that time he can able to download/cache a tile of

Google Map API v2 - Get Driving Distance from Current Location to Known Locations

帅比萌擦擦* 提交于 2019-12-05 07:41:43
问题 I'm trying to figure out how to display the driving distance from the current location to four known locations. I'm not showing a map on the screen, I just need to display how many miles away the user currently is from those locations. I took an example from Here and modified it a little. It is bringing back the correct distance but I can't figure out how to pass in each of the 4 end locations, or differentiate between them. What do I need to do in order to get the distance to each of the 4

Google maps API: Marker image positioning

点点圈 提交于 2019-12-05 01:27:49
I have changed the image that I use for a marker on Google maps. The new image is much wider than the old one and I have noticed that the marker is aligned with the lat and lng so that the marker rests with it's horizontal midpoint over the lat and lng . This is not what I want, I want to have the lat and lng aligned with the markers left hand side - I want to offset the marker from the default position by about 80px to the right. Try this on for size. var markerImage = new google.maps.MarkerImage('/img/icon/here.png', new google.maps.Size(80, 80), //size new google.maps.Point(0, 0), //origin

Google Maps API v2 not working

此生再无相见时 提交于 2019-12-04 20:02:16
问题 I am trying to build an application using Google Maps API v2 but the thing is, the application keeps giving me force closes although i followed all the required instructions. Here is the android part import android.support.v4.app.FragmentActivity; import com.google.android.maps.GeoPoint; import com.google.android.maps.MapController; import com.google.android.maps.MapView; public class GPSonMap extends FragmentActivity{ MapView map; MapController controller; LocationManager locationManager;

Google Maps v2 Set Zoom Level

家住魔仙堡 提交于 2019-12-04 17:09:58
问题 When I launch Google maps in Android, it shows the whole world. What do i need to change so as to set the zoom to the marker? Here are the codes. Thanks googlemap.getUiSettings().setZoomControlsEnabled(true); googlemap.getUiSettings().setMyLocationButtonEnabled(true); LatLng cameraLatLng = sfLatLng; float cameraZoom = 17; if(savedInstanceState != null){ mapType = savedInstanceState.getInt("map_type", GoogleMap.MAP_TYPE_NORMAL); double savedLat = savedInstanceState.getDouble("lat"); double