Hi thanks for your answered,

My goal is to have a simple mapguide window (iframe) in my specific data 
collector application (my application is on top document) and just click button 
to get the x,y of the digitized point in the mapguide viewer.

i geted a solution with a mapguide iframe, I can digitize and get point x,y, 
it's works fine.

Curiously, the error message at loading about MapInit, for my moment usage 
seems not to be a problem for DigitizePoint..

My html page with mapguide in an iframe, if you want test : 

consol.log return :

VM170 pageLoadFunctions.js:25 Uncaught TypeError: Cannot read property 
'mapInit' of undefined
    at window.onload (VM170 pageLoadFunctions.js:25)
window.onload @ VM170 pageLoadFunctions.js:25


<!DOCTYPE html>
<html>
<head>
        <script>
                function digitize_point_from_iframe()
                {
                        
document.getElementById("mapguide_iframe_react").contentWindow.GetMapFrame().DigitizePoint(OnPointDigitized);
                }

                function OnPointDigitized(point) 
                {
          document.getElementById("ag_x").value = point.X;
          document.getElementById("ag_y").value = point.Y;                
                }       
        </script>
</head>
<body>
                <input id="ag_x" type="text">
                <input id="ag_y" type="text">
                <input id="ag_digit_point" type="button" 
onclick="digitize_point_from_iframe('mapguide_iframe_ajax');">
                <BR>

                <iframe id="mapguide_iframe_react" 
src="../mapguide/viewer/index.html?resource=Library://Samples/Sheboygan/Layouts/SheboyganAsp.WebLayout"
 width="1000" height="800">
                </iframe>
</body>

Thanks for your help.

Rémy
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to