<p>I have a list of addresses from a Database for which I'd like to put markers on a Yahoo Map. The <a href="http://developer.yahoo.com/maps/ajax/V3.8/index.html#YMap" rel="nofollow noreferrer"><code>addMarker()</code> method</a> on YMap takes a YGeoPoint, which requires a latitude and longitude. However, Yahoo Maps must know how to convert from addresses because <code>drawZoomAndCenter(LocationType,ZoomLevel)</code> can take an address. I could convert by using <code>drawZoomAndCenter()</code> then <code>getCenterLatLon()</code> but is there a better way, which doesn't require a draw?</p>

[{'answer_id': 73625, 'author': 'Paul Reiners', 'author_id': 7648, 'author_profile': 'https://Stackoverflow.com/users/7648', 'pm_score': -1, 'selected': False, 'text': '<p>If you\'re working with U.S. addresses, you can use <a href="http://geocoder.us/" rel="nofollow noreferrer">geocoder.us</a>, which has <a href="http://geocoder.us/help/" rel="nofollow noreferrer">APIs</a>.</p>\n\n<p>Also, <em>Google Maps Hacks</em> has a hack, <a href="http://safari.oreilly.com/0596101619/googlemapshks-CHP-7-SECT-2" rel="nofollow noreferrer">"Hack 62. Find the Latitude and Longitude of a Street Address"</a>, for that.</p>\n'}, {'answer_id': 81551, 'author': 'David Bick', 'author_id': 4914, 'author_profile': 'https://Stackoverflow.com/users/4914', 'pm_score': 2, 'selected': True, 'text': '<p>You can ask the map object to do the geoCoding, and catch the callback:</p>\n\n<pre><code>&lt;script type="text/javascript"&gt; \nvar map = new YMap(document.getElementById(\'map\'));\nmap.drawZoomAndCenter("Algeria", 17);\n\nmap.geoCodeAddress("Cambridge, UK");\n\nYEvent.Capture(map, EventsList.onEndGeoCode, function(geoCode) {\n    if (geoCode.success)\n        map.addOverlay(new YMarker(geoCode.GeoPoint));\n});\n&lt;/script&gt;\n</code></pre>\n\n<p>One thing to beware of -- in this example the <code>drawAndZoom</code> call will itself make a geoCoding request, so you\'ll get the callback from that too. You might want to filter that out, or set the map\'s centre based on a GeoPoint.</p>\n'}]
['https://Stackoverflow.com/questions/73524', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5346/']