Azure SQL 2008 – Bing Maps – Near Route Demo

Azure SQL 2008 – Bing Maps – Near Route Demo

After the announcement http://bingmapswatch.blogspot.com/2010/03/bing-maps-sql-azure-support-april-2010.html that Azure SQL 2008 was implmenting Spatial Support (Geography and Geometry) this now enabled.

This is an example of combining, Windows Azuew, SQL Azure, Silverlight and Bing Maps to produce a find along a route example

Windows Azure SQL 2008 Bing Maps Find Near a Route
Finding Petrol (Gas) Stations along a route (Boston to Chicago) within 1km (1000m) of the route.

The code inside Azure SQL 2008 doing this is

@myGEOM is the lat and lng (x1,y2)+(x2,y2) start and end points for the route
@myBuffer is the buffer distance (1000m default)
@myRoute is the (xy,xy,xy,xy) of the enitre route creating a polyline
This polyline is then buffered creating a polygon (area) around the route.
SQL 2008 Azure then uses Geoproccessing 'Buffer' and 'Intersect' to pull-out
any points (gas stations in this example) and then displays the points as markers
on bing maps

code:

 CREATE PROCEDURE [FindNearRoute] @myGEOM nvarchar(MAX), @myBuffer int
AS
   --Create the Buffer
   DECLARE @myRoute geography;
   SET @myRoute = @myGEOM;

   DECLARE @SearchArea geography;
   SET @SearchArea = @myRoute.STBuffer(@myBuffer);

   --Return all POI in the search area
   SELECT Lat, Lon, Name
   FROM PetrolStations
   WHERE (@SearchArea.STIntersects(GEOM)) = 1

Live Example (Silverlight required)
http://talkingdonkey.cloudapp.net/BM-SL-FindNearRoute/Default.htm

There is also a zip file (BM-FindNearRoute.zip) with all the source code required to create your own find near a route example.

Source
http://johanneskebeck.spaces.live.com/blog/cns!42E1F70205EC8A96!12533.entry

The map markers! They move!

Maps API v2 had a built in animation that raised and bounced the marker when it was being dragged. When we looked into adding this feature to Maps API v3 we decided to go a step further and give developers more options for animating markers.

In addition to adding the drag animation offered in v2 we are today releasing two new marker animations that developers can trigger. Firstly there is BOUNCE which simply bounces a marker indefinitely to draw attention to it. The other is DROP which adds a marker to the map by dropping it from above with a small bounce.

We rely on a combination of JavaScript and CSS animations to ensure smooth motion across all devices, which was particularly challenging for the DROP animation, as it has a very short duration with a lot of movement. As a consequence this is the first feature we have launched that is not compatible with IE6 since we ended support for that browser (markers still appear in IE6 and can be dragged, but do not animate).

For more details on how to trigger animations check the documentation. While you are there you may notice that the MaxZoom service, which allows you to determine the maximum zoom level of satellite imagery available at a given location, is also now available in Maps API v3.

As always, if you have any questions about these features, or any other aspect of Maps API v3 development, we recommend that you post to the Google Maps API v3 Forum.