Set Active Tool on start up
I would like the identify point tool to be active when the user opens the application. According to (https://support.geocortex.com/SupportForums/Thread.aspx?pageid=0&mid=2&ItemID=9&thread=55318) https://support.geocortex.com/SupportForums/Thread.aspx?pageid=0&mid=2&ItemID=9&thread=55318 you have the following 2 options. It seems like Option #1 would be the corrent way. That way a user can turn off that tool and still have maptips available. Are there other options available to "SetActiveTool" at start up??
Option #1
Activates the tool on the toolbar but nothing happens when clicking. Is the map still looking to "InvokeMapTip" if any map layer has the "Show Map Tips" enabled?
viewer.eventRegistry.event("SiteInitializedEvent").subscribe(this, function () {
// If the splash duration has elapsed already, dismiss the splash screen.
if (!splashDuration) {
dismissSplashScreen();
}
siteInitialized = true;
if(document.URL.indexOf("ChartingTest")>0){ <----- add the following in the index.html
viewer.commandRegistry.command("SetActiveTool").execute("PointIdentifyTool-Analysis");
}
});
Option #2
Works but then if you happen to have "Show Map Tips" enabled, it seems like the Map Tips are lost.
Modify the Desktop.json.js, Handheld.json.js and Tablet.json.js files
Find the map module ("moduleName" : "Map") and change the "onClick" setting. Change this from "onClick" : "InvokeMapTip", to "onClick" : "Identify",.
Please sign in to leave a comment.
Comments
0 comments