Show / Hide Table of Contents

Class GoogleStaticMap

The Google Static Maps API lets you embed a Google Maps image on your web page without requiring JavaScript or any dynamic page loading. The Google Static Maps API service creates your map based on URL parameters sent through a standard HTTP request and returns the map as an image you can display on your web page.

Inheritance
System.Object
System.Web.UI.Control
System.Web.UI.WebControls.WebControl
GoogleStaticMap
Inherited Members
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.Render(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.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.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.OnPreRender(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.CreateChildControls()
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 GoogleStaticMap : WebControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor

Properties

Address

The address to geocode and set the static 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

Center

The LatLng static map center position. A property which handles the Latitude and Longitude values. The static map center LatLng can be set through Latitude and Longitude properties of Center or by comma separated values pair string. For example: GoogleStaticMap1.Center.Latitude = 42.1229; GoogleStaticMap1.Center.Longitude = 24.7879; or GoogleStaticMap1.Center = "42.1229,24.7879";

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

The center.

Height

Defines the height dimensions of the map image. This parameter is affected by the scale parameter, described below; the final output size is the product of the size and scale values.

Declaration
public override Unit Height { get; set; }
Property Value
Type Description
System.Web.UI.WebControls.Unit
Overrides
System.Web.UI.WebControls.WebControl.Height

ImageFormat

Defines the format of the resulting image. By default, the Google Static Maps API creates PNG images. There are several possible formats including GIF, JPEG and PNG types. Which format you use depends on how you intend to present the image. JPEG typically provides greater compression, while GIF and PNG provide greater detail. For more information, see GoogleStaticMap.ImageFormats.

Declaration
public GoogleStaticMap.ImageFormats? ImageFormat { get; set; }
Property Value
Type Description
System.Nullable<GoogleStaticMap.ImageFormats>

Language

Defines the language to use for display of labels on map tiles. Note that this parameter is only supported for some country tiles; if the specific language requested is not supported for the tile set, then the default language for that tileset will be used.

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

MapType

Defines the type of map to construct. There are several possible maptype values, including roadmap, satellite, hybrid, and terrain.

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

Region

Defines the appropriate borders to display, based on geo-political sensitivities. Accepts a region code specified as a two-character ccTLD ('top-level domain') value.

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

Scale

Affects the number of pixels that are returned. scale=2 returns twice as many pixels as scale=1 while retaining the same coverage area and level of detail (i.e. the contents of the map don't change). This is useful when developing for high-resolution displays, or when generating a map for printing. The default value is 1. Accepted values are 2 and 4 (4 is only available to Google Maps APIs Premium Plan customers.)

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

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

Width

Defines the width dimensions of the map image. Maps smaller than 180 pixels in width will display a reduced-size Google logo. This parameter is affected by the scale parameter, described below; the final output size is the product of the size and scale values.

Declaration
public override Unit Width { get; set; }
Property Value
Type Description
System.Web.UI.WebControls.Unit
Overrides
System.Web.UI.WebControls.WebControl.Width

Zoom

Defines the zoom level of the map, which determines the magnification level of the map. This parameter takes a numerical value corresponding to the zoom level of the region desired.

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

Methods

GetStaticUrl()

Gets the generated Url of Google Static Maps API.

Declaration
protected virtual string GetStaticUrl()
Returns
Type Description
System.String

RenderBeginTag(HtmlTextWriter)

Renders the HTML opening tag of the control to the specified writer. This method is used primarily by control developers.

Declaration
public override void RenderBeginTag(HtmlTextWriter writer)
Parameters
Type Name Description
System.Web.UI.HtmlTextWriter writer

A System.Web.UI.HtmlTextWriter that represents the output stream to render HTML content on the client.

Overrides
System.Web.UI.WebControls.WebControl.RenderBeginTag(System.Web.UI.HtmlTextWriter)
Back to top Copyright © 2017 GoogleMapControl
Generated by DocFX