Training
Module
Use the Map and Address Input controls in your app - Training
Learn how maps and address input controls can add value to your Power Apps by simplifying complex coding.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Using Spatial in OData services involves two parts of work:
This section shows how to define spatial properties in entity data models using EdmLib APIs. We will continue to use and extend the sample from the EdmLib sections.
In the SampleModelBuilder.cs file, insert the following code into the SampleModelBuilder.BuildAddressType()
method:
namespace EdmLibSample
{
public class SampleModelBuilder
{
public SampleModelBuilder BuildAddressType()
{
_model = new EdmModel();
var _addressType = new EdmComplexType("test", "Address");
_addressType.AddStructuralProperty("Postcode", EdmPrimitiveTypeKind.Int32);
#region !!!INSERT THE CODE BELOW!!!
_addressType.AddStructuralProperty("GeometryLoc", EdmPrimitiveTypeKind.GeometryPoint);
_addressType.AddStructuralProperty("GeographyLoc", new EdmSpatialTypeReference(EdmCoreModel.Instance.GetPrimitiveType(EdmPrimitiveTypeKind.GeographyPoint), true, 1234));
#endregion
_model.AddElement(_addressType);
return this;
}
}
}
This code:
Edm.GeometryPoint
property GeometryLoc
to the Address
type;Edm.GeographyPoint
property GeographyLoc
with a type facet Srid=1234
to the Address
type.Build and run the sample. Then open the csdl.xml file under the output directory. The content of csdl.xml should look like the following:
Training
Module
Use the Map and Address Input controls in your app - Training
Learn how maps and address input controls can add value to your Power Apps by simplifying complex coding.