[mapguide-users] Using MG Viewer API in Custom Toolbar Frame Outside Viewer Frame

Corey Sollom csollom at gmail.com
Wed Mar 2 14:04:30 EST 2011


I have embedded the MapGuide AJAX viewer in an HTML Frame in my
webpage and would like to use my own custom toolbar embedded in a
frame outside the viewer frame to interact with the MapGuide Map using
MapGuide Viewer API calls.

1) Has anyone tried this or know if this is possible?
2) When programming a button on my custom toolbar, what frame do I
need to specify in order to send JavaScript Viewer API calls from my
custom toolbar to the MapGuide Map?

For example, to execute a "Zoom In" command from the custom toolbar,
would the onClick event of my Zoom In button be something like
"parent.mainappFrame.ExecuteMapAction(7);" ?  I'm using MapGuide
Enterprise 2011, Apache, Java, and Windows Server 2003 for my
development environment.  Below is the HTML for my toolbar and viewer
frames.

<html>
<frameset rows="26,*" BGCOLOR="#A6CAF0">
    <frame name="customtoolbar" src="/customtoolbar.html"
frameborder="0" marginwidth="0" marginheight="0"
scrolling="no"></frame>
    <frame name="main"
src="/mapguide2011/mapviewerajax/?WEBLAYOUT=Library://CoName/Layouts/CoName_Basic_Layout.WebLayout&USERNAME=Anonymous"
frameborder="0" marginwidth="0" marginheight="0"
scrolling="no"></frame>
    <noframes>
        This page is designed to be viewed with a Web Browser that
supports frames.
    </noframes>
</frameset>
</html>

Thanks,
Corey


More information about the mapguide-users mailing list