From 3eec8143dd435bbfe6000f14b5e06a9dc1142401 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Sun, 10 Apr 2011 22:13:24 -0400 Subject: [PATCH 1/2] get PIL include dir from the environ --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 55ee8bb..d3aee8a 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,12 @@ if py2exe != None: # _composite.c extension # -setup_kwargs['ext_modules'].append(Extension('_composite', ['_composite.c'], include_dirs=['.'], extra_link_args=["/MANIFEST"] if platform.system() == "Windows" else [])) +try: + pil_include = os.environ['PIL_INCLUDE_DIR'].split(os.pathsep) +except: + pil_include = [] + +setup_kwargs['ext_modules'].append(Extension('_composite', ['_composite.c'], include_dirs=['.'] + pil_include, extra_link_args=["/MANIFEST"] if platform.system() == "Windows" else [])) # tell build_ext to build the extension in-place # (NOT in build/) setup_kwargs['options']['build_ext'] = {'inplace' : 1} From 45dcca82bbf9af1fc2cd5cf8234cf37671a20033 Mon Sep 17 00:00:00 2001 From: Ryan Finnie Date: Sun, 17 Apr 2011 22:38:29 -0700 Subject: [PATCH 2/2] Add a Minecraft-friendly coordinates system * Add x/y/z query arguments to specify MC world coordinates. If world coordinates are specified, display a POI icon indicating where the coordinates specified are. Gmaps-style "lat" and "lng" are still accepted, and will take precedence over x/y/z. * Expand functionality of the "zoom" query argument. "max" specifies the maximum zoom, and negative numbers are steps out from max. Gmaps-style zoom is still supported. * Change the URL current position area to use x/y/z arguments. Displayed zoom uses the new zoom logic. --- web_assets/functions.js | 94 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 89 insertions(+), 5 deletions(-) diff --git a/web_assets/functions.js b/web_assets/functions.js index 96742af..f94568a 100644 --- a/web_assets/functions.js +++ b/web_assets/functions.js @@ -178,6 +178,20 @@ function initMarkers() { continue; } + if (item.type == 'querypos') { + // Set on page load if MC x/y/z coords are given in the query string + + iconURL = 'http://google-maps-icons.googlecode.com/files/regroup.png'; + var converted = fromWorldToLatLng(item.x, item.y, item.z); + var marker = new google.maps.Marker({position: converted, + map: map, + title: jQuery.trim(item.msg), + icon: iconURL + }); + + continue; + } + var matched = false; for (idx in signGroups) { var signGroup = signGroups[idx]; @@ -240,10 +254,19 @@ function initMarkers() { function makeLink() { + var displayZoom = map.getZoom(); + if (displayZoom == config.maxZoom) { + displayZoom = "max"; + } else { + displayZoom -= config.maxZoom; + } + var xyz; + var xyz = fromLatLngToWorld(map.getCenter().lat(), map.getCenter().lng()); var a=location.href.substring(0,location.href.lastIndexOf(location.search)) - + "?lat=" + map.getCenter().lat().toFixed(6) - + "&lng=" + map.getCenter().lng().toFixed(6) - + "&zoom=" + map.getZoom(); + + "?x=" + Math.floor(xyz.x) + + "&y=" + Math.floor(xyz.y) + + "&z=" + Math.floor(xyz.z) + + "&zoom=" + displayZoom; document.getElementById("link").innerHTML = a; } @@ -254,6 +277,11 @@ function initialize() { var lat = 0.5; var lng = 0.5; var zoom = config.defaultZoom; + var hasquerypos = false; + var queryx = 0; + var queryy = 64; + var queryz = 0; + var mapcenter; var pairs = query.split("&"); for (var i=0; i