Files
openlayers/files/OpenLayers/Feature-js.html
2007-06-21 01:36:46 +00:00

55 lines
20 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><title>OpenLayers.Feature - OpenLayers</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script></head><body class=UnframedPage onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version 1.35 -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td class=MenuSection valign=top><!--START_ND_MENU--><div class=MTitle>OpenLayers<div class=MSubTitle>JavaScript Mapping Library</div></div><div class=MEntry><div class=MFile><a href="../OpenLayers-js.html">OpenLayers</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent5')">OpenLayers</a><div class=MGroupContent id=MGroupContent5><div class=MEntry><div class=MFile><a href="BaseTypes-js.html">Base Types</a></div></div><div class=MEntry><div class=MFile><a href="Console-js.html">Console</a></div></div><div class=MEntry><div class=MFile><a href="Control-js.html">Control.js</a></div></div><div class=MEntry><div class=MFile id=MSelected>Feature</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Feature</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="Feature/WFS-js.html">WFS</a></div></div><div class=MEntry><div class=MFile><a href="Feature/Vector-js.html">Vector</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="Format-js.html">Format</a></div></div><div class=MEntry><div class=MFile><a href="Geometry-js.html">Geometry</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Geometry</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="Geometry/Collection-js.html">Collection</a></div></div><div class=MEntry><div class=MFile><a href="Geometry/MultiLineString-js.html">MultiLineString</a></div></div><div class=MEntry><div class=MFile><a href="Geometry/MultiPoint-js.html">MultiPoint</a></div></div><div class=MEntry><div class=MFile><a href="Geometry/Point-js.html">Point</a></div></div><div class=MEntry><div class=MFile><a href="Geometry/Polygon-js.html">Polygon</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="Icon-js.html">Icon</a></div></div><div class=MEntry><div class=MFile><a href="Layer-js.html">Layer</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Layer</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="Layer/Image-js.html">Image</a></div></div><div class=MEntry><div class=MFile><a href="Layer/Vector-js.html">Vector</a></div></div><div class=MEntry><div class=MFile><a href="Layer/WMS-js.html">WMS</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="Map-js.html">Map</a></div></div><div class=MEntry><div class=MFile><a href="Marker-js.html">Marker</a></div></div><div class=MEntry><div class=MFile><a href="Popup-js.html">Popup</a></div></div><div class=MEntry><div class=MFile><a href="Tile-js.html">Tile</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">Tile</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile><a href="Tile/Image-js.html">Image</a></div></div><div class=MEntry><div class=MFile><a href="Tile/WFS-js.html">WFS</a></div></div></div></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent6')">Index</a><div class=MGroupContent id=MGroupContent6><div class=MEntry><div class=MIndex><a href="../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Properties.html">Properties</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Files.html">Files</a></div></div></div></div></div><script language=JavaScript><!--
if (document.getElementById){for (var menu = 1; menu < 7; menu++){if (menu != 5 && menu != 1){document.getElementById("MGroupContent" + menu).style.display = "none";};};}// --></script><!--END_ND_MENU--></td>
<td class=ContentSection valign=top><div class=CClass id=MainTopic><div class=CTopic><h1 class=CTitle><a name="OpenLayers.Feature"></a>OpenLayers.<span class=HB> </span>Feature</h1><div class=CBody><p class=CParagraph>Features are combinations of geography and attributes.&nbsp; The OpenLayers.Feature class specifically combines a marker and a lonlat.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr><td class=SEntrySize><div class=SMain><div class=SEntry><a href="#OpenLayers.Feature" >OpenLayers.<span class=HB> </span>Feature</a></div></div></td><td class=SDescriptionSize><div class=SMain><div class=SDescription>Features are combinations of geography and attributes. </div></div></td></tr><tr><td><div class=SGroup><div class=SEntry><div class=SIndent1><a href="#OpenLayers.Feature.Properties" >Properties</a></div></div></div></td><td><div class=SGroup><div class=SDescription><div class=SIndent1></div></div></div></td></tr><tr class=SMarked><td><div class=SProperty><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.events" >events</a></div></div></div></td><td><div class=SProperty><div class=SDescription><div class=SIndent2>{&lt;OpenLayers.Events&gt;}</div></div></div></td></tr><tr><td><div class=SProperty><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.layer" >layer</a></div></div></div></td><td><div class=SProperty><div class=SDescription><div class=SIndent2>{<a href="Layer-js.html#OpenLayers.Layer" class=LClass >OpenLayers.Layer</a>}</div></div></div></td></tr><tr class=SMarked><td><div class=SProperty><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.id" >id</a></div></div></div></td><td><div class=SProperty><div class=SDescription><div class=SIndent2>{String}</div></div></div></td></tr><tr><td><div class=SProperty><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.lonlat" >lonlat</a></div></div></div></td><td><div class=SProperty><div class=SDescription><div class=SIndent2>{<a href="BaseTypes-js.html#OpenLayers.LonLat" class=LClass id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">OpenLayers.LonLat</a>}</div></div></div></td></tr><tr class=SMarked><td><div class=SProperty><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.data" >data</a></div></div></div></td><td><div class=SProperty><div class=SDescription><div class=SIndent2>{Object}</div></div></div></td></tr><tr><td><div class=SProperty><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.marker" >marker</a></div></div></div></td><td><div class=SProperty><div class=SDescription><div class=SIndent2>{<a href="Marker-js.html#OpenLayers.Marker" class=LClass id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">OpenLayers.Marker</a>}</div></div></div></td></tr><tr class=SMarked><td><div class=SProperty><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.popup" >popup</a></div></div></div></td><td><div class=SProperty><div class=SDescription><div class=SIndent2>{<a href="Popup-js.html#OpenLayers.Popup" class=LClass >OpenLayers.Popup</a>}</div></div></div></td></tr><tr><td><div class=SGroup><div class=SEntry><div class=SIndent1><a href="#OpenLayers.Feature.Functions" >Functions</a></div></div></div></td><td><div class=SGroup><div class=SDescription><div class=SIndent1></div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.OpenLayers.Feature" >OpenLayers.<span class=HB> </span>Feature</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>Constructor for features.</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.destroy" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">destroy</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>nullify references to prevent circular references and memory leaks</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.onScreen" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">onScreen</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>{Boolean} Whether or not the feature is currently visible on screen (based on its &lsquo;lonlat&rsquo; property)</div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.createMarker" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">createMarker</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>Based on the data associated with the Feature, create and return a marker object.</div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.destroyMarker" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">destroyMarker</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>Destroys marker. </div></div></div></td></tr><tr><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.createPopup" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">createPopup</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>Creates a popup object created from the &lsquo;lonlat&rsquo;, &lsquo;popupSize&rsquo;, and &lsquo;popupContentHTML&rsquo; properties set in this.data. </div></div></div></td></tr><tr class=SMarked><td><div class=SFunction><div class=SEntry><div class=SIndent2><a href="#OpenLayers.Feature.destroyPopup" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">destroyPopup</a></div></div></div></td><td><div class=SFunction><div class=SDescription><div class=SIndent2>Destroys the popup created via createPopup.</div></div></div></td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<div class=CGroup><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.Properties"></a>Properties</h3></div></div>
<div class=CProperty><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.events"></a>events</h3><div class=CBody><p class=CParagraph>{&lt;OpenLayers.Events&gt;}</p></div></div></div>
<div class=CProperty><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.layer"></a>layer</h3><div class=CBody><p class=CParagraph>{<a href="Layer-js.html#OpenLayers.Layer" class=LClass >OpenLayers.Layer</a>}</p></div></div></div>
<div class=CProperty><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.id"></a>id</h3><div class=CBody><p class=CParagraph>{String}</p></div></div></div>
<div class=CProperty><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.lonlat"></a>lonlat</h3><div class=CBody><p class=CParagraph>{<a href="BaseTypes-js.html#OpenLayers.LonLat" class=LClass id=link9 onMouseOver="ShowTip(event, 'tt1', 'link9')" onMouseOut="HideTip('tt1')">OpenLayers.LonLat</a>}</p></div></div></div>
<div class=CProperty><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.data"></a>data</h3><div class=CBody><p class=CParagraph>{Object}</p></div></div></div>
<div class=CProperty><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.marker"></a>marker</h3><div class=CBody><p class=CParagraph>{<a href="Marker-js.html#OpenLayers.Marker" class=LClass id=link10 onMouseOver="ShowTip(event, 'tt2', 'link10')" onMouseOut="HideTip('tt2')">OpenLayers.Marker</a>}</p></div></div></div>
<div class=CProperty><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.popup"></a>popup</h3><div class=CBody><p class=CParagraph>{<a href="Popup-js.html#OpenLayers.Popup" class=LClass >OpenLayers.Popup</a>}</p></div></div></div>
<div class=CGroup><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.Functions"></a>Functions</h3></div></div>
<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.OpenLayers.Feature"></a>OpenLayers.<span class=HB> </span>Feature</h3><div class=CBody><p class=CParagraph>Constructor for features.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>layer</td><td class=CDLDescription>{<a href="Layer-js.html#OpenLayers.Layer" class=LClass >OpenLayers.Layer</a>}</td></tr><tr><td class=CDLEntry>lonlat</td><td class=CDLDescription>{<a href="BaseTypes-js.html#OpenLayers.LonLat" class=LClass id=link11 onMouseOver="ShowTip(event, 'tt1', 'link11')" onMouseOut="HideTip('tt1')">OpenLayers.LonLat</a>}</td></tr><tr><td class=CDLEntry>data</td><td class=CDLDescription>{Object}</td></tr></table><h4 class=CHeading>Return</h4><p class=CParagraph>{<a href="#OpenLayers.Feature.OpenLayers.Feature" class=LFunction id=link12 onMouseOver="ShowTip(event, 'tt9', 'link12')" onMouseOut="HideTip('tt9')">OpenLayers.Feature</a>}</p></div></div></div>
<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.destroy"></a>destroy</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>destroy: function()</td></tr></table></blockquote><p class=CParagraph>nullify references to prevent circular references and memory leaks</p></div></div></div>
<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.onScreen"></a>onScreen</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>onScreen:function()</td></tr></table></blockquote><h4 class=CHeading>Returns</h4><p class=CParagraph>{Boolean} Whether or not the feature is currently visible on screen (based on its &lsquo;lonlat&rsquo; property)</p></div></div></div>
<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.createMarker"></a>createMarker</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>createMarker: function()</td></tr></table></blockquote><p class=CParagraph>Based on the data associated with the Feature, create and return a marker object.</p><h4 class=CHeading>Return</h4><p class=CParagraph>{<a href="Marker-js.html#OpenLayers.Marker" class=LClass id=link13 onMouseOver="ShowTip(event, 'tt2', 'link13')" onMouseOut="HideTip('tt2')">OpenLayers.Marker</a>} A Marker Object created from the &lsquo;lonlat&rsquo; and &lsquo;icon&rsquo; properties set in this.data.&nbsp; If no &lsquo;lonlat&rsquo; is set, returns null.&nbsp; If no &lsquo;icon&rsquo; is set, OpenLayers.Marker() will load the default image.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Note</td><td class=CDLDescription>this.marker is set to return value</td></tr></table></div></div></div>
<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.destroyMarker"></a>destroyMarker</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>destroyMarker: function()</td></tr></table></blockquote><p class=CParagraph>Destroys marker.&nbsp; If user overrides the createMarker() function, s/he should be able to also specify an alternative function for destroying it</p></div></div></div>
<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.createPopup"></a>createPopup</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>createPopup: function(</td><td class=PParameter nowrap>closeBox</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p class=CParagraph>Creates a popup object created from the &lsquo;lonlat&rsquo;, &lsquo;popupSize&rsquo;, and &lsquo;popupContentHTML&rsquo; properties set in this.data.&nbsp; It uses this.marker.icon as default anchor.</p><p class=CParagraph>If no &lsquo;lonlat&rsquo; is set, returns null.&nbsp; If no this.marker has been created, no anchor is sent.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Note</td><td class=CDLDescription>this.popup is set to return value</td></tr></table><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>closeBox</td><td class=CDLDescription>{Boolean} create popup with closebox or not</td></tr></table><h4 class=CHeading>Returns</h4><p class=CParagraph>{&lt;OpenLayers.Popup.AnchoredBubble&gt;}</p></div></div></div>
<div class=CFunction><div class=CTopic><h3 class=CTitle><a name="OpenLayers.Feature.destroyPopup"></a>destroyPopup</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>destroyPopup: function()</td></tr></table></blockquote><p class=CParagraph>Destroys the popup created via createPopup.</p><p class=CParagraph>As with the marker, if user overrides the createPopup() function, s/he should also be able to override the destruction</p></div></div></div>
</td>
</tr></table><div class=Footer><!--START_ND_FOOTER-->Generated by <a href="http://www.naturaldocs.org">Natural Docs</a><!--END_ND_FOOTER--></div>
<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass>This class represents a longitude and latitude pair</div></div><div class=CToolTip id="tt2"><div class=CClass>Instances of OpenLayers.Marker are a combination of a OpenLayers.LonLat and an OpenLayers.Icon.</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>destroy: function()</td></tr></table></blockquote>nullify references to prevent circular references and memory leaks</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>onScreen:function()</td></tr></table></blockquote>{Boolean} Whether or not the feature is currently visible on screen (based on its &lsquo;lonlat&rsquo; property)</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>createMarker: function()</td></tr></table></blockquote>Based on the data associated with the Feature, create and return a marker object.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>destroyMarker: function()</td></tr></table></blockquote>Destroys marker. </div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>createPopup: function(</td><td class=PParameter nowrap>closeBox</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Creates a popup object created from the &lsquo;lonlat&rsquo;, &lsquo;popupSize&rsquo;, and &lsquo;popupContentHTML&rsquo; properties set in this.data. </div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>destroyPopup: function()</td></tr></table></blockquote>Destroys the popup created via createPopup.</div></div><div class=CToolTip id="tt9"><div class=CFunction>Constructor for features.</div></div><!--END_ND_TOOLTIPS-->
<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>