Skip to content

Commit

Permalink
Update blocks.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fustyles authored Dec 30, 2024
1 parent b37c517 commit baae4a9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions SpBlocklyJS/googlemap_20241226/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,9 @@ Blockly.Blocks['googlemap_map_function'] = {
[Blockly.Msg["GOOGLEMAP_MAP_UPDATE_HEADING"],"heading"],
[Blockly.Msg["GOOGLEMAP_MAP_UPDATE_PITCH"],"pitch"]
], this.validate), "func");
this.appendValueInput("zoom")
this.appendValueInput("val")
.setCheck("Number")
.setAlign(Blockly.ALIGN_RIGHT)
.appendField(Blockly.Msg["GOOGLEMAP_ZOOM"]);
.setAlign(Blockly.ALIGN_RIGHT);
this.setInputsInline(true);
this.setPreviousStatement(true);
this.setNextStatement(true);
Expand All @@ -235,10 +234,10 @@ Blockly.Blocks['googlemap_map_function'] = {
validate: function(newValue) {
const block = this.sourceBlock_;
if (!block) return;
if (newValue=="zoom")
block.getInput("zoom").setVisible(true);
if (newValue=="zoom"||newValue=="heading"||newValue=="pitch")
block.getInput("val").setVisible(true);
else
block.getInput("zoom").setVisible(false);
block.getInput("val").setVisible(false);
}
};

Expand Down

0 comments on commit baae4a9

Please sign in to comment.