The quick start guides you through the steps of adding the FlexMap control to your MVC web application, adding a layer to the map and setting the data source of map layer to display the world map. In the following example, we have used Layers property of the FlexMap class to set the map layer and added a GeoMap layer to it using the AddGeoMapLayer method. In addition, we specified the data source for the map layer using the Url property.
To accomplish this, follow these steps:
Create a new MVC application using the ComponentOne or VisualStudio templates. For more information about creating an MVC application, see Configuring your MVC Application topic.
To add the FlexMap control to your application, add C1.Web.MVC reference and follow these steps:
FlexMapController
)..
Index()
.Index.cshtml |
コードのコピー
|
---|---|
@using System.Drawing @(Html.C1().FlexMap().Id("flexMap") .Header("MVC Map") .Height(400) .Layers(ls => { ls.AddGeoMapLayer() .Url("/Content/data/land.json"); }) ) |