[Google Maps API v3] Re: Opening the map focussing on a country using the country code
Thanks Chris, Adding the parameter region=au does the job! Gerrit. On 13 feb, 00:44, Chris Broadfoot c...@google.com wrote: On Sun, Feb 13, 2011 at 7:13 AM, Gerrit de Bolster cbst...@home.nl wrote: I would like to have an answer from one of the Google employees as I believe that the Google Maps API is more than a mere street address geoder as you stated. Rossko is correct. Have a quick read of the documentation and you'll see that it mentions addresses a lot!http://code.google.com/apis/maps/documentation/javascript/services.ht... Changing the region parameter may get you more relevant geocoder results. For example, I get Canada as a result when I specify region=au:http://maps.googleapis.com/maps/api/geocode/json?address=CAsensor=fa... Rossko's suggestion of using your own lookup of ISO 3166-1 codes is an excellent one, and if it's exactly what you need (only lookups of these codes), then you should do that. The full list is published here:http://www.iso.org/iso/english_country_names_and_code_elements Chris --http://twitter.com/broady -- You received this message because you are subscribed to the Google Groups Google Maps JavaScript API v3 group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
[Google Maps API v3] Re: Opening the map focussing on a country using the country code
Hi Chris, This works for Belgium (BE) and a lot of other countries but not for Germany (DE). In case of using the code DE you get only one result not being a country but the state of DELAWARE in the US. Gerrit. On 10 feb, 11:41, Chris Broadfoot c...@google.com wrote: On Thu, Feb 10, 2011 at 9:31 PM, Gerrit de Bolster cbst...@home.nl wrote: If I do this in my case the map is focussed on the city of Bern in Switzerland! That's because you're choosing the first result. You should look for a result with type country. --http://twitter.com/broady -- You received this message because you are subscribed to the Google Groups Google Maps JavaScript API v3 group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
Re: [Google Maps API v3] Re: Opening the map focussing on a country using the country code
On Sun, Feb 13, 2011 at 7:13 AM, Gerrit de Bolster cbst...@home.nl wrote: I would like to have an answer from one of the Google employees as I believe that the Google Maps API is more than a mere street address geoder as you stated. Rossko is correct. Have a quick read of the documentation and you'll see that it mentions addresses a lot! http://code.google.com/apis/maps/documentation/javascript/services.html#Geocoding Changing the region parameter may get you more relevant geocoder results. For example, I get Canada as a result when I specify region=au: http://maps.googleapis.com/maps/api/geocode/json?address=CAsensor=falseregion=au Rossko's suggestion of using your own lookup of ISO 3166-1 codes is an excellent one, and if it's exactly what you need (only lookups of these codes), then you should do that. The full list is published here: http://www.iso.org/iso/english_country_names_and_code_elements Chris -- http://twitter.com/broady -- You received this message because you are subscribed to the Google Groups Google Maps JavaScript API v3 group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
[Google Maps API v3] Re: Opening the map focussing on a country using the country code
Chris, It appeares that if a country code also exists as the code of a state in the US geogoder only returns one result: the state in the US. So for CA you only get California and no Canada. In case of AL you get Alabama as the only result and no Alabania and so on. Can you please correct this error? Gerrit. On 12 feb, 19:51, Gerrit de Bolster cbst...@home.nl wrote: Hi Chris, This works for Belgium (BE) and a lot of other countries but not for Germany (DE). In case of using the code DE you get only one result not being a country but the state of DELAWARE in the US. Gerrit. On 10 feb, 11:41, Chris Broadfoot c...@google.com wrote: On Thu, Feb 10, 2011 at 9:31 PM, Gerrit de Bolster cbst...@home.nl wrote: If I do this in my case the map is focussed on the city of Bern in Switzerland! That's because you're choosing the first result. You should look for a result with type country. --http://twitter.com/broady- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - -- You received this message because you are subscribed to the Google Groups Google Maps JavaScript API v3 group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
[Google Maps API v3] Re: Opening the map focussing on a country using the country code
Sorry: it's 'geocoder' and 'Albania'... On 12 feb, 20:34, Gerrit de Bolster cbst...@home.nl wrote: Chris, It appeares that if a country code also exists as the code of a state in the US geogoder only returns one result: the state in the US. So for CA you only get California and no Canada. In case of AL you get Alabama as the only result and no Alabania and so on. Can you please correct this error? Gerrit. On 12 feb, 19:51, Gerrit de Bolster cbst...@home.nl wrote: Hi Chris, This works for Belgium (BE) and a lot of other countries but not for Germany (DE). In case of using the code DE you get only one result not being a country but the state of DELAWARE in the US. Gerrit. On 10 feb, 11:41, Chris Broadfoot c...@google.com wrote: On Thu, Feb 10, 2011 at 9:31 PM, Gerrit de Bolster cbst...@home.nl wrote: If I do this in my case the map is focussed on the city of Bern in Switzerland! That's because you're choosing the first result. You should look for a result with type country. --http://twitter.com/broady-Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - -- You received this message because you are subscribed to the Google Groups Google Maps JavaScript API v3 group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
[Google Maps API v3] Re: Opening the map focussing on a country using the country code
It's an address geocoder, not a country finder. Neither Alabama nor Albania are addresses, so it's stretching things a bit to rely on what might be returned. Perhaps a state is considered more like a full address than just a country, or a planet. It is not the only geocoder ; others might be more fit for purpose http://groups.google.com/group/google-maps-api/web/resources-non-google-geocoders this one looks relevant http://www.geonames.org/ There are only a limited number of countries ; it wouldn't be too onerous to make your own look-up table for this. Raw data http://www.nearby.org.uk/coords/countries.csv -- You received this message because you are subscribed to the Google Groups Google Maps JavaScript API v3 group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
[Google Maps API v3] Re: Opening the map focussing on a country using the country code
Rossko, So according to you this is one of the limits of Google Maps API. From the answer of Chris Broadfoot I had the impression it would be possible. Furthermore, in case the code is also applying to regions in other countries you get multiple results. Only when it concerns a state in the US the geocoder has only one result. Strange. I would like to have an answer from one of the Google employees as I believe that the Google Maps API is more than a mere street address geoder as you stated. Gerrit. On 12 feb, 20:58, Rossko ros...@culzean.clara.co.uk wrote: It's an address geocoder, not a country finder. Neither Alabama nor Albania are addresses, so it's stretching things a bit to rely on what might be returned. Perhaps a state is considered more like a full address than just a country, or a planet. It is not the only geocoder ; others might be more fit for purposehttp://groups.google.com/group/google-maps-api/web/resources-non-goog... this one looks relevanthttp://www.geonames.org/ There are only a limited number of countries ; it wouldn't be too onerous to make your own look-up table for this. Raw datahttp://www.nearby.org.uk/coords/countries.csv -- You received this message because you are subscribed to the Google Groups Google Maps JavaScript API v3 group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
[Google Maps API v3] Re: Opening the map focussing on a country using the country code
If I do this in my case the map is focussed on the city of Bern in Switzerland! Gerrit. On 9 feb, 15:10, Chris Broadfoot c...@google.com wrote: Just geocoding the two letter country code seems to work: Web services call to demonstrate results:http://maps.googleapis.com/maps/api/geocode/json?address=BEsensor=false In v3: geocoder.geocode({address: 'BE'}, function(.. Chris --http://twitter.com/broady -- You received this message because you are subscribed to the Google Groups Google Maps JavaScript API v3 group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
Re: [Google Maps API v3] Re: Opening the map focussing on a country using the country code
On Thu, Feb 10, 2011 at 9:31 PM, Gerrit de Bolster cbst...@home.nl wrote: If I do this in my case the map is focussed on the city of Bern in Switzerland! That's because you're choosing the first result. You should look for a result with type country. -- http://twitter.com/broady -- You received this message because you are subscribed to the Google Groups Google Maps JavaScript API v3 group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.