Welcome to MSDN Blogs Sign in | Join | Help

Silverlight 2 Beta 2 Now Available!

Silverlight 2 Beta 2 is now available for download.  This includes updated Visual Studio and Expression Blend tools also!  Silverlight 2 Beta 2 adds a bunch of improvements over Silverlight 2 Beta 1 including many new and enhanced UI controls, improved networking support for connecting to network services, improved data binding, and improved WPF compatibility.  Check out Scott Guthrie's Blog for more details.

Posted by keithkin | 1 Comments
Filed under:

Virtual Earth v6.1 Map Control API Released!

The Virtual Earth v6.1 Map Control API was released today.  It is reverse compatible with the v6.0 version of the API.  Here's a list of some of the new enhancements:

  • Birdseye Hybrid - a new VEMapStyle.BirdseyeHybrid map style which allows you to switch to Birdseye view with the street overlays and labels over the map.  You can also switch to standard Birdseye style to turn the labels off.
  • Walking Directions - the GetDirections call now supports a VERouteOptions.RouteMode property which allows you to specify walking or driving directions.
  • Traffic-Based Routing - the GetDirections call now supports a VERouteOptions.UseTraffic property to specify if you want to routes to take traffic into consideration
  • Reverse Geocoding - a new FindLocations call was added to the map which takes a VELatLong and will return reverse-geocoded places for that location.
  • Enhanced Printing Support - a new SetPrintOptions call was added to put the map in a printing mode which significantly improves the printing experience for Virtual Earth across different browsers.
  • Improved Browser Support - Includes enhancements to improve the experience on Safari 2 and Safari 3 on the Mac.
  • New Navigation Control - Improved navigation control with Aerial and Birdseye with a Labels toggle to turn street labels on and off in both modes.
  • Improved 3D Experience - including more detailed textures and improved building models in cities -- currently visible in Las Vegas, Dallas, Phoenix, and Denver.  This will be expanded to future cities later this year.
  • Localized Directions - Localized itineraries for driving and walking directions for many locales.
  • Localized Navigation control - The navigation control now is localized for many locales

You can find all the latest details in the Virtual Earth Map Control SDK, Version 6.1.  Or you can download the Virtual Earth Map Control SDK (CHM file) directly.  You can also try out the updated Virtual Earth Interactive SDK.

Live Search Maps Update!

We just released an updated version of Live Search Maps built on the Virtual Earth platform.  It is difficult to list all the new features, but here are some of the new features:

  • Birdseye Imagery with Labels - Birdseye imagery now supports Road Labels showing roads and names on the birdseye scene similar to Aerial map style.  The navigation control was improved with a Labels toggle which now works in Aerial and Birdseye modes -- so you can turn the Labels on and off.
  • Improved 3D Experience - Improved 3D models and detailed textures including trees in cities.  Initially this is in Las Vegas, Phoenix, Denver, and Dallas but will be expanding to more cities in the future.  Improved 3DVIA Modelling
  • Improved Collections - Export collections to KML, GeoRSS, or GPX format.  Add a MapCruncher custom tile layers to your collection and view them in Live Search Maps. Previously this was only available for API users.Collections Explorer filtering - you can now filter your collection searches by tags . Subscribe to neighborhood region RSS feed
  • Improved Directions and Traffic- Directions now uses MSR Clear Flow technology for enhanced traffic-based routing.  Also added localized itineraries for certain locales.
  • Improved One-Click Directions - One-Click directions map is now interactive. Reverse geocoding is now supported so the address will be displayed when you right-click on the map and ask for 1-click Directions.
  • Enhanced Tour Support - Improved movie resolution support, speed control, and added photo support to movies
  • Improved Browser Support - Added Safari 3 and IE8 Beta Support
  • v6.1 Virtual Earth API - Reverse compatible with v6 and adds enhancements. I'll post more details about this in a future post.

For more details on the new Live Search Maps update, check out this post at the Virtual Earth Spaces Blog

Visual Studio 2008 Intellisense for Virtual Earth Map Control

Marc Schweigert has put together a CodePlex project to support Intellisense for the Virtual Earth Map Control in Visual Studio 2008.  VS2008 JavaScript Intellisense provides an interactive display showing functions and parameters with drop-down lists and documentation as you code.

 

The project is just starting and needs community support, if you are interested, feel free to join and contribute to the project.  Check out Marc's Blog for more details. 

Posted by keithkin | 2 Comments

Microsoft Research Releases Tiled Vectors Demo

Microsoft Research released a Tiled Vectors Demo which is available for download.  The demo shows a way to solve the problem of showing extremely large mapping data sets in the web browser.  If you have used the Virtual Earth AJAX/JavaScript Map Control or other web-based mapping controls or any web application with a large number of DOM elements/SVG/VML graphics, then you probably have seen that loading extremely large data sets (with thousands of points, lines, and polygons) can bring the browser to a crawl because of limitations in the browser DOM.

The Tiled Vectors Demo from MSR attempts to solve this problem by breaking up the shapepoints into constant-sized sets, similar to how MapCruncher breaks up images into image tiles.  Since the data is broken into constant-sized sets, the original data set can be arbitrarily large -- so the solution scales really well to extremely large data sets.  Regardless of which level of detail you are viewing the map from, the amount of data the map loads is always constant.  This significantly improves performance.  The vector data is still loaded using Virtual Earth VEShapeLayers in JavaScript -- so the shapes are still interactive and can be controlled from client code and respond to events.

You can see a demo page here:

Tiled Vectors Demo

For more detailed information regarding the Tiled Vectors approach and how you can apply it to your data sets, see:

Tiled Vectors Demo Information

Harley-Davidson Ride Planner with Virtual Earth

Chris Pendleton wrote a nice article on the Virtual Earth Evangelist Blog about Harley-Davidson's use of Virtual Earth in their Ride Planner application.  The application allows you to view some great motorcycle rides across America.  User can also upload their own custom routes to share with others.  You can also view information about each route and rate them, in addition to finding Harley dealerships, hotels, and events near routes. For more details see:

Virtual Earth Innovation at Harley-Davidson

Harley-Davidson Ride Planner

  >

Posted by keithkin | 0 Comments
Filed under:

.NET Framework Source Code Available

The .NET Framework source code is now available for download and you can debug with Visual Studio 2008.  This includes the .NET Base Class Libraries, ASP.NET, Windows Forms, and WPF.  ScottGu posted the details on his blog.

Posted by keithkin | 0 Comments

Virtual Earth API: Implementing Drag and Drop in Virtual Earth

Steve Lombardi posted some nice samples recently on the Virtual Earth Spaces blog showing how to implement drag and drop on shapes using the Virtual Earth map control API.  You just need to add a custom event handler for the "onmousedown", "onmousemove", and "onmouseup" events.

Here's the links to the working samples:

Simple Drag and Drop Sample

Collections Drag and Drop Sample

Virtual Earth API: Adding KML or GeoRSS Layers to the Map

One of the new features of the Virtual Earth v6 Map Control API is the ability to import KML layers on the map.  Previous versions of the API allowed you to import GeoRSS using client-side XML parsing.  However, one of the restrictions was that the GeoRSS file had to be on the same domain as the application or the browser would bring up a security warning unless the feed was from a trusted site in the client browser. 

For v6, we have improved this by added a new VEDataType.ImportXML option to the ImportShapeLayerData call on VEMap.  This new call uses the same service from Live Search Maps which allows users to import KML, GeoRSS, or GPX into user collections. In the Virtual Earth API, it will import the XML into a shape layer in your application.  It also allows you to load these data files from different domains without causing a browser security warning.

Here are the steps for importing a KML, GeoRSS, or GPX file into your Virtual Earth application:

  1. Create a shape layer

var shapeLayer = new VEShapeLayer();

   2. Create a shape source specification with type VEDataType.ImportXML, the url to the XML file, and a reference to the shape layer:

var shapeSpec = new VEShapeSourceSpecification(VEDataType.ImportXML,"http://dsc.discovery.com/utilities/googleearth/nationalparks/nationalparks.kml", shapeLayer);

   3. Import the data into shape layer by calling ImportShapeLayerData on the map with the specification:

map.ImportShapeLayerData(shapeSpec);

Here's a link to a simple example which imports a KML file from the Discovery Channel that shows different national parks around the United States:

Virtual Earth API - Import XML Sample

Note: you can also import XML files directly into Live Search Maps by opening a collection and then clicking on Import and entering the url.  You can also, use the following url syntax directly:

http://maps.live.com/?mapurl=[insert url here]

For example:

http://maps.live.com/?mapurl=http://dsc.discovery.com/utilities/googleearth/nationalparks/nationalparks.kml

Virtual Earth API: Bulk Adding Pushpins to a Layer to Improve Performance

One of the new features from the Virtual Earth v6 Map Control API is the ability to bulk add groups of pushpins to the map in one step.  This improves performance when putting a large number of pushpins on the map since the HTML markup of the pushpins is serialized and inserted in the map in one operation.

Bulk adding pushpins to the map consists of 3 steps:

  1. Create an array of pushpins
  2. Create an empty shape layer and add it to the map
  3. Add the array of pushpins to the shape layer

For example:

1. Create an array with a large number of pushpins:

var center = map.GetCenter();

var shapes = new Array();
for (i=0 ; i < 150; ++i)
{
     var shape = new VEShape(VEShapeType.Pushpin, new VELatLong(center.Latitude + Math.random()*20 - 10, center.Longitude + Math.random()*20 - 10));
     shapes.push(shape);
}

2. Create an empty shape layer and add it to the map:

var shapeLayer = new VEShapeLayer();
map.AddShapeLayer(shapeLayer);

3. Add the array of pushpins to the shape layer:

shapeLayer.AddShape(shapes);

Here's a link to a working sample which adds pushpins to the map using the new bulk add approach.  It has a checkbox which allows you to turn off the bulk add and add the pushpins in the normal manner so you can compare the performance improvement between bulk add and the traditional approach.  The time to execute a bulk add operation tends to be about 1/2 the time of the traditional approach.

Virtual Earth API Bulk Add Pushpin Sample

Virtual Earth API: Setting Altitude of Shapes

The Virtual Earth v6 map control API added support for setting altitude of VEShapes in Virtual Earth 3D.  There is a new SetAltitude method on VEShape which takes in 2 parameters:

VEShape.SetAltitude(altitude, altitudeMode);

The altitude parameter is the altitude specified in meters.  The altitudeMode parameter is an optional VEAltitudeMode enumeration specifying the mode of the altitude.  If not specified, by default it is VEAltitudeMode.RelativeToGround which is meters above ground level.  You can also specify VEAltitudeMode.Absolute which is meters above the WGS84 ellipsoid.  When the VEShape is a pushpin, the altitude is a single floating point value.  When the VEShape is a polyline or polygon, it is an array of floating point values specifying the altitude for each point in the shape. 

There is also a new SetLineToGround method on the VEShape for polylines and polygon shapes which takes in a boolean to specify whether or not connect the points in the shape to the ground.  By default it is false.

The following sample shows some custom VEShapes at different altitudes.  It also demonstrates a polygon with points at different altitudes and the line to ground functionality:

Virtual Earth API Shape Altitude Sample

 

Virtual Earth API: Customizing Mouse Wheel Zoom

The Virtual Earth map control supports several interactive ways to zoom in and out on the 2D map view.  For example, you can:

  • Click on (or click and hold) the zoom In/zoom Out icons on the navigation control.
  • Double-click on the map to zoom in at a particular point.
  • Hold down the "Alt" key and then click and drag on the mouse to create a zoom box which will become the next view.
  • Use the mouse wheel to zoom in and zoom out.

By default, when scrolling the mouse wheel up, it will zoom in on the center of the current view.  When scrolling the mouse wheel down, it will zoom out with the center of the view the center of the scene.

The Virtual Earth v5 and v6 API allow you to override many of the Virtual Earth events with the VEMap.AttachEvent call including many mouse events such as "onclick", "ondoubleclick", "onmousemove", "onmousedown", and "onmousewheel".  Your event handler can override the default Virtual Earth behavior by returning true from the handler.  If you return false from your event handler, your custom behavior and the default behavior will be executed.  For example, the following code snippet shows how to override "onmousedown" and "onmousewheel" for 2D in v6:

function EventMouseDown()
{
   //insert custom behavior here...
   //return true to disable the default behavior. return false to enable the default behavior.
   return true;
}


function EventMouseWheel()
{
   //insert custom behavior here...
   //return true to disable the default behavior. return false to enable the default behavior.
   return true;
}

map.AttachEvent("onmousedown", EventMouseDown);
map.AttachEvent("onmousewheel", EventMouseWheel);

Here's a link to a working example with checkboxes allowing you to turn off mouse down and mouse wheel events in 2D:

Virtual Earth API Event Customization Sample

The v6 also API added a simpler built-in approach to overriding the default mouse wheel zoom behavior. The default zoom in behavior for the mouse wheel is to zoom to the center of the map view. However, some users want the mouse wheel to zoom to the mouse cursor in the view.  To make this simple so you do not have to override "onmousewheel", we went ahead and added the SetMouseWheelZoomToCenter call to VEMap.  By default it is set to true so mouse wheel events will zoom to the center of the scene.  However, if you pass false to this function, the mouse wheel will zoom to the mouse cursor.

Here's a link to a working example with radio buttons allowing you to select mouse wheel "Zoom to Center" or "Zoom to Mouse" behavior in 2D:

Virtual Earth Mouse Wheel Zoom Sample

Virtual Earth API: Accurately Position Points in Birdseye

In the Virtual Earth v6 API, one of the new features is improved Birdseye accuracy.  The Virtual Earth v6 API has some new methods to more accurately position pushpins when in Birdseye view. 

Satellite (Aerial/Hybrid) and Road imagery views are direct overhead views, so calculations to position a pushpin at an exact latitude and longitude are not as complex as in Birdseye.  The camera is directly overhead the point and the elevation of that point on the Earth does not need to be taken into account in 2D.  However, with Birdseye imagery taken from different angles, there are a lot more variables to consider when calculating where to position a point including the camera position and the elevation of the Earth in that scene.

In order to do this calculation efficiently in Birdseye, a service request is made from the client to the server to get more accurate positions.  For some applications, the client-side, less-accurate, faster calculation may be enough to position points.  Because of this, enhanced birdseye accuracy for pushpins is off by default in the Virtual Earth API. 

To turn on enhanced Birdseye Accuracy for pushpins in the Virtual Earth API, you can make the following call (assuming you have a VEMap instance called "map"):

map.SetShapesAccuracy(VEShapeAccuracy.Pushpin);

To turn off enhanced Birdseye Accuracy for pushpins, you can make the following call:

map.SetShapesAccuracy(VEShapeAccuracy.None);

Here is a link to sample Virtual Earth application showing 3 points on Lombard Street in San Francisco with a checkbox which turns Birdseye Accuracy on and off:

Virtual Earth Birdseye Accuracy Sample

Notice in Aerial view, the 3 yellow dots are positioned at precise points along Lombard Street:

If you click on "Bird's eye" on the navigation panel and click on different orientations ("N", "W", "E", "S") on the compass in the navigation panel, you will notice the 3 yellow dots are still positioned rather accurately in Birdseye.

Here's a screenshot of the Birdseye scene looking toward the West with enhanced accuracy enabled:

Virtual Earth API: How to Create a Full-Screen Virtual Earth Mashup

Using the Virtual Earth Map Control API, it is very simple to create a mashup application that is full screen and takes up the entire browser window. 

Here is the source code for creating a v6 Virtual Earth full-screen mashup:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Virtual Earth v6 API - Full Screen Sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6"></script>
<script type="text/javascript">
var map = null;

function CreateMap()
{
     map = new VEMap('myMap');
     map.LoadMap();
}
</script>
</head>
<body style="width:100%;height:100%; margin:0 0 0 0;" onload="CreateMap();">
<div id='myMap' style="position:absolute;top:0px; left:0px; width:100%; height:100%;"></div>
</body>
</html>

Here is a link to the complete full-screen example:

Virtual Earth v6 Full Screen Sample

Many people have asked about this since there is a slight difference for v6 full screen mashups than in the previous v5 version.  In the v5 version, you did not have to set the style on the body to make it full screen -- you would only have to set it on the map DIV. This is because the v5 API would set the width and height of the body by default to 100%.  However, in the v6 API we have decided to remove the width and height settings on the body since the Virtual Earth map control does not own the body element of the page and not all mashup applications will want the height and width of the body set to 100%.  Because of this change, if you only set the map DIV width and height to a percentage, this percentage may not be of the full screen because it depends on the parent container width and height -- which in this case is the body.  Setting both the body width and height and the map DIV width and height to 100% will make the mashup full screen.

California Fires

The fire outbreak in California has been an immense tragedy with millions of people displaced from their homes and millions of dollars of damage.  Access to the latest information is critical for many trying to find loved ones, trying to evacuate, and those trying to return to their homes.  You can see the latest information on the fires with this Live Search Maps Collection:

California Fires Live Search Maps Collection

This collection can also be viewed from MSNBC at:

MSNBC: Map: Fires of Southern California

You can also subscribe to the Collection RSS feed and get the latest updates from any RSS reader using the following URL:

California Fires Live Search Maps Collection RSS Feed

Posted by keithkin | 1 Comments
More Posts Next page »
 
Page view tracker