Show / Hide Table of Contents

Class GoogleMap

Wraps Google Maps API as ASP.NET Custom Control, providing an easy and fast way of adding Google Maps in your ASP.NET pages with "Zero-Written-JavaScript" code. ASP.NET Google Maps Control includes many features(markers, polyline, polygons, directions) and gives you almost all Google Maps API functionality in enjoyable ASP.NET way of coding.

Inheritance
System.Object
System.Web.UI.Control
System.Web.UI.WebControls.WebControl
System.Web.UI.ScriptControl
GoogleMap
Inherited Members
System.Web.UI.ScriptControl.Render(System.Web.UI.HtmlTextWriter)
System.Web.UI.ScriptControl.System.Web.UI.IScriptControl.GetScriptDescriptors()
System.Web.UI.ScriptControl.System.Web.UI.IScriptControl.GetScriptReferences()
System.Web.UI.WebControls.WebControl.AddAttributesToRender(System.Web.UI.HtmlTextWriter)
System.Web.UI.WebControls.WebControl.ApplyStyle(System.Web.UI.WebControls.Style)
System.Web.UI.WebControls.WebControl.CopyBaseAttributes(System.Web.UI.WebControls.WebControl)
System.Web.UI.WebControls.WebControl.CreateControlStyle()
System.Web.UI.WebControls.WebControl.LoadViewState(System.Object)
System.Web.UI.WebControls.WebControl.TrackViewState()
System.Web.UI.WebControls.WebControl.MergeStyle(System.Web.UI.WebControls.Style)
System.Web.UI.WebControls.WebControl.RenderBeginTag(System.Web.UI.HtmlTextWriter)
System.Web.UI.WebControls.WebControl.RenderEndTag(System.Web.UI.HtmlTextWriter)
System.Web.UI.WebControls.WebControl.RenderContents(System.Web.UI.HtmlTextWriter)
System.Web.UI.WebControls.WebControl.SaveViewState()
System.Web.UI.WebControls.WebControl.System.Web.UI.IAttributeAccessor.GetAttribute(System.String)
System.Web.UI.WebControls.WebControl.System.Web.UI.IAttributeAccessor.SetAttribute(System.String, System.String)
System.Web.UI.WebControls.WebControl.AccessKey
System.Web.UI.WebControls.WebControl.Attributes
System.Web.UI.WebControls.WebControl.BackColor
System.Web.UI.WebControls.WebControl.BorderColor
System.Web.UI.WebControls.WebControl.BorderWidth
System.Web.UI.WebControls.WebControl.BorderStyle
System.Web.UI.WebControls.WebControl.ControlStyle
System.Web.UI.WebControls.WebControl.ControlStyleCreated
System.Web.UI.WebControls.WebControl.CssClass
System.Web.UI.WebControls.WebControl.DisabledCssClass
System.Web.UI.WebControls.WebControl.Style
System.Web.UI.WebControls.WebControl.Enabled
System.Web.UI.WebControls.WebControl.EnableTheming
System.Web.UI.WebControls.WebControl.Font
System.Web.UI.WebControls.WebControl.ForeColor
System.Web.UI.WebControls.WebControl.HasAttributes
System.Web.UI.WebControls.WebControl.Height
System.Web.UI.WebControls.WebControl.IsEnabled
System.Web.UI.WebControls.WebControl.SupportsDisabledAttribute
System.Web.UI.WebControls.WebControl.SkinID
System.Web.UI.WebControls.WebControl.TabIndex
System.Web.UI.WebControls.WebControl.TagName
System.Web.UI.WebControls.WebControl.ToolTip
System.Web.UI.WebControls.WebControl.Width
System.Web.UI.Control.ResolveAdapter()
System.Web.UI.Control.HasEvents()
System.Web.UI.Control.GetRouteUrl(System.Object)
System.Web.UI.Control.GetRouteUrl(System.String, System.Object)
System.Web.UI.Control.GetRouteUrl(System.Web.Routing.RouteValueDictionary)
System.Web.UI.Control.GetRouteUrl(System.String, System.Web.Routing.RouteValueDictionary)
System.Web.UI.Control.GetUniqueIDRelativeTo(System.Web.UI.Control)
System.Web.UI.Control.ApplyStyleSheetSkin(System.Web.UI.Page)
System.Web.UI.Control.OnDataBinding(System.EventArgs)
System.Web.UI.Control.DataBind()
System.Web.UI.Control.DataBind(System.Boolean)
System.Web.UI.Control.DataBindChildren()
System.Web.UI.Control.AddParsedSubObject(System.Object)
System.Web.UI.Control.EnsureID()
System.Web.UI.Control.OnInit(System.EventArgs)
System.Web.UI.Control.ClearChildState()
System.Web.UI.Control.ClearChildControlState()
System.Web.UI.Control.ClearChildViewState()
System.Web.UI.Control.ClearEffectiveClientIDMode()
System.Web.UI.Control.ClearCachedClientID()
System.Web.UI.Control.Focus()
System.Web.UI.Control.LoadControlState(System.Object)
System.Web.UI.Control.MapPathSecure(System.String)
System.Web.UI.Control.OpenFile(System.String)
System.Web.UI.Control.OnLoad(System.EventArgs)
System.Web.UI.Control.BuildProfileTree(System.String, System.Boolean)
System.Web.UI.Control.SaveControlState()
System.Web.UI.Control.RenderChildren(System.Web.UI.HtmlTextWriter)
System.Web.UI.Control.RenderControl(System.Web.UI.HtmlTextWriter)
System.Web.UI.Control.RenderControl(System.Web.UI.HtmlTextWriter, System.Web.UI.Adapters.ControlAdapter)
System.Web.UI.Control.OnUnload(System.EventArgs)
System.Web.UI.Control.Dispose()
System.Web.UI.Control.RaiseBubbleEvent(System.Object, System.EventArgs)
System.Web.UI.Control.OnBubbleEvent(System.Object, System.EventArgs)
System.Web.UI.Control.AddedControl(System.Web.UI.Control, System.Int32)
System.Web.UI.Control.CreateControlCollection()
System.Web.UI.Control.ResolveUrl(System.String)
System.Web.UI.Control.ResolveClientUrl(System.String)
System.Web.UI.Control.FindControl(System.String)
System.Web.UI.Control.FindControl(System.String, System.Int32)
System.Web.UI.Control.GetDesignModeState()
System.Web.UI.Control.HasControls()
System.Web.UI.Control.IsLiteralContent()
System.Web.UI.Control.EnsureChildControls()
System.Web.UI.Control.RemovedControl(System.Web.UI.Control)
System.Web.UI.Control.SetDesignModeState(System.Collections.IDictionary)
System.Web.UI.Control.SetRenderMethodDelegate(System.Web.UI.RenderMethod)
System.Web.UI.Control.System.Web.UI.IParserAccessor.AddParsedSubObject(System.Object)
System.Web.UI.Control.System.Web.UI.IControlDesignerAccessor.GetDesignModeState()
System.Web.UI.Control.System.Web.UI.IControlDesignerAccessor.SetDesignModeState(System.Collections.IDictionary)
System.Web.UI.Control.System.Web.UI.IControlDesignerAccessor.SetOwnerControl(System.Web.UI.Control)
System.Web.UI.Control.ClientIDMode
System.Web.UI.Control.ClientID
System.Web.UI.Control.ClientIDSeparator
System.Web.UI.Control.Context
System.Web.UI.Control.Adapter
System.Web.UI.Control.DesignMode
System.Web.UI.Control.Events
System.Web.UI.Control.ID
System.Web.UI.Control.IsChildControlStateCleared
System.Web.UI.Control.EnableViewState
System.Web.UI.Control.ViewStateMode
System.Web.UI.Control.IsViewStateEnabled
System.Web.UI.Control.NamingContainer
System.Web.UI.Control.IdSeparator
System.Web.UI.Control.LoadViewStateByID
System.Web.UI.Control.Page
System.Web.UI.Control.RenderingCompatibility
System.Web.UI.Control.TemplateControl
System.Web.UI.Control.Parent
System.Web.UI.Control.TemplateSourceDirectory
System.Web.UI.Control.AppRelativeTemplateSourceDirectory
System.Web.UI.Control.Site
System.Web.UI.Control.Visible
System.Web.UI.Control.UniqueID
System.Web.UI.Control.HasChildViewState
System.Web.UI.Control.Controls
System.Web.UI.Control.ViewState
System.Web.UI.Control.ViewStateIgnoresCase
System.Web.UI.Control.ChildControlsCreated
System.Web.UI.Control.IsTrackingViewState
System.Web.UI.Control.System.Web.UI.IDataBindingsAccessor.HasDataBindings
System.Web.UI.Control.System.Web.UI.IDataBindingsAccessor.DataBindings
System.Web.UI.Control.System.Web.UI.IControlDesignerAccessor.UserData
System.Web.UI.Control.System.Web.UI.IControlBuilderAccessor.ControlBuilder
System.Web.UI.Control.System.Web.UI.IExpressionsAccessor.HasExpressions
System.Web.UI.Control.System.Web.UI.IExpressionsAccessor.Expressions
System.Web.UI.Control.Disposed
System.Web.UI.Control.DataBinding
System.Web.UI.Control.Init
System.Web.UI.Control.Load
System.Web.UI.Control.PreRender
System.Web.UI.Control.Unload
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace:GoogleMaps
Assembly:GoogleMaps.dll
Syntax
public class GoogleMap : ScriptControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IPostBackEventHandler

Constructors

GoogleMap()

Initializes a new instance of the GoogleMap class.

Declaration
public GoogleMap()

GoogleMap(Bounds)

Declaration
public GoogleMap(Bounds bounds)
Parameters
Type Name Description
Bounds bounds

GoogleMap(Bounds, Int32)

Declaration
public GoogleMap(Bounds bounds, int zoom)
Parameters
Type Name Description
Bounds bounds
System.Int32 zoom

GoogleMap(LatLng)

Declaration
public GoogleMap(LatLng center)
Parameters
Type Name Description
LatLng center

GoogleMap(LatLng, Int32)

Declaration
public GoogleMap(LatLng center, int zoom)
Parameters
Type Name Description
LatLng center
System.Int32 zoom

GoogleMap(Int32)

Declaration
public GoogleMap(int zoom)
Parameters
Type Name Description
System.Int32 zoom

Fields

OnClientIdle

Gets or sets the client idle handler.

Declaration
public string OnClientIdle
Field Value
Type Description
System.String

Properties

Address

The address to geocode and set the initial map center.

Declaration
public string Address { get; set; }
Property Value
Type Description
System.String

The address.

ApiClientID

The client ID to use Google Maps API under premium plan.

Declaration
public string ApiClientID { get; set; }
Property Value
Type Description
System.String

ApiKey

All Maps API applications* should load the Maps API using an API key. Using an API key enables you to monitor your application's Maps API usage, and ensures that Google can contact you about your application if necessary. If your application's Maps API usage exceeds the Usage Limits (https://developers.google.com/maps/documentation/javascript/usage#usage_limits), you must load the Maps API using an API key in order to purchase additional quota. Google Maps API for Business developers must not include a key in their requests. Please refer to Loading the Google Maps JavaScript API for Business-specific instructions(https://developers.google.com/maps/documentation/business/clientside#MapsJS). To create your API key:

  1. Visit the APIs Console at https://code.google.com/apis/console and log in with your Google Account.
  2. Click the Services link from the left-hand menu.
  3. Activate the Google Maps API v3 service.
  4. Click the API Access link from the left-hand menu. Your API key is available from the API Access page, in the Simple API Access section. Maps API applications use the Key for browser apps.

Declaration
public string ApiKey { get; set; }
Property Value
Type Description
System.String

ApiSignature

The digital signature to use Google Maps API under standard plan with pay-as-you-go or premium plan.

Declaration
public string ApiSignature { get; set; }
Property Value
Type Description
System.String

ApiVersion

Gets or sets the Google Maps API version. You can indicate which version of the API to load within your application.

Declaration
public string ApiVersion { get; set; }
Property Value
Type Description
System.String

The maps API version.

Bounds

The initial Bounds of the map. This or Zoom is required in order to show the map.

Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public Bounds Bounds { get; set; }
Property Value
Type Description
Bounds

Center

The initial LatLng map center. This is a new property which handles the Latitude and Longitude values. The initial map center LatLng can be set through Latitude and Longitude properties of Center or by comma seprated values pair string. For example: GoogleMap1.Center.Latitude = 42.1229; GoogleMap1.Center.Longitude = 24.7879; or GoogleMap1.Center = "42.1229,24.7879";

Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public LatLng Center { get; set; }
Property Value
Type Description
LatLng

The center.

DefaultAddress

The address to geocode and set as initial map center, when the provided Address is not valid or failed to geocode. This property can be used to avoid "gray" maps, when the address set to the controls is not valid.

Declaration
public string DefaultAddress { get; set; }
Property Value
Type Description
System.String

The default address.

Directions

Gets the directions.

Declaration
public ICollection<GoogleDirections> Directions { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<GoogleDirections>

The directions.

DisableClear

If true, do not clear the contents of the Map div.

Declaration
public bool DisableClear { get; set; }
Property Value
Type Description
System.Boolean

true if [disable clear]; otherwise, false.

DisableDefaultUI

Enables/disables all default UI. May be overridden individually.

Declaration
public bool DisableDefaultUI { get; set; }
Property Value
Type Description
System.Boolean

true if [disable default UI]; otherwise, false.

DisableDoubleClickZoom

Enables/disables zoom and center on double click. Enabled by default.

Declaration
public bool DisableDoubleClickZoom { get; set; }
Property Value
Type Description
System.Boolean

true if [double click zoom]; otherwise, false.

DisableKeyboardShortcuts

If false, prevents the map from being controlled by the keyboard. Keyboard shortcuts are enabled by default.

Declaration
public bool DisableKeyboardShortcuts { get; set; }
Property Value
Type Description
System.Boolean

true if [disable keyboard shortcuts]; otherwise, false.

DisableMultipleInfoWindows

If true, when one infowindow is shown, all others are hidden

Declaration
public bool ? DisableMultipleInfoWindows { get; set; }
Property Value
Type Description
System.Nullable<System.Boolean>

Draggable

If false, prevents the map from being dragged. Dragging is enabled by default.

Declaration
public bool Draggable { get; set; }
Property Value
Type Description
System.Boolean

true if [enable dragging]; otherwise, false.

DraggableCursor

The name or url of the cursor to display on a draggable object.

Declaration
public string DraggableCursor { get; set; }
Property Value
Type Description
System.String

The draggable cursor.

DraggingCursor

The name or url of the cursor to display when an object is dragging.

Declaration
public string DraggingCursor { get; set; }
Property Value
Type Description
System.String

The dragging cursor.

EnableMapTypeControl

The initial enabled/disabled state of the Map type control. By default it is set to true and map type control is visible.

Declaration
public bool EnableMapTypeControl { get; set; }
Property Value
Type Description
System.Boolean

true if [show map type control]; otherwise, false.

EnableOverviewMapControl

The enabled/disabled state of the Overview Map control.

Declaration
public bool EnableOverviewMapControl { get; set; }
Property Value
Type Description
System.Boolean

true if [show overview map control]; otherwise, false.

EnablePanControl

The enabled/disabled state of the Pan control.

Declaration
public bool EnablePanControl { get; set; }
Property Value
Type Description
System.Boolean

true if [pan control]; otherwise, false.

EnableReverseGeocoding

Gets or sets a value indicating whether reverse geocoding (address lookup) is enabled. When the reverse geocoding is enabled the intial map center location is translated to a human-readable address, known as reverse geocoding. Once the location is translated to a human-readable address, its value is saved in the Address property of the GoogleMap Control and persisted during the postback.

Declaration
public bool EnableReverseGeocoding { get; set; }
Property Value
Type Description
System.Boolean

true if [enable reverse geocoding]; otherwise, false.

EnableRotateControl

The enabled/disabled state of the Rotate control.

Declaration
public bool EnableRotateControl { get; set; }
Property Value
Type Description
System.Boolean

true if [rotate control]; otherwise, false.

EnableScaleControl

The initial enabled/disabled state of the Scale control.

Declaration
public bool EnableScaleControl { get; set; }
Property Value
Type Description
System.Boolean

true if [enable scale control]; otherwise, false.

EnableScrollWheelZoom

If false, disables scrollwheel zooming on the map. The scrollwheel is enabled by default.

Declaration
public bool EnableScrollWheelZoom { get; set; }
Property Value
Type Description
System.Boolean

true if [enable scroll wheel zoom]; otherwise, false.

EnableSearchBoxControl

The enabled/disabled state of the search box control

Declaration
public bool EnableSearchBoxControl { get; set; }
Property Value
Type Description
System.Boolean

true if [rotate control]; otherwise, false.

EnableStreetViewControl

The initial enabled/disabled state of the Street View Pegman control. This control is part of the default UI, and should be set to false when displaying a map type on which the Street View road overlay should not appear (e.g. a non-Earth map type).

Declaration
public bool EnableStreetViewControl { get; set; }
Property Value
Type Description
System.Boolean

true if [show street view control]; otherwise, false.

EnableZoomControl

The enabled/disabled state of the Zoom control.

Declaration
public bool EnableZoomControl { get; set; }
Property Value
Type Description
System.Boolean

true if [enable zoom control]; otherwise, false.

FullscreenControl

Enables/disables the control that opens the map in fullscreen mode. By default, this control is visible on mobile devices and not visible on desktop. When enabled, the control appears near the top right of the map. By default it is set to false

Declaration
public bool FullscreenControl { get; set; }
Property Value
Type Description
System.Boolean

FullscreenControlOptions

Options for the rendering of the fullscreen control.

Declaration
public FullscreenControlOptions FullscreenControlOptions { get; set; }
Property Value
Type Description
FullscreenControlOptions

Heading

The heading for aerial imagery in degrees measured clockwise from cardinal direction North. Headings are snapped to the nearest available angle for which imagery is available.

Declaration
public int ? Heading { get; set; }
Property Value
Type Description
System.Nullable<System.Int32>

The heading.

IsSensor

Use of the Google Maps API requires that you indicate whether your application is using a sensor (such as a GPS locator) to determine the user's location. This is especially important for mobile devices. Applications must pass a required sensor parameter to the Maps API javascript code, indicating whether or not your application is using a sensor device.

Declaration
public bool IsSensor { get; set; }
Property Value
Type Description
System.Boolean

true if this instance is sensor; otherwise, false.

Language

The Google Maps API uses the browser's preferred language setting when displaying textual information such as the names for controls, copyright notices, driving directions and labels on maps. In most cases, this is preferable; you usually do not wish to override the user's preferred language setting. However, if you wish to change the Maps API to ignore the browser's language setting and force it to display information in a particular language, you can specifying the language to use.

Declaration
public string Language { get; set; }
Property Value
Type Description
System.String

The language.

Latitude

Gets or sets the initial map center latitude. This property is kept for backward compatability, concider using the new Center property.

Declaration
public double ? Latitude { get; set; }
Property Value
Type Description
System.Nullable<System.Double>

The latitude.

Libraries

List of libraries used in this map. For example: places, panoramio

Declaration
public HashSet<GoogleMapLibrary> Libraries { get; }
Property Value
Type Description
System.Collections.Generic.HashSet<GoogleMapLibrary>

Longitude

Gets or sets the initial map center longitude. This property is kept for backward compatability, concider using the new Center property.

Declaration
public double ? Longitude { get; set; }
Property Value
Type Description
System.Nullable<System.Double>

The longitude.

MapType

The initial Map mapTypeId. Required. You must specifically set an initial map type to see appropriate tiles.

Declaration
public MapType MapType { get; set; }
Property Value
Type Description
MapType

The type of the map.

MapTypeControlOptions

The initial display options for the Map type control.

Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public MapTypeControlOptions MapTypeControlOptions { get; set; }
Property Value
Type Description
MapTypeControlOptions

The map type control options.

Markers

Gets the markers.

Declaration
public ICollection<GoogleMarkers> Markers { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<GoogleMarkers>

The markers.

MaxZoom

The maximum zoom level which will be displayed on the map. If omitted, or set to null, the maximum zoom from the current map type is used instead.

Declaration
public int ? MaxZoom { get; set; }
Property Value
Type Description
System.Nullable<System.Int32>

The max zoom.

MinZoom

The minimum zoom level which will be displayed on the map. If omitted, or set to null, the minimum zoom from the current map type is used instead.

Declaration
public int ? MinZoom { get; set; }
Property Value
Type Description
System.Nullable<System.Int32>

The min zoom.

OnClientBoundsChanged

Gets or sets the client bounds changed handler.

Declaration
public string OnClientBoundsChanged { get; set; }
Property Value
Type Description
System.String

The on client bounds changed.

OnClientCenterChanged

Gets or sets the client center changed handler.

Declaration
public string OnClientCenterChanged { get; set; }
Property Value
Type Description
System.String

The on client center changed.

OnClientClick

Gets or sets the client click handler.

Declaration
public string OnClientClick { get; set; }
Property Value
Type Description
System.String

The on client click.

OnClientDoubleClick

Gets or sets the client double click handler.

Declaration
public string OnClientDoubleClick { get; set; }
Property Value
Type Description
System.String

The on client double click.

OnClientDrag

Gets or sets the client drag handler.

Declaration
public string OnClientDrag { get; set; }
Property Value
Type Description
System.String

The on client drag.

OnClientDragEnd

Gets or sets the client drag end handler.

Declaration
public string OnClientDragEnd { get; set; }
Property Value
Type Description
System.String

The on client drag end.

OnClientDragStart

Gets or sets the client drag start handler.

Declaration
public string OnClientDragStart { get; set; }
Property Value
Type Description
System.String

The on client drag start.

OnClientHeadingChanged

Gets or sets the client heading changed handler.

Declaration
public string OnClientHeadingChanged { get; set; }
Property Value
Type Description
System.String

The on client heading changed.

OnClientMapTypeChanged

Gets or sets the client map type changed handler.

Declaration
public string OnClientMapTypeChanged { get; set; }
Property Value
Type Description
System.String

The on client map type changed.

OnClientMouseMove

Gets or sets the client mouse move handler.

Declaration
public string OnClientMouseMove { get; set; }
Property Value
Type Description
System.String

The on client mouse move.

OnClientMouseOut

Gets or sets the client mouse out handler.

Declaration
public string OnClientMouseOut { get; set; }
Property Value
Type Description
System.String

The on client mouse out.

OnClientMouseOver

Gets or sets the client mouse over handler.

Declaration
public string OnClientMouseOver { get; set; }
Property Value
Type Description
System.String

The on client mouse over.

OnClientProjectionChanged

Gets or sets the client projection changed handler.

Declaration
public string OnClientProjectionChanged { get; set; }
Property Value
Type Description
System.String

The on client projection changed.

OnClientResize

Gets or sets the client resize handler.

Declaration
public string OnClientResize { get; set; }
Property Value
Type Description
System.String

The on resize.

OnClientRightClick

Gets or sets the client right click handler.

Declaration
public string OnClientRightClick { get; set; }
Property Value
Type Description
System.String

The on client right click.

OnClientTilesLoaded

Gets or sets the client tiles loaded handler.

Declaration
public string OnClientTilesLoaded { get; set; }
Property Value
Type Description
System.String

The on client tiles loaded.

OnClientTiltChanged

Gets or sets the client tilt changed handler.

Declaration
public string OnClientTiltChanged { get; set; }
Property Value
Type Description
System.String

The on client tilt changed.

OnClientZoomChanged

Gets or sets the client zoom changed handler.

Declaration
public string OnClientZoomChanged { get; set; }
Property Value
Type Description
System.String

The on client zoom changed.

Overlays

Gets the polygons.

Declaration
public ICollection<GoogleOverlay> Overlays { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<GoogleOverlay>

The polygons.

OverviewMapControlOptions

The display options for the Overview Map control.

Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public OverviewMapControlOptions OverviewMapControlOptions { get; set; }
Property Value
Type Description
OverviewMapControlOptions

The overview map control options.

PanControlOptions

The display options for the Pan control.

Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public PanControlOptions PanControlOptions { get; set; }
Property Value
Type Description
PanControlOptions

The pan control options.

Polylines

Gets the polylines.

Declaration
public ICollection<GooglePolyline> Polylines { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<GooglePolyline>

The polylines.

Region

The Maps API serves map tiles and biases application behavior, by default, using the country of the host domain from which the API is loaded (which is the USA for maps.google.com). If you wish to alter your application to serve different map tiles or bias the application (such as biasing geocoding results towards the region), you can override this default behavior by adding a region parameter to the Maps API javascript code. The region parameter accepts Unicode region subtag identifiers which (generally) have a one-to-one mapping to country code Top-Level Domains (ccTLDs). Most Unicode region identifiers are identical to ISO 3166-1 codes, with some notable exceptions. For example, Great Britain's ccTLD is "uk" (corresponding to the domain .co.uk) while its region identifier is "GB." For example, to use a Maps API application localized to the United Kingdom, add this settings to the code-behind as shown below:

GoogleMap1.Region = "GB";

Declaration
public string Region { get; set; }
Property Value
Type Description
System.String

The region.

RotateControlOptions

The display options for the Rotate control.

Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public RotateControlOptions RotateControlOptions { get; set; }
Property Value
Type Description
RotateControlOptions

The rotate control options.

ScaleControlOptions

The initial display options for the Scale control.

Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public ScaleControlOptions ScaleControlOptions { get; set; }
Property Value
Type Description
ScaleControlOptions

The scale control options.

SearchBoxControlOptions

Options for the rendering of the search box control.

Declaration
public SearchBoxControlOptions SearchBoxControlOptions { get; set; }
Property Value
Type Description
SearchBoxControlOptions

The zoom control options.

ShowTraffic

Gets or sets a value indicating whether [show traffic].

Declaration
public bool ShowTraffic { get; set; }
Property Value
Type Description
System.Boolean

true if [show traffic]; otherwise, false.

StaticScale

Scale (zoom) value used to multiply the static map image size to define the output size in pixels.

Declaration
public int StaticScale { get; set; }
Property Value
Type Description
System.Int32

The static scale.

TagKey

Gets the System.Web.UI.HtmlTextWriterTag value that corresponds to this Web server control. This property is used primarily by control developers.

Declaration
protected override HtmlTextWriterTag TagKey { get; }
Property Value
Type Description
System.Web.UI.HtmlTextWriterTag
Overrides
System.Web.UI.WebControls.WebControl.TagKey

Tilt

The angle of incidence of the map as measured in degrees from the viewport plane to the map plane. The only currently supported values are 0, indicating no angle of incidence (no tilt), and 45, indicating a tilt of 45deg;. 45deg; imagery is only available for SATELLITE and HYBRID map types, within some locations, and at some zoom levels.

Declaration
public int Tilt { get; set; }
Property Value
Type Description
System.Int32

The tilt.

Zoom

The initial Map zoom level. Required.

Declaration
public int Zoom { get; set; }
Property Value
Type Description
System.Int32

The zoom.

ZoomControlOptions

The initial zoom level of the map. This or Bounds is required in order to show the map.

Declaration
public ZoomControlOptions ZoomControlOptions { get; set; }
Property Value
Type Description
ZoomControlOptions

The zoom control options.

Methods

Add(GoogleDirections)

Adds a directions item to google map control.

Declaration
public void Add(GoogleDirections item)
Parameters
Type Name Description
GoogleDirections item

The item.

Add(GoogleOverlay)

Adds an overlay to google map control.

Declaration
public void Add(GoogleOverlay item)
Parameters
Type Name Description
GoogleOverlay item

The item.

Add(GooglePolyline)

Adds a polyline to google map control.

Declaration
public void Add(GooglePolyline item)
Parameters
Type Name Description
GooglePolyline item

The item.

CreateChildControls()

Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.

Declaration
protected override void CreateChildControls()
Overrides
System.Web.UI.Control.CreateChildControls()

GetScriptDescriptors()

Gets the script descriptors.

Declaration
protected override IEnumerable<ScriptDescriptor> GetScriptDescriptors()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Web.UI.ScriptDescriptor>

An System.Collections.IEnumerable collection of System.Web.UI.ScriptDescriptor objects.

Overrides
System.Web.UI.ScriptControl.GetScriptDescriptors()

GetScriptReferences()

Gets the script references.

Declaration
protected override IEnumerable<ScriptReference> GetScriptReferences()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Web.UI.ScriptReference>

An System.Collections.IEnumerable collection that contains ECMAScript (JavaScript) files that have been registered as embedded resources.

Overrides
System.Web.UI.ScriptControl.GetScriptReferences()

OnBoundsChanged(MapEventArgs)

Raises the BoundsChanged event.

Declaration
protected virtual void OnBoundsChanged(MapEventArgs e)
Parameters
Type Name Description
MapEventArgs e

The BoundsEventArgs instance containing the event data.

OnCenterChanged(MapEventArgs)

Raises the CenterChanged event.

Declaration
protected virtual void OnCenterChanged(MapEventArgs e)
Parameters
Type Name Description
MapEventArgs e

The MouseEventArgs instance containing the event data.

OnClick(MouseEventArgs)

Raises the Click event.

Declaration
protected virtual void OnClick(MouseEventArgs e)
Parameters
Type Name Description
MouseEventArgs e

The MouseEventArgs instance containing the event data.

OnDoubleClick(MouseEventArgs)

Raises the DoubleClick event.

Declaration
protected virtual void OnDoubleClick(MouseEventArgs e)
Parameters
Type Name Description
MouseEventArgs e

The MouseEventArgs instance containing the event data.

OnDrag(MapEventArgs)

Raises the Drag event.

Declaration
protected virtual void OnDrag(MapEventArgs e)
Parameters
Type Name Description
MapEventArgs e

The BoundsEventArgs instance containing the event data.

OnDragEnd(MapEventArgs)

Raises the DragEnd event.

Declaration
protected virtual void OnDragEnd(MapEventArgs e)
Parameters
Type Name Description
MapEventArgs e

The BoundsEventArgs instance containing the event data.

OnDragStart(MapEventArgs)

Raises the DragStart event.

Declaration
protected virtual void OnDragStart(MapEventArgs e)
Parameters
Type Name Description
MapEventArgs e

The BoundsEventArgs instance containing the event data.

OnHeadingChanged(EventArgs)

Raises the HeadingChanged event.

Declaration
protected virtual void OnHeadingChanged(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

The System.EventArgs instance containing the event data.

OnIdle(EventArgs)

Raises the Idle event.

Declaration
protected virtual void OnIdle(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

The System.EventArgs instance containing the event data.

OnMapTypeChanged(MapEventArgs)

Raises the MapTypeChanged event.

Declaration
protected virtual void OnMapTypeChanged(MapEventArgs e)
Parameters
Type Name Description
MapEventArgs e

The MapEventArgs instance containing the event data.

OnMouseMove(MouseEventArgs)

Raises the MouseMove event.

Declaration
protected virtual void OnMouseMove(MouseEventArgs e)
Parameters
Type Name Description
MouseEventArgs e

The MouseEventArgs instance containing the event data.

OnMouseOut(MouseEventArgs)

Raises the MouseOut event.

Declaration
protected virtual void OnMouseOut(MouseEventArgs e)
Parameters
Type Name Description
MouseEventArgs e

The MouseEventArgs instance containing the event data.

OnMouseOver(MouseEventArgs)

Raises the MouseOver event.

Declaration
protected virtual void OnMouseOver(MouseEventArgs e)
Parameters
Type Name Description
MouseEventArgs e

The MouseEventArgs instance containing the event data.

OnPreRender(EventArgs)

Raises the System.Web.UI.Control.OnPreRender(System.EventArgs) event and registers the script control with the System.Web.UI.ScriptManager control.

Declaration
protected override void OnPreRender(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

An System.EventArgs object that contains the event data.

Overrides
System.Web.UI.ScriptControl.OnPreRender(System.EventArgs)

OnProjectionChanged(EventArgs)

Raises the ProjectionChanged event.

Declaration
protected virtual void OnProjectionChanged(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

The System.EventArgs instance containing the event data.

OnResize(MapEventArgs)

Raises the Resize event.

Declaration
protected virtual void OnResize(MapEventArgs e)
Parameters
Type Name Description
MapEventArgs e

The MapEventArgs instance containing the event data.

OnRightClick(MouseEventArgs)

Raises the RightClick event.

Declaration
protected virtual void OnRightClick(MouseEventArgs e)
Parameters
Type Name Description
MouseEventArgs e

The MouseEventArgs instance containing the event data.

OnTilesLoaded(EventArgs)

Raises the TilesLoaded event.

Declaration
protected virtual void OnTilesLoaded(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

The System.EventArgs instance containing the event data.

OnTiltChanged(EventArgs)

Raises the TiltChanged event.

Declaration
protected virtual void OnTiltChanged(EventArgs e)
Parameters
Type Name Description
System.EventArgs e

The System.EventArgs instance containing the event data.

OnZoomChanged(MapEventArgs)

Raises the ZoomChanged event.

Declaration
protected virtual void OnZoomChanged(MapEventArgs e)
Parameters
Type Name Description
MapEventArgs e

The MapEventArgs instance containing the event data.

RegisterGoogleReference()

Registers the GoogleMaps API reference.

Declaration
protected virtual void RegisterGoogleReference()

Events

BoundsChanged

This event is fired when the viewport bounds have changed.

Declaration
public event EventHandler<MapEventArgs> BoundsChanged
Event Type
Type Description
System.EventHandler<MapEventArgs>

CenterChanged

This event is fired when the map center property changes.

Declaration
public event EventHandler<MapEventArgs> CenterChanged
Event Type
Type Description
System.EventHandler<MapEventArgs>

Click

This event is fired when the user clicks on the map (but not when they click on a marker or infowindow).

Declaration
public event EventHandler<MouseEventArgs> Click
Event Type
Type Description
System.EventHandler<MouseEventArgs>

DoubleClick

This event is fired when the user double-clicks on the map. Note that the click event will also fire, right before this one.

Declaration
public event EventHandler<MouseEventArgs> DoubleClick
Event Type
Type Description
System.EventHandler<MouseEventArgs>

Drag

This event is repeatedly fired while the user drags the map.

Declaration
public event EventHandler<MapEventArgs> Drag
Event Type
Type Description
System.EventHandler<MapEventArgs>

DragEnd

This event is fired when the user stops dragging the map.

Declaration
public event EventHandler<MapEventArgs> DragEnd
Event Type
Type Description
System.EventHandler<MapEventArgs>

DragStart

This event is fired when the user starts dragging the map.

Declaration
public event EventHandler<MapEventArgs> DragStart
Event Type
Type Description
System.EventHandler<MapEventArgs>

HeadingChanged

This event is fired when the map heading property changes.

Declaration
public event EventHandler HeadingChanged
Event Type
Type Description
System.EventHandler

Idle

This event is fired when the map becomes idle after panning or zooming.

Declaration
public event EventHandler Idle
Event Type
Type Description
System.EventHandler

MapTypeChanged

This event is fired when the mapTypeId property changes.

Declaration
public event EventHandler<MapEventArgs> MapTypeChanged
Event Type
Type Description
System.EventHandler<MapEventArgs>

MouseMove

This event is fired whenever the user's mouse moves over the map container.

Declaration
public event EventHandler<MouseEventArgs> MouseMove
Event Type
Type Description
System.EventHandler<MouseEventArgs>

MouseOut

This event is fired when the user's mouse exits the map container.

Declaration
public event EventHandler<MouseEventArgs> MouseOut
Event Type
Type Description
System.EventHandler<MouseEventArgs>

MouseOver

This event is fired when the user's mouse enters the map container.

Declaration
public event EventHandler<MouseEventArgs> MouseOver
Event Type
Type Description
System.EventHandler<MouseEventArgs>

ProjectionChanged

This event is fired when the projection has changed.

Declaration
public event EventHandler ProjectionChanged
Event Type
Type Description
System.EventHandler

Resize

This event is fired on the map when the div changes size.

Declaration
public event EventHandler<MapEventArgs> Resize
Event Type
Type Description
System.EventHandler<MapEventArgs>

RightClick

This event is fired when the DOM contextmenu event is fired on the map container.

Declaration
public event EventHandler<MouseEventArgs> RightClick
Event Type
Type Description
System.EventHandler<MouseEventArgs>

TilesLoaded

This event is fired when the visible tiles have finished loading.

Declaration
public event EventHandler TilesLoaded
Event Type
Type Description
System.EventHandler

TiltChanged

This event is fired when the map tilt property changes.

Declaration
public event EventHandler TiltChanged
Event Type
Type Description
System.EventHandler

ZoomChanged

This event is fired when the map zoom property changes.

Declaration
public event EventHandler<MapEventArgs> ZoomChanged
Event Type
Type Description
System.EventHandler<MapEventArgs>

Explicit Interface Implementations

IPostBackEventHandler.RaisePostBackEvent(String)

Declaration
void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
Parameters
Type Name Description
System.String eventArgument
Implements
System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(System.String)

See Also

System.Web.UI.ScriptControl
System.Web.UI.IPostBackEventHandler
Back to top Copyright © 2017 GoogleMapControl
Generated by DocFX