On this page you will find some MapBasic tools, both the program source and the compiled application. Everything on this page is offered "as is" without warranty of any kind, either expressed or implied, including limitation warranties of merchantability, fitness for a particular purpose, and noninfringement.
MapBasic 9.0 has been used to compile the files - this means that the MBXs offered here will only run with MapInfo Professional 9.0 or higher. If you want to use the tools with another (an older) version of MapInfo Professional, you will have to compile the tool using the relevant version of the Mapbasic compiler.
The following tools are available here:
This little application will give you two menus with menu entries for each of the ToolButtons in the Drawing and Main toolbars in MapInfo Professional.
In the menus mnemonics are used. What is a mnemonic? A mnemonic is an underlined letter in a menu or labeled dialog control that indicates to a user a quick, keyboard method of simulating a click on that element.
This has the advantage that you can use keystrokes to activate a tool: i.e. instead of clicking the Select Button, you can use the keystroke Alt+I+S. And to start to draw a polyline you can use Alt+D+P. With these mnemonics you can enhance your productivity, e.g. when you have to switch very often between Select and Drawing Tools.
The tool has been tested with MapInfo Professional 9.0 and 9.5, and it does not interfere with any of the default mnemonics in the MAPINFOW.MNU. But please be sure to check with any other tools and applications you might be using on top of MapInfo Professional. (If necessary, you can always modify a mnemonic - the source code is provided here.)
|Please see the file below for Mnemonics.mb and Mnemonics.MBX:
Below you will find the list of keystrokes as defined in this tool:
|Drag Map Window||Alt+I+D|
Please note: for zooming and panning in your Map Window default shortcuts are available in MapInfo Professional:
|ZOOMING AND PANNING|
|Zoom-in||+||Apart from the + and the - and the arrow keys on your keyboard you can also use the mouse wheel for zooming and panning. (To pan: hold down the middle mouse button (the mouse wheel) and move the mouse.)||Zoom-out||-||Grabber||←↑↓→|
|With MapInfo2Leaflet you can export a MapInfo table to a web map application using Leaflet - the output consists of an html file, a json file (containing a GeoJSON FeatureCollection) and css files for the styling.
Optionally you can export a thematic layer to color the geometry based on attribute data.
More information about Leaflet can be found here: http://leafletjs.com/
With a few mouse clicks you can export your MapInfo table to a web map application.
Please see the file below for the application and the source code:
MapInfo2Leaflet User Guide.pdf
FR_Airports.html: point data with a tooltip with a hyperlink
FR_Departements2006.html: region data with a tooltip with column titles
Railways.html: line data with thematic coloring
NL_Municipalities2010_Pop_Density.html: region data with thematic coloring (Interactive Choropleth Map)
NL_Municipalities2010_Provinces.html: region data with thematic coloring (individual values)
kernnet_meter.html: point data with thematic coloring
This version is compatible with the 'classic' 32 bit version of MapInfo Professional, 9.5 or higher (because it uses some .NET capabilities)
|The MapSearch function allows you to search for objects in the current Map window, based on values in a given column in a table (e.g. a municipality by it's name).
MapSearch offers functionality comparable to the existing Find function in MapInfo Professional.
First you will need to specify (or respecify) the table and column to search.
Then a dialog will appear where you can enter a value (e.g. a part of the municipality name).
The list with possible results will be updated while you type.
After selecting a value and clicking OK the object(s) found will be highlighted (selected) and the Map window will zoom in to them.
The MapSearch button and the MapSearch menu item (in the Query menu) will only be enabled when the front window is a map window.
Please see the file below for the application (MapSearch.MBX, MSearch.dll and MSearchDialog.dll) and the source code (MapSearch.MB and MSearchDialog.cs):
This application is compatible with MapInfo Professional 9.5 and higher (because it uses some .NET capabilities)
The C# source code is included. You can compile the file using the Visual C# 2008 Compiler:
csc /t:library MSearchDialog.cs
(No Visual Studio needed :-)
|The Mask application allows you to create a translucent mask around one or more region objects.
Select one or more region objects - either by clicking in the map window or by using a query.
The Mask button and the Mask menu item (in the Map menu) will only be enabled in the following circumstances:
A dialog appears, allowing you to:
Please see the file below for Mask.MB, Mask.MBX and Mask.dll:
This application is compatible with MapInfo Professional 9.5 and higher
(The support of vector translucency has been introduced in MapBasic 9.5)
The tool Query Date and Time (QDateTime.MBX) will add 2 functions to the Query menu:
|Select by Date||Alt+Q+T+S|
|The function 'Select by Date' offers a dialog to select records by date: before, after or between certain dates (as stored in a Date or DateTime column).
If querying a DateTime column the time can also be taken into consideration.
|Select using Date Functions||Alt+Q+T+T|
The function 'Select using Date Functions' offers a dialog to query Date and/or DateTime columns using the following functions:
The syntax of the resulting queries will be printed to the Message window, e.g.:
Select * From Calendar Where Date >= "20120828" AND Date <= "20130218" into Last_changes
Select * From Calendar Where Day(Date) in (29) And Month(Date) in (2) into Leap_days
The tool can be found in the zip file below.
To be able to run the tool in MapInfo Professional you will need these 3 files: QDateTime.MBX, MBExtensions.dll and DTIcons.dll.
The source code of the tool is also included in the zip file: MBExtensions.cs, QDateFunctions.mb, QDates.mb, QDateTime.def, QDateTime.mbp, QDateTimeShared.mb and QDateTimeUI.mb
After running the tool the function appears in MapInfo Professional under Query>Query Date and Time
This tool will only run on MapInfo Professional 9.5 and higher (because it uses some .NET capabilities)
Background information on the C# methods used in this tool can be found here
|This little tool - called Omen.MBX - provides some Reverse Geocoding functionality for MapInfo Professional.
By activating the tool Reverse Geocoding you can lookup an address by clicking in the Map Window, regardless of any open tables.
The results are stored in the the table ReverseGeocoding.TAB. (This table will be created automatically.)
The address is obtained via a request to Nominatim: http://nominatim.openstreetmap.org
This sample request will retrieve the details of the Centre Pompidou in Paris.
Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright
A .Net Assembly is being used to process the Nominatim request. The source code - both MapBasic (*.mb) and C# (*.cs) - is included in the download file.
Please see the file below for Omen.mb, Omen.MBX, Omen.dll, OSMNominatim.cs and OSMNominatim.dll:
|Save Table As||Alt+F+E|
|This application adds a 'Save Table As...' option to MapInfo Professional.
This option is accessible via the File (and the Tools) menu, the Standard toolbar and the Table List context menu.
'Save Table As' allows you to save a table with a new name (and location). After saving the new table, the original table will be closed and the new table will be opened.
Please see the file below for FileSaveAs.mb, FileSaveAs.MBX and FileSaveAs.dll:
|With Sort you can sort your MapInfo table by up to 3 columns, in ascending or descending order. You can choose to display the query results in a Browser window or to save the sorted table by overwriting the existing table. And there is an option to show the syntax of the SQL statement in a Message window.
There are more sorting tools to be found on the net. This is my version;-)
|Please see the file below for Sort.MB, Sort.MBX and Sort.dll:|
|This tool does not do anything special. It just adds a Toolbar with buttons for 2 already existing functions: VIEW ENTIRE LAYER and PREVIOUS VIEW.
This example is mainly offered to show how to add custom icons to your own MapBasic application. The icons used are stored in a Dynamic Link Library: ZoomButtons.dll. This DLL has been created with Pelles C (Version 5).
If you want to know more about adding custom icons to your own MapBasic app, please have a look here.
|Please see the file below for ZoomButtons.mb, ZoomButtons.MBX and ZoomButtons.dll:|
More tools will follow...;-)