turtlestitch/libraries/maps_module.xml

1 wiersz
11 KiB
XML

<blocks app="Snap! 5.1, http://snap.berkeley.edu" version="1"><block-definition s="$globe show current location" type="command" category="other"><header></header><code></code><translations>de:$globe zeige aktuellen Standort&#xD;pt:mostra a localização corrente do dispositivo no $globe&#xD;ca:$globe centra a la meva ubicació&#xD;</translations><inputs></inputs><script><custom-block s="set $globe to lon: %n lat: %n"><custom-block s="$globe current longitude"></custom-block><custom-block s="$globe current latitude"></custom-block></custom-block></script></block-definition><block-definition s="$globe zoom" type="reporter" category="other"><header></header><code></code><translations>de:$globe Zoom&#xD;pt:o zoom do $globe&#xD;ca:$globe zoom&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>stage</l></list><l>return stage.worldMap.zoom;</l></block><list><block s="reportGet"><l><option>stage</option></l></block></list></block></block></script></block-definition><block-definition s="set $globe zoom to %&apos;n&apos;" type="command" category="other"><header></header><code></code><translations>de:setze $globe Zoom auf _&#xD;pt:altera o zoom do $globe para _&#xD;ca:$globe fixa el zoom a _&#xD;</translations><inputs><input type="%n">10</input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>stage</l><l>n</l></list><l>stage.worldMap.setZoom(n)</l></block><list><block s="reportGet"><l><option>stage</option></l></block><block var="n"/></list></block><custom-block s="update $globe"></custom-block></script></block-definition><block-definition s="$globe longitude of x %&apos;x&apos;" type="reporter" category="other"><header></header><code></code><translations>de:$globe Längengrad von x _&#xD;pt:a longitude no $globe da coordenada x _&#xD;ca:$globe longitud per a x _&#xD;</translations><inputs><input type="%n">0</input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>stage</l><l>x</l></list><l>return stage.worldMap.lonFromSnapX(x)</l></block><list><block s="reportGet"><l><option>stage</option></l></block><block var="x"/></list></block></block></script></block-definition><block-definition s="$globe latitude of y %&apos;y&apos;" type="reporter" category="other"><header></header><code></code><translations>de:$globe Breitengrad von y _&#xD;pt:a latitude no $globe da coordenada y _&#xD;ca:$globe latitud per a y _&#xD;</translations><inputs><input type="%n">0</input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>stage</l><l>y</l></list><l>return stage.worldMap.latFromSnapY(y)</l></block><list><block s="reportGet"><l><option>stage</option></l></block><block var="y"/></list></block></block></script></block-definition><block-definition s="set $globe to lon: %&apos;lon&apos; lat: %&apos;lat&apos;" type="command" category="other"><header></header><code></code><translations>de:setze $globe auf Länge: _ Breite: _&#xD;pt:altera a posição no $globe para (longitude: _ , latitude: _ )&#xD;ca:$globe centra a longitud: _ latitud: _&#xD;</translations><inputs><input type="%n">-122.257852</input><input type="%n">37.872099</input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>stage</l><l>lat</l><l>lon</l></list><l>stage.worldMap.setView(lon, lat);</l></block><list><block s="reportGet"><l><option>stage</option></l></block><block var="lat"/><block var="lon"/></list></block><custom-block s="update $globe"></custom-block></script></block-definition><block-definition s="y of $globe latitude %&apos;lat&apos;" type="reporter" category="other"><header></header><code></code><translations>de:y von $globe Breitengrad _&#xD;pt:a coordenada y da latitude _ no $globe&#xD;ca:$globe y per a latitud _&#xD;</translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>stage</l><l>lat</l></list><l>return stage.worldMap.snapYfromLat(lat)</l></block><list><block s="reportGet"><l><option>stage</option></l></block><block var="lat"/></list></block></block></script></block-definition><block-definition s="x of $globe longitude %&apos;lng&apos;" type="reporter" category="other"><header></header><code></code><translations>de:x von $globe Längengrad _&#xD;pt:a coordenada x da longidude _ no $globe&#xD;ca:$globe x per a longitud _&#xD;</translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>stage</l><l>lng</l></list><l>return stage.worldMap.snapXfromLon(lng)</l></block><list><block s="reportGet"><l><option>stage</option></l></block><block var="lng"/></list></block></block></script></block-definition><block-definition s="change $globe by x: %&apos;x&apos; y: %&apos;y&apos; pixels" type="command" category="other"><header></header><code></code><translations>de:ändere $globe um x: _ y: _ Pixel&#xD;pt:desloca a posição do mapa de (x: _ , y: _ )&#xD;ca:$globe canvia la ubicació en x: _ y: _ píxels&#xD;</translations><inputs><input type="%n">10</input><input type="%n">10</input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>stage</l><l>x</l><l>y</l></list><l>stage.worldMap.panBy(x, y)</l></block><list><block s="reportGet"><l><option>stage</option></l></block><block var="x"/><block var="y"/></list></block><custom-block s="update $globe"></custom-block></script></block-definition><block-definition s="$globe distance in km to %&apos;target&apos;" type="reporter" category="other"><header></header><code></code><translations>de:$globe Entfernung in km zu _&#xD;pt:a tua distância em km a _ no $globo&#xD;ca:$globe distància en km fins a _&#xD;</translations><inputs><input type="%s" readonly="true"><options>§_objectsMenu</options></input></inputs><script><block s="doDeclareVariables"><list><l>trg</l></list></block><block s="doSetVar"><l>trg</l><block s="reportObject"><block var="target"/></block></block><block s="doIf"><block s="reportNot"><block s="reportAnd"><block s="reportIsA"><block s="reportGet"><l><option>self</option></l></block><l><option>sprite</option></l></block><block s="reportIsA"><block var="trg"/><l><option>sprite</option></l></block></block></block><script><block s="doReport"><l>-1</l></block></script></block><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>stage</l><l>lat1</l><l>lng1</l><l>lat2</l><l>lng2</l></list><l>return stage.worldMap.distanceInKm(lat1, lng1, lat2, lng2)</l></block><list><block s="reportGet"><l><option>stage</option></l></block><custom-block s="$globe latitude of y %n"><block s="yPosition"></block></custom-block><custom-block s="$globe longitude of x %n"><block s="xPosition"></block></custom-block><custom-block s="$globe latitude of y %n"><block s="reportAttributeOf"><l><option>y position</option></l><block var="target"/></block></custom-block><custom-block s="$globe longitude of x %n"><block s="reportAttributeOf"><l><option>x position</option></l><block var="target"/></block></custom-block></list></block></block></script></block-definition><block-definition s="$globe current location" type="reporter" category="other"><header></header><code></code><translations>de:$globe aktuelle Position&#xD;pt:a localização corrente do dispositivo no $globe&#xD;ca:$globe ubicació actual&#xD;</translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>test</l></list></block><block s="doSetVar"><l>test</l><block s="evaluate"><block s="reportJSFunction"><list></list><l>var crd = new List(),&#xD; myself = this,&#xD; options = {&#xD; enableHighAccuracy: true,&#xD; timeout: 5000,&#xD; maximumAge: 0&#xD; };&#xD;&#xD;function success(pos) {&#xD; crd = new List([&#xD; pos.coords.latitude,&#xD; pos.coords.longitude&#xD; ]);&#xD;}&#xD;&#xD;function error(err) {&#xD; crd = new List([37.872099, -122.257852]);&#xD; myself.inform(&apos;Warning:\nGeolocation failed.&apos;);&#xD;}&#xD;&#xD;navigator.geolocation.getCurrentPosition(&#xD; success,&#xD; error,&#xD; options&#xD;);&#xD;&#xD;return function () {return crd; }</l></block><list></list></block></block><block s="doWaitUntil"><block s="reportEquals"><block s="reportListLength"><block s="evaluate"><block var="test"/><list></list></block></block><l>2</l></block></block><block s="doReport"><block s="evaluate"><block var="test"/><list></list></block></block></script></block-definition><block-definition s="$globe current latitude" type="reporter" category="other"><header></header><code></code><translations>de:$globe aktueller Breitengrad&#xD;pt:a latitude corrente do dispositivo no $globe&#xD;ca:$globe latitud actual&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="reportListItem"><l>1</l><custom-block s="$globe current location"></custom-block></block></block></script></block-definition><block-definition s="$globe current longitude" type="reporter" category="other"><header></header><code></code><translations>de:$globe aktueller Längengrad&#xD;pt:a longitude corrente do dispositivo no $globe&#xD;ca:$globe longitud actual&#xD;</translations><inputs></inputs><script><block s="doReport"><block s="reportListItem"><l>2</l><custom-block s="$globe current location"></custom-block></block></block></script></block-definition><block-definition s="update $globe" type="command" category="other"><header></header><code></code><translations>de:aktualisiere $globe&#xD;pt:actualiza o $globe&#xD;ca:$globe força refresc&#xD;</translations><inputs></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>stage</l></list><l>stage.worldMap.extent = stage.dimensions;&#xD;stage.worldMap.render()</l></block><list><block s="reportGet"><l><option>stage</option></l></block></list></block><block s="doTellTo"><block s="reportGet"><l><option>stage</option></l></block><block s="reifyScript"><script><block s="doSwitchToCostume"><custom-block s="$globe as costume"></custom-block></block></script><list></list></block><list></list></block></script></block-definition><block-definition s="$globe as costume" type="reporter" category="other"><header></header><code></code><translations>de:$globe als Kostüm&#xD;pt:a parte visível do $globe na forma de traje&#xD;ca:$globe vestit del mapa actual&#xD;</translations><inputs></inputs><script><block s="doWaitUntil"><block s="evaluate"><block s="reportJSFunction"><list><l>stage</l></list><l>return !stage.worldMap.loading</l></block><list><block s="reportGet"><l><option>stage</option></l></block></list></block></block><block s="doReport"><block s="evaluate"><block s="reportJSFunction"><list><l>stage</l></list><l>return new Costume(stage.worldMap.canvas, &apos;map&apos;)</l></block><list><block s="reportGet"><l><option>stage</option></l></block></list></block></block></script></block-definition><block-definition s="set $globe style to %&apos;name&apos;" type="command" category="other"><header></header><code></code><translations>de:setze $globe Stil auf _&#xD;pt:altera o estilo do $globe para _&#xD;ca:$globe fixa l&apos;estil de mapa a _&#xD;</translations><inputs><input type="%s" readonly="true">Wikimedia<options>OpenStreetMap&#xD;Wikimedia&#xD;Watercolor&#xD;Toner&#xD;Terrain&#xD;Topographic&#xD;Satellite&#xD;Streets&#xD;Shading&#xD;Mapbox (experimental)</options></input></inputs><script><block s="doRun"><block s="reportJSFunction"><list><l>stage</l><l>name</l></list><l>stage.worldMap.setHost(name)</l></block><list><block s="reportGet"><l><option>stage</option></l></block><block var="name"/></list></block><custom-block s="update $globe"></custom-block></script></block-definition></blocks>