Change the shape color in a KML file for Salesforce Maps

Salesforce maps allows KML imports with shapes as Boundaries that you can’t edit. Here’s how to change the shape color before importing your KML file.

Change the KML Polygon Color (Area Fill or Shape Color) using a Text editor

You can open the KML using your favorite text editor, such as Sublime, Notepad ++ or even Visual Code Editor. Any simple Test editor (like the system one) will also work just fine to change to shape color of your KML file.

  1. Open the KML in a text editor
sublime text editor change color hex code of kml polygons
  1. Find the Style tag at the beginning of the file.
  • LineStyle: is the color for the outline. Usually black by default.
  • PolyStyle: the shape color (area fill). Usually blue by default.

The Hex code inside the <color></color> tags is the shape color or area fill. By default it’s blue. You can change it to any of these:

  • Red – ff0000ff
  • Yellow – ff00ffff
  • Blue – ffff0000
  • Green – ff00ff00
  • Purple – ff800080
  • Orange – ff0080ff
  • Brown – ff336699
  • Pink – ffff00ff

Change the polygon outline and Area fill (shape color) using Google Earth Pro

  1. Download and install Google Earth if you haven’t done so already. It’s free and available for Mac and Microsoft
  2. Open the KML fill in Google Earth Pro by dragging it or double clicking the file
  3. Select the Polygons you want to change color holding Shift and click or if you want to change them all at once, skip this step
  4. Right Click on the KML file in Google Earth Pro under Temporary Places and select Get Info.
google earth pro change KML fill and line area shape color
  1. In the Edit window, click on the Style, Color tab next to View and Altitude.
google earth pro salesforce maps change kml file style and shape color
  1. Click on the Color you want to change, either Lines (outline) or Area (the fill color), a smaller window with the color picker will pop up with different subsets. Once you pick a color click OK
google earth pro salesforce maps change kml file style and shape color
  1. Go back to the left sidebar and right-click on the KML you edited, choose Save Place as…
google earth pro salesforce maps change kml file style and shape color save new KML
  1. Select KML and set the name, save in your desired location.

Now you’re ready to Load the KML file to Salesforce Maps and see the new color shinning.

Was this article helpful?
YesNo