Hi Jackie, <br/>
I have a question about execute <b>setScale </b>command from <br/>
a function in <i>application.tsx</i><br/>
<br/>
i want to add function in <i>application.tsx</i> to communicate <br/>
custom ui (in template) with Mapguide react<br/>
<div align=left dir=ltr>
<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
style='border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;
mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
<td width=616 valign=top style='width:462.1pt;border:solid windowtext 1.0pt;
mso-border-alt:solid windowtext .5pt;background:#BFBFBF;mso-background-themecolor:
background1;mso-background-themeshade:191;padding:0cm 5.4pt 0cm 5.4pt'>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>application.tsx</p>
</td>
</tr>
<tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes'>
<td width=616 valign=top style='width:462.1pt;border:solid windowtext 1.0pt;
border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
padding:0cm 5.4pt 0cm 5.4pt'>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='color:#0070C0'>import </span>* as React from "react";<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='color:#0070C0'>import </span>* as ReactDOM from "react-dom";<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='color:#0070C0'>import </span>{ Provider } from
"react-redux";<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
class=GramE><span style='color:#0070C0'>import</span></span><span
style='color:#0070C0'> </span>{ IAppProps, App } from
"../containers/app";<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
class=GramE><span style='color:#0070C0'>import</span></span><span
style='color:#0070C0'> </span>{ ClientKind } from "../api/common";<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
class=GramE><span style='color:#0070C0'>import</span></span><span
style='color:#0070C0'> </span>{ ClientContext } from
"../api/client";<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
class=GramE><span style='color:#0070C0'>import</span></span><span
style='color:#0070C0'> </span>configureStore from
"../store/configure-store";<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
class=GramE><span style='color:#0070C0'>import</span></span><span
style='color:#0070C0'> </span>{ INITIAL_STATE } from
"../reducers/config";<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
lang=FA dir=RTL style='font-family:"Arial","sans-serif";mso-ascii-font-family:
Calibri;mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;mso-bidi-font-family:Arial;mso-bidi-theme-font:
minor-bidi'><o:p> </o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
class=GramE><span style='color:#0070C0'>import</span></span><span
style='color:#0070C0'> </span>* as MapActions from
"../actions/map";<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>/**<span
lang=FA dir=RTL style='font-family:"Arial","sans-serif";mso-ascii-font-family:
Calibri;mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;mso-bidi-font-family:Arial;mso-bidi-theme-font:
minor-bidi'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
dir=LTR></span><span dir=LTR></span><span style='mso-spacerun:yes'> </span>*
This is the entry point to the Application component<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>*/<span lang=FA dir=RTL style='font-family:
"Arial","sans-serif";mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:
Arial;mso-bidi-theme-font:minor-bidi'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='color:#0070C0'>export </span>class ApplicationViewModel {<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>constructor() {<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span><span lang=FA dir=RTL
style='font-family:"Arial","sans-serif";mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:Arial;mso-bidi-theme-font:minor-bidi'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
dir=LTR></span><span dir=LTR></span><span style='mso-spacerun:yes'>
</span>}<span lang=FA dir=RTL style='font-family:"Arial","sans-serif";
mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-hansi-font-family:
Calibri;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:Arial;
mso-bidi-theme-font:minor-bidi'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
dir=LTR></span><span dir=LTR></span><span style='mso-spacerun:yes'>
</span><span style='color:#0070C0'>public </span>mount(node: Element, props:
IAppProps) {<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>const agentConf = {<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>agentUri: props.agent.uri,<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>agentKind: props.agent.kind ||
"mapagent"<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>};<span lang=FA dir=RTL
style='font-family:"Arial","sans-serif";mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:Arial;mso-bidi-theme-font:minor-bidi'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
dir=LTR></span><span dir=LTR></span><span style='mso-spacerun:yes'>
</span>const store = configureStore({ config: { ...INITIAL_STATE,
...agentConf } });<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>ReactDOM.render(<Provider
store={store}><o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span><App {...props} /><o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span></Provider>, node);<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>}<span lang=FA dir=RTL style='font-family:
"Arial","sans-serif";mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:
Arial;mso-bidi-theme-font:minor-bidi'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-tab-count:1'> </span><span lang=FA dir=RTL
style='font-family:"Arial","sans-serif";mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:Arial;mso-bidi-theme-font:minor-bidi'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-tab-count:1'> </span><span style='color:#984807;
mso-themecolor:accent6;mso-themeshade:128;mso-style-textfill-fill-color:#984807;
mso-style-textfill-fill-themecolor:accent6;mso-style-textfill-fill-alpha:
100.0%;mso-style-textfill-fill-colortransforms:lumm=50000'>public
setScale_To_20000()<o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='color:#984807;mso-themecolor:accent6;mso-themeshade:128;mso-style-textfill-fill-color:
#984807;mso-style-textfill-fill-themecolor:accent6;mso-style-textfill-fill-alpha:
100.0%;mso-style-textfill-fill-colortransforms:lumm=50000'><span
style='mso-tab-count:1'> </span>{</span><span lang=FA dir=RTL
style='font-family:"Arial","sans-serif";mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:Arial;mso-bidi-theme-font:minor-bidi;
color:#984807;mso-themecolor:accent6;mso-themeshade:128;mso-style-textfill-fill-color:
#984807;mso-style-textfill-fill-themecolor:accent6;mso-style-textfill-fill-alpha:
100.0%;mso-style-textfill-fill-colortransforms:lumm=50000'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='color:#984807;mso-themecolor:accent6;mso-themeshade:128;mso-style-textfill-fill-color:
#984807;mso-style-textfill-fill-themecolor:accent6;mso-style-textfill-fill-alpha:
100.0%;mso-style-textfill-fill-colortransforms:lumm=50000'><span
style='mso-tab-count:2'> </span>// I don’t khnow
how to call <u>setScale</u> function<o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='color:#984807;mso-themecolor:accent6;mso-themeshade:128;mso-style-textfill-fill-color:
#984807;mso-style-textfill-fill-themecolor:accent6;mso-style-textfill-fill-alpha:
100.0%;mso-style-textfill-fill-colortransforms:lumm=50000'><span
style='mso-tab-count:2'> </span>return 'Ok';<o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='color:#984807;mso-themecolor:accent6;mso-themeshade:128;mso-style-textfill-fill-color:
#984807;mso-style-textfill-fill-themecolor:accent6;mso-style-textfill-fill-alpha:
100.0%;mso-style-textfill-fill-colortransforms:lumm=50000'><span
style='mso-tab-count:1'> </span>}</span><span lang=FA dir=RTL
style='font-family:"Arial","sans-serif";mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:Arial;mso-bidi-theme-font:minor-bidi;
color:#984807;mso-themecolor:accent6;mso-themeshade:128;mso-style-textfill-fill-color:
#984807;mso-style-textfill-fill-themecolor:accent6;mso-style-textfill-fill-alpha:
100.0%;mso-style-textfill-fill-colortransforms:lumm=50000'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
dir=LTR></span><span dir=LTR></span>}</p>
</td>
</tr>
</table>
</div>
<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi:
embed'><o:p> </o:p></p>
<p class=MsoNormal dir=LTR style='text-align:left;direction:ltr;unicode-bidi:
embed'><o:p> </o:p></p>
<div align=left dir=ltr>
<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
style='border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;
mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'>
<tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
<td width=616 valign=top style='width:462.1pt;border:solid windowtext 1.0pt;
mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt'>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>Index.html</p>
</td>
</tr>
<tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes'>
<td width=616 valign=top style='width:462.1pt;border:solid windowtext 1.0pt;
border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
padding:0cm 5.4pt 0cm 5.4pt'>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'>var el =
document.getElementById("map");<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>var <span style='color:#0070C0'>viewer
</span>= new MapGuide.Application();<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>viewer.mount(el, {<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>layout:
"ajax-viewer",<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>externalBaseLayers: [<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>{ name:
"OpenStreetMap", kind: "OSM" },<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>],<span lang=FA dir=RTL
style='font-family:"Arial","sans-serif";mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:Arial;mso-bidi-theme-font:minor-bidi'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
dir=LTR></span><span dir=LTR></span><span
style='mso-spacerun:yes'> </span>agent: {<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span><span class=GramE>uri</span>:
"../mapagent/mapagent.fcgi"<o:p></o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
style='mso-spacerun:yes'> </span>}<span lang=FA dir=RTL
style='font-family:"Arial","sans-serif";mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;mso-hansi-font-family:Calibri;mso-hansi-theme-font:
minor-latin;mso-bidi-font-family:Arial;mso-bidi-theme-font:minor-bidi'><o:p></o:p></span></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
dir=LTR></span><span dir=LTR></span><span
style='mso-spacerun:yes'> </span>});</p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><o:p> </o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><o:p> </o:p></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><span
class=GramE><b><span style='color:#0070C0'>viewer</span></b></span><b>.<span
style='color:#984807;mso-themecolor:accent6;mso-themeshade:128;mso-style-textfill-fill-color:
#984807;mso-style-textfill-fill-themecolor:accent6;mso-style-textfill-fill-alpha:
100.0%;mso-style-textfill-fill-colortransforms:lumm=50000'> setScale_To_20000();<o:p></o:p></span></b></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><b><span
style='color:#984807;mso-themecolor:accent6;mso-themeshade:128;mso-style-textfill-fill-color:
#984807;mso-style-textfill-fill-themecolor:accent6;mso-style-textfill-fill-alpha:
100.0%;mso-style-textfill-fill-colortransforms:lumm=50000'><o:p> </o:p></span></b></p>
<p class=MsoNormal dir=LTR style='margin-bottom:0cm;margin-bottom:.0001pt;
text-align:left;line-height:normal;direction:ltr;unicode-bidi:embed'><b><span
style='color:#984807;mso-themecolor:accent6;mso-themeshade:128;mso-style-textfill-fill-color:
#984807;mso-style-textfill-fill-themecolor:accent6;mso-style-textfill-fill-alpha:
100.0%;mso-style-textfill-fill-colortransforms:lumm=50000'><o:p> </o:p></span></b></p>
</td>
</tr>
</table>
</div>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Adding-custom-command-in-react-layout-tp5304940.html">Adding custom command in react layout</a><br/>
Sent from the <a href="http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html">MapGuide Users mailing list archive</a> at Nabble.com.<br/>