[[PageOutline]] = Introduction = This is a central location for users to share useful code samples for !MapGuide, be they JavaScript, .Net, PHP, Java, or something entirely new... == Code Samples == === !JavaScript === * [wiki:CodeSamples/JavaScript/AJAXViewerEventHooking Hooking to events in the AJAX viewer] * [wiki:CodeSamples/JavaScript/InvokeCommandOnStartup Initial Task to invoke command on viewer startup] * [wiki:CodeSamples/JavaScript/CustomCursors Displaying custom cursors when the zoom tool is selected] * [wiki:CodeSamples/JavaScript/WaterMark Displaying a watermark over the map in the AJAX viewer] * [wiki:CodeSamples/JavaScript/OpenlayersExample Display Mapguide Maps using OpenLayers] * [wiki:CodeSamples/JavaScript/ZoomRectangleTweak Tweak of how 'Zoom to Rectangle' works] === ASP.Net === * [wiki:CodeSamples/ASP.Net/mapagent Building your own custom mapagent handler] * [wiki:CodeSamples/ASP.Net/ScribbleApp Dennis' Scribble Application] * [wiki:CodeSamples/AspDotNet/TemporaryMarkupsDotNet Creating Temporary Markups] * [wiki:CodeSamples/AspDotNet/DevFAQ ASP.net Development FAQ] === .NET === * [wiki:CodeSamples/DotNet/TfNetMgReaderWriter TF.NET Reader/Writer for MapGuide geometries] * [wiki:maestro/MaestroAPI MapGuide Maestro, MapGuide .Net API and Administrative GUI] === PHP === * [wiki:CodeSamples/PHP/MPUCalculator Calculating meters-per-unit for a map] * [wiki:CodeSamples/PHP/InitialMapView Dynamically setting initial map position and scale] * [wiki:CodeSamples/PHP/AddLayerToInitialMap Dynamically adding a layer to the initial map] * [wiki:CodeSamples/PHP/GeneralTasks General Tasks example - Markup, Theme, and Query] * [wiki:CodeSamples/PHP/CustomAggregateFunctions Using MapGuide's Custom Aggregate Functions] === Java === === Fusion === * [wiki:CodeSamples/Fusion/SuperSimple Simple Fusion application to get you started] === Tiled Maps === * [wiki:CodeSamples/Tiles/ServingTilesViaHttp Serving Mapguide map Tiles directly via Apache] * [wiki:CodeSamples/Tiles/TileCacheSeeding Client side tool for Seeding all Tiles in a tiled map] === Other === * [wiki:CodeSamples/Other/ExampleStylizationFunctions Stylization function examples] * [wiki:CodeSamples/Other/MobileMapExample Mobile Map Example] == Creating New Pages == === Page Title === When creating a new page, please use the following convention for the page location: !CodeSamples/TechnologyType/YourPageName for example: !CodeSamples/JavaScript/AJAXViewerEventHooking This is to ensure that pages are easily found via the TitleIndex, and may allow for an automated index at some point. You can easily do this by editing the the CodeSamples page, copying another entry, and then modifying it to fit your title. Once you have saved the page, you will have a handy link to follow to edit your own sample. === Header Section === Please include the following on every Code Sample page. It allows users to easily navigate the page, and if they come in off a search engine link they can get to the code samples index more easily. {{{ [[PageOutline]] This page is one of the !MapGuide Community CodeSamples. Visit the CodeSamples page to view more! }}} === Syntax Highlighting === Trac has some really cool [wiki:WikiProcessors syntax highlighting] built into it. The !MapGuide Trac doesn't have all of these set up, but at least the text/html one works, and does a reasonable job with both HTML and JS. For example: {{{ #!text/html }}} Please use this where possible to make your inline examples more readable.