Wesley Bakker

Interesting things I encounter doing my job...

Sponsors

News

Wesley Bakker
motion10
Rivium Quadrant 151
2909 LC Capelle aan den IJssel
Region of Rotterdam
The Netherlands
Phone: +31 10 2351035

(feel free to chat with me)
 

Add to Technorati Favorites

Virtual Earth vs Google Maps in a SharePoint feature

Which one suites me better?

I do get asked about implementing a Google Maps feature into SharePoint pretty often. Most of the time however it's not that the client wants Google Maps. No, they want a maps implementation on their SharePoint site and they don't really care if that's Google Maps or Virtual Earth. I developed both features lately and did notice some points that make the implementation of Virtual Earth as the one I prefer. I'll show you why in this post.

Google Maps Key

If you like to implement Google Maps on a site you'll have to add a script tag to the head of our page that refers to the Google Maps API. Unfortunately this URL needs a Google Maps key. This key is some sort of hash that corresponds to the hostname of your site. So if you do like to add a Google Maps feature to a site, you'll need some sort of user UI to add the Google Maps key. I decided to create a layouts page to do the job. I't not that it's hard to do, but it does give me extra work. Oh... and don't forget that a user can enter a site in multiple URL zones.

Google Maps Feature Settings

For using Virtual Earth you don't need any key whatsoever so it's very easy to implement a feature for Virtual Earth. Add a script tag to the additional page head and we're done!

Development Experience

Google Maps has an API that is TOO complicated in a lot of ways. You can't simply change the icon image you would like to use for the icon size will not match up and mess up your image. The Google Maps API does not have an easy way to fetch the best zoom level. You need to create a GLatLngBounds object and extend it with all markers you like to add to your page and then get the zoom level. You can bind html to a marker's info window but markers don't have an openInfoWindowHtml method that takes zero arguments. You can't however get the marker's infoWindowHtml because it doesn't expose a property to do so. All together it get's a very annoying job to add some markers, open the last marker its info window, right after we zoomed in to the best level. It costs me a 100 lines of JavaScript code to do so.

The exact same functionality built with Virtual Earth cost me exactly half the amount of code. I used 50 lines!

You can download this zip file with both js files to see for yourself.

User Experience

Virtual Earth loads its maps way faster and by default looks an awfull lot better than Google Maps. But that's just my opinion. You have to judge that one for yourself.

Google Maps Feature Settings

Conclusion

I'ld pick Virtual Earth above Google Maps anytime. And not because it's better in a sense that I can do more with it. It's just that I can accomplish even better results in less time.

Cheers,

Wes

P.S. : If there's enough demand for it I'll write a few blogposts on how to create a connected Virtual Earth Maps control. Just let me know in the comments if you would like me to do so.

Comments

No Comments