Skip to content

Instantly share code, notes, and snippets.

@TomLewis
Forked from jason-green-io/mca_poly_overviewer
Last active April 19, 2016 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TomLewis/9a7e25a81cd50622b79d6031c518c09c to your computer and use it in GitHub Desktop.
Save TomLewis/9a7e25a81cd50622b79d6031c518c09c to your computer and use it in GitHub Desktop.
Add these functions, filters and manual POIs to your overviewer config file to add a mca file grid
def pointDict( coords ):
coordLabel = ("x", "y", "z")
return dict(zip(coordLabel, coords))
def mcafilter(poi):
if poi["id"] == "mca":
# print poi
return poi
mcapoi = []
for x in xrange(-20, 21):
for z in xrange(-20, 21):
x1 = x * 512
z1 = z * 512
bl = (x1, 64, z1)
tl = (x1 + 511, 64, z1)
tr = (x1 + 511, 64, z1+ 511)
br = (x1, 64, z1 + 511)
square = [bl, tl, tr, br, bl]
poi = dict(text = "r." + str(x) + "." + str(z) + ".mca",
id = "mca",
color = "red" if (x % 2 or z % 2) else "red",
x = x1+256,
y = 64,
z = z1 +256,
polyline=tuple([pointDict( coords) for coords in square]))
mcapoi.append(poi)
markers += [ dict(name="mca file", icon="", filterFunction=mcafilter, createInfoWindow=True, checked=True) ]
overmanualpois += mcapoi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment