Actually render cities of any size when passed
This commit is contained in:
parent
9dcb6f043e
commit
c4c5336e53
1 changed files with 7 additions and 12 deletions
|
@ -85,26 +85,21 @@ class EquirectMap():
|
||||||
|
|
||||||
if city.population >= 1000000:
|
if city.population >= 1000000:
|
||||||
radius = 4
|
radius = 4
|
||||||
pass
|
|
||||||
elif city.population >= 500000:
|
elif city.population >= 500000:
|
||||||
radius = 3
|
radius = 3
|
||||||
pass
|
|
||||||
elif city.population >= 100000:
|
elif city.population >= 100000:
|
||||||
radius = 2
|
radius = 2
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
radius = 1
|
radius = 1
|
||||||
pass
|
|
||||||
|
|
||||||
if radius > 2:
|
extents = cr.text_extents(city.name)
|
||||||
extents = cr.text_extents(city.name)
|
|
||||||
|
|
||||||
cr.set_source_rgb(0.2, 0.2, 0.2)
|
cr.set_source_rgb(0.2, 0.2, 0.2)
|
||||||
cr.arc(x, y, radius, 0, 2*math.pi)
|
cr.arc(x, y, radius, 0, 2*math.pi)
|
||||||
cr.fill()
|
cr.fill()
|
||||||
|
|
||||||
cr.set_font_size(14)
|
cr.set_font_size(14)
|
||||||
cr.move_to(x + 8, y + extents.height / 2)
|
cr.move_to(x + 8, y + extents.height / 2)
|
||||||
cr.show_text(city.name)
|
cr.show_text(city.name)
|
||||||
|
|
||||||
cr.restore()
|
cr.restore()
|
||||||
|
|
Loading…
Add table
Reference in a new issue