google-geocoder

java.io.IOException: grpc failed

点点圈 提交于 2019-12-17 17:48:43
问题 When I use call getFromLocationName I get an IOException with description "grpc failed". Code that's ran @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; try { Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault()); List<Address> listAdresses = geocoder.getFromLocationName("London", 10); Log.i("PlaceInfo", listAdresses.get(0).toString()); } catch (IOException e) { e.printStackTrace(); } } Error the console outputs: 07-10 12:01:38.781 13712

Geocoder's isPresent() method always returns false

ぐ巨炮叔叔 提交于 2019-12-17 16:49:17
问题 I had written a simple Activity to test presence of Geocoder, calling Geocoder.isPresent() always returns false. Class: public class LocationTestActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); Log.d( "LocationTestActivity", "Geocoder.isPresent : " + Geocoder.isPresent() ); } }

How to dynamically change the script src?

限于喜欢 提交于 2019-12-13 09:50:14
问题 I'm trying to dynamically change the region depends on what I select in a dropdown field. <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?region=DK"></script> Can someone help me figure this out? 回答1: You can load JavaScript dynamically after page has loaded, but remember: once you've loaded it, you can't unload JavaScript in an active page. It is stored in the browsers memory pool. You can reload a page, which will clear the active scripts, and start over.

Google Maps Geocode Showing Wrong Address

[亡魂溺海] 提交于 2019-12-13 08:24:07
问题 I have locations stored within a database, and I am looping through them and putting markers down for each location (mix of JS and Razor) on Google Maps (API v3). The code I am using is from a question I asked a couple of days ago on StackOverFlow. The two addresses in question are: 6-7 Hall Place, Spalding, PE11, 1SA, UK 29 Union Street, Birmingham, B2 4LR, UK These addresses show perfectly on here. But when I try them on my site (localhost currently), one shows up in San Francisco and the

google maps geocode: I get a new API key and it claims it's invalid

妖精的绣舞 提交于 2019-12-13 07:40:19
问题 I have a geocode library (makeKML.pm at MarginalHacks.com) which uses the Google Maps geocode API. It has stopped working because it was using v2 requests, so I've switched to v3, and I'm told my API key is invalid. So I login to their disastrously confusing cloud console and finally figure out how to make a new server API key. Again I try a request with the new key: https://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=659+Valencia+St%2C+San+Francisco+CA&key=<<<my new API key

Geo Coder Error

我只是一个虾纸丫 提交于 2019-12-13 07:31:54
问题 I am using geo coder class to find the address, but I, get a IOException with message, of "Service Not Available", How I can solve this problem. 回答1: This is a know issue with the Emulator. It works fine on an actual device On 2.2 API 8 you'll receive the following stacktrace java.io.IOException: Service not Available at android.location.Geocoder.getFromLocation(Geocoder.java:117) See here for more info (and a possible workaround) see the following URL : http://code.google.com/p/android

Failure to geocode using the ggmap and Google Geocoding API in R; behind company firewall

笑着哭i 提交于 2019-12-13 06:20:41
问题 I am attempting to geocode addresses in R using the geocode() function in the ggmap package. I have done this on my personal computer relatively easily and want to attempt this on my work computer. Generally, I am supposed to register with Google, library the ggmap package, read-in my security key, and then I can use the geocode() function. But I get errors. See below: # Library package library(ggmap) # Set key file gmAPI <- "key_file.txt" # Read-in Google API key gmAPIKey <- readLines(gmAPI)

Wrong country code returned by Google Geocoder

拥有回忆 提交于 2019-12-13 02:55:34
问题 I'm getting incorrect country codes when using Google Places API to geocode point locations. This happens mainly near country borders so I suppose that Places API is using a different source for country borders (with less precision) than the one shown in the Google Map tiles. In the example below, the point is clearly inside France but the returned ISO code by Google Places is "ES" for "Spain". function initMap() { var geocoder = new google.maps.Geocoder; var point = new google.maps.LatLng(42

How do I restrict a Google Geocode query to multiple countries?

早过忘川 提交于 2019-12-12 17:05:47
问题 I am trying to send a user query to Google Maps Geocoding API, and restrict it to the countries that my service will be operating in. If I just want results from the UK, then the following query works when searching for quay : https://maps.googleapis.com/maps/api/place/autocomplete/json?key=$apiKey&input=quay&language=en-gb&location=0,0&radius=50000&components=country:uk If I want to restrict the results to just France then the following works: https://maps.googleapis.com/maps/api/place

Write a location and get the geocords, not working properly? JS

被刻印的时光 ゝ 提交于 2019-12-12 05:48:19
问题 Link removed This is my site. Im working on so you can enter a location on the search input field, and then see theres xx km from a restaurant. Now i got almost everything working. If you see the source code you can see how it works. It showAddress(what you searched). And then show addresses makes it into lat/lng cords, and pass it to computeRestaurants() which computes the distances between the location you entered and the restaurants. Somehow, when I run: computeRestaurants(new google.maps