User Tools

Site Tools


map_suite_mobile_for_ios_quick_start_guide

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
map_suite_mobile_for_ios_quick_start_guide [2017/02/21 08:16]
tgwikiupdate [Map Suite Quick Start Guide For iOS]
map_suite_mobile_for_ios_quick_start_guide [2017/03/14 10:25] (current)
tgwikiupdate [Build Host Settings]
Line 2: Line 2:
  
 <div msgbox> <div msgbox>
-The Map Suite iOS 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 iOS 10.0.0.0 and higher and will show you how to create an iOS application.+The Map Suite iOS 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 Mobile for iOS 10.0.0 and higher and will show you how to create an iOS application.
  
 \\ \\
  
-If you want to build an Android application,​ please see the [[map_suite_mobile_for_android_quick_start_guide|Android ​QuickStart ​Guide]] instead.</​div>​+If you want to build an Android application,​ please see the [[map_suite_mobile_for_android_quick_start_guide|Android ​Quickstart ​Guide]] instead.</​div>​
  
 Welcome to Map Suite™ from ThinkGeo, a full-featured mapping control that makes it easy for any Microsoft .NET developer to add mapping functionality to a Microsoft .NET application quickly and efficiently. Using the intuitive object model, even developers inexperienced with Geographic Information Systems (GIS) can have fully functional maps working in minutes. Welcome to Map Suite™ from ThinkGeo, a full-featured mapping control that makes it easy for any Microsoft .NET developer to add mapping functionality to a Microsoft .NET application quickly and efficiently. Using the intuitive object model, even developers inexperienced with Geographic Information Systems (GIS) can have fully functional maps working in minutes.
Line 20: Line 20:
 Before start, please follow our [[Map Suite Mobile for iOS Installation Guide|Map Suite Mobile for iOS Installation Guide]] for Xamarin iOS development environment. Before start, please follow our [[Map Suite Mobile for iOS Installation Guide|Map Suite Mobile for iOS Installation Guide]] for Xamarin iOS development environment.
  
-Let's start by creating a new iOS Universal project in Microsoft Visual Studio (2015 or newer) named HelloWorld ​(see Figure 1). We can create the project with .NET Framework 4.5 or higher.+Let's start by creating a new iOS Universal project in Microsoft Visual Studio (2015 or newer) named QuickstartSample(see Figure 1). We can create the project with .NET Framework 4.5 or higher.
  
-{{mapsuite10:​ios:​screenshots:​mapsuite_ios_helloworld.png}}+{{mapsuite10:​ios:​Map_Suite_iOS_QSG_NewProject.png}}
 \\ \\
 //Figure 1. Creating a new project in the Visual Studio IDE.// //Figure 1. Creating a new project in the Visual Studio IDE.//
  
-The project ​HelloWorld ​is created in a new solution called ​HelloWorld. The wizard creates a single iOS Application.+The project ​QuickstartSample ​is created in a new solution called ​QuickstartSample. The wizard creates a single iOS Application.
  
 Now let's open NuGet dialog and install the three Nuget packages. ​ Now let's open NuGet dialog and install the three Nuget packages. ​
  
-{{mapsuite10:​ios:​screenshots:​mapsuite_ios_helloworld_references.png}}+{{mapsuite10:​ios:​Map_Suite_iOS_QSG_NuGetManager.png}}
 \\ \\
 //Figure 2. Open NuGet Manager UI in the Visual Studio IDE.// //Figure 2. Open NuGet Manager UI in the Visual Studio IDE.//
  
-{{mapsuite10:​ios:​screenshots:​mapsuite_ios_helloworld_nuget_packages.png}} +{{mapsuite10:​ios:​Map_Suite_iOS_QSG_InstalliOSPackage.png}}\\
-\\+
 //Figure 3. Install iOS package.// //Figure 3. Install iOS package.//
  
-{{mapsuite10:​ios:​screenshots:​mapsuite_ios_helloworld_install_shapefile.png}} 
 \\ \\
-//Figure 4. Install ShapeFile layer package.// 
- 
-{{mapsuite10:​ios:​screenshots:​mapsuite_ios_helloworld_install_styles.png}} 
-\\ 
-//Figure 5. Install style package.// 
- 
 Next we need to prepare our map data. Create an AppData folder and put the map data into it. Make sure the resources’ build action is Content (see Figure 6). Next we need to prepare our map data. Create an AppData folder and put the map data into it. Make sure the resources’ build action is Content (see Figure 6).
  
-{{iosedition:QSG_iOS_PrepareData.jpg}}+{{mapsuite10:ios:​Map_Suite_iOS_QSG_AppData.png}}
 \\ \\
 //Figure 6. Add resources and set build action to Content.// //Figure 6. Add resources and set build action to Content.//
Line 55: Line 47:
 In Windows for Visual Studio 2015 or newer, Go to Tools > Options in Visual Studio and open the Xamarin > iOS Settings panel to access the iOS Mac Build Host settings: In Windows for Visual Studio 2015 or newer, Go to Tools > Options in Visual Studio and open the Xamarin > iOS Settings panel to access the iOS Mac Build Host settings:
  
-{{mapsuite10:​ios:​screenshots:​mapsuite_ios_helloworld_find_machost.png}}+{{mapsuite10:​ios:​Map_Suite_iOS_QSG_iOSSetting.png}}
 \\ \\
 // Figure 7. Accessing the iOS Mac Build Host settings.// // Figure 7. Accessing the iOS Mac Build Host settings.//
Line 62: Line 54:
 You can change the Mac Build Host by clicking the Find Mac Build Host button. The following screen is displayed to update the Mac Build Host: You can change the Mac Build Host by clicking the Find Mac Build Host button. The following screen is displayed to update the Mac Build Host:
  
-{{mapsuite10:​ios:​screenshots:​mapsuite_ios_helloworld_connect_machost.png}}+{{mapsuite10:​ios:​Map_Suite_iOS_QSG_ConnectMacHost.png}}
 \\ \\
 //Figure 8. Updating the Mac Build Host.// //Figure 8. Updating the Mac Build Host.//
Line 71: Line 63:
 Our App can run on the Simulator we selected: Our App can run on the Simulator we selected:
  
-{{iosedition:QSG_iOS_Simulator.png ?500}}+{{mapsuite10:ios:​Map_Suite_iOS_QSG_SetSimulator.png}}
  
 ===== Add Map View to Controller ===== ===== Add Map View to Controller =====
  
-The next step is to create Map view in HelloWorldViewController ​ViewDidLoad override method, and define it as "​mapView"​.+The next step is to create Map view in ViewController ​ViewDidLoad override method, and define it as "​mapView"​.
  
 Every Content View Hierarchy has a corresponding View Controller to power user interaction. The role of the View Controller is to manage the Views in     the Content View Hierarchy. The View Controller is not part of the Content View Hierarchy, and it's not an element in the interface. Rather, it provides the code that powers the user's interactions with the objects on the screen. Every Content View Hierarchy has a corresponding View Controller to power user interaction. The role of the View Controller is to manage the Views in     the Content View Hierarchy. The View Controller is not part of the Content View Hierarchy, and it's not an element in the interface. Rather, it provides the code that powers the user's interactions with the objects on the screen.
Line 89: Line 81:
 </​code>​ </​code>​
  
-==== Map Suite Android "Hello World" ==== +==== Map Suite Android "Quickstart Sample" ==== 
-The first step in creating our "Hello World" ​sample ​application is to set references to the ''​ThinkGeo.MapSuite.iOS''​ , ''​ThinkGeo.MapSuite''​ and ''​ThinkGeo.MapSuite.Shapes''​ workspaces at the very top of our code, since we'll use many classes within them. Set the reference ​like this:+The first step in creating our "Quickstart Sample" application is to set references to the ''​ThinkGeo.MapSuite.iOS''​ , ''​ThinkGeo.MapSuite''​ and ''​ThinkGeo.MapSuite.Shapes''​ workspaces at the very top of our code, since we'll use many classes within them. Add the references ​like this:
  
 <code csharp> <code csharp>
Line 101: Line 93:
  
 ==== Display World Map ==== ==== Display World Map ====
-Now, Let's add a base overlay to display the world map witch called "​WorldStreetAndImageryOverlay"​.+Now, Let's add a base overlay to display the world map which is called "​WorldStreetAndImageryOverlay"​.
  
 <code csharp> <code csharp>
Line 114: Line 106:
             mapView.MapUnit = GeographyUnit.DecimalDegree;​             mapView.MapUnit = GeographyUnit.DecimalDegree;​
  
-            // Create a WorldStreetsAndImageryOverlay+            // Create a WorldStreetAndImageryOverlay
-            ​WorldStreetsAndImageryOverlay worldStreetsAndImageryOverlay ​= new WorldStreetsAndImageryOverlay();+            ​WorldStreetAndImageryOverlay worldStreetAndImageryOverlay ​= new WorldStreetAndImageryOverlay();
    
-            // Add a WorldStreetsAndImageryOverlay ​+            // Add a WorldStreetAndImageryOverlay ​
-            mapView.Overlays.Add("​WorldStreetsAndImageryOverlay", ​worldStreetsAndImageryOverlay);+            mapView.Overlays.Add("​WorldStreetAndImageryOverlay", ​worldStreetAndImageryOverlay);
  
             // Set a proper extent for the map. The extent is the geographical area you want it to display.             // Set a proper extent for the map. The extent is the geographical area you want it to display.
-            mapView.CurrentExtent = new RectangleShape(5783026);+            mapView.CurrentExtent = new RectangleShape(-13470-567);
             mapView.Refresh();​             mapView.Refresh();​
         }         }
 </​code>​ </​code>​
  
-Now the project is ready, Map Suite Runtime license is required for running and debugging your product. Please open the Product Center, then generate your license by steps like login account -> activate or start evaluation -> continue debugging -> get runtime ​license. For more details, please refer to (http://​wiki.thinkgeo.com/​wiki/​map_suite_runtime_license_guide_for_mobile).+Now the project is ready, Map Suite Runtime license is required for running and debugging your product. Please open the Product Center, then generate your license. For more details, please refer to (http://​wiki.thinkgeo.com/​wiki/​map_suite_runtime_license_guide_for_mobile).
  
 If we compile and run what we have now, our map should look like the one below. (see Figure 9). If we compile and run what we have now, our map should look like the one below. (see Figure 9).
  
-{{iosedition:QSG_iOS_Img10.png}}+{{mapsuite10:ios:​Map_Suite_iOS_QSG_ShowBaseMap.png?300}}
 \\ \\
-//Figure 9. A simple ​map of Europe.//+//Figure 9. A sample ​map of Europe.//
  
-==== Map Suite iOS "Hello World" ==== +==== Map Suite iOS "Quickstart Sample" ==== 
-In creating our "Hello World" ​sample ​application,​ our first step is to set references to the ''​ThinkGeo.MapSuite'',​ ''​ThinkGeo.MapSuite.Shapes''​ and ''​ThinkGeo.MapSuite.iOS''​ workspaces at the very top of our code, since we'll use many classes within them. Set the reference like this:+In creating our "Quickstart Sample" application,​ our first step is to set references to the ''​ThinkGeo.MapSuite'',​ ''​ThinkGeo.MapSuite.Shapes''​ and ''​ThinkGeo.MapSuite.iOS''​ workspaces at the very top of our code, since we'll use many classes within them. Set the reference like this:
  
 <code csharp> <code csharp>
Line 146: Line 138:
 </​code>​ </​code>​
  
-Now let's look at a code sample to bring this concept to fruition. We'll look at Shapefiles ​relating to the entire world. In our example, we have one such Shapefile:+Now let's look at a code sample to bring this concept to fruition. We'll look at ShapeFiles ​relating to the entire world. In our example, we have one such ShapeFile:
  
-*worldwide ​country borders (cntry02.shp)+*world wide country borders (cntry02.shp)
  
 (NOTE: The data used here can be found in the attached sample above in the "​\AppData"​ folder. The data files' build action should be “Content”.) (NOTE: The data used here can be found in the attached sample above in the "​\AppData"​ folder. The data files' build action should be “Content”.)
  
-Our next step is to define and add our Layers. Here is the code to use for our example. All of the following code can be placed in the ''​ViewDidLoad ​''​ override method.+Our next step is to define and add our layers. All of the following code can be placed in the "ViewDidLoad"​ event of the form. Here is the code to use for our example.
  
 <code csharp> <code csharp>
Line 162: Line 154:
     View.Add(mapView);​     View.Add(mapView);​
  
-    // Set the Map Unit to DecimalDegrees,​ the Shapefile’s unit of measure.+    // Set the Map Unit to DecimalDegrees,​ the ShapeFile’s unit of measure.
     mapView.MapUnit = GeographyUnit.DecimalDegree;​     mapView.MapUnit = GeographyUnit.DecimalDegree;​
     WorldStreetAndImageryOverlay worldStreetsAndImageryOverlay = new WorldStreetAndImageryOverlay();​     WorldStreetAndImageryOverlay worldStreetsAndImageryOverlay = new WorldStreetAndImageryOverlay();​
Line 169: Line 161:
     mapView.Overlays.Add("​WorldStreetsAndImageryOverlay",​ worldStreetsAndImageryOverlay);​     mapView.Overlays.Add("​WorldStreetsAndImageryOverlay",​ worldStreetsAndImageryOverlay);​
  
-    // Create a new Layer and pass the path to a Shapefile ​into its constructor. ​+    // Create a new Layer and pass the path to a ShapeFile ​into its constructor. ​
     ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer("​AppData/​cntry02.shp"​);​     ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer("​AppData/​cntry02.shp"​);​
  
Line 184: Line 176:
     LayerOverlay layerOverlay = new LayerOverlay();​     LayerOverlay layerOverlay = new LayerOverlay();​
  
-    // Add the shapefile ​layer to the layer overlay+    // Add the ShapeFile ​layer to the layer overlay
     layerOverlay.Layers.Add(worldLayer);​     layerOverlay.Layers.Add(worldLayer);​
  
Line 191: Line 183:
  
     // Set a proper extent for the map. The extent is the geographical area you want it to display.     // Set a proper extent for the map. The extent is the geographical area you want it to display.
-    mapView.CurrentExtent = new RectangleShape(5783026);+    mapView.CurrentExtent = new RectangleShape(-13470-567);
  
     // We now need to call the Refresh() method of the Map view so that the Map can redraw based on the data that has been provided.     // We now need to call the Refresh() method of the Map view so that the Map can redraw based on the data that has been provided.
Line 200: Line 192:
 If you compile and run what you have now, your map should look like the one below. (see Figure 10). If you compile and run what you have now, your map should look like the one below. (see Figure 10).
  
-{{iosedition:QSG_iOS_Img08.png}}+{{mapsuite10:ios:​Map_Suite_iOS_QSG_ShowAreaStyle.png?300}}
 \\ \\
-//Figure 10. A Simple ​map of Europe.//+//Figure 10. A Sample ​map of Europe.//
  
-So what has occurred here? We've created a layer and added it to the Map, and the Map has rendered it according to its default style parameters. We've also used ZoomLevel to display the map the way we want.+So what has occurred here? We've created a layer and added it to the map and the map has rendered it 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 the coordinates stored in a Shapefile ​can be in decimal degrees ​(a format of latitude and longitude), feet, meters, or another unit system, and our map has no way to know what the Shapefile's unit of measurement is until we tell it. This information is normally found somewhere in the Shapefile's documentation (also referred to as its metadata), or within its supplemental data file, as discussed in the section on Shapefiles. It may also come as a separate .txt, .xml, or .html file that begins with the same file name as the main Shapefile.+**NOTE:** It is important that the "MapUnit" ​property of a map object be set using the "GeographyUnit" enumeration. This is because the coordinates stored in a ShapeFile ​can be in DecimalDegrees ​(a format of latitude and longitude), feet, meters, or another unit system. Our map has no way to know what the ShapeFile's unit of measurement is until we set it. This information is normally found somewhere in the ShapeFile's documentation (also referred to as its metadata), or within its supplemental data file, as discussed in the section on ShapeFiles. It may also come as a separate .txt, .xml, or .html file that begins with the same file name as the main ShapeFile.
  
 ==== Navigate the Map ==== ==== Navigate the Map ====
-Now you can display and navigate ​your mapPan by dragging ​the map, zoom in by double-clicking, track zoom in by drawing a rectangle with your left mouse button mouse while holding ​the shift key, or zoom in and out with the mouse wheel. Very powerful for just couple lines of code, isn't it?+With the code above, ​you can both display ​a map and navigate ​itYou can pan by touch on the device and move finger around; ​zoom in/out by pinch on the screen with two fingers; ​double ​tap to zoom in to the next zoom level. Very powerful for just couple lines of code, isnt it?
  
-That was an easy start! Now let's add a second ​Shapefile to the sampleso we'​ll ​have a total of two layers:+That was an easy start! Nowlet's add another ​Shapefile to the sample so that we will have a total of two layers:
  
   - World country borders ("​cntry02.shp"​)   - World country borders ("​cntry02.shp"​)
Line 224: Line 216:
     View.Add(mapView);​     View.Add(mapView);​
  
-    // Set the Map Unit to DecimalDegrees,​ the Shapefile’s unit of measure.+    // Set the Map Unit to DecimalDegrees,​ the ShapeFile’s unit of measure.
     mapView.MapUnit = GeographyUnit.DecimalDegree;​     mapView.MapUnit = GeographyUnit.DecimalDegree;​
     WorldStreetAndImageryOverlay worldStreetsAndImageryOverlay = new WorldStreetAndImageryOverlay();​     WorldStreetAndImageryOverlay worldStreetsAndImageryOverlay = new WorldStreetAndImageryOverlay();​
Line 231: Line 223:
     mapView.Overlays.Add("​WorldStreetsAndImageryOverlay",​ worldStreetsAndImageryOverlay);​     mapView.Overlays.Add("​WorldStreetsAndImageryOverlay",​ worldStreetsAndImageryOverlay);​
  
-    // Create a new Layer and pass the path to a Shapefile ​into its constructor. ​+    // Create a new Layer and pass the path to a ShapeFile ​into its constructor. ​
     ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer("​AppData/​cntry02.shp"​);​     ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer("​AppData/​cntry02.shp"​);​
  
Line 265: Line 257:
     LayerOverlay layerOverlay = new LayerOverlay();​     LayerOverlay layerOverlay = new LayerOverlay();​
  
-    // Add the shapefile ​layer to the layer overlay+    // Add the ShapeFile ​layer to the layer overlay
     layerOverlay.Layers.Add(worldLayer);​     layerOverlay.Layers.Add(worldLayer);​
     layerOverlay.Layers.Add(capitalLayer);​     layerOverlay.Layers.Add(capitalLayer);​
Line 273: Line 265:
  
     // Set a proper extent for the map. The extent is the geographical area you want it to display.     // Set a proper extent for the map. The extent is the geographical area you want it to display.
-    mapView.CurrentExtent = new RectangleShape(5783026);+    mapView.CurrentExtent = new RectangleShape(-13470-567);
  
     // We now need to call the Refresh() method of the Map view so that the Map can redraw based on the data that has been provided.     // We now need to call the Refresh() method of the Map view so that the Map can redraw based on the data that has been provided.
Line 282: Line 274:
 And the result is as following (Figure 11): And the result is as following (Figure 11):
  
-{{iosedition:QSG_iOS_Img09.png}}+{{mapsuite10:ios:​Map_Suite_iOS_QSG_ShowPointStyle.png?300}}
 \\ \\
 //Figure 11. A map of Europe with the additional borders and capitals layers displayed.//​ //Figure 11. A map of Europe with the additional borders and capitals layers displayed.//​
  
 ===== How to Use TextStyle ===== ===== How to Use TextStyle =====
-TextStyle is used to label items on map. While the features themselves are drawn from information in the Shapefile, they'​re labeled with feature names or other attributes contained in the .dbf file. For example, ​the Shapefile ​containing capitals of the world has a corresponding .dbf file with the field "​CITY_NAME"​. We can use this field to label the cities on our map.+TextStyle ​is used to label items on map. As every ShapeFile ​has a relative ​.dbf file that includes descriptions for every record, the most common way to use TextStyles is for labeling. For example, ​WorldCapital ​Shapefile'​​s ​corresponding .dbf file contains ​the field "CITY_NAME"​. We can use this field to label the cities on our map.
  
-{{iosedition:QSG_WPFDesktop_Img10.png}}+{{mapsuite10:ios:​Map_Suite_iOS_QSG_DBFDetails.png}}
  
 Map Suite includes several built-in TextStyles to help us quickly apply attractive city labels. We can simply pick the TextStyle we like and use it. Map Suite includes several built-in TextStyles to help us quickly apply attractive city labels. We can simply pick the TextStyle we like and use it.
Line 302: Line 294:
     View.Add(mapView);​     View.Add(mapView);​
  
-    // Set the Map Unit to DecimalDegrees,​ the Shapefile’s unit of measure.+    // Set the Map Unit to DecimalDegrees,​ the ShapeFile’s unit of measure.
     mapView.MapUnit = GeographyUnit.DecimalDegree;​     mapView.MapUnit = GeographyUnit.DecimalDegree;​
     WorldStreetAndImageryOverlay worldStreetsAndImageryOverlay = new WorldStreetAndImageryOverlay();​     WorldStreetAndImageryOverlay worldStreetsAndImageryOverlay = new WorldStreetAndImageryOverlay();​
Line 309: Line 301:
     mapView.Overlays.Add("​WorldStreetsAndImageryOverlay",​ worldStreetsAndImageryOverlay);​     mapView.Overlays.Add("​WorldStreetsAndImageryOverlay",​ worldStreetsAndImageryOverlay);​
  
-    // Create a new Layer and pass the path to a Shapefile ​into its constructor. ​+    // Create a new Layer and pass the path to a ShapeFile ​into its constructor. ​
     ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer("​AppData/​cntry02.shp"​);​     ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer("​AppData/​cntry02.shp"​);​
  
Line 355: Line 347:
     LayerOverlay layerOverlay = new LayerOverlay();​     LayerOverlay layerOverlay = new LayerOverlay();​
  
-    // Add the shapefile ​layer to the layer overlay+    // Add the ShapeFile ​layer to the layer overlay
     layerOverlay.Layers.Add(worldLayer);​     layerOverlay.Layers.Add(worldLayer);​
     layerOverlay.Layers.Add(capitalLayer);​     layerOverlay.Layers.Add(capitalLayer);​
Line 364: Line 356:
  
     // Set a proper extent for the map. The extent is the geographical area you want it to display.     // Set a proper extent for the map. The extent is the geographical area you want it to display.
-    mapView.CurrentExtent = new RectangleShape(5783026);+    mapView.CurrentExtent = new RectangleShape(-13470-567);
  
     // We now need to call the Refresh() method of the Map view so that the Map can redraw based on the data that has been provided.     // We now need to call the Refresh() method of the Map view so that the Map can redraw based on the data that has been provided.
Line 373: Line 365:
 The result should look like this (Figure 12): The result should look like this (Figure 12):
  
-{{iosedition:QSG_iOS_Img11.png}}+{{mapsuite10:ios:​Map_Suite_iOS_QSG_ShowTextStyle.png?300}}
 \\ \\
-//Figure 12. Europe ​map with TextStyle applied.//+//Figure 12. Map of Europe with TextStyle applied.//
  
-Now that we know how to render text and symbols, let's create ​custom ​Styles and TextStyles. We'll also specify different ranges of ZoomLevels, and apply varying ​custom ​Styles and TextStyles to the same layer at different ZoomLevel ranges.+Now that we know how to render text and symbols, let's create ​customized ​Styles and TextStyles. We'll also specify different ranges of ZoomLevels, and apply varying ​customized ​Styles and TextStyles to the same layer at different ZoomLevel ranges.
  
 <code csharp> <code csharp>
Line 387: Line 379:
     View.Add(mapView);​     View.Add(mapView);​
  
-    // Set the Map Unit to DecimalDegrees,​ the Shapefile’s unit of measure.+    // Set the Map Unit to DecimalDegrees,​ the ShapeFile’s unit of measure.
     mapView.MapUnit = GeographyUnit.DecimalDegree;​     mapView.MapUnit = GeographyUnit.DecimalDegree;​
     WorldStreetAndImageryOverlay worldStreetsAndImageryOverlay = new WorldStreetAndImageryOverlay();​     WorldStreetAndImageryOverlay worldStreetsAndImageryOverlay = new WorldStreetAndImageryOverlay();​
Line 394: Line 386:
     mapView.Overlays.Add("​WorldStreetsAndImageryOverlay",​ worldStreetsAndImageryOverlay);​     mapView.Overlays.Add("​WorldStreetsAndImageryOverlay",​ worldStreetsAndImageryOverlay);​
  
-    // Create a new Layer and pass the path to a Shapefile ​into its constructor. ​+    // Create a new Layer and pass the path to a ShapeFile ​into its constructor. ​
     ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer("​AppData/​cntry02.shp"​);​     ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer("​AppData/​cntry02.shp"​);​
  
Line 448: Line 440:
     LayerOverlay layerOverlay = new LayerOverlay();​     LayerOverlay layerOverlay = new LayerOverlay();​
  
-    // Add the shapefile ​layer to the layer overlay+    // Add the ShapeFile ​layer to the layer overlay
     layerOverlay.Layers.Add(worldLayer);​     layerOverlay.Layers.Add(worldLayer);​
     layerOverlay.Layers.Add(capitalLayer);​     layerOverlay.Layers.Add(capitalLayer);​
Line 457: Line 449:
  
     // Set a proper extent for the map. The extent is the geographical area you want it to display.     // Set a proper extent for the map. The extent is the geographical area you want it to display.
-    mapView.CurrentExtent = new RectangleShape(5783026);+    mapView.CurrentExtent = new RectangleShape(-13470-567);
  
     // We now need to call the Refresh() method of the Map view so that the Map can redraw based on the data that has been provided.     // We now need to call the Refresh() method of the Map view so that the Map can redraw based on the data that has been provided.
Line 466: Line 458:
 Can you imagine what the map will look like now? Below is the result. At first it looks like Figure 7, then like Figure 8 as you zoom in further. Can you imagine what the map will look like now? Below is the result. At first it looks like Figure 7, then like Figure 8 as you zoom in further.
  
-{{iosedition:QSG_iOS_Img12.png}}+{{mapsuite10:ios:​Map_Suite_iOS_QSG_ShowLowZoomLevel.png?300}}
 \\ \\
-//Figure 7. Map of Europe before zooming in.//+//Figure 7. A map of Europe ​with two ZoomLevels, ​before zooming in.//
  
-{{iosedition:QSG_iOS_Img13.png}}+{{mapsuite10:ios:​Map_Suite_iOS_QSG_ShowHeightZoomLevel.png?300}}
 \\ \\
-//Figure 8. Map of Europe ​after zooming in.//+//Figure 8. The same map with two ZoomLevels, ​after zooming in.//
  
 ===== Summary ===== ===== Summary =====
map_suite_mobile_for_ios_quick_start_guide.1487664976.txt.gz · Last modified: 2017/02/21 08:16 by tgwikiupdate