locked
bing maps in asp.net application RRS feed

  • Question

  • User351619809 posted

    Hi,

    I have list of facilities on my web page so for example I have

    ABC store1
    ABC store2
    XYZ store3

    on my web page

    I want when the user clicks on a particular store, I can pass the directions in a querystring to see the directions in bing map.


    I did lot of research and  found that bing provides the web services that I can call from my asp.net application. I was wondering someone has some code like this, I just want to see the one click directions when user clicks on the particular location.

    Any help will be appreciated. I also got the key from bing api's

     

    Tuesday, January 12, 2010 3:41 PM

All replies

  • User1095964419 posted

    I have used VirtualEarth in one of my app.. But you should download Microsoft.Live.ServerControls.VE.dll

    I am just pasting the code below..Once you have the dll in Bin folder you can just register the dll in which ever page you want

    aspx page

    <%@ Register Assembly="Microsoft.Live.ServerControls.VE" Namespace="Microsoft.Live.ServerControls.VE"
        TagPrefix="ve" %>


    <asp:ScriptManager ID="ScriptManager1" runat="server" />
                <ve:Map ID="VEMap" runat="server" Height="500px"   Width="730px" ZoomLevel="12"  
                Center-Latitude="40.764015" Center-Longitude="-73.982797" />

    CSharp Code Behind

    protected void Page_Load(object sender, EventArgs e)
        {

        double lat = double.Parse(Request["lat"]);

        double long = double.Parse(Request["lat"]);

       string description = "Some description";

       AddShape(lat,long,description);

    }

    private void AddShape(double latitude, double longitude, string description)
        {
            LatLongWithAltitude point = new LatLongWithAltitude(latitude, longitude);
            Shape shape = new Shape(ShapeType.Pushpin, point);
            shape.Description = description;
            shape.CustomIcon = "images/yourImage.gif";
            VEMap.AddShape(shape);
        }

    Also you can point mulitple location too

    Hope this helps

    Thanks
    Deepu

    Don't forget to “Mark as Answer” on the post, if it helps you.

    Tuesday, January 12, 2010 4:54 PM
  • User351619809 posted

    I just have the address. I don't have latitude and longitude. so for e.g, I have

     

    1234 test ave.

    Testcity, 928561

     

     

    Tuesday, January 12, 2010 6:12 PM
  • User1095964419 posted

    okie try this :

    http://www.blogmenot.de/?p=13

    http://www.bing.com/toolbox/blogs/maps/archive/2008/04/10/live-search-maps-api.aspx

    Hope this helps

    Thanks
    Deepu

    Don't forget to “Mark as Answer” on the post, if it helps you.

    Tuesday, January 12, 2010 6:21 PM
  • User-1997237389 posted

    Hi!!

    I am Milind Kansagara working as a web developer. Here we have integrated Microsoft.Live.ServerControls.VE.dll in our project. But When we make the code live we are getting error “Could not load file or assembly ‘Microsoft.Live.Server Control.VE. Access Denaied”. The Error Comes Randomly Can anyone has solution ? please mail me on milind@cybercomcreation.com

    Regards,

    Milind Kansagara

    Monday, March 15, 2010 3:20 AM