您的位置:首页 > 编程语言 > C#

用C#创建一个封装Google Map API的GoogleMap Web服务器控件(二)

2008-04-23 16:01 519 查看
前面我们创建了一个很简单的GoogleMap控件,它显然不满足我们的需求,通过分析,我们有如下这些进一步的需求:

一. 我们想要给用户提供在客户端调整Map大小的功能,也就是说我们的用户可以根据自己的喜好在网页上自己调整Map的大小.


要实现这个功能,我们需要三个属性:MaxHeight,MaxWidth,SizePercent,我决定用前面重写的Heght和Width属性充当MaxHeight和MaxWidth属性,而Map的实际显示大小则由它们和SizePercent属性一起决定.SizePercent属性如下:

[

Bindable(true),

Category("Google"),

DefaultValue(50),

Description("The size percent.")

]

public virtual int SizePercent

private ArrayList _zoomBound;

[

Bindable(true),

Category("Google"),

Description("The zoom bounds."),

DesignerSerializationVisibility(DesignerSerializationVisibility.Content),

Editor("Int32", typeof(UITypeEditor)),

PersistenceMode(PersistenceMode.InnerProperty)

]

public virtual ArrayList ZoomBound

[

Bindable(true),

Category("Google"),

DefaultValue(false),

Description("Gets or sets a value indicating whether [enable zoom bounds].")

]

public virtual bool EnableZoomBound

[

Bindable(true),

Category("Google"),

DefaultValue(0),

Description("Gets or sets the scroll interval.")

]

public virtual int ScrollInterval

[

Bindable(true),

Category("Google"),

DefaultValue(false),

Description("Gets or sets a value indicating whether [show draggable marker].")

]

public virtual bool ShowDraggableMarker

[

Bindable(true),

Category("Google"),

DefaultValue(""),

Description("The draggable marker related LongTextBox.")

]

public virtual string LongTextBox

[

Bindable(true),

Category("Google"),

DefaultValue(""),

Description("The draggable marker related LatTextBox.")

]

public virtual string LatTextBox

{

get

{

String s = (String)ViewState["LatTextBox"];

return (s == null) ? String.Empty : s;

}

set

{

ViewState["LatTextBox"] = value;

}

}

好了,后面的文章我将编写GoogleInfoWindow,GoogleMarker类及相应的集合类,并给GoogleMap类添加相应的集合属性及其他属性.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐