3

I am looking for a light-weight map component that displays a map of the US and allows users to click on a State and see information pertaining to that state. The data I want to display is in my database. I just need to know what state was selected so I can display the detail. This is something I am doing to get familiar with Silverlight.

All the searches for Silverlight/ Maps I have done so far have pointed me at solutions that are far more complicated than I need. My perception is that using Bing Maps to do this simple task would a waste of the features provide by Bing.

Anyone know of such a Component? Am I wrong that Bing Maps is not the right tool for the job?

TIA!

brian chandley
  • 1,276
  • 1
  • 10
  • 20
  • 1
    You're right using Bing maps for this is like ... well ... "a sledgehammer to crack a nut" doesn't do the comparison justice. – AnthonyWJones Oct 02 '10 at 17:48

3 Answers3

4

If you have access to Expression Studio (specifically Expression Design), creating maps as vector based images is quite easy. Poly-paths in Xaml are also relatively efficient to store and serve up compared to images.

You import a map as a background image and use the pen tool to dot-to-dot trace around the country. Combine all those path segments into a single path. Then create a separate poly-path for each state (close them to allow for a fill).

It will take a few hours to build all this (I know having done this for a world map country selector... took 4-5 hours solid for the one polygon styled below):

enter image description here

By having each state represented by a filled polygon-path highlighting (by changing the fill colour) is trivial on mouse-enter/mouse-leave events.

If you want stylistic map, remove the image, otherwise use transparency on the state polygons to show the map through the roll-overs.

Update:

And if you get yourself a graphic tablet and pen this sort of point-to-point work is about 5 times faster than with a mouse!

Community
  • 1
  • 1
iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
  • 1
    I do not have Blend right now. This is a nice feature. I have been thinking that Blend is a must for Silverlight more and more. – brian chandley Oct 02 '10 at 17:27
  • +1 A pragmatic solution that doesn't involve a the heavy super-dooper Bing map control just to provide a State chooser. – AnthonyWJones Oct 02 '10 at 17:45
  • @brian chandley: I'm a pure coder through and through (not a designer by any means) but I cannot recommend the Expression tools strongly enough. You can't do complicated GUIs in VS 2010 as easily as Expression Blend and Sketch flow has allowed me to *knock the socks off* clients. Any one of the tools will pay for the package quite quickly if you develop for a living. – iCollect.it Ltd Oct 02 '10 at 18:34
  • Thanks. Working a Blend evaluation version for now. As my intention is to take SL for a spin, this approach will take me further. I'll leave Bing Maps for another day! – brian chandley Oct 03 '10 at 00:50
1

The interaction with Bing Maps in Silverlight is really strong and provide you with easy communication between the map and your data. I would give Bing Maps a try.

thomasmartinsen
  • 1,983
  • 14
  • 21
1

I'm not sure if you've already come across this, but it seems you can also use the control with custom tile sources. Here are a few resources.

http://www.cadmaps.com/gisblog/?p=54

http://developers.de/blogs/damir_dobric/archive/2009/11/16/implementing-custom-map-in-silverlight-map-control.aspx

http://labs.mandogroup.com/skinning-the-silverlight-bing-maps-control/

Custom Rendering in Bing Silverlight Control

Community
  • 1
  • 1
Garett
  • 16,632
  • 5
  • 55
  • 63