addListStyle | R Documentation |
After creating a kml object, this method defines a style that can be used by containers. When a container uses a ListStyle, be sure that the feature's styleUrl matches the desired styleid argument. See references for documentation on how to effectively use the text argument.
yourKMLobj$addListStyle(styleid, listItemTpye, bgColor)
styleid |
Mandatory. Define the id for this style. kml containers will need to reference this id to use the defined style. You may choose an id that has already been defined in other styles types such as LineStyle or PolyStyle. |
listItemType |
Define the way elements of a container using this style are displayed. This can be one of check, checkOffOnly, checkHideChildren or radioFolder. (Default: "check) |
bgColor |
Define the background color. This can be one of the predefined colors(), color as hex, or color as rgb object. (Default: "white") |
styleid
Do not attempt to define more than one liststle for the same styleid.
Brent Cameron
Department of Fisheries and Oceans Canada
Population Ecology Division
mykml = RKmlObject()
#Create a radio style to allow only one element of a container to be displayed at a time
mykml$addListStyle(styleid = "test", bgColor = "green", listItemType = "radioFolder")
mykml$addPolyStyle(styleid = "mystyle2", color = "yellow", transparency = 1, fill = 0)
mykml$addFolder(fid = "new", styleUrl = "test")
mykml$getFolder("new")$addFolder("1")
mykml$getFolder("new")$addFolder("2")
mykml$getFolder("new")$addFolder("3")
#mykml$preview()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.