Welcome
Guest
, you are in:
<root>
EnterpriseLibrary
FDOT Security STS
FDOT_Application_Model
GisFramework
•
Login
FDOT Wiki
GisFramework
¶
Gis Framework
Fdot Wiki
Random Page
All Pages
Categories
Search the wiki
»
Back
Application Link Example
Modified on Wednesday, 13 July 2011 11:10 AM
by
Administrator
Categorized as
Feature Actions
Here's a completely implemented example of the StreetViewLink. {toc} ==StreetViewLink== (((@@ [Export(typeof(IApplicationLink))] public class StreetViewLink : ApplicationLink<StreetViewData> { public StreetViewLink() { DataIdentifiers = new List<ApplicationLinkDataIdentifier<StreetViewData>> { new StreetViewDataIdentifier() }; } protected override void OnApplicationLinkExecute(StreetViewData linkData) { if (linkData != null) { string link2 = "http://maps.google.com/maps?q=&layer=c&cbll=" + linkData.Latitude + "," + linkData.Longitude + "&cbp=12&output=svembed"; var navigateUri = new Uri(link2); HtmlPage.Window.Navigate(navigateUri, "__blank", "height=376,width=501,status=no,scrollbars=no,toolbar=no,resizable=true"); } } public override string GetDisplayName() { return "Street View"; } }@@))) ==StreetViewData== (((@@ public class StreetViewData { public double Latitude; public double Longitude; }@@))) ==StreetViewDataIdentifier== (((@@ public class StreetViewDataIdentifier : ApplicationLinkDataIdentifier<StreetViewData> { public override bool CanLinkFromObject(Feature o) { return o.Geometry != null && o.Geometry.GetGeometryEnumType() == GeometryTypes.Point; } public override StreetViewData GetLinkData(Feature o) { var projector = new ESRI.ArcGIS.Client.Projection.WebMercator(); var geometry = GeometryTranslator.Translate(projector.ToGeographic( GeometryTranslator.Translate(o.Geometry) ) ); return new StreetViewData { Latitude = geometry.Y.Value, Longitude = geometry.X.Value }; } } @@))) ==See Also== {incoming}
Meta Keywords:
Meta Description:
Change Comment:
Any Questions or Comments? Email
GIS Framework Development Team
Some of the icons created by
FamFamFam
.