TabrizSoftware
8 years ago
Hi Jackie,
I have a question about execute *setScale *command from
a function in /application.tsx/
i want to add function in /application.tsx/ to communicate
custom ui (in template) with Mapguide react
application.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { IAppProps, App } from "../containers/app";
import { ClientKind } from "../api/common";
import { ClientContext } from "../api/client";
import configureStore from "../store/configure-store";
import { INITIAL_STATE } from "../reducers/config";
import * as MapActions from "../actions/map";
/**
 * This is the entry point to the Application component
 */
export class ApplicationViewModel {
   constructor() {
      Â
   }
   public mount(node: Element, props: IAppProps) {
       const agentConf = {
           agentUri: props.agent.uri,
           agentKind: props.agent.kind || "mapagent"
       };
       const store = configureStore({ config: { ...INITIAL_STATE,
...agentConf } });
       ReactDOM.render(<Provider store={store}>
           <App {...props} />
       </Provider>, node);
   }
              Â
               public setScale_To_20000()
               {
                               // I donât khnow how to call _setScale_
function
                               return 'Ok';
               }
}
Index.html
var el = document.getElementById("map");
           var viewer = new MapGuide.Application();
           viewer.mount(el, {
               layout: "ajax-viewer",
               externalBaseLayers: [
                   { name: "OpenStreetMap", kind:
"OSM" },
               ],
               agent: {
                   uri: "../mapagent/mapagent.fcgi"
               }
           });
*viewer**. setScale_To_20000();*
* *
* *
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Adding-custom-command-in-react-layout-tp5304940.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
I have a question about execute *setScale *command from
a function in /application.tsx/
i want to add function in /application.tsx/ to communicate
custom ui (in template) with Mapguide react
application.tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { IAppProps, App } from "../containers/app";
import { ClientKind } from "../api/common";
import { ClientContext } from "../api/client";
import configureStore from "../store/configure-store";
import { INITIAL_STATE } from "../reducers/config";
import * as MapActions from "../actions/map";
/**
 * This is the entry point to the Application component
 */
export class ApplicationViewModel {
   constructor() {
      Â
   }
   public mount(node: Element, props: IAppProps) {
       const agentConf = {
           agentUri: props.agent.uri,
           agentKind: props.agent.kind || "mapagent"
       };
       const store = configureStore({ config: { ...INITIAL_STATE,
...agentConf } });
       ReactDOM.render(<Provider store={store}>
           <App {...props} />
       </Provider>, node);
   }
              Â
               public setScale_To_20000()
               {
                               // I donât khnow how to call _setScale_
function
                               return 'Ok';
               }
}
Index.html
var el = document.getElementById("map");
           var viewer = new MapGuide.Application();
           viewer.mount(el, {
               layout: "ajax-viewer",
               externalBaseLayers: [
                   { name: "OpenStreetMap", kind:
"OSM" },
               ],
               agent: {
                   uri: "../mapagent/mapagent.fcgi"
               }
           });
*viewer**. setScale_To_20000();*
* *
* *
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Adding-custom-command-in-react-layout-tp5304940.html
Sent from the MapGuide Users mailing list archive at Nabble.com.