| Comments

as i continue to build on top of my virtual earth example that uses proximity searching, i found myself wanting to add more visualization to the mix.  i wanted the radius being searched to actually show a radius ring for the area...so the user could see the proximity being searched where the results are plotted.

so, i started digging -- how do you draw a circle using the polyline api?  hmmm...rounded corners with straight lines...seemed like a challenge.

well after a prod to some people i was pointed to a solution already doing this!

and thus the had the answer.  basically it is a javascript function like this:

   1:  function addCircle(polyname, latin, lonin, radius, vecolor, linewidth) 
   2:  { 
   3:      var locs = new Array(); 
   4:      var lat1 = latin * Math.PI/180.0; 
   5:      var lon1 = lonin * Math.PI/180.0; 
   6:      var d = radius/3956; 
   7:      var x; 
   8:      for (x = 0; x <= 360; x++) 
   9:      { 
  10:          var tc = (x / 90)* Math.PI / 2; 
  11:          var lat = Math.asin(Math.sin(lat1)*Math.cos(d)+Math.cos(lat1)*Math.sin(d)*Math.cos(tc)); 
  12:          lat = 180.0 * lat / Math.PI; 
  13:          var lon; 
  14:           if (Math.cos(lat1)==0) 
  15:          { 
  16:              lon=lonin; // endpoint a pole 
  17:          } 
  18:          else 
  19:          { 
  20:              lon = ((lon1 - Math.asin(Math.sin(tc) * Math.sin(d)/Math.cos(lat1)) + Math.PI) % (2 * Math.PI)) - Math.PI; 
  21:          } 
  22:          lon = 180.0 * lon / Math.PI; 
  23:          var loc = new VELatLong(lat,lon); 
  24:          locs.push(loc); 
  25:      } 
  26:      var poly = new VEPolyline(polyname, locs, vecolor , linewidth); 
  27:      return poly; 
  28:  }

(note: the 3956 indicates this is miles...if you need km, then you'd have to adjust the earth radius setting to be km instead)

now that i add that to my code, i simply call:

   1:  map.AddPolyline(addCircle("SearchRadius", center.Latitude, center.Longitude, $get("MilesRadius").value, new VEColor(255,0,0,1), 4));

and have a radius drawn around my resulted plot points.


the beauty is that as with everything, this applies to the 3d views as well:


very cool -- hope this helps others as well.

| Comments

the gang up in utah is organizing a code camp!  they have a call for speakers going on RIGHT NOW.

currently they have a developer and SQL track planned and are looking for speakers to present.  you don't have to be an expert...if you have an idea to share and speak about -- sign up!  code camps are a great mechanism to learn with your peers.

if you are interested in speaking, contact Pat Wright at [email protected] (put "code camp speaker" in the subject line).

| Comments

have you been looking at sharepoint (yeah, yeah, okay "moss")?  wanted to add some ajaxified love to those new interfaces?  or perhaps some of your own web parts.

take a look at some comments from on the topic.  in a recent post, mike talks about integrating asp.net ajax with sharepoint (see he doesn't even use moss).  there are some tips on extending the sharepoing web.config with the appropriate elements, yada yada.

in addition to that, writes about the and provides examples and code for you to use.

with these two resources it should be enough to get you started -- or at least thinking.

| Comments

i've got a few questions a while back on what i use for screenshots for my blog as well as for other areas (documentation, etc.).  i know there are a lot of popular programs out there, namely snagit, but i settled on a recommendation from scott hanselman and have been using .

sure in vista, there is a snipping tool, but i've not found it to be as efficient as winsnap which is smaller than paint.exe in size!

i recently started using the latest version of winsnap and figured i could integrate my other photo tool of choice () into the mix.  for me, the screenshot thing has always been a multi-step process: take the screenshot, save image, upload to .  well it dawned on me that i could use the same command-line interface that i use with and integrate that into winsnap...and boom, two clicks to heaven.

here's what i did...first use winsnap -- it is awesome.  it's light and fast.  it has subtle, yet effective post-shot image manipulation that you can use.  i keep it in my system tray and run on startup.  i also make the default screenshot be a "region" so i can precisely capture what i want.  the latest version also does vista aero glass well.

first for you need to install and ensure you authorize the application (read: run it once and upload a picture to your account).  in winsnap go to the tools...customize option.  basically create a command like this:


then basically when you take a snapshot, you can change the settings then hit (in my case) ALT+3 and my window comes up and sends directly to .  sweet.

if you do a lot of screen captures either for your blog, bugs, or documentation, check out for sure...it's great.

| Comments

virtual pc 2007 is now available -- go get it

note: if you have a vpc saved state file in an older version of vpc, i have seen oddities where it may not work, so heads up.