How to Use a Custom Module to run an existing tool: Identify By Rectangle
For our mobile clients (handheld.json.js), we wanted to have the ability to simply select a button on the UI that would perform the “Identify by Rectangle” that is in the “I Want To” menu. To get familiar with how this could be done I started with the QuickStart sample (TemplateModule which creates Custom.js) and then moved on to the more robust HelloWorldMVVM HTML5 SDK sample. I also took a look at “Commands and Events” sample but felt I did not need this complexity as I was not registering a new command / tool.
The MVVM example clearly shows how to display a string that is set in the configuration file *.json.js. I really wanted to use the compiled Custom.js to create a button on the HTML and then listen to the click event and bind this to an existing command, Identify, that is already compiled and registered in the HTML5 viewer through the configuration handheld.json.js.
I have attached a zip file TemplateModule.zip with the files (TemplateModule.css, TemplateModule.js, TemplateModuleView.html, TemplateModuleView.js, and TemplateModuleViewModel.js) as well as my current Handheld.json.js. I have successfully been compiling the custom TemplateModule code into the a file named Custom.js that I think copy into the Resources>Compiled folder. I am using an observable named ‘identifyByRect’ in the TemplateModule and configuration files.
(https://support.geocortex.com/Data/Sites/1/userfiles/3341/templatemodule.zip) /Data/Sites/1/userfiles/3341/templatemodule.zip
Thanks,
Reily Love
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
0 Kommentare