Skip to main content

#Map Polygon0 personne en discute

Error:  Polygon KML data structure is invalid

 

I'm getting an error on the KML format for a Map Polygon.  I found the county coordinates in Google Fusion Tables.  Anyone have experience with this that could help?  

 

I followed the guidelines in https://help.salesforce.com/articleView?id=pfs_import_kml.htm&type=5

5 commentaires
  1. 28 juil. 2022, 16:14

    Hi, we were able to find the right structure for KML. Here is the one-

     

    FSL__Polygon__c myPolygon = new FSL__Polygon__c(

    Name = 'Central SSS1'

    ,FSL__Color__c = '#5679C0'

    ,FSL__KML__c = '<?xml version="1.0" encoding="UTF-8"?> '+

    '<kml xmlns="http://www.opengis.net/kml/2.2">'+

    '<Style id="CentralSSSStyle">'+

    '<LineStyle>'+

    '<width>1</width>'+

    '</LineStyle>'+

    '<PolyStyle>'+

    '<color>80C07956</color>'+

    '</PolyStyle>'+

    '</Style>'+

    '<Placemark>'+

    '<name>CentralSSS</name>'+

    '<styleUrl>#CentralSSSStyle</styleUrl>'+

    '<Polygon>'+

    '<outerBoundaryIs>'+

    '<LinearRing>\n'+

    '<coordinates>-89.02172505348693,47.81952924639332,0\n'+

    '-84.18774067848693,48.01097620848099,0\n'+

    '-84.89086567848693,46.22441984873406,0\n'+

    '-88.34057270973693,45.91190522847453,0\n'+

    '-88.90087544411193,47.53103006689299,0\n'+

    '-89.30736958473693,47.77524856801052,0\n'+

    '-89.02172505348693,47.81952924639332,0\n'+

    '</coordinates>\n'+

    '</LinearRing>'+

    '</outerBoundaryIs>'+

    '</Polygon>'+

    '</Placemark>'+

    '</kml>'

    ,FSL__Ma_La__c = 48.01097620848099

    ,FSL__Ma_Lo__c = -84.18774067848693

    ,FSL__Mi_La__c = 45.91190522847453

    ,FSL__Mi_Lo__c = -89.30736958473693

    );

    insert myPolygon;

0/9000

#Wisdomwednesday Saving a boundary that you have created using the polygon, circle, or rectangle shape tools can be done with a few clicks of a button.  See the link below to see how.

 

Saving Custom Boundaries as Shape Layers in Salesforce Maps

 

#SF Maps #Map Polygon #Shape Layers #Wisdomwednesday

0/9000

I have tried to copy the KML details on the Map Polygon object from dev org and pasted in QA org's Map polygon object for the same service territory but the Map does not work. Please suggest. What is the best way of migrating polygons from one org to another?

5 commentaires
  1. 19 août 2020, 20:03
    I can never export FSL-related objects with Dataloader.io, but using Salesforce's Dataloader works fine. I exported the Polygons via Salesforce's and imported in to another environment.
0/9000

I found the 'Use polygons to assign service territories' very useful. It would be really helpful to be able to use this functionality on demand to be able to determine which territory any coordinates fall into. Does anyone know if its possible to use this functionality in code or in a flow to pass in the latitude/longitude data and get back a response of what territory those coordinates fall into?

2 commentaires
0/9000