Lennart Moltrecht
2008-12-23 21:39:44 UTC
Hello!
I'm currently trying to develop a Facebook application that shows a
map of all your Facebook friends. I use the Google Maps API for this
map and place markers on the spots where my friends live.
In order to geocode the city/country information I get from Facebook,
I use a modified version of the showAddress function provided in one
of the examples. Here is my version:
function showAddress(address, name) {
geocoder.getLatLng(
address,
function(point)
{
if (!point)
{
missing += name + ": " + address + "\r\n";
}
else
{
success += name + ": " + address + "\r\n";
var marker = new GMarker(point, { icon:redIcon,
title:address });
map.addOverlay(marker);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(name + ": " +
address);
});
}
}
);
}
When the user loads the page, I call this function as often as the
user has friends with location information in their profile, for me
this is about 100 times. For some reason, only a few markers (around
30) are shown on the map, the others are ignored. And it's not always
the same marker is ignored, when I refresh the page, some appear and
some disappear. This is very weird, so I decided to track which
markers are shown and which aren't, that's why I add them to the
missing/success strings.
I can't really find the error, because sometimes a location that
Google should be able to find (e.g. "Singapore, Singapore") is not
shown. So the only idea I have is that the Geocoder Limit is stopping
some of my requests (link to the FAQ: http://code.google.com/apis/maps/faq.html#geocoder_limit
). But I never made 15.000, so it's perhaps because I do it too fast?
What else can I do? Please help me!!
Here is an example of how my missing/success lists may look:
missing:
undefinedManaswini Rao:Bangalore, India
Moritz Nieschlag:Hamburg, Germany
Tim Guckelsberger:L'Anse au Loup, Canada
Malin Joneleit:Jamaica, United States
Victoria Pistivsek:Vienna, Austria
Jannik Djamilda:Jork, Germany
Amandine Michalski:Berlin, Germany
Jordan Ralph:Portsmouth, United Kingdom
Wei Cheng Heng:Choa Chu Kang New Town, Singapore
Sukanyaa Suresh:Singapore, Singapore
Bulut Gok:Istanbul, Turkey
Joshua Tan:Singapore, Singapore
Vanessa Garbers:Buxtehude, Germany
Aarthi Ravi:Singapore, Singapore
Beke Lüdtke:Jork, Germany
Tan Ning:Singapore, Singapore
Christian Teo:Singapore, Singapore
Josselin Petit-Hoang:Vannes, France
Alley Petrella:Greensburg, United States
Christina Bredehöft:Buxtehude, Germany
Low WeiLin:Singapore, Singapore
Michelle Jayalie:Medan, Indonesia
Benedikt Schulte:Hamburg, Germany
Jasper Moltrecht:Buxtehude, Germany
Iris Chew:Hamburg, Germany
Nina Moltrecht:Aachen, Germany
Niclas Meier:Buxtehude, Germany
Simon Eberhardt:Heidenheim an der Brenz, Germany
Lena Hellwig:Norman, United States
Jonathan Pape:Buxtehude, Germany
Markus Mohr:Hamburg, Germany
Stephan Bräuer:Buxtehude, Germany
Parameswari Kunnasegaran:Singapore, Singapore
Jana Aug.:Hong Kong, Hong Kong
Matthias Huhn:Oer-Erkenschwick, Germany
Ramona Heitmann:Hamburg, Germany
Carolin Möllers:Mastholte, Germany
Judith Keil:Buxtehude, Germany
Bjorn Schulz:Halifax, Canada
Ron Tuvia:Nahal `Oz, Israel
Mareile Fruhner:Buxtehude, Germany
Christina Le:Buxtehude, Germany
�ukasz Borowy:Gorzów Wielkopolski, Poland
Joanna Kubejko:Gorzów Wielkopolski, Poland
Bartek Szymczak:Gorzów Wielkopolski, Poland
Milla Arikka:Turku, Finland
Moritz Harms:Jork, Germany
Steffen Sumfleth:Jork, Germany
Charlotte Jesch:Buxtehude, Germany
Jara Beckmann:Buxtehude, Germany
Sarah Gittermann:Horneburg, Germany
Christoph Schröder:Bruchhausen-Vilsen, Germany
Jannes Kruse:Buxtehude, Germany
Sönke Detjen:Buxtehude, Germany
success:
undefinedTom Nusseck:Hamburg, Germany
Lim Ai:Singapore, Singapore
Lukas Wölfel:Ludwigshafen, Germany
Anna Wana:Hendon, United Kingdom
Vanessa Chin:Johor Bahru, Malaysia
Jacob Kroeger:Sunderland, United States
Eugene Koh:Seoul, South Korea
Jill Keshyap:Singapore, Singapore
Ami Firdaus:Singapore, Singapore
Angus Comrie:Cape Town, South Africa
Mooly Jarjoura:Nazareth, Israel
Anja Gros:Visnja Gora, Slovenia
Gong Tan:Singapore, Singapore
Lisa Heiy:Buxtehude, Germany
Stevan Brckalo:Marburg, Germany
Nuraini Mansor:Singapore, Singapore
Joeran Blendermann:Buxtehude, Germany
Anish Mayuran:Sembawang, Singapore
Karl Nagel:Tartu, Estonia
Mari Mäkinen:Quebec, Canada
Floriane Fricaud:Nantes, France
Diyanah Nur:Singapore, Singapore
Afiq Azman:Singapore, Singapore
Tobias Arciszewski:Hamburg, Germany
Martin Birch:Buxtehude, Germany
Linda Rulle:Riga, Latvia
Wanda Tiefenbacher:Graz, Austria
Jasmin Burchert:Jork, Germany
Saskia Hesebeck:Buxtehude, Germany
Muhammad Afiq Roslim:Sembawang, Singapore
Ziyue Liu:Shanghai, China
Simon Vipavec:Crnomelj, Slovenia
Yoanna Georgieva:Sofia, Bulgaria
Maike Müller:Hamburg, Germany
Daria Gurschi:Chisinau, Moldova
Torben Nodop:Buxtehude, Germany
I'm currently trying to develop a Facebook application that shows a
map of all your Facebook friends. I use the Google Maps API for this
map and place markers on the spots where my friends live.
In order to geocode the city/country information I get from Facebook,
I use a modified version of the showAddress function provided in one
of the examples. Here is my version:
function showAddress(address, name) {
geocoder.getLatLng(
address,
function(point)
{
if (!point)
{
missing += name + ": " + address + "\r\n";
}
else
{
success += name + ": " + address + "\r\n";
var marker = new GMarker(point, { icon:redIcon,
title:address });
map.addOverlay(marker);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(name + ": " +
address);
});
}
}
);
}
When the user loads the page, I call this function as often as the
user has friends with location information in their profile, for me
this is about 100 times. For some reason, only a few markers (around
30) are shown on the map, the others are ignored. And it's not always
the same marker is ignored, when I refresh the page, some appear and
some disappear. This is very weird, so I decided to track which
markers are shown and which aren't, that's why I add them to the
missing/success strings.
I can't really find the error, because sometimes a location that
Google should be able to find (e.g. "Singapore, Singapore") is not
shown. So the only idea I have is that the Geocoder Limit is stopping
some of my requests (link to the FAQ: http://code.google.com/apis/maps/faq.html#geocoder_limit
). But I never made 15.000, so it's perhaps because I do it too fast?
What else can I do? Please help me!!
Here is an example of how my missing/success lists may look:
missing:
undefinedManaswini Rao:Bangalore, India
Moritz Nieschlag:Hamburg, Germany
Tim Guckelsberger:L'Anse au Loup, Canada
Malin Joneleit:Jamaica, United States
Victoria Pistivsek:Vienna, Austria
Jannik Djamilda:Jork, Germany
Amandine Michalski:Berlin, Germany
Jordan Ralph:Portsmouth, United Kingdom
Wei Cheng Heng:Choa Chu Kang New Town, Singapore
Sukanyaa Suresh:Singapore, Singapore
Bulut Gok:Istanbul, Turkey
Joshua Tan:Singapore, Singapore
Vanessa Garbers:Buxtehude, Germany
Aarthi Ravi:Singapore, Singapore
Beke Lüdtke:Jork, Germany
Tan Ning:Singapore, Singapore
Christian Teo:Singapore, Singapore
Josselin Petit-Hoang:Vannes, France
Alley Petrella:Greensburg, United States
Christina Bredehöft:Buxtehude, Germany
Low WeiLin:Singapore, Singapore
Michelle Jayalie:Medan, Indonesia
Benedikt Schulte:Hamburg, Germany
Jasper Moltrecht:Buxtehude, Germany
Iris Chew:Hamburg, Germany
Nina Moltrecht:Aachen, Germany
Niclas Meier:Buxtehude, Germany
Simon Eberhardt:Heidenheim an der Brenz, Germany
Lena Hellwig:Norman, United States
Jonathan Pape:Buxtehude, Germany
Markus Mohr:Hamburg, Germany
Stephan Bräuer:Buxtehude, Germany
Parameswari Kunnasegaran:Singapore, Singapore
Jana Aug.:Hong Kong, Hong Kong
Matthias Huhn:Oer-Erkenschwick, Germany
Ramona Heitmann:Hamburg, Germany
Carolin Möllers:Mastholte, Germany
Judith Keil:Buxtehude, Germany
Bjorn Schulz:Halifax, Canada
Ron Tuvia:Nahal `Oz, Israel
Mareile Fruhner:Buxtehude, Germany
Christina Le:Buxtehude, Germany
�ukasz Borowy:Gorzów Wielkopolski, Poland
Joanna Kubejko:Gorzów Wielkopolski, Poland
Bartek Szymczak:Gorzów Wielkopolski, Poland
Milla Arikka:Turku, Finland
Moritz Harms:Jork, Germany
Steffen Sumfleth:Jork, Germany
Charlotte Jesch:Buxtehude, Germany
Jara Beckmann:Buxtehude, Germany
Sarah Gittermann:Horneburg, Germany
Christoph Schröder:Bruchhausen-Vilsen, Germany
Jannes Kruse:Buxtehude, Germany
Sönke Detjen:Buxtehude, Germany
success:
undefinedTom Nusseck:Hamburg, Germany
Lim Ai:Singapore, Singapore
Lukas Wölfel:Ludwigshafen, Germany
Anna Wana:Hendon, United Kingdom
Vanessa Chin:Johor Bahru, Malaysia
Jacob Kroeger:Sunderland, United States
Eugene Koh:Seoul, South Korea
Jill Keshyap:Singapore, Singapore
Ami Firdaus:Singapore, Singapore
Angus Comrie:Cape Town, South Africa
Mooly Jarjoura:Nazareth, Israel
Anja Gros:Visnja Gora, Slovenia
Gong Tan:Singapore, Singapore
Lisa Heiy:Buxtehude, Germany
Stevan Brckalo:Marburg, Germany
Nuraini Mansor:Singapore, Singapore
Joeran Blendermann:Buxtehude, Germany
Anish Mayuran:Sembawang, Singapore
Karl Nagel:Tartu, Estonia
Mari Mäkinen:Quebec, Canada
Floriane Fricaud:Nantes, France
Diyanah Nur:Singapore, Singapore
Afiq Azman:Singapore, Singapore
Tobias Arciszewski:Hamburg, Germany
Martin Birch:Buxtehude, Germany
Linda Rulle:Riga, Latvia
Wanda Tiefenbacher:Graz, Austria
Jasmin Burchert:Jork, Germany
Saskia Hesebeck:Buxtehude, Germany
Muhammad Afiq Roslim:Sembawang, Singapore
Ziyue Liu:Shanghai, China
Simon Vipavec:Crnomelj, Slovenia
Yoanna Georgieva:Sofia, Bulgaria
Maike Müller:Hamburg, Germany
Daria Gurschi:Chisinau, Moldova
Torben Nodop:Buxtehude, Germany