How to Load Bing Map using Coordinates from Database?

Posted by Lukasz on Stack Overflow See other posts from Stack Overflow or by Lukasz
Published on 2010-03-23T01:46:40Z Indexed on 2010/03/23 1:51 UTC
Read the original article Hit count: 460

I have latitude and longitude saved inside a database. I have the bing map loading and I can set the VELatLong using regular values but can't seem to be able to load them from the database. Whatever I try the map just doesn't show at all.

<script type="text/javascript">
    var map = null;
    var selStyle = VEMapStyle.Road;
    var selMode = VEMapMode.Mode2D;
    var zoom = 14;

    var latLon = new VELatLong(40.67959657544238, -73.94073486328126); // NYC, NY

    var locationPin = null;

    function GetMap() {
        map = new VEMap("myMap");

        map.onLoadMap = InitialPin;

        map.SetCredentials("--KEY HERE--");
        map.LoadMap(latLon, zoom, selStyle, false, selMode, false);
        map.AttachEvent("onclick", OnClick_PinHandler);
    }
    window.onload = GetMap;
    window.onunload = DisposeMap;
</script>

Thanks for your help!

© Stack Overflow or respective owner

Related posts about bing-maps

Related posts about JavaScript