<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- P { margin-top: 0px; margin-bottom: 0px; } @font-face { font-family: "Cambria Math"; } @font-face { font-family: Calibri; } @font-face { font-family: Consolas; } p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; } a:link, span.MsoHyperlink { color: rgb(5, 99, 193); text-decoration: underline; } a:visited, span.MsoHyperlinkFollowed { color: rgb(149, 79, 114); text-decoration: underline; } pre { margin: 0cm 0cm 0.0001pt; font-size: 10pt; font-family: "Courier New"; } p.msonormal0, li.msonormal0, div.msonormal0 { margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; } span.HTML-esimuotoiltuChar { font-family: Consolas, serif; } span.Shkpostityyli21 { font-family: Calibri, sans-serif; color: windowtext; } .MsoChpDefault { font-size: 10pt; } @page WordSection1 { margin: 70.85pt 2cm; } div.WordSection1 { }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi,<br>
</p>
<p><br>
</p>
<p>just <span style="caret-color: rgb(33, 33, 33); color: rgb(33, 33, 33); font-family: Calibri, sans-serif; font-size: 14.666666984558105px; background-color: rgb(255, 255, 255);">WebView</span><span style="caret-color: rgb(33, 33, 33); color: rgb(33, 33, 33); font-family: Calibri, sans-serif; font-size: 14.666666984558105px; background-color: rgb(255, 255, 255);"> </span><span style="caret-color: rgb(33, 33, 33); color: rgb(33, 33, 33); font-family: Calibri, sans-serif; font-size: 14.666666984558105px; background-color: rgb(255, 255, 255);">for
 the iframe</span> is ok.<br>
</p>
<p><br>
</p>
<p>In the browser that works fine. But when I try this in android phone with cordova "Osakari onReady" newer occurs. <br>
</p>
<p><br>
</p>
<pre style="background-color: rgb(255, 255, 255); font-family: Menlo; font-size: 9pt;"><span style="color: rgb(0, 0, 128); font-weight: bold;">try </span>{<br>  <span style="color: rgb(69, 131, 131);">channel </span>= <span style="color: rgb(69, 131, 131);">OskariRPC</span>.<span style="color: rgb(122, 122, 67);">connect</span>(<br>    <span style="color: rgb(69, 131, 131);">documentItem</span>,<br>    mapAddr<br>  );<br>  <span style="color: rgb(69, 131, 131);">channel</span>.onReady(res => {<br>    <span style="color: rgb(0, 0, 128); font-weight: bold;">this</span>.<span style="color: rgb(102, 14, 122); font-weight: bold;">loggerService</span>.<span style="color: rgb(122, 122, 67);">debugBuffer</span>(<span style="color: rgb(0, 128, 0); font-weight: bold;">"Oskari onReady: " </span>+ res.clientSupported + <span style="color: rgb(0, 128, 0); font-weight: bold;">" " </span>+ res.<span style="color: rgb(102, 14, 122); font-weight: bold;">version</span>);<br>  });<br></pre>
<p><br>
</p>
<p>We are using <a href="https://hkp.maanmittauslaitos.fi">https://hkp.maanmittauslaitos.fi</a> maps. <br>
</p>
<p><br>
</p>
<p>This might be a reason maybe...but what can I do to allow this?:<br>
</p>
<p><br>
</p>
<p>Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (’https://hkp.maanmittauslaitos.fi') does not match the recipient window’s origin (‘file://’).“,<br>
</p>
<p><br>
</p>
<p>-klasu<br>
</p>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Lähettäjä:</b> Mäkinen Sami (MML)<br>
<b>Lähetetty:</b> 12. huhtikuuta 2019 9:58<br>
<b>Vastaanottaja:</b> Puikkonen Klaus (Ruoka); Oskari-user@lists.osgeo.org<br>
<b>Aihe:</b> VS: Oskari RPC and Cordova Android app issue</font>
<div> </div>
</div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<br>
<br>
Do you need the “parent page” or can you just do a WebView for the iframe src/the map? Most of the Google search results related to postMessage in WebView seems to deal with how to communicate between Java and Javascript by sending and receiving messages using
 the postMessage().</span></p>
<p class="MsoNormal"><span lang="EN-US" style=""> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="">BR,</span></p>
<p class="MsoNormal"><span lang="EN-US" style="">          Sami</span></p>
<p class="MsoNormal"><span lang="EN-US" style=""> </span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> Oskari-user <oskari-user-bounces@lists.osgeo.org>
<b>Puolesta </b>Puikkonen Klaus (Ruoka)<br>
<b>Lähetetty:</b> torstai 11. huhtikuuta 2019 16.02<br>
<b>Vastaanottaja:</b> Oskari-user@lists.osgeo.org<br>
<b>Aihe:</b> [Oskari-user] Oskari RPC and Cordova Android app issue</p>
</div>
</div>
<p class="MsoNormal"> </p>
<p><span style="font-size:12.0pt; color:black">Hi,</span></p>
<p><span style="font-size:12.0pt; color:black"> </span></p>
<p><span style="font-size:12.0pt; color:black">does anybody have idea or knowledge how Oskari RPC could work with Cordova and Android Webview. With browser everything works fine but in Webview postmessages does not work for some reason.</span></p>
<p><span style="font-size:12.0pt; color:black"> </span></p>
<p><span style="font-size:12.0pt; color:black">For example:</span></p>
<p><span style="font-size:12.0pt; color:black"> </span></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt; color:black">this.channel.postRequest(</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt; color:black">  'MapMoveRequest', [x, y, zoomlevel]</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt; color:black">);​</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt; color:black">does nothing.</span></p>
</div>
<pre style="background:white"><span style="font-family:"Calibri",sans-serif; color:black; background:white">I'm trying to convert www application to simple </span><span style="font-family:"Calibri",sans-serif; color:black">android app....the applications for herders. They take pictures and locations of dead reindeers... the location are shown in the map which is in iFrame.</span><span style="color:black"></span></pre>
<pre style="background:white"><span style="color:black">br</span></pre>
<pre style="background:white"><span style="color:black">klasu</span></pre>
</div>
</div>
</div>
</body>
</html>