summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCode WvS <code-wvs@quantentunnel.de>2015-03-01 12:49:34 +0100
committerCode WvS <code-wvs@quantentunnel.de>2015-03-01 12:49:34 +0100
commita06ce92b1a354bb623aff9b834ce2664021c44fa (patch)
tree7e4bab43fef5e26fc7434d770fd19e5a3eef1537
parent6dff0b435a059f0c66b842673677c13bfd95f7c4 (diff)
downloadsnap-yow-a06ce92b1a354bb623aff9b834ce2664021c44fa.tar.gz
snap-yow-a06ce92b1a354bb623aff9b834ce2664021c44fa.zip
added overpass simplification blocks
-rw-r--r--overpass.xml1
-rwxr-xr-xsnap.html5
2 files changed, 5 insertions, 1 deletions
diff --git a/overpass.xml b/overpass.xml
new file mode 100644
index 0000000..03cf6d4
--- /dev/null
+++ b/overpass.xml
@@ -0,0 +1 @@
+<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="is a street near lon: %'lon' lat: %'lat'" type="predicate" category="sensing"><header/><code/><inputs><input type="%n"/><input type="%n"/></inputs><script><block s="doReport"><block s="overpassQuerySucceeds"><block s="reportJoinWords"><list><l>way(around:7,</l><block var="lat"/><l>,</l><block var="lon"/><l>)[highway];out;</l></list></block></block></block></script></block-definition><block-definition s="is a building near lon: %'lon' lat: %'lat'" type="predicate" category="sensing"><header/><code/><inputs><input type="%n"/><input type="%n"/></inputs><script><block s="doReport"><block s="overpassQuerySucceeds"><block s="reportJoinWords"><list><l>way(around:5,</l><block var="lat"/><l>,</l><block var="lon"/><l>)[building];out;</l></list></block></block></block></script></block-definition></blocks> \ No newline at end of file
diff --git a/snap.html b/snap.html
index 51c861f..b5c2e7f 100755
--- a/snap.html
+++ b/snap.html
@@ -103,7 +103,10 @@
// Load the IDE
world = new WorldMorph(document.getElementById('world'));
world.worldCanvas.focus();
- new IDE_Morph().openIn(world);
+ ide = new IDE_Morph();
+ ide.openIn(world);
+ // load custom blocks that simplify the use of overpass
+ ide.droppedText(ide.getURL('overpass.xml'));
setInterval(loop, 10);
</script>
</body>