Download Earth is not affiliated with Google in any way

Download Google Earth is free

By using our site you get free access to: Our Google Earth Tips & Tricks guides, Free Installation Guide & Videos, Free Technical Support Only Available To Our Members, More Free Software You Can Download, News On Free Software & Other Important Information, Access To Our Members Only News & Help Forums

Just Click Here To Get Started

Executing Driving Directions in virtual earth

Did you find the title amazing? How can we implement driving directions though the Microsoft Virtual Earth? Oh yes, it is quite a simple job. You can implement driving directions in this virtual earth program, here is how? Firstly, you need to make a pop-up menu to set the starting-point and end-point for your journey. After setting the menus precisely, you can discover how to build the code that will retrieve the directions for your journey. Now finalize a specific route on map. You will require a basic HTML page that displays the virtual earth map to start this work.

The very first thing you will need to define is a way for the user. This will allow you to define the end-points and starting points of the map. Start building the HTMP menu and then add it to the body. Then you can add different styles to define the menu. Then figure out a way that will make your menu appear as well as disappear. If you want the menu to appear when the user right clicks on the map, then should design a JavaScript method to show the map attach it with the ‘oncontextmenu’ event of our map.

Now write the JavaScript for displaying your menu. Here we need two global variables like popuplat and popuplon. These two variables define the position of the cursor after starting the process of adding start and end-points. The next step is to create shells for start and end directions. When the menu opens, the Virtual earth map control has no way of knowing when there is an occurrence of other mouse events. We are unable to capture a “click” event and thus, we cannot close the map.

Remember, every menu function closes the window by calling to RemovePopupMenu () function. Thus, at this stage you should have a virtual earth map with a pop-up menu that will close the menu on selecting any option. For executing the driving directions in Microsoft virtual earth, you should follow the following steps in a systematic order: Remove the existing start-pin and endpin and then create a pushpin for the start. Store the longitude and latitude in VELatLong object. Then finally close the popup menu.

Add more than two variables and then create the pushpin in Set Start method. Likewise, if the pushpin does not exist then the Delete Pushpin () method crafts an exception. When we try to insert a new pushpin with the same ID as an existing pushpin then we must perform a workaround. When we want to make use of custom pushpin, replace the null third parameter with a URL to an image. Now our application must show our popup menu and allow us to create pushpins for the start points and the end-points.

The actual magic of driving directions contains a single call to VEMap object. By passing out start point, end-point and some other parameters to GetRoute method, we can draw route on map.

Technorati Tags: , , ,

Tags: Microsoft Virtual Earth

Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Comments are closed.

We are not the company "Google" which is a registered trademark. We are a non affiliated 3rd party who is providing no cost tips, advice and troubleshooting for various software included in the "Google Software Pack".

I highly recommend the Google Software Pack. It comes with a lot of great software that is all FREE. You can also pick and choose which of the software products you want to download. You don't have to download them all. If you have a Mac or you don't want the Google Software Pack for some reason you can download it directly from the main site.

The main site for Google Earth is managed by Google at:

http://earth.google.com/