Status Update
Comments
th...@google.com <th...@google.com>
ae...@gmail.com <ae...@gmail.com> #2
To investigate further, can you share more details on your use case where you are using the Glide? Kindly also note that Glide is "An image loading and caching library for Android focused on smooth scrolling", this may have implementations against the Terms of Service of Google Maps Platform[1] under "3.2.4(b) No Caching. Customer will not cache Google Maps Content except as expressly permitted under the Maps Service Specific Terms.".
Kindly review the ToS of Google Maps Platform, once confirmed that your use case is compliant, we will be glad to proceed with the investigation.
[1]
ad...@gmail.com <ad...@gmail.com> #3
ae...@gmail.com <ae...@gmail.com> #4
java.lang.ClassCastException: com.bumptech.glide.GeneratedAppGlideModuleImpl cannot be cast to com.google.android.libraries.maps.c.zza
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:96)
at com.google.android.libraries.maps.c.zzb.zza(Glide.java:11)
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:218)
at com.google.android.libraries.maps.cf.zzi.zza(ResourceManagerImpl.java:7)
at com.google.android.libraries.maps.hi.zzas.zza(Suppliers.java:7)
at com.google.android.libraries.maps.cf.zzf.run(Unknown Source:7)
at com.google.android.libraries.maps.fc.zzc.run(CancelableRunnable.java:7)
at com.google.android.libraries.maps.fc.zzad.run(Task.java:9)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.libraries.maps.fc.zzv.run(GmmThread.java:10)
at java.lang.Thread.run(Thread.java:919)
Glide in the maps SDK still tries to find the generated module by its non-shaded name, with and then tries to cast it to the shaded class, which blows up:
(com.google.android.libraries.maps.c.zza) Class.forName("com.bumptech.glide.GeneratedAppGlideModuleImpl")
ma...@hangflug.ch <ma...@hangflug.ch> #5
re...@gmail.com <re...@gmail.com> #6
ma...@gmail.com <ma...@gmail.com> #7
ap...@gmail.com <ap...@gmail.com> #8
ha...@googlemail.com <ha...@googlemail.com> #9
on...@coop.ch <on...@coop.ch> #10
Does anyone else facing this issue have a workaround they've implemented in the meantime? Aside from pulling out Glide from your project...
ro...@gmail.com <ro...@gmail.com> #11
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
implementation ('com.github.bumptech.glide:okhttp3-integration:4.9.0') {
exclude group: 'glide-parent'
}
implementation ('com.github.bumptech.glide:annotations:4.9.0')
implementation name:'maps-sdk-3.0.0-beta', ext:'aar'
Stack trace:
java.lang.IllegalStateException: tname=DefaultPool6 - GeneratedAppGlideModuleImpl is implemented incorrectly. If you've manually implemented this class, remove your implementation. The Annotation processor will generate a correct implementation.
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:103)
at com.google.android.libraries.maps.c.zzb.zza(Glide.java:11)
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:218)
at com.google.android.libraries.maps.cf.zzi.zza(ResourceManagerImpl.java:7)
at com.google.android.libraries.maps.hi.zzas.zza(Suppliers.java:7)
at com.google.android.libraries.maps.cf.zzf.run(Unknown Source)
at com.google.android.libraries.maps.fc.zzc.run(CancelableRunnable.java:7)
at com.google.android.libraries.maps.fc.zzad.run(Task.java:9)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at com.google.android.libraries.maps.fc.zzv.run(GmmThread.java:10)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.IllegalAccessException: java.lang.Class<com.bumptech.glide.GeneratedAppGlideModuleImpl> is not accessible from java.lang.Class<com.google.android.libraries.maps.c.zzb>
at java.lang.reflect.Constructor.newInstance(Native Method)
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:96)
gr...@gmail.com <gr...@gmail.com> #12
ra...@gmail.com <ra...@gmail.com> #13
wo...@gmail.com <wo...@gmail.com> #14
br...@google.com <br...@google.com>
dv...@gmail.com <dv...@gmail.com> #15
apparently the issue is that newer glide versions will generate a com.bumptech.glide.GeneratedAppGlideModuleImpl class with context inside constructor
and google maps 3 will try to instantiate without passing the constructor -> hence the reflection exception. not sure how to fix that from the outside though, it would help if we knew the actual glide version they're using
here the glide generated class glide:
com.github.bumptech.glide:glide:4.11.0 com.github.bumptech.glide:compiler:4.11.0
@SuppressWarnings("deprecation")
final class GeneratedAppGlideModuleImpl extends GeneratedAppGlideModule {
private final AppGlideModule appGlideModule;
public GeneratedAppGlideModuleImpl(Context context) {
appGlideModule = new AppGlideModule();
if (Log.isLoggable("Glide", Log.DEBUG)) {
Log.d("Glide", "Discovered AppGlideModule from annotation: com.europapark.services.glide.AppGlideModule");
Log.d("Glide", "Discovered LibraryGlideModule from annotation: com.bumptech.glide.integration.okhttp3.OkHttpLibraryGlideModule");
Log.d("Glide", "Discovered LibraryGlideModule from annotation: net.kibotu.mediagallery.internal.progress.GlideConfiguration");
}
}
@Override
public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
appGlideModule.applyOptions(context, builder);
}
@Override
public void registerComponents(@NonNull Context context, @NonNull Glide glide,
@NonNull Registry registry) {
new OkHttpLibraryGlideModule().registerComponents(context, glide, registry);
new GlideConfiguration().registerComponents(context, glide, registry);
appGlideModule.registerComponents(context, glide, registry);
}
@Override
public boolean isManifestParsingEnabled() {
return appGlideModule.isManifestParsingEnabled();
}
@Override
@NonNull
public Set<Class<?>> getExcludedModuleClasses() {
return Collections.emptySet();
}
@Override
@NonNull
GeneratedRequestManagerFactory getRequestManagerFactory() {
return new GeneratedRequestManagerFactory();
}
}
and here the call within the gmaps 3 library
private static com.google.android.libraries.maps.c.zza zzb() {
com.google.android.libraries.maps.c.zza var0 = null;
try {
var0 = (com.google.android.libraries.maps.c.zza)Class.forName("com.bumptech.glide.GeneratedAppGlideModuleImpl").getDeclaredConstructor().newInstance();
} catch (ClassNotFoundException var2) {
if (Log.isLoggable("Glide", 5)) {
Log.w("Glide", "Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored");
}
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException var3) {
throw new IllegalStateException("GeneratedAppGlideModuleImpl is implemented incorrectly. If you've manually implemented this class, remove your implementation. The Annotation processor will generate a correct implementation.", var3);
}
return var0;
}
pw...@googlemail.com <pw...@googlemail.com> #16
al...@gmail.com <al...@gmail.com> #17
br...@gmail.com <br...@gmail.com> #18
This is still happening with glide 4.11.0
mi...@gmail.com <mi...@gmail.com> #19
We tried understanding the issue, it seems that a glide module is generated through reflection:
Some thing like this
try {
var0 = (com.google.android.libraries.maps.c.zza)Class.forName("com.bumptech.glide.GeneratedAppGlideModuleImpl").getDeclaredConstructor().newInstance();
} catch (ClassNotFoundException var2) {
if (Log.isLoggable("Glide", 5)) {
Log.w("Glide", "Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored");
}
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException var3) {
throw new IllegalStateException("GeneratedAppGlideModuleImpl is implemented incorrectly. If you've manually implemented this class, remove your implementation. The Annotation processor will generate a correct implementation.", var3);
}
Glide has a constructor of this method with context, but google tries to create an instance of this class without any parameters, that is why an exception is occurred.
Someone can think of a workaround or time till this is fixed?
an...@gmail.com <an...@gmail.com> #20
pe...@gmail.com <pe...@gmail.com> #21
ma...@gmail.com <ma...@gmail.com> #22
fr...@gmail.com <fr...@gmail.com> #23
The actual problem here is that Glide generates GeneratedAppGlideModuleImpl
as package-private and when maps tries to use its own obfuscated, repackaged version of Glide to read it it blows up because its accessing it from a different package. If you look at the original issue the root cause is an IllegalAccessException
.
The real question is: why not just depend on Glide?
ta...@gmail.com <ta...@gmail.com> #24
an...@gmail.com <an...@gmail.com> #25
The Maps SDK 3.1.0-beta is not able to access to the constructor of GeneratedAppGlideModuleImpl
, if you call the reflection method isAccessible()
you will get false
So you need to fix it into Maps SDK.
I have done some tests and you should be able to write some code like:
@Nullable
private static com.google.android.libraries.maps.c.zza zzc(Context var0) {
com.google.android.libraries.maps.c.zza var1 = null;
try {
Constructor<?> constructor = Class.forName("com.bumptech.glide.GeneratedAppGlideModuleImpl").getDeclaredConstructor(Context.class);
constructor.setAccessible(true);
var1 = constructor.newInstance(var0.getApplicationContext());
} catch (ClassNotFoundException var3) {
if (Log.isLoggable("Glide", 5)) {
Log.w("Glide", "Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored");
}
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException var4) {
throw new IllegalStateException("GeneratedAppGlideModuleImpl is implemented incorrectly. If you've manually implemented this class, remove your implementation. The Annotation processor will generate a correct implementation.", var4);
}
return var1;
}
ma...@gmail.com <ma...@gmail.com> #26
Is it something you've been working or you'll be working on soon?
re...@gmail.com <re...@gmail.com> #27
hb...@gmail.com <hb...@gmail.com> #28
2020-10-26 20:02:59.828 8739-16763/? E/AndroidRuntime: FATAL EXCEPTION: DefaultPool2
Process:
java.lang.RuntimeException: Expected instanceof GlideModule, but found: com.foo.BarGlideModule@81c319a
at com.google.android.libraries.maps.w.zzd.zza(ManifestParser.java:39)
at com.google.android.libraries.maps.w.zzd.zza(ManifestParser.java:18)
at com.google.android.libraries.maps.c.zzb.zza(Glide.java:14)
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:240)
at com.google.android.libraries.maps.cq.zzh.zza(ResourceManagerImpl.java:7)
at com.google.android.libraries.maps.ij.zzaw.zza(Suppliers.java:7)
at com.google.android.libraries.maps.cq.zzi.run(Unknown Source:8)
at com.google.android.libraries.maps.fv.zzc.run(CancelableRunnable.java:7)
at com.google.android.libraries.maps.fv.zzae.run(Task.java:9)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.android.libraries.maps.fv.zzv.run(GmmThread.java:10)
at java.lang.Thread.run(Thread.java:919)
[Deleted User] <[Deleted User]> #29
Process: com.hevo, PID: 11001
java.lang.IllegalStateException: GeneratedAppGlideModuleImpl is implemented incorrectly. If you've manually implemented this class, remove your implementation. The Annotation processor will generate a correct implementation.
at com.google.android.libraries.maps.c.zzb.zzc(Glide.java:108)
at com.google.android.libraries.maps.c.zzb.zza(Glide.java:3)
at com.google.android.libraries.maps.c.zzb.zzb(Glide.java:240)
at com.google.android.libraries.maps.cq.zzh.zza(ResourceManagerImpl.java:7)
at com.google.android.libraries.maps.ij.zzaw.zza(Suppliers.java:7)
at com.google.android.libraries.maps.cq.zzi.run(Unknown Source:8)
at com.google.android.libraries.maps.fv.zzc.run(CancelableRunnable.java:7)
at com.google.android.libraries.maps.fv.zzae.run(Task.java:9)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at com.google.android.libraries.maps.fv.zzv.run(GmmThread.java:10)
at java.lang.Thread.run(Thread.java:764)
used glide 4.11.0 and google maps 3.1.0-beta
I'm not sure if this is also relevant but i also use google places 2.4.0.
ga...@gmail.com <ga...@gmail.com> #30
Only now I decide to checkout google maps v3 since I want to use it in Compose.... but this is great.... (together the use of the support lib)
th...@gmail.com <th...@gmail.com> #31
ga...@gmail.com <ga...@gmail.com> #32
I just integrated and was trying out maps v3 since I was facing OOM issues in v2 and ended up with this issue. Almost every developer I know uses Glide. If this issue is not fixed, will have to abandon the upgrade to v3. Team, please prioritise this and fix it. Thanks.
ga...@gmail.com <ga...@gmail.com> #33
ga...@gmail.com <ga...@gmail.com> #34
ga...@gmail.com <ga...@gmail.com> #35
sv...@gmail.com <sv...@gmail.com> #36
us...@gmail.com <us...@gmail.com> #37
Thanks for patiently waiting.
Maps SDK for Android Beta version is now deprecated and will be fully decommissioned in late 2022. For more information, you can check our documentation here:
Google has released a new client library for Maps SDK for Android, version 18.0.0 that we suggest that you try. You can also migrate your Beta SDK version to the latest version by using our migration tool here:
If you have any issues using the latest version of the SDK, please let us know by either:
de...@gmail.com <de...@gmail.com> #38
mr...@gmail.com <mr...@gmail.com> #39
componentRestrictions: country: ['us', 'uk']
wu...@gmail.com <wu...@gmail.com> #40
jh...@gmail.com <jh...@gmail.com> #41
[Deleted User] <[Deleted User]> #42
ca...@gmail.com <ca...@gmail.com> #43
si...@gmail.com <si...@gmail.com> #44
ma...@hangflug.ch <ma...@hangflug.ch> #45
ho...@gmail.com <ho...@gmail.com> #46
pe...@brownies-websolutions.nl <pe...@brownies-websolutions.nl> #47
ad...@gmail.com <ad...@gmail.com> #48
je...@gmail.com <je...@gmail.com> #49
pe...@brownies-websolutions.nl <pe...@brownies-websolutions.nl> #50
[Deleted User] <[Deleted User]> #51
We are really looking forward to have something like this:
...
componentRestrictions: {
country: ['at','ch','de']
}
...
or a similar workaround to get all cities from (de,at,ch)...
se...@gmail.com <se...@gmail.com> #52
ah...@cetin.info <ah...@cetin.info> #53
dm...@heb.be <dm...@heb.be> #54
ad...@gmail.com <ad...@gmail.com> #55
br...@gmail.com <br...@gmail.com> #56
[Deleted User] <[Deleted User]> #57
be...@gmail.com <be...@gmail.com> #58
be...@gmail.com <be...@gmail.com> #59
Like France > FR + (Martinique MQ, Guadeloupe QP, French Guiana GF, Mayotte YT)
Like United Kingdom > GB + (Gibraltar GI ...)
It could be very useful...
ma...@gmail.com <ma...@gmail.com> #60
os...@gmail.com <os...@gmail.com> #61
ja...@gmail.com <ja...@gmail.com> #62
jw...@gmail.com <jw...@gmail.com> #63
jo...@gmail.com <jo...@gmail.com> #64
be...@edicos.de <be...@edicos.de> #65
dv...@gmail.com <dv...@gmail.com> #66
[Deleted User] <[Deleted User]> #67
ke...@gmail.com <ke...@gmail.com> #68
We need something like country: {us,ca}
bl...@gmail.com <bl...@gmail.com> #69
se...@googlemail.com <se...@googlemail.com> #70
Upvote here!
ma...@gmail.com <ma...@gmail.com> #71
th...@gmail.com <th...@gmail.com> #72
jo...@gmail.com <jo...@gmail.com> #73
bu...@gmail.com <bu...@gmail.com> #74
ts...@gmail.com <ts...@gmail.com> #75
th...@gmail.com <th...@gmail.com> #76
if (status!=='OK') {
// Search using another 'region'
}
Repeat for each region.
th...@gmail.com <th...@gmail.com> #77
if (results[0].formatted_address==='Australia') {
// Search using componentRestrictions:{country:'nz'}
}
This is because when no address is found, the formatted_address will be set to the country name.
[Deleted User] <[Deleted User]> #78
th...@gmail.com <th...@gmail.com> #79
[Deleted User] <[Deleted User]> #80
But it is not as precise as restrictions :
- when autocompleting, I still see places from all over the world
- if I want to cover, let's say, France and Germany, I would also include parts of UK, Italy...
jo...@bookridesonline.com <jo...@bookridesonline.com> #81
ti...@gmail.com <ti...@gmail.com> #82
[Deleted User] <[Deleted User]> #83
[Deleted User] <[Deleted User]> #84
geocoder.geocode({ 'address': address + ', Deutschland OR Österreich OR Schweiz' }, function (results, status)
co...@gmail.com <co...@gmail.com> #85
mb...@gmail.com <mb...@gmail.com> #86
[Deleted User] <[Deleted User]> #87
al...@gmail.com <al...@gmail.com> #88
ma...@gmail.com <ma...@gmail.com> #89
gc...@gmail.com <gc...@gmail.com> #90
gc...@gmail.com <gc...@gmail.com> #91
please provide us that
[Deleted User] <[Deleted User]> #92
ru...@gmail.com <ru...@gmail.com> #93
Hope this helps some people here..
m....@gmail.com <m....@gmail.com> #94
dv...@gmail.com <dv...@gmail.com> #95
gr...@gmail.com <gr...@gmail.com> #96
See this link to fetch data about the location
This line of code is the part to be changed. It need to be equals to your country code(s):
place.address_components[i][componentForm[addressType]];
pi...@gmail.com <pi...@gmail.com> #97
I am getting mad with this issue!
ha...@gmail.com <ha...@gmail.com> #98
id...@sdenv.fr <id...@sdenv.fr> #99
vy...@gmail.com <vy...@gmail.com> #100
th...@gmail.com <th...@gmail.com> #101
componentRestrictions: {
country: ['aus', 'nz']
}
ma...@gmail.com <ma...@gmail.com> #102
jy...@gmail.com <jy...@gmail.com> #103
ga...@gmail.com <ga...@gmail.com> #104
an...@gmail.com <an...@gmail.com> #105
m....@gmail.com <m....@gmail.com> #106
ji...@gmail.com <ji...@gmail.com> #107
st...@gmail.com <st...@gmail.com> #108
st...@gmail.com <st...@gmail.com> #109
wo...@gmail.com <wo...@gmail.com> #113
We need this:
componentRestrictions: {
country: ['us', 'ca']
}
Just change your query from '=' to 'in()', should not take more than 5 minutes.
po...@gmail.com <po...@gmail.com> #122
ab...@gmail.com <ab...@gmail.com> #123
componentRestrictions: {
country: ['us', 'ca']
}
[Deleted User] <[Deleted User]> #125
je...@gmail.com <je...@gmail.com> #126
ed...@gmail.com <ed...@gmail.com> #127
Can we at least get an update on this?
ai...@gmail.com <ai...@gmail.com> #128
db...@esokia-webagency.com <db...@esokia-webagency.com> #129
pa...@aperturelabs.biz <pa...@aperturelabs.biz> #130
Come on Google, get it together.
ra...@gmail.com <ra...@gmail.com> #131
componentRestrictions: {
country: ['us', 'ca']
}
se...@gtempaccount.com <se...@gtempaccount.com> #132
ke...@iodigital.com <ke...@iodigital.com> #133
ga...@gmail.com <ga...@gmail.com> #134
A response from Google would be appreciated - multiple choice options below to make it simple!
a) won't do
b) working on it, won't be long
c) already done and waiting release...
br...@google.com <br...@google.com> #135
ra...@gmail.com <ra...@gmail.com> #136
are 278 people who starred this issue in the last 3years not enough?
ralf
ga...@gmail.com <ga...@gmail.com> #137
If you sort the features list by number of stars, this is second on the list so obviously in high demand (after styled maps which is understandably more complex).
I understand you don't want to reveal what you're working on, but do you think three years an acceptable length of time not to do anything with this issue? Is there an alternative channel to raise the priority on this one eg through our Maps-for-work account manager?
br...@google.com <br...@google.com> #138
If you are a Maps for Work customer, by all means raise this as a ticket on the support portal.
As to how product managers make decisions, I know they take into account the number of stars on an issue, but they also take into account other technical, product and business directions when making these engineering effort prioritization decisions.
I share your (collective) frustration here, but I can't make promises on future product direction.
hw...@gmail.com <hw...@gmail.com> #139
[Deleted User] <[Deleted User]> #140
ke...@gmail.com <ke...@gmail.com> #141
ga...@gmail.com <ga...@gmail.com> #142
Have just had a comment from Google via a Maps-For-Work request for this feature:
"I am sorry to tell you that given the current backend, there is no plan to implement this feature."
I guess we'll have to wait for them to update the backend then...
di...@gmail.com <di...@gmail.com> #144
mc...@google.com <mc...@google.com>
pi...@gmail.com <pi...@gmail.com> #145
ka...@gmail.com <ka...@gmail.com> #149
**************************************************************
var input = document.getElementById('pac-input');
var options = {
types: ['(cities)'],
componentRestrictions: { country: 'in' }
};
var options1 = {
types: ['(cities)'],
componentRestrictions: { country: 'au' }
};
autocomplete = new google.maps.places.Autocomplete(input, options);
autocomplete.addListener('place_changed', function () {
var place = autocomplete.getPlace();
var lat = parseFloat(place.geometry.location.lat()).toFixed(4);
var long = parseFloat(place.geometry.location.lng()).toFixed(4);
map.setView(new L.LatLng(lat, long), 18);
});
autocomplete = new google.maps.places.Autocomplete(input, options1);
autocomplete.addListener('place_changed', function () {
var place = autocomplete.getPlace();
var lat = parseFloat(place.geometry.location.lat()).toFixed(4);
var long = parseFloat(place.geometry.location.lng()).toFixed(4);
map.setView(new L.LatLng(lat, long), 18);
});
*************************
Cheers,
Kamaraj k
[Deleted User] <[Deleted User]> #150
ex...@hkmci.com <ex...@hkmci.com> #151
an...@gmail.com <an...@gmail.com> #152
m....@gmail.com <m....@gmail.com> #153
di...@capitalone.com <di...@capitalone.com> #155
y....@gmail.com <y....@gmail.com> #157
ma...@gmail.com <ma...@gmail.com> #158
st...@gmail.com <st...@gmail.com> #159
fl...@gmail.com <fl...@gmail.com> #160
mr...@gmail.com <mr...@gmail.com> #161
sc...@gmail.com <sc...@gmail.com> #162
fa...@gmail.com <fa...@gmail.com> #163
ve...@gmail.com <ve...@gmail.com> #164
st...@gmail.com <st...@gmail.com> #165
te...@gmail.com <te...@gmail.com> #166
up...@gmail.com <up...@gmail.com> #167
dm...@gmail.com <dm...@gmail.com> #168
ma...@gmail.com <ma...@gmail.com> #169
ei...@gmail.com <ei...@gmail.com> #170
de...@gmail.com <de...@gmail.com> #171
[Deleted User] <[Deleted User]> #172
gs...@gmail.com <gs...@gmail.com> #173
lu...@gmail.com <lu...@gmail.com> #174
Guess they're not going to do it.
ro...@gmail.com <ro...@gmail.com> #175
nr...@gmail.com <nr...@gmail.com> #176
az...@gmail.com <az...@gmail.com> #177
jo...@gmail.com <jo...@gmail.com> #178
ma...@gmail.com <ma...@gmail.com> #179
je...@gmail.com <je...@gmail.com> #180
wi...@creawebstudio.com <wi...@creawebstudio.com> #181
eu...@gmail.com <eu...@gmail.com> #182
st...@gmail.com <st...@gmail.com> #183
Many clients ask me for this feature here :
Thanks !
km...@gmail.com <km...@gmail.com> #184
components=postal_code:96799|country:US,AS
where I can have the postal code of US and American Samoa
to...@gmail.com <to...@gmail.com> #185
ka...@grasveld.net <ka...@grasveld.net> #186
cl...@gmail.com <cl...@gmail.com> #187
ta...@gmail.com <ta...@gmail.com> #189
ra...@gmail.com <ra...@gmail.com> #190
vi...@leduc.xyz <vi...@leduc.xyz> #191
st...@gmail.com <st...@gmail.com> #192
be...@gmail.com <be...@gmail.com> #193
be...@gmail.com <be...@gmail.com> #194
fr...@gmail.com <fr...@gmail.com> #195
autocomplete = new google.maps.places.Autocomplete(
(document.getElementById('autocomplete')), {
types: ['geocode'],
componentRestrictions: { country: ['nl', 'de', 'fr', 'de']}
}
ev...@gmail.com <ev...@gmail.com> #196
ba...@gmail.com <ba...@gmail.com> #197
ch...@gmail.com <ch...@gmail.com> #198
[Deleted User] <[Deleted User]> #200
mo...@gmail.com <mo...@gmail.com> #201
az...@gmail.com <az...@gmail.com> #202
ga...@gmail.com <ga...@gmail.com> #203
ch...@gmail.com <ch...@gmail.com> #204
ta...@gmail.com <ta...@gmail.com> #205
ej...@gmail.com <ej...@gmail.com> #206
[Deleted User] <[Deleted User]> #207
ti...@gmail.com <ti...@gmail.com> #208
The workaround with multiple requests is not very environmentally friendly ;)
lo...@gmail.com <lo...@gmail.com> #209
[Deleted User] <[Deleted User]> #210
je...@gmail.com <je...@gmail.com> #211
st...@gmail.com <st...@gmail.com> #212
['de','at','ch']
ar...@gmail.com <ar...@gmail.com> #213
h2...@gmail.com <h2...@gmail.com> #214
Even the requst is 4 years old and highly wanted, google knows whats good for you.
nf...@gmail.com <nf...@gmail.com> #215
pi...@gmail.com <pi...@gmail.com> #216
fc...@gmail.com <fc...@gmail.com> #217
fc...@gmail.com <fc...@gmail.com> #218
here the working demo:
here the code:
var countries = ['fr', 'gp', 'mq', 'gf', 're', 'pm', 'yt', 'nc', 'pf', 'mf', 'tf'];
var processItemsDeferred = [],
results = [];
function multipleCountriesPredictions(input) {
$.each(countries, function(i, country) {
processItemsDeferred.push(getPrediction(input, country));
});
}
function getPrediction(input, country) {
var deferred = new $.Deferred();
var service = new google.maps.places.AutocompleteService();
service.getPlacePredictions({
input: input,
componentRestrictions: {
country: country
}
}, function(data) {
$.each(data, function(i) {
results.push({
'country': country,
'description': data[i].description,
'place_id': data[i].place_id
});
});
deferred.resolve();
});
return deferred.promise();
}
dw...@gmail.com <dw...@gmail.com> #219
de...@gmail.com <de...@gmail.com> #220
ti...@gmail.com <ti...@gmail.com> #221
sa...@gmail.com <sa...@gmail.com> #222
dc...@gmail.com <dc...@gmail.com> #223
ju...@gmail.com <ju...@gmail.com> #224
je...@gmail.com <je...@gmail.com> #225
do...@gmail.com <do...@gmail.com> #226
fa...@gmail.com <fa...@gmail.com> #227
su...@gmail.com <su...@gmail.com> #228
[Deleted User] <[Deleted User]> #229
jm...@googlemail.com <jm...@googlemail.com> #230
a) scalability with so many people using / abusing the feature
b) People basically just scraping the API for all countries and scraping all of the data and IP.
al...@onedoc.ch <al...@onedoc.ch> #231
fc...@gmail.com <fc...@gmail.com> #232
with deferred request for each service call
ri...@gmail.com <ri...@gmail.com> #233
tr...@gmail.com <tr...@gmail.com> #235
If you also have encountered the other issue (e.g. riazuddi) of needing to filter on deeper administration boundaries (e.g. state, council/county, postcode) can I please urge you to consider reviewing and maybe starring <a href="
mi...@google.com <mi...@google.com> #236
This new feature has been available for a few weeks and a few rough edges have been polished now (
The Place Autocomplete web service and the JavaScript Places library now support restricting predictions to multiple countries, see details below. Please file new feature requests for the Android and iOS Places API SDKs if you are interested in using this feature in the SDKs.
Please see how to add multiple county restricts here:
See also this new example: Place Autocomplete Restricted to Multiple Countries
There is a limitation to this new feature: requests may be restricted up to 5 countries.
Please note that restricting to multiple countries comes with an increased latency. The limit of 5 countries is there to keep the latency increase in check.
Should you want to retrieve predictions restricted to a greater number of countries, you can use the approach proposed above (#236): build your own widget using the AutocompleteService in the JavaScript Places library to send multiple requests. Now each request can be restricted to (up to) 5 countries, thus reducing the amount of requests necessary per keystroke. Each request will return up to 5 predictions, regardless of how many countries it's restricted to.
There is also now the possibility to restrict predictions to be strictly within a given viewport, as recently announced in
el...@gmail.com <el...@gmail.com> #237
ah...@cetin.info <ah...@cetin.info> #238
ja...@gmail.com <ja...@gmail.com> #239
we...@andersencorp.com <we...@andersencorp.com> #240
mi...@google.com <mi...@google.com> #242
Besides, Autocomplete is generally a better approach when users enter addresses interactively, as outlined in
we...@andersencorp.com <we...@andersencorp.com> #243
ma...@gmail.com <ma...@gmail.com> #245
Dear Google 5 or 1 is the same s*it, the request was to filter an indefinite number of multiple countries not 5!
Implementing #236 approach is useless, how can we decide what to filter from all the results we got from multiple requests?
be...@gmail.com <be...@gmail.com> #246
Ok, Google Map, how i can include all ~20+ countries from EU to filter? This code works just for first 5 countries. No "Paris" or "Rotterdam" :((
If it's impossible - How you see to make filter by continent? Thank you!
rm...@gmail.com <rm...@gmail.com> #247
or
or
Or something
vi...@gmail.com <vi...@gmail.com> #248
Ex - searching for the postal code "10115" (in "address" parameter) returned a location at US but I was expecting a location from Germany. So below code helped.
geocoder.geocode({
"region": "150",
'address': "10115",
'bounds': {
west: -5.12543,
east: 17.28668,
south: 42.55742,
north: 54.83280
}
Region codes -
Bounds -
gg...@gmail.com <gg...@gmail.com> #249
[Deleted User] <[Deleted User]> #250
jo...@gmail.com <jo...@gmail.com> #251
la...@gmail.com <la...@gmail.com> #252
I'm wondering what's the real purpose of this API tbh ?
mi...@google.com <mi...@google.com> #253
An update from
includedRegionCodes
eu
for the European Union.
Description
restrict componentRestrictions to filter by multiple countries
*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************