When v7.0 of the Bings Maps AJAX control was released last fall, I began testing out how easy it would be to port some of my existing code that was originally developed against the v6.3 AJAX control. I was pleasantly surprised to find the newer version performed considerably faster, and had a more natural API. However, many of the features that v6.3 gives you OTB were not available in v7.0; info boxes being one of those features. Thus I began testing how easy it would be to develop my own info boxes. I got about 90% of the way there before running into some snags with the way mouse events and pushpins interacted that made building display-on-hover style info boxes problematic. You can read more about this experience on Windows Live Developer Forums – Creating Infoboxes in Bing Maps AJAX v7.
Microsoft recently released an update for the Bing Maps AJAX v7.0 control which includes the ability to create info boxes. The initial release did not offer this feature so this is a welcome improvement. It also seems to have addressed the mouse event issues with push-pins. Using information published in the MSDN documentation and the experiences gathered from other developer’s forum postings, I have put together an example of how to use the new info box features and create hover-style info boxes that allow clickable content. Unlike the examples provided in the API documentation, my solution doesn’t require that the user click the pin to display the info box, or click the close button to hide it . Instead, they will show by hovering the mouse over the pushpin, will stay visible as long as the mouse remains on the pushpin or info box, and will then automatically hide as the mouse moves off the info box or pushpin.
Sample code showing how this can be done is provided below.
I’ve recently been spending a fair amount of time working with js and css files inside Visual Studio 2010, and while I generally like Visual Studio as an IDE, it does lack a few things in this area. As a result, I spent some time looking through the available extensions on the MSDN Visual Studio Gallery site. Here’s my list of favorites so far and a little bit about them.
devColor – This extension gives you some cool color managing features in css files. Have you ever found yourself looking at something like #E5234A in a css file and wondered exactly what color was being represented? Well, this tool gives that information to you at a glance, right in the css file by including a color-specific underline directly under the color value. This tool also provides a nice visual color-picker, a color anagram feature, and lists all colors used in the css file.
VSCommands 2010 – This is another grab-bag of enhancements (a lot actually), but there is one feature I really like in this pack and it is the sole reason I have it on my list. In fact, if I could find an extension that provided just this feature, I’d probably do away with VSCommands. It is the ability to use Visual Studio’s file group/ungroup feature directly in the solution explorer. This allows you to link related files together into a tree of items, exactly how the code behind is “nested” under the aspx file for example. You can do this manually without this tool, by simply editing the project file, but this tool makes it very convenient to do it right in the solution explorer.
As I work on Ajax-rich sites, I’m often finding each web page has a need for it’s own js file. Rather than put all these into a separate scripts folder, I prefer to keep them in the same location as the web page for which they are related, but this can result in a lot of nodes in the solution explorer. Where I have found this a very useful feature is in organizing those page-level js files by grouping them under their related web page file. For example, the MyPage.js file can now be grouped under MyPage.aspx, keeping all related code together. Even better, I can also group minimized versions under the non-minimized versions.
Spell Checker – Nothing fancy, just does exactly what you would think. For me it’s been a great tool, though, because I’m quite bad about mistyping and/or misspelling words. Rather than having to copy-paste sections of comments, code, or text into another tool to do my spell checking – and have to weed through code in the process – this allows the spelling to be checked right in Visual Studio. It provides automatic spell checking of your documents, taking into account code formats, and provides red-squiggles under any misspelled words. Simply click-to-correct, add word to custom dictionary, or ignore the word. My only complaint is that there isn’t a “correct all” feature, but over-all I find it very helpful.
So there is my list of favorite Visual Studio Extensions so far. Want to share your experiences and/or favorites? Drop me a quick comment.