How to add the what3words Java API for GE Smallworld
This guide describes how to use what3words Java API for GE Smallworld. GE has a long and successful track record in utilities. It has similar capabilities to most GIS software. Because it specialises in network infrastructure, you get value-added tools specifically for networking.
GE Smallworld is completely written in Magik. Magik is an object-oriented programming language and can be stand-alone applications on their own. The what3words Java API module uses the Magik-Java Interoperability, a supported mechanism to call code written in Java™ from GE Smallworld. This provides an efficient way of exposing Java to Magik, allowing access to exist Java code and third-party libraries written in Java.
Your project could be separated into two parts, the Java module part which is used to implement the what3words class and the Magik part where the plugin is implemented. The Java class is available here.
This module has been tested on Smallworld 5.1.9.
What can you do with what3words Java API for GE Smallworld
- Users can select different languages on the toolbar;
- Users can search what3words address on the toolbar;
- Users can use the autosuggestion functionality on the search bar to find the right what3words address;
- Users can convert a what3words address typed on the search bar to a point feature on the map (convert to coordinate);
- Users can tap on the map to get any what3words address (convert to what3words address);
- Users can copy the what3words address from the pop-up displayed on the map;
- Users can display the what3words address on the selection status bar pane at the bottom of the map;
- Users can use the backward or forward buttons on the what3word toolbar to search for a what3words selection.
To install this plugin, make sure you follow these steps:
1. Copy these files in their specified directories:
swj_magik_what3words_modulein Magik_Module folder to the
- copy contents of the “
Final Jar Files, Exported from Java Project” folder’s Jar files to
2. Type this command on the command line:
3. Compile the modules;
4. Add this code to the
config.xml of the Application;
<plugin name="what3words_plugin" class_name="what3words_plugin"> <properties> <property name="api_key" value="Your_API_KEY" /> <property name="language" value="en" /> <property name="maximum_number_of_auto_suggestions" value="10" /> <property name="clip_to_country" value="GB,FR" /> <property name="use_floating_info_window" value="true" /> </properties> <export> <toolbar source_name="what3words"/> </export> </plugin>
5. Copy the what3words API key from your what3words account and paste it in the
6. Add this code to the
gui.xml of the Application:
<dock name="top"> <toolbar name="what3words"/> </dock>
The what3words toolbar would be displayed on the GE Smallworld platform.
Select different languages on the toolbar
The what3words application is available in multiple languages. Users can choose their language from the dropdown menu, as it is shown here.
Search what3words on the search bar
Users can search what3words address on the search bar. On the toolbar, the backward and forward buttons allow users to easily navigate the what3words addresses that have been searched on the search bar.
Autosuggestion of 3 word addresses
When users type a 3 word address on the search bar that may be incorrectly entered, the what3words autosuggestion functionality will return a list of potential correct 3 word addresses. The user will need to enter the first two words plus at least the first character of the third word to get the list of suggestions, e.g.
filled.count.s . This method provides corrections for mistyped words (including plural vs singular), and words being in the wrong order. When a user is happy with the selection of the what3words address, it can click the green play button next to it to display it on the map.
Convert a 3 word address to coordinates
Users can convert a what3words address, e.g.
filled.count.soap, to a position, expressed as coordinates of latitude and longitude. It will be displayed as a pop-up message on the map with the what3words address. A Copy button, next to the what3words address, is available to easily copy the what3words address.
Note: The what3words address is visible on the selection status bar pane located at the bottom of the map.
Convert coordinates to a 3 word address
Users can tap anywhere on the map to retrieve a what3words address. It will be displayed as a popup message on the map. Any coordinates on the map (expressed as latitude and longitude) get converted on the fly to a what3words address.