Joseph Guadagno

Founder of Southeast Valley .NET User and Microsoft Visual C# MVP

Join us for our 2nd social mixer of the year at Brunswick Zone in Gilbert for two hours of bowling and socializing taking place on Monday 2/22 at 6:00 PM.

We got a few lanes, a few shoes, some appetizers and some drinks sponsored by Comsys*.

Registration will be limited!

Register at: http://sevdnug0210.eventbrite.com

* The sponsor will cover a certain amount of the cost.  You might be required to purchase some of your own food and drink.

 


MSDN Events: Take Your Applications Sky High with Cloud Computing and the Windows Azure Platform

February 23rd

Join your local MSDN Events team as we take a deep dive into cloud computing and the Windows Azure Platform. We’ll start with a developer-focused overview of this new platform and the cloud computing services that can be used either together or independently to build highly scalable applications. As the day unfolds, we’ll explore data storage, SQL Azure, and the basics of deployment with Windows Azure. Register today for these free.

Register at: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032438178&Culture=en-US

MSDN Events Presents: From Zero to XAML in 4 Hours

March 23rd

Learning XAML for use in Windows Presentation Foundation (WPF) or Silverlight can be a little daunting. This seminar will introduce the basic concepts of XAML and show you how to get started quickly and easily. You wil be given an overview of XAML tools such as VS.NET 2010 and Expression Blend. If you are new to Silverlight and WPF you need to attend this seminar to see how to move to these powerful new platforms. The focus on this seminar is using XAML to build business applications.

Register at: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032439056&Culture=en-US

These are free events.  I would register while there is still room!


In my previous post, Using the Bing Maps Web Services for Geocoding Addresses, I talk about geocoding addresses using the Bing Maps Web Services. Now it is time to talk about getting imagery of maps, roads or aerials views for addresses or geocodes.

In order to get started using the Bing Maps Web Services, check out the previous post Getting Started section.

Bing Maps Web Services

Bing Maps Web Services is a set of Web services that allow you to add mapping and search functionality to your application, including location finding, map imagery, and routing capabilities. For example, you can:

Use the Imagery Service to:

  • Return a link to a map with a pushpin at a specific location
  • Provide a road map or bird’s eye or aerial imagery to you application

Use the Route Service to:

  • Get directions that include traffic warnings and route hints between multiple locations.
  • Get directions from all major roads to a destination (1-click directions, also referred to as a "party map") and then use the Imagery Service to map those routes.

For this post we will cover the Imagery service.

Just like the Geocode Service, there is a request, MapUriRequest, and response, MapUriResponse, object for the Imagery Service.

In order to get the Uri to display a map in your application you will need to use the imagery service client, ImageryServiceClient. The ImageryServiceClient needs to be instantiated with the WCF endpoint to use, by default it should be ‘BasicHttpBinding_IImageryService’. Then call the GetMapUri method passing your MapUriRequest object.

ImageryServiceClient imageryService = new ImageryServiceClient("BasicHttpBinding_IImageryService");
MapUriResponse mapUriResponse = imageryService.GetMapUri(mapUriRequest);
Building the MapUriRequest

The MapUrilRequest has two properties that need to be populated; the Credentials property which should contain you Bing Maps Id and either the Center, MajorRoutesDestination, or Pushpins property.  The code snippet below demonstrates instantiating the MapUriRequest and setting the properties based on values passed into a method (outlined later).

MapUriRequest mapUriRequest = new MapUriRequest
    {
      Credentials = new Credentials {ApplicationId = appId},
      Pushpins = pushpins,
      Center = new Location {Latitude = latitude, Longitude = longitude}
    };

Now you can customize the options for the map using the MapUriOptions property of the MapUriRequest object. Here is a list of the properties from the MSDN documentation:

Property name Description

DisplayLayers

A string array indicating the layer data to display on the map. Optional. The default value is null.

ImageSize A SizeOfint Class object specifying the height and width of the image to return. Optional. The default width is 350 and the default height is 350.
ImageType An ImageType Enumeration value specifying the format of the image to return. Optional. The default value is ImageType.Default, which means the default changes depending on the map style specified.
PreventIconCollision A bool indicating whether or not to separate pushpin icons that are close to each other on the map so that they are more visible. Optional. The default value is false.
Style A MapStyle Enumeration value specifying the map style of the image to return. Optional. The default value is MapStyle.Road.
UriScheme A UriScheme Enumeration value specifying the URI scheme to return. Optional. The default value is UriScheme.Http.
ZoomLevel An int indicating the zoom level of the map to return. Optional.

Assigning some of the options:

// Set the map options
MapUriOptions mapUriOptions = new MapUriOptions();
mapUriOptions.Style = MapStyle.Road;
mapUriOptions.ZoomLevel = zoom;
mapUriOptions.ImageSize = new SizeOfint {Height = height, Width = width};
// Set the options property of the request.
mapUriRequest.Options = mapUriOptions;

Now you are ready to call the image service client to get the MapUriResponse.

ImageryServiceClient imageryService = new ImageryServiceClient("BasicHttpBinding_IImageryService");
MapUriResponse mapUriResponse = imageryService.GetMapUri(mapUriRequest);

Here is a helper class,

,  which wraps the GetMapUri function with 8 different overloads.

Working with the MapUriResponse

The MapUriResponse object has three properties:

Name Description
BrandLogoUri The System.Uri of the Bing Maps brand logo image.
ResponseSummary A ResponseSummary Class object describing the response that was returned by the service.
Uri A string that is the URI of the requested map.

For brevity sake, we will just use the Uri property.  You should, though, for good programming practices, check the ResponseSummary property for any exceptions.

string mapUri = Imagery.GetMapUri("YourAppId", 47.62, -122.2);
imgMap.imageUrl = mapUri;

This call retrieve the Uri to use to display a 200x200 road map of the area at latitude 47.62 and longitude -122.2 with a zoom of 14, which is downtown Bellevue, WA.

image

If you want to add pushpins or markers similar to the above image you will need to populate the an array of PushPin objects. A PushPin object has an IconStyle which is the type of icon to use, a Label which an optional text to display on the pushpin (only works with certain pushpins) and the Location which contains the latitude and longitude that the pushpin should be located at.

That’s it.  It seems like a lot of work for a one line call.  With the attached Imagery.cs class, a lot of the overhead work was done for you.


For the MVPSummitEvents and Mix10Events site I wanted to create a map of all of the events listed on the site. In order to do that I needed to Geocode all of the addresses for the events.  There are several services out there for geocoding an address, Microsoft, Yahoo, and Google provide this service as well as others.  I decided to go with the Microsoft Bing services, being a Microsoft MVP.

Getting Started

Let’s get started. MSDN has just about everything you need to get started with using the Bing Map Web Services. 

Step 1: The first step is to get a key or token to use in your application for the Bing Maps Web Services application. This can be done by visiting the Bing Maps Account center and clicking on Create a Bing Maps account.

Step 2: If you are using Visual Studio, add a service reference to one or more Bing Maps Web Services that provide the features you need. See the Generating Client Proxy Classes topic and the Bing Maps Web Services Metadata topic.

VirtualEarthWebServicesWhether you used Visual Studio or the svcutil application you should have one file, most likely named VirtualEarthWebServices.cs. The file will contain a bunch of wrapper classes around the Bing Maps Web Services, and the required Windows Communication Foundation (WCF) classes. You will also see the generated configuration settings for the app or web config files.

Step 3: Set every Bing Maps Web Services request a valid Credentials property. You will see more on this in a bit.

Geocoding an Address

There are two properties that are required to successfully request a GeoCode for an address.

  1. 1) Set the Credential Property of the GeoCodeRequest object
  2. 2) Set either the Query property or Address property of the GeoCodeRequest object.

Here is a helper function that wraps the call to GeoCodeRequest.

/// <summary>
/// Gets the location.
/// </summary>
/// <param name="appId">The app id.</param>
/// <param name="address">The address.</param>
/// <returns></returns>
public static GeocodeResponse GetGeocodeResponse(string appId, string address)
{
    GeocodeRequest geocodeRequest = new GeocodeRequest
      {
          Credentials = new Credentials {ApplicationId = appId},
          Query = address
      };
    ConfidenceFilter[] filters = new ConfidenceFilter[1];
    filters[0] = new ConfidenceFilter {MinimumConfidence = Confidence.High};
    GeocodeOptions geocodeOptions = new GeocodeOptions {Filters = filters};
    geocodeRequest.Options = geocodeOptions;

    GeocodeServiceClient geocodeServiceClient = new GeocodeServiceClient("BasicHttpBinding_IGeocodeService");
    return geocodeServiceClient.Geocode(geocodeRequest);
}

This method will return a GeocodeResponse object. The GeocodeResponse object contains three properties that are populated based on the query.

Name Description

BrandLogoUri

The System.Uri of the Bing Maps brand logo image. (Inherited from the ResponseBase Class.)

ResponseSummary A ResponseSummary Class object describing the response that was returned by the service. (Inherited from the ResponseBase Class.) This class returns any exceptions that we raised during the request.
Results A GeocodeResult Class array, where each element is a possible match returned by the Geocode Service.

To keep this article short(er) I will just cover the Results object. Depending on the Confidence filter and Geocode options that were set in the call you could receive more than one result.

Let’s assume that we only want to work with the first result and get the Geocode for “1 Microsoft Way, Redmond, WA”. We simply call the static method of GetGeocodeResponse and pass in the Bing Maps API key and the address to search for.

var address = "1 Microsoft Way, Redmond, WA";
GeocodeResponse response = GetGeocodeResponse(appId, address);

Assuming the address was found we can now work with the properties of the GeocodeResult class to find out the Geocode.  The Geocode is located in the Locations property which is an array of GeocodeLocation objects. If the Count of the Locations is greater than one, let’s just take the first one and update the txtLatitude and txtLongitude objects.

if (response.Results != null)
{
	var geocodeLocation = response.Results[0].Locations[0];
	if (geocodeLocation != null)
	{
	    txtLatitude.Value = geocodeLocation.Latitude;
	    txtLongitude.Value = geocodeLocation.Longitude;
	}
	else
	{
	    txtLatitude.Value = txtLongitude.Value = 0;
	}
}

That’s it. Next up, using the Bing Maps Web Services for getting map images.


Mix 10 Events Site Launched

Are you going to Mix10 in March? If so, you might want to check out the new site I launched call Mix 10 Events.  Mix 10 Events will be you one stop shop for all of the events and after parties at Mix10.

Anyone can create an event on the sign. All you need to do is sign in with you Windows Live credentials, and link to create an event will appear.  Please note, the event will not be available until it is reviewed and approved for display.

VisitMixEvents.info

Staying connected

Don’t feel like checking out the site every day to see what is happening? Here are a few resources to help you.

The site http://www.visitmixevents.info/default.aspx
RSS Feed http://www.visitmixevents.info/rss.ashx
GeoRSS Feed http://www.visitmixevents.info/rss.ashx?format=geo
iCal Feed http://www.visitmixevents.info/calendar.ashx
Map of events http://www.visitmixevents.info/map.aspx

Mobile Users

You will be able to view all of the events that are happening, even filter by day. In addition, you can view the events on a Map, and check out the event info.

Mobile Site http://www.visitmixevents.info/m/default.aspx
Mobile Map http://www.visitmixevents.info/m/m.aspx

Las Vegas

In case you do not want to check out the events, I mean “It’s Vegas Baby”. Here are some other resources, also accessible from the site.

Bing Local http://www.bing.com/local/default.aspx?q=Las+Vegas%2C+Nevada
Official Las Vegas Tourism http://www.visitlasvegas.com/vegas/index.jsp
Vegas.com Guide http://www.vegas.com/traveltips/

MVP Summit Events Launched

One thing that I have noticed of the past few years when it comes to conference or “Summits” is that there are a lot of after parties, tweets, etc. that happen.  Most of the time it is difficult to get the word out about these events or even find out about them.  That’s where MVPSummitEvents.com comes in.  The site will hopefully be a one stop shop to find public events that are happening at the Microsoft 2010 MVP Global Summit.

From the site you can add events, create venues, display events, subscribe to the RSS feed or iCal feed, download an event to outlook or calendar client that can consume a .VCS file. Note: the creation of events and venues requires you to sign in using your Windows Live Id account, no information from Live is used within our site.

If the site is successful, I plan to white label it to use with other events like MIX2010, TechEd, PDC, etc.

Let me know what you think at jguadagno@sevdnug.org


The Southeast Valley .NET User Group is looking for some speakers for 2010. The meetings are held monthly typically on the fourth Thursday of the month, although we can move the meeting to make it easier for speakers.  The meetings are held in Chandler, AZ about 20 miles south of downtown Phoenix, AZ. 

This year we had Tim Rayburn and Alan Stevens speak at the user group.  Add your name to the list, contact me at jguadagno @ sevdnug.org

Here are some of the topics that the community is looking for…

  • ASP.NET
  • Entity Framework
  • LINQ
  • Managed Extensibility Framework (MEF)
  • Windows Communication Framework
  • Windows Presentation Framework
  • I hope to hear from you!


    Events for 2010

    I recently sat down with some other community evangelists in the Chandler / Phoenix area to talk about some of the events that I plan to put on in the coming year. 

    To get updates on these events follow me on Twitter @jguadagno and the Southeast Valley .NET User Group @SEVDNUG and continue to watch this blog.

    Putting on an event is time consuming, any help I receive is appreciated.  If you are interest let me know… jguadagno @ sevdnug.org

    Here is the list, please note that the dates are not set in stone yet.

     

    Weekly Events

    Tech Lunch South

    A weekly technology agnostic lunch meeting open to all.

    http://www.techlunchsouth.com

    Every Tuesday.

    Hacknight *

    A weekly technology agnostic event open to all.

    http://gangplankhq.com/collaborative/

    Every Wednesday night.

     

    Monthly Events

    Southeast Valley .NET User Group

    http://www.sevdnug.org 

    Monthly on the 4th Thursday of the month.

     

    Gangplank Jr.

    A monthly meeting dedicated to kids from 4 – 18 years of age. Topics include, development, robotics, drawing, photography, cooking and more.

    http://www.gankplankjr.com

    Monthly (the day has not been determined yet)

     

    The Rest of Year

    Phoenix Bar Camp

    BarCamp is an ad-hoc gathering born from the desire for people to share and learn in an open environment. It is an intense event with discussions, demos and interaction from participants who are the main actors of the event.

    http://www.barcampphoenix.com

    February and August

     

    Desert Code Camp

    http://www.desertcodecamp.com

    May and November

     

    AZGiveCamp *

    AZGiveCamp is a massive weekend event where the software development community comes together to support charities and non-profits by developing or improving their web sites and applications. It's fun, it's agile, it's geeky, and it's good for the community.

    If you are interested in helping out as a volunteer, organizer, or sponsor, we would like to hear from you! Please check out our FAQs, and then drop them an email through our Contact Us page.

    http://www.azgivecamp.org

    March or April.

     

    Gangplank Jr. Code Camp

    A code camp style event for kids from the ages of 4 – 18.

    no URL yet

    Quarterly or semi annual

     

    Startup Weekend **

    http://phoenix.startupweekend.org

    Spring

     

    Legend:

    * indicates an event that is taking place in the area that I am not running but I am part of.

    ** this event might need someone to organize it the area again.


    A November to Remember

    And no it is not because the Yankees won the World Series (although congrats to them) it is because it has been an awesome month for me personally and professionally.

    On the personal front…

    My son’s baseball team, which I am an assistant coach, finished the season undefeated in regular season games (end of year tournament in next week).  My son hit his first over the fence homerun which was a Grand Slam (technically not November but pretty awesome). My daughter's softball team, which I am an assistant coach, finished the season undefeated in regular season games (end of year tournament in next week).

    I get to go to fly back to NY in a few days to see family and friends and wish my mother a happy 60th birthday.

    On the professional front…

    I was elected to the North American INETA board of directors.

    I was elected to the AZGiveCamp executive committee, VP of Operations.  As the VP I will oversee the activities of the Logistics, Sponsorship, Technology and Publicity teams.

    I put together my first Code Camp, Desert Code Camp.

    I am presenting a Bird of Feather session at PDC with Chris Woodruff on “How to Build and Enrich Your Technical and Local Community” on Tuesday Nov 17 from 11a – 12p.  Stop by if you want to see how to build your community.

     

    That’s it for now.  Hopefully I can relax a bit in December.




    My first Code Camp is done and I wanted to jot down some of the lessons I learned.

    Bring EXTRA equipment! You will never now what people will want or need. Here’s a list of items that are good to have.

    • Adapters
      • DVI to VGA (those MACs)
      • HDMI to VGA
      • Multiple video to VGA
    • Mice
    • CAT5 cables
    • USB Cables
    • USB Flash drive

    Speakers

    • Speakers will cancel.  It is an unfortunate fact.
    • Don’t allow one speaker to speak at more than 3 sessions.  This reduces your risk in case of cancelation and prevents speaker fatigue.

    Schedule.  Printed schedules are good to have and good to hang.  Also add speaker names to the presentations.

    Name Tags. People like and want them.

    Venue

    • WIFI is key.  A reliable and unobtrusive WiFi connection is best.
    • You need to be able handle last minute room changes

    Food

    • Make sure you provide the person(s) that are ordering the food explicit instructions on the food.
    • Try to have more than just pizza.
    • You should have vegetarian and vegan options.

     

    And remember you are not going to be able to make EVERYONE happy.