====== Map Suite Windows Phone Edition Projection Samples ======
==== Best Practices - Silverlight Edition ====
{{windowsphoneedition:codesamples:SilverlightEditionSample_ClientAndServerData_CS_110614.jpg?300x180}}
[[Source_Code_SilverlightEditionSample_ClientAndServerData_CS_110614.zip|View Source]] {{filehistory:SilverlightEditionSample_ClientAndServerData_CS_110614.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: WindowsPhone \ Silverlight ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
In this Silverlight-based project, we demonstrate the best practices for rendering and querying data that resides on the server or the client. The Map Suite Silverlight Edition provides the developer with many different options on where and how to render your map data. This sample renders one shapefile(airports) on the client side and another shapefile(counties) on the server side. Querying the client-side airport data is very simple and the coding is very similar to the desktop, WPF or WebEditions. Querying the server-side county data is a little more involved and requires the client to communicate back to the server side using a WCF service. This sample presents the developer with a ready to use sample that demonstrates both methods. \\ \\ \\ You can also check out[[http://wiki.thinkgeo.com/mediawiki/images/e/e4/SilverlightEditionSample_ClientAndServerData_CS_110614_part1.mp4|Part 1]] and [[http://wiki.thinkgeo.com/mediawiki/images/8/89/SilverlightEditionSample_ClientAndServerData_CS_110614_part2.mp4|Part 2]] of the video which provides a brief summary of this sample.
----
==== Custom Scale Bar ====
{{windowsphoneedition:codesamples:Map Suite Silverlight Edition Sample Custom Scale Bar.jpg?300x180}}
[[Source_Code_WebEditionSample_CustomScaleBar_CS_100810.zip|View Source]] {{filehistory:WebEditionSample_CustomScaleBar_CS_100810.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: WindowsPhone \ Desktop \ Web \ Silverlight \ Services \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
In today’s Web project, we learn how to extend ScaleBarAdornmentLayer to create a custom scale bar that is based on a projection of choice instead of the projection of the map. This can be useful when the displayed projection of the map has highly distortable distances especially at high latitudes such as Spherical Mercator (used by Google Map, Virtual Earth, Yahoo maps etc). Using a scale bar based on distance geometry of the Geodetic (WGS84) projection will give a more accurate result. Note that the CustomScaleBar class is based on MapSuiteCore and can be used in any other versions of MapSuite such as Desktop.
----
==== Draw Custom Exception ====
{{windowsphoneedition:codesamples:Map Suite Silverlight Edition Sample Draw Custom Exception.png?300x180}}
[[Source_Code_DesktopEditionSample_DrawCustomException_CS_100127.zip|View Source]] {{filehistory:DesktopEditionSample_DrawCustomException_CS_100127.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: WindowsPhone \ Desktop \ Web \ Silverlight \ Services \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
This sample shows how you can suppress and draw exceptions in desktop overlays instead of throwing them. There is a little-known feature in the Map Suite Desktop Edition Overlay class that allows you to draw an exception in the event an exception is thrown during the drawing process. We have a default image we draw in this case; however, you can override this using the DrawExceptionCore method and draw whatever you want. By default we always throw expections, but to start drawing them you can use the Overlay.DrawExceptionMode property.
----
==== MDI Form ====
{{windowsphoneedition:codesamples:Map Suite Silverlight Edition Sample MDI Form.jpg?300x180}}
[[Source_Code_DesktopEditionSample_MDIform_CS_100405.zip|View Source]] {{filehistory:DesktopEditionSample_MDIform_CS_100405.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: WindowsPhone \ Desktop \ Web \ Silverlight \ Services \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
In today’s project, we show how to have the WinformsMap control in a MDI form. Using an MDI form with a map background can represent a challenge. You will see in this project the technique to display properly a child form on top of the map. You can also notice how the map is accessed from the child form by plotting points on it from the child form.
\\ \\ ----
==== Use Map with MVC Framework ====
{{windowsphoneedition:codesamples:Map Suite Silverlight Edition Sample Use Map with MVC Framework.png?300x180}}
[[Source_Code_WebEditionSample_UseMapWithMVCFramework_CS.zip|View Source]] {{filehistory:WebEditionSample_UseMapWithMVCFramework_CS_141211.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: WindowsPhone \ Desktop \ Web \ Silverlight \ Services \ Wpf ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
This project demonstrates how to create a web-based map using Microsoft ASP.NET MVC 1.0 and Map Suite Web Edition. To meet the requirements of MVC, we inherit the interface IMapInitializer in the controller, which has a function InitializeMap that is overridden in the controller. We then implement the class "MapInitializerHelper" to initialize the map instance.
\\ \\ ----
==== Use Progress Bar ====
{{windowsphoneedition:codesamples:Map Suite Silverlight Edition Sample Use ProgressBar.jpg?300x180}}
[[Source_Code_SilverlightEditionSample_UseProgressBar_CS.zip|View Source]] {{filehistory:SilverlightEditionSample_UseProgressBar_CS_141211.zip|C# Download}}
[[Map Suite Samples Applies To|Applies To: WindowsPhone \ Silverlight ]] \\ [[Map Suite Samples Alternate Languages | Need it in another language?]]
In this Silverlight-based project, we demonstrate how to implement a custom Overlay inherited from Overlay to add a progress bar indicator while a layer is rendering. The project is simple and meant to show only the basic logic; to extend it, you could add some other information or a loading image instead of a progress bar.
\\ \\ ---- {{page>map_suite_services_edition_projection_samples}}