This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
map_suite_web_for_mvc_quick_start_guide [2017/02/22 06:47] tgwikiupdate [Creating the Controller and Required View Page] |
map_suite_web_for_mvc_quick_start_guide [2017/03/15 08:30] (current) tgwikiupdate [Parameters] |
||
---|---|---|---|
Line 2: | Line 2: | ||
<div msgbox> | <div msgbox> | ||
- | The Map Suite MVC QuickStart Guide will guide you through the process of creating a sample application and will help you become familiar with Map Suite. The QuickStart Guide supports Map Suite 10.0.0.0 and higher and will show you how to create an ASP.NET MVC application. | + | The Map Suite MVC Quickstart Guide will guide you through the process of creating a sample application and will help you become familiar with Map Suite. The Quickstart Guide supports Map Suite Web for Mvc 10.0.0 and higher and will show you how to create an ASP.NET MVC application. |
\\ | \\ | ||
\\ | \\ | ||
- | If you want to build a WebForms application, please see the [[map_suite_web_for_webforms_quick_start_guide|WebForms QuickStart Guide]] instead. | + | If you want to build a WebForms application, please see the [[map_suite_web_for_webforms_quick_start_guide|WebForms Quickstart Guide]] instead. |
</div> | </div> | ||
Line 20: | Line 20: | ||
\\ | \\ | ||
===== Setting up the Environment ===== | ===== Setting up the Environment ===== | ||
- | Let's start with a new ASP.NET MVC 4 web application in Visual Studio.NET 2015 IDE and call it “HelloWorld” (see Figure 1). (NOTE: Map Suite MVC Edition supports both the Razor and ASPX view engines. In this guide we are just using Razor as an example.) | + | Let's start with a new ASP.NET MVC 4 web application in Visual Studio.NET 2015 IDE and call it “QuickstartSample” (see Figure 1). (NOTE: Map Suite MVC Edition supports both the Razor and ASPX view engines. In this guide we are just using Razor as an example.) |
In this sample, we are going to implement following six items: | In this sample, we are going to implement following six items: | ||
Line 30: | Line 30: | ||
- Compared to Map Suite Web, MVC provides many more client APIs which are used to operate the map and easily communicate with the server side. | - Compared to Map Suite Web, MVC provides many more client APIs which are used to operate the map and easily communicate with the server side. | ||
- | This Quick Start Guide uses an ASP.NET MVC 4 web application as an example, so you will need to have the ASP.NET MVC framework installed in order to follow along. The MVC 4 framework can be downloaded from [[http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=1491|ASP.NET MVC 4 Tools Update]]. | + | This Quickstart Guide uses an ASP.NET MVC 4 web application as an example, so you will need to have the ASP.NET MVC framework installed in order to follow along. The MVC 4 framework can be downloaded from [[http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=1491|ASP.NET MVC 4 Tools Update]]. |
- | {{mapsuite10:mvc:1.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_NewProject.png}} |
- | {{mapsuite10:mvc:2.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_SetProjectTemplate.png}} |
- | {{mapsuite10:mvc:3.png}} | + | |
\\ | \\ | ||
//Figure 1. Creating a new project in Visual Studio.NET 2015 IDE.// | //Figure 1. Creating a new project in Visual Studio.NET 2015 IDE.// | ||
Line 41: | Line 40: | ||
===== Installing ThinkGeo MVC NuGet packages ===== | ===== Installing ThinkGeo MVC NuGet packages ===== | ||
To build this sample, we need to reference several packages from NuGet manager. There are two options for you. | To build this sample, we need to reference several packages from NuGet manager. There are two options for you. | ||
- | - For the beginner of MapSuite 10.0 products, we recommend to use “MapSuiteWebForMvc-Standard” package. This package is the full featured package for developing GIS application with MVC. Please refer [[http://wiki.thinkgeo.com/wiki/map_suite_web_for_mvc#standard|MapSuite Mvc Standard]] for detail. | + | - For a beginner of MapSuite 10.0 products, we recommend using “MapSuiteWebForMvc-Standard” package. This package is the full featured package for developing GIS applications with MVC. Please refer to [[http://wiki.thinkgeo.com/wiki/map_suite_web_for_mvc#standard|MapSuite Mvc Standard]] for detail. |
- | - For the advanced user of MapSuite 10.0 products and want to include the least set of reference, we recommend to use “MapSuiteWebForMvc-BareBone” package. It only depends on required packages that a basic MVC application needs. Please refer [[http://wiki.thinkgeo.com/wiki/map_suite_web_for_mvc#barebone| MapSuite Mvc BareBone]] for detail. | + | - For the advanced user of MapSuite 10.0 products who wants to include the smallest set of references, we recommend to use “MapSuiteWebForMvc-BareBone” package. It only depends on required packages that a basic MVC application needs. Please refer to [[http://wiki.thinkgeo.com/wiki/map_suite_web_for_mvc#barebone| MapSuite Mvc Standard]] for detail. |
- | In this sample, we choose option 2 (It also compatible with option 1, the difference is that, the other packages will be installed by default when installing the MapSuiteWebForMvc-Standard package). To build this sample, we need to reference the following packages. | + | In this sample, we choose option 1. The other packages will be installed by default when installing the MapSuiteWebForMvc-Standard package. To build this sample, we need to reference the "MapSuiteWebForMvc-Standard" package. |
- | - MapSuiteWebForMvc-BareBone | + | |
- | - ThinkGeo.MapSuite.Layers.ShapeFile | + | |
- | - ThinkGeo.MapSuite.Layers.Background | + | |
- | Right-click on “References” in Solution Explorer and select “Manage NuGet Packages…” | + | Right-click on “References” in Solution Explorer and select “Manage NuGet Packages…” (See Figure 1) |
\\ | \\ | ||
- | {{mapsuite10:mvc:screenshots:mapsuite_mvc_helloworld_nugetmanager.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_NuGetManager.png}} |
+ | \\ | ||
+ | //Figure 1.// | ||
+ | \\ | ||
Search the packages list above and install them. (See Figure 2). | Search the packages list above and install them. (See Figure 2). | ||
\\ | \\ | ||
- | {{mapsuite10:mvc:screenshots:mapsuite_mvc_helloworld_installmvc.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_InstallMvcPackage.png}} |
- | //Figure 2. Install ThinkGeo MVC NuGet packages.// | + | \\ |
+ | //Figure 2. Install the ThinkGeo MVC NuGet packages.// | ||
Now the package is installing into the project. | Now the package is installing into the project. | ||
+ | Click “OK” if the message box like the following pops up. | ||
+ | \\ | ||
+ | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_ReferenceRreview.png}} | ||
+ | \\ | ||
The “NetTopologySuite” is the third part assembly, so the license acceptance is required. You can click “I Accept” to agree the license. | The “NetTopologySuite” is the third part assembly, so the license acceptance is required. You can click “I Accept” to agree the license. | ||
+ | \\ | ||
+ | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_PackageLicenseAcceptance.png}} | ||
+ | \\ | ||
+ | \\ | ||
- | {{mapsuite10:mvc:screenshots:licenseAcceptance.png}} | + | Now, we have all the references set. NuGet brings us a flexible way and pleasant experience to manage our references. |
- | + | ||
- | Now, we have all the reference set. NuGet brings us a flexible way and experience to manage our references. In the next chapter, we are going to talk about the real coding part. | + | |
===== Creating the Controller and Required View Page ===== | ===== Creating the Controller and Required View Page ===== | ||
In Solution Explorer, right-click on the "Controller" folder, then navigate to "Add" and select "Controller..." to add a new controller page named "HomeController". It should look like the screenshot below: | In Solution Explorer, right-click on the "Controller" folder, then navigate to "Add" and select "Controller..." to add a new controller page named "HomeController". It should look like the screenshot below: | ||
- | {{mapsuite10:mvc:screenshots:QST_Mvc_Edition_51.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_AddController.png}} |
+ | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_AddScaffold.png}} | ||
Now move your mouse pointer over the code "return View()" and right-click to add the responding view page. Keep all of the default settings as shown below: | Now move your mouse pointer over the code "return View()" and right-click to add the responding view page. Keep all of the default settings as shown below: | ||
- | {{mapsuite10:mvc:screenshots:QST_Mvc_Edition_52.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_AddView.png}} |
- | ===== Map Suite MVC "Hello World" ===== | + | ===== Map Suite MVC "Quickstart" ===== |
(**NOTE:** Map Suite MVC provides two places where we can add our code for defining the ShapeFileFeatureLayer. One is in the action of the controller, and the other is in the View page. Here we will use the “ViewPage” for this example.) | (**NOTE:** Map Suite MVC provides two places where we can add our code for defining the ShapeFileFeatureLayer. One is in the action of the controller, and the other is in the View page. Here we will use the “ViewPage” for this example.) | ||
Line 86: | Line 92: | ||
Our next step is to define and add our ShapeFile layers to the map. All of the following code can be placed in the view page “Views/Home/Index.cshtml”. | Our next step is to define and add our ShapeFile layers to the map. All of the following code can be placed in the view page “Views/Home/Index.cshtml”. | ||
- | As we will use many classes within this sample. We do this so that we do not have to use the fully qualified name of the Map Suite classes throughout our code. Add namespaces like this: | + | We will use many classes within this sample. We do this so that we do not have to use the fully qualified name of the Map Suite classes throughout our code. Add namespaces like this: |
<code csharp> | <code csharp> | ||
@using ThinkGeo.MapSuite; | @using ThinkGeo.MapSuite; | ||
Line 97: | Line 103: | ||
Then, we can add the map and shape file reference code as below: | Then, we can add the map and shape file reference code as below: | ||
<code csharp> | <code csharp> | ||
- | @{Html.ThinkGeo().Map("Map1", 600, 500) | + | @{Html.ThinkGeo().Map("Map1", 800, 600) |
.MapBackground(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))) | .MapBackground(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))) | ||
.CurrentExtent(-131.22, 55.05, -54.03, 16.91) | .CurrentExtent(-131.22, 55.05, -54.03, 16.91) | ||
Line 118: | Line 124: | ||
</code> | </code> | ||
- | Now it is time to press F5 to start the application. If you have not setup a developer license, the Map Suite Product Center will pop up. You need to generate your developer license. For more details, please refer to (http://wiki.thinkgeo.com/wiki/map_suite_developer_license_guide). | + | Now it is time to press F5 to start the application. If you have not set up a developer license, the Map Suite Product Center will pop up. You will need to generate your developer license. For more details, please refer to http://wiki.thinkgeo.com/wiki/map_suite_developer_license_guide. |
Once the developer license is ready, run the application. Your map should look like the one below: (See Figure 3) | Once the developer license is ready, run the application. Your map should look like the one below: (See Figure 3) | ||
\\ | \\ | ||
- | {{mapsuite10:mvc:mapsuite_mvc_helloworld_maprender.png}}\\ | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_ShowAreaStyle.png}}\\ |
//Figure 3. A sample map of United States.// | //Figure 3. A sample map of United States.// | ||
\\ | \\ | ||
Line 128: | Line 134: | ||
So what has occurred here? We have created a layer and added it to the map and the map has rendered according to its default style parameters. Also, we have used ZoomLevel to display the map the way that we want. | So what has occurred here? We have created a layer and added it to the map and the map has rendered according to its default style parameters. Also, we have used ZoomLevel to display the map the way that we want. | ||
- | **NOTE:** It is important that the "MapUnit" property of a Map object be set using the "GeographyUnit" enumeration. This is because ShapeFiles only store binary vector coordinates, which can be in DecimalDegrees, feet, meters, or numerous other unit systems. Our map has no idea about what the unit of measurement is until we set it. This information is normally found somewhere in the documentation or within the supplemental data file as discussed in the section on ShapeFiles. | + | **NOTE:** It is important that the "MapUnit" property of a Map object be set using the "GeographyUnit" enumeration. This is because ShapeFiles only store binary vector coordinates, which can be in DecimalDegrees, feet, meters, or numerous other unit systems. Our map has no idea what the unit of measurement is until we set it. This information is normally found somewhere in the documentation or within the supplemental data file as discussed in the section on ShapeFiles. |
==== Navigate the Map ==== | ==== Navigate the Map ==== | ||
Line 141: | Line 147: | ||
<code csharp> | <code csharp> | ||
- | @{Html.ThinkGeo().Map("Map1", 600, 500) | + | @{Html.ThinkGeo().Map("Map1", 800, 600) |
.MapBackground(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))) | .MapBackground(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))) | ||
- | .CurrentExtent(5, 78, 30, 26) | + | .CurrentExtent(-131.22, 55.05, -54.03, 16.91) |
.MapUnit(GeographyUnit.DecimalDegree) | .MapUnit(GeographyUnit.DecimalDegree) | ||
.StaticOverlay(overlay => | .StaticOverlay(overlay => | ||
Line 180: | Line 186: | ||
The result is as follows (Figure 4): | The result is as follows (Figure 4): | ||
- | {{mapsuite10:mvc:screenshots:mapsuite_mvc_helloworld_addlayers.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_ShowPointStyle.png}} |
\\ | \\ | ||
//Figure 4. Map of Europe with 2 layers.// | //Figure 4. Map of Europe with 2 layers.// | ||
Line 187: | Line 193: | ||
A TextStyle is used to label items on map. As every ShapeFile has a related .dbf file that includes descriptions for each record, the most common way to use the TextStyle is for labeling features. For example, the ShapeFile containing capitals of the world has a corresponding .dbf file contains the field “CITY_NAME”. We can use this field to label the cities on our map. | A TextStyle is used to label items on map. As every ShapeFile has a related .dbf file that includes descriptions for each record, the most common way to use the TextStyle is for labeling features. For example, the ShapeFile containing capitals of the world has a corresponding .dbf file contains the field “CITY_NAME”. We can use this field to label the cities on our map. | ||
- | {{mapsuite10:mvc:5.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_DBFDetails.png}} |
Map Suite has many TextStyles built in to help us quickly design attractive labels for the cities on our map. We can just pick the TextStyle we like and use it. | Map Suite has many TextStyles built in to help us quickly design attractive labels for the cities on our map. We can just pick the TextStyle we like and use it. | ||
<code csharp> | <code csharp> | ||
- | @{Html.ThinkGeo().Map("Map1", 600, 500) | + | @{Html.ThinkGeo().Map("Map1", 800, 600) |
.MapBackground(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))) | .MapBackground(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))) | ||
- | .CurrentExtent(5, 78, 30, 26) | + | .CurrentExtent(-131.22, 55.05, -54.03, 16.91) |
.MapUnit(GeographyUnit.DecimalDegree) | .MapUnit(GeographyUnit.DecimalDegree) | ||
.StaticOverlay(overlay => | .StaticOverlay(overlay => | ||
Line 236: | Line 242: | ||
The result is as follows (Figure 5): | The result is as follows (Figure 5): | ||
- | {{mapsuite10:mvc:6.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_ShowTextStyle.png}} |
\\ | \\ | ||
//Figure 5. Map of Europe with a TextStyle.// | //Figure 5. Map of Europe with a TextStyle.// | ||
Line 243: | Line 249: | ||
<code csharp> | <code csharp> | ||
- | @{Html.ThinkGeo().Map("Map1", 600, 500) | + | @{Html.ThinkGeo().Map("Map1", 800, 600) |
.MapBackground(new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)) | .MapBackground(new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)) | ||
- | .CurrentExtent(5, 78, 30, 26) | + | .CurrentExtent(-131.22, 55.05, -54.03, 16.91) |
.MapUnit(GeographyUnit.DecimalDegree) | .MapUnit(GeographyUnit.DecimalDegree) | ||
.StaticOverlay(overlay => | .StaticOverlay(overlay => | ||
Line 303: | Line 309: | ||
Can you imagine what the map will look like now? Figure 7 below is the result. At first it looks the same as it did in Figure 6. Now zoom in, and watch the map change to resemble Figure 7 as you do. | Can you imagine what the map will look like now? Figure 7 below is the result. At first it looks the same as it did in Figure 6. Now zoom in, and watch the map change to resemble Figure 7 as you do. | ||
- | {{mapsuite10:mvc:screenshots:mapsuite_mvc_helloworld_lowerzoomlevel.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_ShowLowZoomLevel.png}} |
\\ | \\ | ||
//Figure 6. A map of European cities with two ZoomLevels, before zooming in.// | //Figure 6. A map of European cities with two ZoomLevels, before zooming in.// | ||
- | {{mapsuite10:mvc:screenshots:mapsuite_mvc_helloworld_highterzoomlevel.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_ShowHighZoomLevel.png}} |
\\ | \\ | ||
//Figure 7. The same map with two ZoomLevels, after zooming in.// | //Figure 7. The same map with two ZoomLevels, after zooming in.// | ||
Line 335: | Line 341: | ||
<code javascript> | <code javascript> | ||
- | [JavaScript] | + | <script language="javascript" type="text/javascript"> |
function UpdateDynamicOverlay(layerName) { | function UpdateDynamicOverlay(layerName) { | ||
Map1.ajaxCallAction("Home", "UpdateOverlay", { layer: layerName }, function (result) { | Map1.ajaxCallAction("Home", "UpdateOverlay", { layer: layerName }, function (result) { | ||
Line 342: | Line 348: | ||
}) | }) | ||
} | } | ||
- | [JavaScript] | + | </script> |
<div> | <div> | ||
- | @{Html.ThinkGeo().Map("Map1", 600, 500) | + | @{Html.ThinkGeo().Map("Map1", 800, 600) |
.MapBackground(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))) | .MapBackground(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))) | ||
.CurrentExtent(-131.22, 55.05, -54.03, 16.91) | .CurrentExtent(-131.22, 55.05, -54.03, 16.91) | ||
Line 369: | Line 375: | ||
<code csharp> | <code csharp> | ||
- | [MapActionFilter] | + | [MapActionFilter] |
public void UpdateOverlay(Map map, GeoCollection<object> args) | public void UpdateOverlay(Map map, GeoCollection<object> args) | ||
{ | { | ||
Line 378: | Line 384: | ||
{ | { | ||
// States layer | // States layer | ||
- | ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(Server.MapPath("~/App_Data/USStates.SHP")); | ||
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(Server.MapPath("~/App_Data/USStates.SHP")); | ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(Server.MapPath("~/App_Data/USStates.SHP")); | ||
AreaStyle areaStyle = new AreaStyle(); | AreaStyle areaStyle = new AreaStyle(); | ||
Line 385: | Line 390: | ||
areaStyle.OutlinePen.DashStyle = LineDashStyle.Solid; | areaStyle.OutlinePen.DashStyle = LineDashStyle.Solid; | ||
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = areaStyle; | worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = areaStyle; | ||
- | worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; | + | worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; |
overlay.Layers.Add(worldLayer); | overlay.Layers.Add(worldLayer); | ||
} | } | ||
else | else | ||
{ | { | ||
- | // Cities layer | + | // Cities layer |
- | ShapeFileFeatureLayer countyLayer = new ShapeFileFeatureLayer(Server.MapPath("~/App_Data/cities_e.shp")); | + | ShapeFileFeatureLayer countyLayer = new ShapeFileFeatureLayer(Server.MapPath("~/App_Data/cities_e.shp")); |
- | PointStyle pointStyle = new PointStyle(); | + | PointStyle pointStyle = new PointStyle(); |
- | pointStyle.SymbolType = PointSymbolType.Square; | + | pointStyle.SymbolType = PointSymbolType.Square; |
- | pointStyle.SymbolSolidBrush = new GeoSolidBrush(GeoColor.StandardColors.White); | + | pointStyle.SymbolSolidBrush = new GeoSolidBrush(GeoColor.StandardColors.White); |
- | pointStyle.SymbolPen = new GeoPen(GeoColor.StandardColors.Black, 1); | + | pointStyle.SymbolPen = new GeoPen(GeoColor.StandardColors.Black, 1); |
- | pointStyle.SymbolSize = 6; | + | pointStyle.SymbolSize = 6; |
- | PointStyle stackStyle = new PointStyle(); | + | PointStyle stackStyle = new PointStyle(); |
- | stackStyle.SymbolType = PointSymbolType.Square; | + | stackStyle.SymbolType = PointSymbolType.Square; |
- | stackStyle.SymbolSolidBrush = new GeoSolidBrush(GeoColor.StandardColors.Maroon); | + | stackStyle.SymbolSolidBrush = new GeoSolidBrush(GeoColor.StandardColors.Maroon); |
- | stackStyle.SymbolPen = new GeoPen(GeoColor.StandardColors.Transparent, 0); | + | stackStyle.SymbolPen = new GeoPen(GeoColor.StandardColors.Transparent, 0); |
- | stackStyle.SymbolSize = 2; | + | stackStyle.SymbolSize = 2; |
- | pointStyle.CustomPointStyles.Add(stackStyle); | + | pointStyle.CustomPointStyles.Add(stackStyle); |
- | GeoFont font = new GeoFont("Arial", 9, DrawingFontStyles.Bold); | + | GeoFont font = new GeoFont("Arial", 9, DrawingFontStyles.Bold); |
- | GeoSolidBrush txtBrush = new GeoSolidBrush(GeoColor.StandardColors.Maroon); | + | GeoSolidBrush txtBrush = new GeoSolidBrush(GeoColor.StandardColors.Maroon); |
- | TextStyle textStyle = new TextStyle("NAME", font, txtBrush); | + | TextStyle textStyle = new TextStyle("AREANAME", font, txtBrush); |
- | textStyle.XOffsetInPixel = 0; | + | textStyle.XOffsetInPixel = 0; |
- | textStyle.YOffsetInPixel = -6; | + | textStyle.YOffsetInPixel = -6; |
- | countyLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = pointStyle; | + | countyLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = pointStyle; |
- | countyLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = textStyle; | + | countyLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = textStyle; |
- | countyLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; | + | countyLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; |
- | overlay.Layers.Add(countyLayer); } | + | overlay.Layers.Add(countyLayer); |
+ | } | ||
} | } | ||
</code> | </code> | ||
- | If we compile and run the application now, it should look like the screenshot below: | + | If we compile and run the application now, it should look like the screenshot below: |
- | {{mapsuite10:mvc:screenshots:mapsuite_mvc_helloworld_result.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_ShowUSStates.png}} |
You can click the checkboxes for "Show US States" or "Show US Cities" to load different layers to the map. For example, if you check the "Show US States" box, the map should look like this: | You can click the checkboxes for "Show US States" or "Show US Cities" to load different layers to the map. For example, if you check the "Show US States" box, the map should look like this: | ||
- | {{mapsuite10:mvc:screenshots:mapsuite_mvc_helloworld_showusstatus.png}} | + | {{mapsuite10:mvc:Map_Suite_Mvc_QSG_ShowUSCities.png}} |
- | This completes this scenario. The next thing you might want to do is to make it run on another machine that does not have a developer license. A runtime license is the one we are looking for. Here is the guide to generate a runtime license, please refer to (http://wiki.thinkgeo.com/wiki/map_suite_runtime_license_guide_for_desktop ) for details. | + | This completes this scenario. The next thing you might want to do is to make it run on another machine that does not have a developer license. A runtime license is the one we are looking for. Here is the guide to generate a runtime license: http://wiki.thinkgeo.com/wiki/map_suite_runtime_license_guide_for_desktop |
===== Summary ===== | ===== Summary ===== |