def overlay_generator(hexgrid, depth=params.shells, major=params.major):
# GPolygon.RegularPoly(coord,major,poly,rot,"#000000",strokeOpacity,linethick,"#00ffff",fillalpha)
s1 = ''
numhextiles = float(len(hexgrid))
for idx, hexel in enumerate(hexgrid):
speckle = random.gauss(1, 0.5)
rank = int((speckle * idx / numhextiles) * 15)
invrank = 15 - rank
blue = hex(rank)[2:]
red = hex(invrank)[2:]
tilecolor = red + red + '00' + blue + blue
ts = "map.addOverlay(GPolygon.RegularPoly(new GLatLng{coord},\
{major},6,90,\"\#{strokeColor}\",{strokeOpacity},{strokeWeight},\"\#{fillColor}\",{fillalpha}))\
\n".format(coord=hexel, major=major, strokeColor=tilecolor, strokeOpacity=params.opacity,
strokeWeight=params.strokeWeight, fillColor=tilecolor, fillalpha=params.opacity)
s1 += ts
return s1
评论列表
文章目录