Import Service Territory Polygons in KML

Map polygons represent the physical boundaries of a service territory in Field Service. While you can draw a polygon on the Classic Dispatch Console map, you can also import one in KML (Keyhole Markup Language). For example, cities may provide public KML files so you can create service territories whose boundaries correspond exactly to the city borders.

Required Editions

Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience
The Agentforce Field Service and Operations core features, managed package, and mobile app are available in Enterprise, Unlimited, and Developer Editions.

Package icon This is a Field Service managed package feature.

Before you import a polygon in KML, make sure that you meet these requirements.

  • The longitude values range between -180 to +180. These values are the first numbers in each coordinate line.
  • The latitude values range between -90 to +90. These values are the second numbers in each coordinate line.
  • To clearly define the start and end of the polygon, the first and last coordinates must be identical.
  • To prevent a self-intersecting or invalid polygon, make sure that there are no duplicate coordinates, except for the first and last coordinates.

To import a polygon in KML, click the Map Polygons custom object tab in Salesforce and click New. Add a name, color, description, and service territory. In the KML Details field, add your KML text. Make sure that each set of coordinates has its own line.

Example
Example
<?xml version="1.0" encoding="UTF-8"?> 
<kml xmlns="http://www.opengis.net/kml/2.2">
<Style id="myPolygonStyle"> 
<LineStyle> 
<width>1</width> 
</LineStyle> 
<PolyStyle> 
<color>8047A043</color> 
</PolyStyle> 
</Style> 
<Placemark> 
<name>myPolygon</name> 
<styleUrl>#myPolygonStyle</styleUrl> 
<Polygon> 
<outerBoundaryIs> 
<LinearRing>
<coordinates>-122.44257817993167,37.80710430993863,0
-122.4278153015137,37.804391739106606,0
-122.4113358093262,37.80737556154185,0
-122.40412603149417,37.80629054915071,0
-122.38867650756839,37.78974213500372,0
-122.38764653930667,37.74821914921608,0
-122.45390783081058,37.74523293816564,0
-122.4604309631348,37.78865686357955,0
-122.44257817993167,37.80710430993863,0</coordinates> 
</LinearRing> 
</outerBoundaryIs> 
</Polygon> 
</Placemark> 
</kml>