I'm using simplekml to plot some data.
As I can have a lot of points I'm using sharedstyle, but the problem is that I can't any style paraneter between every point (as the icon scale or the balloosstyle text).
So, I have my sharedstyle
kml = simplekml.Kml()
fol = kml.newfolder(name="Eventos")
sharedstyle = simplekml.Style()
sharedstyle.labelstyle.color = 'ffffffff'
sharedstyle.iconstyle.icon.href = 'http://maps.google.com/mapfiles/kml/shapes/target.png'
sharedstyle.iconstyle.color = 'ff0000ff'
sharedstyle.balloonstyle.bgcolor = simplekml.Color.lightgreen
sharedstyle.balloonstyle.textcolor = simplekml.Color.rgb(0, 0, 255)
I read the data on a loop and I call for every point I need to create this method
def add_to_kml(folder, event, style):
coord = (event.lon, event.lat)
label = event.date.isoformat()
pnt = folder.newpoint(name="{0}".format(label), coords=[coord])
pnt.style = style
pnt.style.iconstyle.scale = event.scale
pnt.style.balloonstyle.text = "{0}, \n {1}".format(event.label, event.geo_ref)
But, every single point ploted has the same iconscale and balloonstyle.text (the corresponding to the last added point)
Is there a way to modify some style data while using shared style?