PolygonHotSpot.GetCoordinates メソッド
アセンブリ: System.Web (system.web.dll 内)

Dim instance As PolygonHotSpot Dim returnValue As String returnValue = instance.GetCoordinates
PolygonHotSpot オブジェクトの各頂点の座標を表す文字列。既定値は空の文字列 ("") です。

GetCoordinates メソッドは、PolygonHotSpot オブジェクトの各頂点の座標を表す文字列を返します。このメソッドが返す文字列は、Coordinates プロパティの現在の値です。
GetCoordinates メソッドは、PolygonHotSpot をレンダリングする際に、その座標に使用するテキストを取得するために、ASP.NET によって内部的に使用されます。返される文字列は、ブラウザやマークアップ言語に固有です。

3 つの PolygonHotSpot オブジェクトを持つ ImageMap コントロールを作成する方法を次のコード例に示します。各 PolygonHotSpot オブジェクトは、地図上の地理的な領域を表します。ユーザーが PolygonHotSpot オブジェクトをクリックすると、サーバーへのポストバックが行われます。GetCoordinates メソッドは、多角形の各頂点の座標を取得し、ラベルに表示します。
<%@ Page Language="VB" %> <script runat="server"> Sub RegionMap_Clicked(ByVal sender As Object, ByVal e As ImageMapEventArgs) Dim coordinates As String ' When a user clicks a hot spot, display ' the coordinates of the hot spot's vertices. Select Case (e.PostBackValue) Case ("Western") coordinates = Regions.HotSpots(0).GetCoordinates() Message1.Text = "The coordinates are " & coordinates Case ("Northern") coordinates = Regions.HotSpots(1).GetCoordinates() Message1.Text = "The coordinates are " & coordinates Case ("Southern") coordinates = Regions.HotSpots(2).GetCoordinates() Message1.Text = "The coordinates are " & coordinates Case Else Message1.Text = "You did not click a valid hot spot region." End Select End Sub </script> <html> <head id="Head1" runat="server"> <title>PolygonHotSpot.GetCoordinates Example</title> </head> <body> <form id="Form1" runat="server"> <h3>PolygonHotSpot.GetCoordinates Example</h3> <!-- Change or remove the width and height attributes as appropriate for your image. --> <asp:imagemap id="Regions" imageurl="Images/RegionMap.jpg" alternatetext="Sales Regions" hotspotmode="PostBack" width="400" height="400" onclick="RegionMap_Clicked" runat="Server"> <asp:PolygonHotSpot coordinates="0,0,176,0,125,182,227,400,0,400" postbackvalue="Western" alternatetext="Western Region"> </asp:PolygonHotSpot> <asp:PolygonHotSpot coordinates="177,0,400,0,400,223,335,154,127,180" postbackvalue="Northern" alternatetext="Northern Region"> </asp:PolygonHotSpot> <asp:PolygonHotSpot coordinates="128,185,335,157,400,224,400,400,228,400" postbackvalue="Southern" alternatetext="Southern Region"> </asp:PolygonHotSpot> </asp:imagemap> <br /><br /> <asp:label id="Message1" runat="Server"> </asp:label> </form> </body> </html>
<%@ Page Language="C#" %> <script runat="server"> void RegionMap_Clicked (object sender, ImageMapEventArgs e) { string coordinates; // When a user clicks a hot spot, display // the hot spot's type and name. switch (e.PostBackValue) { case "Western": coordinates = Regions.HotSpots[0].GetCoordinates(); Message1.Text = "The coordinates are " + coordinates; break; case "Northern": coordinates = Regions.HotSpots[1].GetCoordinates(); Message1.Text = "The coordinates are " + coordinates; break; case "Southern": coordinates = Regions.HotSpots[2].GetCoordinates(); Message1.Text = "The coordinates are " + coordinates; break; default: Message1.Text = "You did not click a valid hot spot region."; break; } } </script> <html> <head id="Head1" runat="server"> <title>PolygonHotSpot.GetCoordinates Example</title> </head> <body> <form id="Form1" runat="server"> <h3>PolygonHotSpot.GetCoordinates Example</h3> <!-- Change or remove the width and height attributes as appropriate for your image. --> <asp:imagemap id="Regions" imageurl="Images/RegionMap.jpg" alternatetext="Sales Regions" hotspotmode="PostBack" width="400" height="400" onclick="RegionMap_Clicked" runat="Server"> <asp:PolygonHotSpot coordinates="0,0,176,0,125,182,227,400,0,400" postbackvalue="Western" alternatetext="Western Region"> </asp:PolygonHotSpot> <asp:PolygonHotSpot coordinates="177,0,400,0,400,223,335,154,127,180" postbackvalue="Northern" alternatetext="Northern Region"> </asp:PolygonHotSpot> <asp:PolygonHotSpot coordinates="128,185,335,157,400,224,400,400,228,400" postbackvalue="Southern" alternatetext="Southern Region"> </asp:PolygonHotSpot> </asp:imagemap> <br /><br /> <asp:label id="Message1" runat="Server"> </asp:label> </form> </body> </html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からPolygonHotSpot.GetCoordinates メソッドを検索する場合は、下記のリンクをクリックしてください。

- PolygonHotSpot.GetCoordinates メソッドのページへのリンク