TrueNorth Geospatial
Mapping software for backcountry enthusiasts and professionals
  • Features
    • Requirements
    • Layers
    • Data Neutral
      • File Formats
      • Web Formats
      • Databases
    • User Interface
    • GPS & Devices
  • Support
    • Forum
    • Mailing List
    • Updates
    • Privacy Policy
    • Terms of Service
    • Contact Us
  • Download
  • Blog
    • Articles
    • Development
  • Screenshots

Scripting Support

25/06/2012|Development Blog2
Home » Content » Posts » Development Blog » Scripting Support

Another post for the really hard core users out there.

Developers can never fully predict what their users are going to need, but we can figure out a way to let users solve their own problems. One of the ways we do that is by adding extensibility to the product, and one great way to extend any product is through scripting.

The scripting feature in TrueNorth has just been added!

Scripting in TrueNorth is done through coding in C#. The underlying product is written in C#, so it’s very easy to read, compile, and execute a file or several files of code. An example of a script written for TrueNorth is below; it loads, writes out the parameters, prompts the user for a file, and loads it.

The “Controller” object is how the script accesses the functionality of TrueNorth. The Controller contains all of the functionality of TrueNorth, including loading and saving all file formats, drawing, printing, panning, zooming, and examining the maps, layers and features that are currently loaded.

Expect more news on this feature in the future as we develop the documentation.

using System;
using System.Windows.Forms;
using TrueNorth.Script;

namespace TrueNorth.ScriptTest
{
    public class Script : ScriptBase
    {
        public override int Execute(string[] args)
        {
            foreach (var arg in args)
                Console.WriteLine(arg);

            if (this.Controller!=null)
                Console.WriteLine("The controller looks OK");

            try
            {
                OpenFileDialog ofd = new OpenFileDialog()
                {
                    Title = "Open File"
                };

                if (ofd.ShowDialog(this.Form) != DialogResult.OK)
                    Console.WriteLine("Script cancelled");

                Controller.OpenFile(ofd.FileName);
                Console.WriteLine("Script finished");
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Error:\r\n{0}", ex));
            }

            return 1;
        }
    }
}
28/12/2012 TrueNorth
← Map Sharing
Alpha Screenshot: ArcGIS tile layer →

2 Responses to Scripting Support

  • Planning an 1800 km backcountry trip |TrueNorth Geospatial 03/04/2013

    […] the map footprints were placed, we wrote a script to iterate through them, and print reports for each one, exporting it to PDF. The PDFs were […]

  • Planning an 1800 km backcountry trip - TrueNorth Geospatial 28/10/2013

    […] the map footprints were placed, we wrote a script to iterate through them, and print reports for each one, exporting it to PDF. The PDFs were […]

Related Posts

  • In Beta
    In Beta 30/01/2013
  • Alpha Screenshot: Updated map styling
    Alpha Screenshot: Updated map styling 28/12/2012
  • Locally cached WMS tiles
    Locally cached WMS tiles 27/12/2012
  • Stamen Designs OSM Tiles
    Stamen Designs OSM Tiles 12/12/2012

Popular Posts

  • In Beta
    In Beta 30/01/2013
  • Alpha Screenshot: The Joffre Group
    Alpha Screenshot: The Joffre Group 17/02/2012
  • Raster versus Vector
    Raster versus Vector 14/10/2011
  • Case Study: Paddling in Kenai Fjords National Park
    Case Study: Paddling in Kenai Fjords National Park 01/07/2016

Recent Posts

  • Case Study: Paddling in Kenai Fjords National Park
    Case Study: Paddling in Kenai Fjords National Park 01/07/2016
  • Garmin GPS Maps support
    Garmin GPS Maps support 04/11/2015
  • Disaster Mapping: Mud Creek Washout
    Disaster Mapping: Mud Creek Washout 05/07/2014
  • TrueNorth Beta Release
    TrueNorth Beta Release 29/04/2014

Portfolio

  • Ribbon UI

    A screenshot showing an early iteration of the new user interface. The area is G...

  • Local Maps

    The Joffre Group, rendered using data from the CanVec 1:50,000 data set and the...

  • OpenStreetMap layer

    OpenStreetMap layer in TrueNorth; the OSM layer is implemented as a tile layer....

  • Google Satellite layer

    Google “Satellite” (air photo) tiles as a layer in TrueNorth. Notice...

Twitter

Follow Us

Follow Us on FacebookFollow Us on LinkedInFollow Us on RSSFollow Us on TwitterFollow Us on YouTube
  • About
  • Privacy Policy
  • Terms of Service
  • Contact
Copyright © 2013 BlueToque Software, All Rights Reserved