Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This is done by sending performing a Javascript command in the MazeMap webview.

Drawio
baseUrlhttps://mazemap.atlassian.net/wiki
diagramNameInjecting Positions Into MazeMap
width863
zoom1
pageId107708421
lbox1
height1147
revision1

Performing JavaScript commands in a webview

...

Code Block
String js = "var msg={ ... }; window.postMessage(msg,'*');"; wkwebview.evaluateJavaScript(js);



The

...

Javascript Command


Code Block
var msg = {
    type: 'MM_INJECTABLE_LOCATION_UPDATE',
    data: {
        latlng: {
            lat: 63,
            lng: 10.5
        },
        accuracy: 500,    // In meters
        mm_z: 3,    // Optional numerical z-level
    }
};
window.postMessage(
    msg,
    '*'    // The "origin" of the destination window, which can be
        // replaced by the domain name of the currently loaded webpage.
);


Coordinates

The coordinates must be WGS84 latitude and longitude values.

If you are using a third party location source/SDK that provides coordinates in another format, you will need to convert them before sending them to into the MazeMap web view