This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
map_suite_mvc_edition_quick_start_guide [2015/09/01 03:27] admin [PresetZoomLevels] |
map_suite_mvc_edition_quick_start_guide [2017/03/17 05:03] (current) tgwikiupdate |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Map Suite MVC Edition Quick Start Guide ====== | ====== Map Suite MVC Edition Quick Start Guide ====== | ||
+ | |||
+ | {{section>upgrade_map_suite_to_10.0}} | ||
<div msgbox> | <div msgbox> | ||
Line 17: | Line 19: | ||
===== Download the Sample ===== | ===== Download the Sample ===== | ||
- | <faicon fa fa-download> [[:File:HelloWorld MVC.zip|Download Sample Code From This Exercise]] //(4.18 MB)// | + | <faicon fa fa-download fa-lg> {{filehistory:HelloWorld MVC.zip|Download Sample Code From This Exercise}} //(4.18 MB)// |
===== Setting up the Environment ===== | ===== Setting up the Environment ===== | ||
Line 35: | Line 37: | ||
===== Adding Map Suite MVC Edition to your MVC Application ===== | ===== Adding Map Suite MVC Edition to your MVC Application ===== | ||
- | We need to add two Map Suite files, "MvcEdition.dll" and "MapSuiteCore.dll", to the reference. Right-click on "References" in Solution Explorer and select "Add Reference...", navigate to the <kbd>C:\Program Files (x86)\ThinkGeo\Map Suite 9.0\Map Suite MVC\Current Version\Managed Assemblies folder and select both "MvcEdition.dll" and "MapSuiteCore.dll". | + | We need to add two Map Suite files, "MvcEdition.dll" and "MapSuiteCore.dll", to the reference. Right-click on "References" in Solution Explorer and select "Add Reference...", navigate to the //C:\Program Files (x86)\ThinkGeo\Map Suite 9.0\Map Suite MVC\Current Version\Managed Assemblies// folder and select both "MvcEdition.dll" and "MapSuiteCore.dll". |
**Note: Although it is not a ThinkGeo assembly, you also need to add "WindowsBase.dll" to the references. WindowsBase can be found on the .NET tab of the Add Reference dialog. If you don't do this, you will get the following error when you compile the project:** | **Note: Although it is not a ThinkGeo assembly, you also need to add "WindowsBase.dll" to the references. WindowsBase can be found on the .NET tab of the Add Reference dialog. If you don't do this, you will get the following error when you compile the project:** | ||
Line 143: | Line 145: | ||
Our next step is to define and add our Shapefile layers to the map. All of our sample code is placed in the view page "Index.cshtml". | Our next step is to define and add our Shapefile layers to the map. All of our sample code is placed in the view page "Index.cshtml". | ||
- | <code lang="csharp"> | + | <code asp.net> |
@{Html.ThinkGeo().Map("Map1", 600, 500) | @{Html.ThinkGeo().Map("Map1", 600, 500) | ||
.MapBackground(new BackgroundLayer(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF")))) | .MapBackground(new BackgroundLayer(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF")))) | ||
Line 185: | Line 187: | ||
Change the code in your View page following the example below. You don't need to make any changes to the controller. | Change the code in your View page following the example below. You don't need to make any changes to the controller. | ||
- | <code lang="csharp"> | + | <code asp.net> |
@{Html.ThinkGeo().Map("Map1", 600, 500) | @{Html.ThinkGeo().Map("Map1", 600, 500) | ||
.MapBackground(new BackgroundLayer(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF")))) | .MapBackground(new BackgroundLayer(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF")))) | ||
Line 331: | Line 333: | ||
====Client APIs used==== | ====Client APIs used==== | ||
- | <code lang="asp"> | + | <code javascript> |
ajaxCallAction: function (controller, action, params, callback) | ajaxCallAction: function (controller, action, params, callback) | ||
</code> | </code> | ||
Line 348: | Line 350: | ||
The code in your View page should look like this: | The code in your View page should look like this: | ||
- | <code lang="asp"> | + | <code javascript> |
[JavaScript] | [JavaScript] | ||
function UpdateDynamicOverlay(layerName) { | function UpdateDynamicOverlay(layerName) { | ||
Line 383: | Line 385: | ||
Now copy and paste the code below about the accessed action into your "HomeController" page: | Now copy and paste the code below about the accessed action into your "HomeController" page: | ||
- | <code lang="csharp"> | + | <code csharp> |
// Here we set the MapActionFilterAttribute, for which two input parameters are required. | // Here we set the MapActionFilterAttribute, for which two input parameters are required. | ||
[MapActionFilter] | [MapActionFilter] | ||
Line 433: | Line 435: | ||
- | <faicon fa fa-download> [[:File:HelloWorld MVC.zip|Download Sample Code From This Exercise]] //(12.4 MB)// | + | <faicon fa fa-download fa-lg> {{filehistory:HelloWorld MVC.zip|Download Sample Code From This Exercise}} //(12.4 MB)// |