freealise commited on
Commit
80429bc
1 Parent(s): 7abc51c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -607,7 +607,7 @@ with gr.Blocks(css=css) as demo:
607
  with gr.Accordion(label="Locations", open=False):
608
  offset = gr.HTML(value="""<label for='displace'>Displace</label><input id='displace' type='range' style='width:256px;height:1em;' value='0' min='0' max='255' step='1' oninput='
609
  try {
610
- var txt = document.getElementById(\"coords\").innerText.replace(/\"root=/, \"\").replace(/\]\"/, \"\").replace(/(\\n|\\s|\\d:)/g, \"\").replace(/\\w+:/g, function(x){return \"&quot;\"+x.slice(0,-1)+\"&quot;:\"});
611
  alert(txt);
612
  var json = JSON.parse(txt);
613
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.x = this.value * json[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)].lat;
@@ -735,7 +735,7 @@ with gr.Blocks(css=css) as demo:
735
  {"lat": -3.0588534016828817e-06, "lng": 3.549113042566887e-06, "heading": 151.93391, "pitch": 2.843050000000005},
736
  {"lat": 2.513057799546914e-05, "lng": -2.1219586638920873e-05, "heading": 152.95769, "pitch": 4.233024999999998}
737
  ]"""
738
- coords = gr.JSON(elem_id="coords", value=example_coords, label="", show_label=False)
739
 
740
  html = gr.HTML(value="""<label for='zoom'>Zoom</label><input id='zoom' type='range' style='width:256px;height:1em;' value='0.8' min='0.157' max='1.57' step='0.001' oninput='
741
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
 
607
  with gr.Accordion(label="Locations", open=False):
608
  offset = gr.HTML(value="""<label for='displace'>Displace</label><input id='displace' type='range' style='width:256px;height:1em;' value='0' min='0' max='255' step='1' oninput='
609
  try {
610
+ var txt = document.getElementById(\"coords\").getElementsByTagName(\"textarea\")[0].value;
611
  alert(txt);
612
  var json = JSON.parse(txt);
613
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.x = this.value * json[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)].lat;
 
735
  {"lat": -3.0588534016828817e-06, "lng": 3.549113042566887e-06, "heading": 151.93391, "pitch": 2.843050000000005},
736
  {"lat": 2.513057799546914e-05, "lng": -2.1219586638920873e-05, "heading": 152.95769, "pitch": 4.233024999999998}
737
  ]"""
738
+ coords = gr.Textbox(elem_id="coords", value=example_coords, label="Coordinates", interactive=False)
739
 
740
  html = gr.HTML(value="""<label for='zoom'>Zoom</label><input id='zoom' type='range' style='width:256px;height:1em;' value='0.8' min='0.157' max='1.57' step='0.001' oninput='
741
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {