MerginMaps / MerginMaps/mobile

Support of QML and HTML Widgets on iOS

Open
#3,692 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
388
Forks
87
Avg merge
2d 7h
Merged PRs (30d)
20

Description

It should be technically possible to support QML and HTML widgets in attribute forms on iOS, as QField already demonstrates.

I really don't want to fan a flame here, but it would be nice if you could support something like the following that works in QGIS and QField.

QML Widget:

import QtQuick 2

Loader {
  id: loader
  width:300;height:30
  
  function getJSON(url, callback) {
    var xhr = new XMLHttpRequest();
    xhr.open('GET', url, true);
    xhr.responseType = 'json';
    xhr.onload = function() {
      var status = xhr.status;
      if (status === 200) {
        callback(null, xhr.response);
      } else {
        callback(status, xhr.response);
      }
    };
    xhr.send();
  }

  sourceComponent: Text {
    id: elev
    text: getJSON('https://voibos.rechenraum.com/voibos/voibos?name=hoehenservice&Koordinate='+expression.evaluate("x(transform(@geometry,'EPSG:3857','EPSG:31255'))")+','+expression.evaluate("y(transform(@geometry,'EPSG:3857','EPSG:31255'))")+'&CRS=31255',function(err, data) {if (err == null) { elev.text = data.hoeheDTM.toFixed(2).concat('m'); } else { elev.text = 'Error'}})
  }
}

HTML Widget:

<h1 id="elev"/>
<script>
function getJSON(url, callback) {
    var xhr = new XMLHttpRequest();
    xhr.open('GET', url, true);
    xhr.responseType = 'json';
    xhr.onload = function() {
      var status = xhr.status;
      if (status === 200) {
        callback(null, xhr.response);
      } else {
        callback(status, xhr.response);
      }
    };
    xhr.send();
};
getJSON('https://voibos.rechenraum.com/voibos/voibos?name=hoehenservice&Koordinate='+expression.evaluate("\"x\"")+','+expression.evaluate("\"y\"")+'&CRS=31255',
function(err, data) {
  if (err == null) {
    document.getElementById("elev").innerHTML = data.hoeheDTM.toFixed(2).concat('m');
  }
});
</script>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how attribute-form widgets are handled on iOS, using the QML and HTML examples in the issue and QField as reference. Done means QML and HTML widgets can render and behave in iOS attribute forms with the demonstrated content and appropriate validation or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, ios
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.