all posts

Using the DH Simple Google Map Wrapper in CS profile page

Published to Blog on 31 Aug 2006

Yesterday I talked about my CS/Google mashup and showed an example, my profile. Today I provide the instructions for using my Simple Google Map Wrapper in CS profile page:

1. Download the source or the binary here.

2. Place the DanHounshell.Google.Maps.OneMarkerMap dll in your /Web/bin folder.

3. Open the /Web/Themes/default/Skins/Skin-UserProfile.ascx page

        1. Register the assembly by pasting the following to the top of the page (after the other register and import statements):

<%@ Register TagPrefix="DHGM" Namespace="DanHounshell.Google.Maps" Assembly="DanHounshell.Google.Maps" %>

        2. Paste the following after the other script blocks:

<script language="C#" runat="server">
    protected override void OnPreRender(EventArgs e) {
        base.OnPreRender(e);
        map.Address = Location.Text;
    }
</script>

        3. Find the table row that includes the Location field.  Underneath it add a new row like this:

<tr>
     <td colspan="2">
          <DHGM:OneMarkerMap ID="map" runat="server" GoogleMapsAPIKey="YourAPIKey" Address="" Zoom="4" />
     </td>
</tr>

That’s all there is to it. You can apply this in other places besides the CS profile page by following the above example.

You cat get a Google Maps API key here

Give me a shout if you have any questions.

Additionally - the code does not have a bunch of error checking or any other “fancy” stuff - it was more or less just a proof of concept. The version number is 0.1, so it is pre-pre-beta. It is offered as-is, no warranties expressed or impled, etc.  The source is there for you to peruse - it’s pretty simple stuff actually.


Dan Hounshell
Web geek, nerd, amateur maker. Likes: apis, node, motorcycles, sports, chickens, watches, food, Nashville, Savannah, Cincinnati and family.
Dan Hounshell on Twitter