diff options
| author | Code WvS <code-wvs@quantentunnel.de> | 2015-02-08 15:24:05 +0100 |
|---|---|---|
| committer | Code WvS <code-wvs@quantentunnel.de> | 2015-02-08 15:24:05 +0100 |
| commit | c71147a2fccf5d6ebd8a1eabd41e10b134248070 (patch) | |
| tree | 225bed731052a5884bfe3bc3e2d5790997e26c22 /objects.js | |
| parent | 79437a6ab81112438373a6010030ef504ffd5deb (diff) | |
| download | snap-yow-c71147a2fccf5d6ebd8a1eabd41e10b134248070.tar.gz snap-yow-c71147a2fccf5d6ebd8a1eabd41e10b134248070.zip | |
improve initial world loading; prepare conversion of sprites to "persons"
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -215,6 +215,7 @@ SpriteMorph.prototype.initBlocks = function () { defaults: [null, 12] }, addMarker: { + dev: true, type: 'command', category: 'map', spec: 'add a marker to %l' @@ -1358,6 +1359,16 @@ SpriteMorph.prototype.init = function (globals) { this.isDraggable = true; this.isDown = false; + // Snap! - YOW code + this.icon = L.icon({ + iconUrl: 'images/marker-icon.png', + iconRetinaUrl: 'images/marker-icon-2x.png', + shadowUrl: 'images/marker-shadow.png' + }); + this.geoposition = window.map.getCenter(); + this.marker = L.marker(this.geoposition, {icon: this.icon, title: this.name}); + this.marker.addTo(window.map); + this.heading = 90; this.changed(); this.drawNew(); @@ -1724,7 +1735,10 @@ SpriteMorph.prototype.blockTemplates = function (category) { blocks.push(block('reportLocation')); blocks.push(block('focusMap')); - blocks.push(block('addMarker')); + + //if (this.world().isDevMode) { + blocks.push(block('addMarker')); + //} } /* else if (cat === 'motion') { @@ -4910,7 +4924,9 @@ StageMorph.prototype.blockTemplates = function (category) { blocks.push(block('reportLocation')); blocks.push(block('focusMap')); - blocks.push(block('addMarker')); + if (this.world().isDevMode) { + blocks.push(block('addMarker')); + } } /* else if (cat === 'motion') { |
