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.
- Open the KML in a text editor
- 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
- Download and install Google Earth if you haven’t done so already. It’s free and available for Mac and Microsoft
- Open the KML fill in Google Earth Pro by dragging it or double clicking the file
- 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
- Right Click on the KML file in Google Earth Pro under Temporary Places and select Get Info.
- In the Edit window, click on the Style, Color tab next to View and Altitude.
- 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
- Go back to the left sidebar and right-click on the KML you edited, choose Save Place as…
- 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.
4 Responses
[…] The KML file is basically a kind of XML file, so when you open it on a text editor like Sublime or Notepad++ it is mostly human-readable. The first few lines have information about the file format and the polygons colors, which can be useful if you want to change the color. […]
[…] The shapes or placemarks will show in the color that they originally were in the Software they came from (Google Earth or ArcGIS). You can’t change the color or any attribute of the boundary once is loaded into Salesforce Maps. But, you can change the color using Google Earth. […]
[…] can also differentiate markers by using different colors or marker modes or changing the color of KML shapes you’ve loaded in other layers. Keep in mind that this method won’t work for things you […]
[…] Googleを含めて,この情報が無かった。https://howtosfdc.cloud/salesforce/change-shape-color-kml-salesforce-maps/ このページにあった。次の情報でぼくには十分である。すぐ上のKMLでは,<color>ff336699</color>,であるから,Brownとなる。 […]