ASP.NET Google Map Control

4. January 2008

If you are looking for a ASP.NET Google Map Control, your search is now over.

Jacob Reimers from http://www.reimers.dk/ offers a great asp.net control in 2 flavors.

The free version which lets you easily display a map with markers and/or lines and a licensed version which gives you the full power of Google Maps.

 

I have used this control on a few of Web Solutions clients sites. Two of the better implementations are Low Index and Seville Homes.

 

*The deals listed below are entirely fictional. They were created for presentation purposes only.

 

lowIndex

seville

 

 

 

To use this great control, head over to http://www.reimers.dk/, download the free control, unzip it to your Bin folder in your web app and add a reference to it.

 

This is a sample asp.net page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="GoogleMap" Namespace="Reimers.Map" TagPrefix="Reimers" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>Google Map test</title>

</head>

<body>

    <form id="form1" runat="server">

        <div>

            <reimers:googlemap id="GMap" runat="server" width="349" height="354" onmarkerclick="GMap_MarkerClick"  />

        </div>

    </form>

</body>

</html>

 

and the code behind

 

using System;

using System.Web.UI;

using Reimers.Map;

 

public partial class _Default : Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        GMap.GoogleKey = "Your API Code here";

        GMap.MapType = MapType.Map;

        GMap.TypeControl = MapTypeControl.None;

        GMap.MapControl = ControlType.Small;

 

        GoogleMarker testMarker = new GoogleMarker("newMarker", new GoogleLatLng(43.611611, -88.952931));

        testMarker.MarkerText = "Test Marker";

        GMap.Markers.Add(testMarker);

 

        GMap.Latitude = testMarker.Latitude;

        GMap.Longitude = testMarker.Longitude;

        GMap.Zoom = 10;

    }

 

    protected void GMap_MarkerClick(GoogleMap GMap, GoogleMarker Marker, ref String MapCommand)

    {

        MapCommand = Marker.OpenInfoWindowHTML(GMap, Marker.MarkerText);

    }

}

ASP.NET, Google Maps ,

Comments

johan
johan
1/9/2008 4:12:25 AM #
Doesn't google maps have a terms of use that prohibits commercial usage like this?????
Chris Newman
Chris Newman
1/9/2008 4:59:14 AM #
From their http://code.google.com/apis/maps/terms.html">Terms of Service page.


"The API may be used only for services that are generally accessible to consumers without charge. Accordingly, You may not use the API for any service that requires a subscription or other restricted access, or for which a fee is charged."

In both of these cases, the visitors of the sites are not charged in any way.
Kee
Kee
5/12/2008 4:59:04 PM #
Hi all,

I would like to know it is possible for me to add the polyline between the two makers if I using Jacob Reimers google map control?


Regards,
Kee
Chris Newman
Chris Newman
5/13/2008 9:29:50 AM #
Yes his controls support this feature.
Head on over to his site and check out the tutorials.
Kee
Kee
5/13/2008 11:11:38 AM #
Hi Chris,

Thanks for your prompt response and I'll check it out now.


Regards,
Kee

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading