?? mapobject學習筆記-第二講 圖層的基本功能開發_魏國強 的 博客.htm
字號:
layer</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>Set layer = New
MapLayer</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>layer.GeoDataset =
dc.FindGeoDataset("rivers")</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>layer.Symbol.Color
= moRed</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>layer.Symbol.Size
= 2</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>layer.Symbol.Style
= 4</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>Map1.Layers.Add
layer</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>Set layer = New
MapLayer</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>layer.GeoDataset =
dc.FindGeoDataset("cities")</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>layer.Symbol.Color
= moBlack</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>layer.Symbol.Size
= 3</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>layer.Symbol.Style
= 2</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>Map1.Layers.Add
layer</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>Map1.Refresh</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>End Sub</SPAN></P>
<P class=MsoNormal
style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21.75pt"><SPAN>至此,我們已經學了和圖層操作有關的幾個對象和控件:</SPAN><SPAN>Map</SPAN><SPAN>控件,</SPAN><SPAN>DataConnection</SPAN><SPAN>對象,</SPAN><SPAN>Layers</SPAN><SPAN>集合對象,</SPAN><SPAN>MapLayer</SPAN><SPAN>對象,以及和設置地圖圖層屬性的</SPAN><SPAN>Symbol</SPAN><SPAN>對象。</SPAN><SPAN>DataConnection</SPAN><SPAN>對象包括的屬性和函數有</SPAN><SPAN>Database</SPAN><SPAN>屬性,</SPAN><SPAN>Connect</SPAN><SPAN>和</SPAN><SPAN>FindGeoDataset</SPAN><SPAN>函數;</SPAN><SPAN>MapLayer</SPAN><SPAN>對象的</SPAN><SPAN>GeoDataset</SPAN><SPAN>屬性;</SPAN><SPAN>Layers</SPAN><SPAN>集合對象包含所有對應控件上的向量圖層(</SPAN><SPAN>MapLayer</SPAN><SPAN>)和柵格圖像圖層(</SPAN><SPAN>Image
Layer</SPAN><SPAN>)對象,用到的成員函數有</SPAN><SPAN>Add</SPAN><SPAN>和</SPAN><SPAN>Clear</SPAN><SPAN>;</SPAN><SPAN>Map</SPAN><SPAN>控件的</SPAN><SPAN>Extent</SPAN><SPAN>屬性,</SPAN><SPAN>Fullextent</SPAN><SPAN>屬性,</SPAN><SPAN>MousePointe</SPAN><SPAN>鼠標指針變量,</SPAN><SPAN>Refresh</SPAN><SPAN>成員函數;</SPAN><SPAN>Symbol</SPAN><SPAN>對象的</SPAN><SPAN>Color</SPAN><SPAN>屬性,</SPAN><SPAN>OutlineColor</SPAN><SPAN>屬性,</SPAN><SPAN>Size</SPAN><SPAN>屬性,</SPAN><SPAN>Style</SPAN><SPAN>屬性。</SPAN></P></SPAN></FONT></SPAN></SPAN></SPAN></STRONG></DIV></TD></TR></TBODY></TABLE><BR>
<DIV class=opt><A title=查看該分類中所有文章
href="http://hi.baidu.com/laowei/blog/category/ĬÈÏ·ÖÀà">類別:默認分類</A> | <A
title=將此文章添加到百度搜藏 onclick="return addToFavor();"
href="http://cang.baidu.com/do/add" target=_blank>添加到搜藏</A> | 瀏覽(<SPAN
id=result></SPAN>) | <A
href="http://hi.baidu.com/laowei/blog/item/7c31730e3adbf8ce7bcbe124.html#send">評論</A> (0)
<SCRIPT language=javascript>
/*<![CDATA[*/
var pre = [true,'MapObject學習筆記-第一講 MO概述及程序設計入門', 'MapObject學習筆記-第一講 MO概...','/laowei/blog/item/582db03596daad8fa61e125c.html'];
var post = [true,'MapObject學習筆記-第三講 圖層標注、圖層控制和電子地圖常用工具開發','MapObject學習筆記-第三講 圖層...', '/laowei/blog/item/329bd53f41bf8bc67d1e7127.html'];
if(pre[0] || post[0]){
document.write('<div style="height:5px;line-height:5px;"> </div><div id="in_nav">');
if(pre[0]){
document.write('上一篇:<a href="' + pre[3] + '" title="' + pre[1] + '">' + pre[2] + '</a> ');
}
if(post[0]){
document.write('下一篇:<a href="' + post[3] + '" title="' + post[1] + '">' + post[2] + '</a>');
}
document.write('</div>');
}
/*]]>*/
</SCRIPT>
</DIV>
<DIV class=line></DIV>
<STYLE type=text/css>#in_related_doc A {
TEXT-DECORATION: none
}
</STYLE>
<DIV id=in_related_tmp></DIV>
<SCRIPT language=javascript type=text/javascript>
/*<![CDATA[*/
function HI_MOD_IN_RELATED_DOC_CALLBACK(arg){
if(arg.length <= 1) return false;
var hasMore = arg[0];
var D=function(A,B){A[A.length]=B;}
if(arg.length % 2 == 0) D(arg, ["","","",""]);
var html = ['<div id="in_related_doc"><div class="tit">相關文章:</div>'];
D(html, '<table cellpadding="0" cellspacing="3" border="0">');
for(var i = 1, j = arg.length; i < j; i += 2){
D(html, '<tr>');
D(html, '<td width="15px"><a style="font-size:25px" >•</a></td><td><a href="http://hi.baidu.com/' + arg[i][3] + '/blog/item/' + arg[i][2] + '.html" target="_blank" title="' + arg[i][0] + '">' + arg[i][1] + '</a>');
D(html, new Array(10).join('\u3000'));
D(html, '</td>');
if(arg[i + 1][0] != "")
D(html, '<td width="15px"><a style="font-size:25px" >•</a></td><td><a href="http://hi.baidu.com/' + arg[i + 1][3] + '/blog/item/' + arg[i + 1][2] + '.html" target="_blank" title="' + arg[i + 1][0] + '">' + arg[i + 1][1] + '</a></td>');
else
D(html, '<td> </td><td> </td>');
D(html, '</tr>');
}
if(hasMore) D(html, '<tr><td colspan="4"><a target="_blank" href="/sys/search?pageno=1&type=7&sort=1&word=MapObject%D1%A7%CF%B0%B1%CA%BC%C7%A3%AD%B5%DA%B6%FE%BD%B2%20%CD%BC%B2%E3%B5%C4%BB%F9%B1%BE%B9%A6%C4%DC%BF%AA%B7%A2&item=7c31730e3adbf8ce7bcbe124">更多>></a></td></tr>');
D(html, '</table></div><div class="line"> </div>');
var div = document.getElementById('in_related_tmp');
if(div){
div.innerHTML = html.join('');
while(div.firstChild){
div.parentNode.insertBefore(div.firstChild, div);
}
div.parentNode.removeChild(div);
}
window.setTimeout("tracker_init('in_related_doc')",100);
}
if(RelatedDocData == -1){ // not supported xhr
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '/sys/search?type=8&word=MapObject%D1%A7%CF%B0%B1%CA%BC%C7%A3%AD%B5%DA%B6%FE%BD%B2%20%CD%BC%B2%E3%B5%C4%BB%F9%B1%BE%B9%A6%C4%DC%BF%AA%B7%A2&item=7c31730e3adbf8ce7bcbe124&t=' + new Date().getTime();
document.getElementsByTagName('HEAD')[0].appendChild(script);
}else if(RelatedDocData == null){
GetAndEval = true;
}else{
eval(RelatedDocData);
}
/*]]>*/
</SCRIPT>
<DIV id=in_reader>
<DIV class=tit>最近讀者:</DIV>
<SCRIPT>
var g_spAnnony=true;
var g_read=[
["awming520","300e61776d696e673532309e01","awming520"],
["luojason","fb554c756f4a61736f6e2b04","LuoJason"],
["sbxm","9f517362786d6203","sbxm"],
{}
];
g_read.length=g_read.length-1;
var _rh1="";
var _rh2="";
function wrreader(){
_rh1 += '<table width="100%" ><tr>';
_rh2+='<tr>';
if(g_spAnnony){
_rh1+='<td align="center" width="10%" ><img border="0" width="55" height="55" src="http://img.baidu.com/hi/img/portraitn.jpg"></td>';
_rh2+='<td> </td>';
if(g_read.length>0){
_rh1+='<td align="left" width="12%">';
}else{
_rh1+='<td align="left" width="100%">';
}
_rh1+='<a href="https://passport.baidu.com/?login&tpl=sp&tpl_reg=sp&u='+myref+'" target="_self">登錄</a>后,您就出現在這里。</td>';
_rh2+='<td> </td>'
}
if(g_read.length==0){
if(!g_spAnnony){
_rh1+='<td align=left width="100%">最近還沒有登錄用戶看過這篇文章……</td>';
_rh2+='<td> </td>';
}
}else{
for(i=0,len=g_read.length;i<len;i++){
_rh1+='<td align="center" valign="bottom" width="10%" class="user"><a href="/'+g_read[i][0]+'" target="_blank"><img border="0" src="http://himg.baidu.com/sys/portraitn/item/'+g_read[i][1]+'.jpg"></a></td>';
_rh2+='<td align="center" valign="top" class="user"><a href="/'+g_read[i][0]+'" target="_blank">'+g_read[i][2]+'</a></td>';
}
}
_rh1+='<td width="100%"></td></tr>';
_rh2+='<td></td></tr></table>';
document.write(_rh1+_rh2);
}
wrreader();
</SCRIPT>
</DIV>
<DIV class=line></DIV>
<SCRIPT language=JavaScript>
allkey=allkey+"2d2e71cfdfd49e3df8dc6143_7c31730e3adbf8ce7bcbe124_";
</SCRIPT>
<DIV id=in_comment><A name=comment></A>
<DIV class=tit>網友評論:</DIV>
<SCRIPT>
function writecmt(type,id,cmtname,cmturl,portraitId){
var html1="";
if(type==1){
html1="<a href='"+cmturl+"' target='_blank' title='"+cmturl+"'><img border='0' src='http://himg.baidu.com/sys/portraitn/item/"+portraitId+".jpg'><br>"+cmtname+"</a>";
}else{
if(cmtname=="" || cmtname=="匿名網友"){
if(cmturl==""){
html1="<a>匿名網友</a>";
}else{
html1="<a href='"+cmturl+"' target='_blank' title='"+cmturl+"'>"+cmtname+"</a>";
}
}else{
if(cmturl==""){
html1="<div class='f14' style='display:inline'>網友:<a>"+cmtname+"</a></div>";
}else{
html1="<div class='f14' style='display:inline'>網友:<a href='"+cmturl+"' target='_blank' title='"+cmturl+"'>"+cmtname+"</a></div>";
}
}
}
document.write(html1);
}
function filterCmtContent(n){
if(!BdBrowser.isIE){
var defaultfilter1='<span style="filter:glow(color=#000000,strength=2);height:0px;color:#000000">';
var defaultfilter2='<span style="height: 0px; color: rgb(0, 0, 0);">';
var commentDiv=document.getElementById(n);
var divs=commentDiv.getElementsByTagName('div');
var d,tmp;
for( var i=0,len=divs.length;i<len;i++){
d=divs[i];
if(d.getAttribute('name')=='cmtcontent'){
tmp=d.innerHTML;
tmp=tmp.replace(/<span style="filter:glow\(color=#([0-9a-z]{3,6}),strength=2\);height:0px;color:#([0-9a-z]{3,6})">/ig,defaultfilter1);
tmp=tmp.replace('<span style="height: 0px; color: rgb(255, 255, 255);">',defaultfilter2);
d.innerHTML=tmp;
}
}
}
}
</SCRIPT>
<DIV id=page></DIV></DIV>
<SCRIPT>filterCmtContent('in_comment');</SCRIPT>
<DIV id=in_send><A name=send></A>
<FORM id=popFormSubmit name=form1 onsubmit="return checkcmtform()"
action=/laowei/commit method=post><INPUT type=hidden value=8 name=ct> <INPUT
type=hidden value=1 name=cm> <INPUT type=hidden value=7c31730e3adbf8ce7bcbe124
name=spBlogID> <INPUT id=spRefURL type=hidden name=spRefURL>
<SCRIPT>
document.getElementById("spRefURL").value = window.location.href;
</SCRIPT>
<DIV class=tit>發表評論:</DIV>
<TABLE cellSpacing=5 cellPadding=0 width=620 border=0>
<TBODY>
<TR>
<TD class=f14>姓 名:</TD>
<TD><INPUT id=spBlogCmtor style="WIDTH: 220px" onfocus=hidErr(1);
maxLength=49 onchange="checkname('spBlogCmtor')" name=spBlogCmtor>
<SCRIPT>
document.write(" <a href='https://passport.baidu.com/?reg&tpl=sp&return_method=get&skip_ok=1&u=http://hi.baidu.com/sys/reg/' target='_blank'>注冊</a>");
document.write(' | <a href="https://passport.baidu.com/?login&tpl=sp&tpl_reg=sp&u='+myref+'">登錄</a>');
</SCRIPT>
<DIV id=nmerror style="DISPLAY: none">*姓名最長為50字節</DIV></TD></TR>
<TR id=1_err style="DISPLAY: none">
<TD> </TD>
<TD>
<DIV class=error id=1_err_con></DIV></TD></TR>
<TR>
<TD class=f14>網址或郵箱:</TD>
<TD><INPUT id=spBlogCmtURL style="WIDTH: 360px" onfocus=hidErr(2);
maxLength=128 onchange="checkeandu('spBlogCmtURL')" name=spBlogCmtURL>
(選填)</TD>
<SCRIPT>
G("spBlogCmtor").value="";
G("spBlogCmtURL").value="";
</SCRIPT>
</TR>
<TR id=2_err style="DISPLAY: none">
<TD> </TD>
<TD>
<DIV class=error id=2_err_con></DIV></TD></TR>
<TR>
<TD class=f14 id=reTitle vAlign=top>內 容:</TD>
<TD><TEXTAREA id=spBlogCmtText style="WIDTH: 520px; HEIGHT: 155px" onfo
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -