November 23, 2009

Google Maps version 3 intellisense

Intellisense is one of those killer-features of Visual Studio. I love that I can just drop in an assembly in VS and start poking around in an editor to get a feel of the API. If the API i properly documented and layed out in a .netty way I can immediately start working with it.

The flipside of intellisense is that once you get used to it you feel severely limited when you encounter a project without intellisense. That's what happened to me today.

I was integrating the excellent Google Maps library into one of our websites and decided that I should use the latest and greatest release - Google Maps v3. I fired up VS and started hacking away in a .js file until i got flashbacks from back in the days when I developed PHP. I was toggling between writing code in my IDE and reading the api documentation in my browser. It was horrifying!

-vsdoc to the rescue

At some point I realized that since I can get intellisense for jQuery I should be able to get it for Google Maps as well so I started googling and found this single commit project at codeplex that did offer an intellisense file for Google Maps v2 but not for v3.

That's when I started looking at writing my own intellisense file. I tried to validate the Google API reference in the W3 Validator only to find out that the king of all web doesn't always produce the best markup.

Not to fear; I've written a couple of screen scraping utilities before and I know that there's one project that makes dealing with badly formatted html a breeze: Html Agility Pack. The agility pack parses almost any amount of bad markup and gives you a nice little XPath interface for poking around inside the DOM.

The result

After some hackish (screen scrapers are always messy) code I was able to produce a basic intellisense file that covers most of the Google Maps API.

The files

The js intellisense file and usage instructions can be found over at http://www.freakcode.com/projects/google-maps-v3-vsdoc.

kick it on DotNetKicks.com

Licensing information

6 comments:

  1. Hey, good stuff.

    I too build up intellisense files for Google and produced one recently with full API coverage. Can find it @ http://gmapvsdoc.codeplex.com/.

    I started writing a parser but just got fed up and knocked it out in UltraEdit in about 6 hours. Next time the API is updated I will probably build a parser.

    I too have nothing but good things to say about HTML agility pack.

    ReplyDelete
  2. I love it so far.
    It felt awkward blindly calling stuff and guessing it if will work or not. Ever worse I didn't have much javascript experience so....

    ReplyDelete
  3. correction:
    ^
    if it*
    Even*
    you get the picture.

    ReplyDelete
  4. Thanks to Markus for the generator and Thanks to sky for the guide
    I was able after some modifications to regenerate the whole page except for nested parsing callbacks which i did as well but requires some revision

    ReplyDelete
  5. It is not necessarily a natural to get fantastic extravagance programs meant for such an affordable selling price, but the watch trade is rolling out a lot in the last many who now pieces are generally no more readily available just for this wealthy several. You will get this refined take a look without having to fork out unbelievably huge fees. Also, you recognize how celebrities often plan to differentiate yourself and stay distinctive? Good, the belief that and so some of them continue back to Breitling designer watches should really inform you the way in which excellent they are just. Their particular reputation fails to have an impact on their particular cost and attractiveness whatsoever! Subsequently after witnessing wonderful fellas similar to men and women dressed in him or her replica cartier watches uk, it will be unachievable do not like to increase wristwatches selection! Any wrist watches, seeing that we all believe, will be some of the most sought-after watches round, not only because of their appears to be, but customer happiness credibility and primarily, the perception with versatility that serve individuals. The tends to make them all the initial range of a portion of the primary companies near. Marriage ceremony a revelation naturally replica breitling uk, assigned the actual enthusiasm expended all over the a long time towards earning accurate, well-performing, not to mention you should not likely do not include amazing, pieces. Nonetheless well then, i will inform you before it starts: My business is possibly not preaching about low-cost replicas that not likely stay an opportunity to cross away from when realistic. I am talking about high class devices that have an spectacular likeness to genuine timepieces. Nonetheless despite that they have got the whole set of properties you are interested in in the observe www.waxwatchreplicas.co.uk, their incontrovertible edge is actually the price tag.

    ReplyDelete