Coded - Web Development and Programming Blog

C#, ASP.NET, Google, Remoting, AJAX, Silverlight, Web Development

How to auto zoom and auto center Google Maps

Posted in User Interface, Web Programming by Andrei Alecu on the September 28th, 2007

This post discusses how to auto center and auto zoom a Google Map to display all of the markers optimally.

In order to get accomplish this, you have to calculate the center point and zoom level manually via code. Fortunately this is pretty easy to do, you just need to calculate the minimum and maximum latitude/longitude of all of your markers and then get the center point of the resulting area (which will be a rectangle). (more…)

Bookmark on del.icio.us

Generating a transparent GIF image using C#

Posted in Web Programming, C#, ASP.NET by Andrei Alecu on the August 28th, 2007

Problem:

There is apparently no easy way to generate a transparent GIF image using the .NET framework. Microsoft provided a method in the Bitmap class called MakeTransparent() but it doesn’t work for GIFs, it only seems to work for PNGs.

To create a transparent GIF you need to recreate the color table of the image using Imaging APIs, as detailed in this KB article . Unfortunately, this can be pretty slow for an ASP.NET Web application, and it has a lot of overhead, so I needed an alternative. (more…)

Bookmark on del.icio.us