Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Yahoo geocoder jMaki widget for Phobos (See related posts)

Yahoo geocoder jMaki widget for Phobos

<% library.jmaki.insert(
    {
        component : "yahoo.geocoder",
        service : "xhp"
    }
    ); %> 

<script  type:"text/javascript">
    function geoCoderListener(coordinates) {
    var targetDiv = document.getElementById("geocoder001_message");
    var reponseText  = "";
    for (var i in coordinates) {
        reponseText += "Latitude=" + coordinates[i].latitude + " Longitude=" +  coordinates[i].longitude + "<br>";
    }
    targetDiv.innerHTML = reponseText;
    }
    // subscribe to the topic '/yahoo/geocode' to which this widget publishes events
    jmaki.subscribe("/yahoo/geocoder", geoCoderListener);
</script>
<div id="geocoder001_message"></div>


You need to create an account or log in to post comments to this site.


Click here to browse all 4834 code snippets

Related Posts