Jim Bonnie's Blog

Jun 30

Written by: jbonnie
Friday, June 30, 2006 9:09:06 PM 

This is a quick overview of how Virtualearth can be integrated into Dotnetnuke

The best way to get started with VirtualEarth is to check out Dr Neil's site www.viavirtualearth.com. There is a number of how to articles and an excellent collection of demonstration sites.

Microsoft has also posted samples, and a reference guide at http://dev.live.com/virtualearth/sdk/

You can always frame in www.local.live.com into your DNN site, but where is the fun in that!!!

The simplest way that I have gotten virtualearth into DNN is by updating your modules ASCX file in HTML edit mode
1) Add a reference to the VE 3 javascript from Microsoft

<script src="http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js">  </script>

2) putting an html element, such as a DIV into your modules ASCX page

<div id='myMap' style=" position:relative;width:600px; height:400px;"></div>


3) place a routine into the ASCX page that loads the MAP
    <script>
      var map = null;
      function MyOnPageLoad()
      {
        map = new VEMap('myMap');
        map.LoadMap(new VELatLong(42, -96.1093), 8, 'r', false);
      }
    </script>

4) Ensure that your routine is called and the maps get loaded
a) Dr Neil does this with an onload event in the browser as follows:
 <body onload="MyOnPageLoad();">

b) I have been doing this by registering my routine with DNN and having the DNN Client API place a call to the onpageload routine
DotNetNuke.UI.Utilities.DNNClientAPI.AddBodyOnloadEventHandler(Page, "MyOnPageLoad();")

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 

Navigation

Register Login

About Me

Thanks for stopping by. My name is Jim Bonnie and I have been writing software for over 20 years. After building financial data systems for Reuters for nearly 18 years I have started doing contract work and am excited about technology and currently focus on Microsoft solutions. DotNetNuke has helped provide a good introduction to ASP.NET web application development, and I am now starting to branch out into other areas. Data Access techniques and SubSonic is something that I am looking into now. This has helped me get an invitation to speak at Las Vegas at DNN Open Force 07. it was a great time. And I am looking forward to OpenForce08, where I wil be presenting on TDD for DNN.

 

Reading the codebetter blogs and attending a nothing but .net training class with JP Boodhoo helped spark my interest in ALT.NET. I attended the first conference in Austin Texas, and it was amazing to see Scott Guthrie introduce the ASP.NET MVC framework.

Add to Technorati Favorites

View blog top tags

Links

Jim Bonnie's Blog

Jim Bonnie's Blog

Jim Bonnie's Blog