Tile server basemaps for MapInfo

Ever needed a stylish basemap to display under some map data but have no idea where to look or how to even get it into MapInfo?

Well worry no more, try this:

basemaps

With the click of a button you can quickly add one of many stylish and freely available basemaps to your map.

The basemaps come from various providers in tile format which with a bit of MapBasic can be converted into TAB files. I have selected a few of my favourites from this rather large list of basemaps and added them to a handy toolbar menu.
The menu is based on the excellent dynamic XML menu example by James Moloney. This means you, the user, can easily add or remove basemaps from the menu by editing a simple XML file.

Usage:

Download, extract the zip file and run the MBX in MapInfo 10.5 or above.
You’ll now have a ‘Basemaps’ option on the toolbar, so get clicking!

The only thing you need to be aware of is there must be a folder called ‘TABs’ in the same directory as the MBX. This is where the TAB files are created so will fail if it doesn’t exist. You can take copies of or move these TABs and they will still work without this basemaps tool.

To add or remove basemaps from the menu, edit Basemaps.xml and then re-run the tool. Hopefully the structure is self explanatory.
You can find all the values you need as well as seeing a preview of each basemap here.

Any issues, leave a comment below.

Licensing:

The tool is released under the GNU GPL license so is free to copy, modify or distribute however you please.
All basemaps are free to use and should already include all the correct attribution for use in MapInfo. Please check with the individual providers if you plan to print or distribute the maps to ensure you’re not in breach of their licensing agreements.
HERE and Esri maps require registration to use, please see here for more info.

Download:

Due to changes in MapInfo 12.5, there are now 2 versions of the tool:

Includes sourcecode, compiled MBX (v9.5) and config XML file.

Includes sourcecode, compiled MBX (v12.5) and config XML file.

Known issues / limitations:

– Tile Server support was added in v10.5 of MapInfo. Therefore, while the tool may run in older versions, you will not be able to open any of the basemaps/TAB files.

– Some basemaps at certain zoom levels are pixelated. This is related to the tile height setting, the size of the MapInfo map window and the particular basemap you are using. You can modify the tile height setting in the sourcecode and recompile but I found ‘230’ seemed to give ok results for most maps. I also noticed resizing the map window seemed to improve the quality too.

– Some basemaps seem to be missing tiles at certain zoom levels. Not much can be done about this besides try a different zoom level or a different basemap.

– Some basemaps give an error at certain zoom levels. This means there are no tiles at this level. Why MapInfo returns an error while for other basemaps it simply displays no basemap, I don’t know.

– The OpenWeatherMap layers appear black. This is because MapInfo doesn’t deal with transparency unless you tell it to: Layer Properties > Style override > Transparent.

– Messy code, haha. Could do with a tidy up and more comments, but that’s what v1.1 is for.


Posted in GIS, MapBasic
  • Chris Stutz

    Cheers — this is a great tool!

    One request: would it be possible for you to add a licence for the tool itself (as opposed to the feed data, which you address under Licensing above). I’d like to recommend this to someone but they will want to know what the terms are.

    • brendan

      Thanks for the comment Chris. I’ve now added a GNU GPL license.
      Cheers

    • http://www.rsc-niapp.com Phuong Do

      Can you help create an access point to GoogleImages from MapInfo Professional, Brendan?

      Thanks a ton.

      • brendan

        Google Images or Google Maps? If maps, I believe it’s against Google Maps Terms of Use to use their map tiles in any other way than via their API. That said, there is this paid for add-on for MapInfo which claims to add GMaps, but not sure how they get around the Google’s terms/if its legal. http://mapperg.com/

        • http://www.rsc-niapp.com Phuong Do

          Googlemaps and GoogleImages are what I want to see on my MapInfo Professional. Regardless to EULA from Google, this is a technical barrier which I have not come over. The MapperG application is not what I’m looking for in this discussion, but a technical idea on how to use WMST making me mad sometimes. Please give some hints for this case Brendan.

          Thanks again.

  • John Bradford

    Hi Brendan. Nice ‘Basemaps’ add-on. Just getting used to it until we upgraded to MI 12.5. Now Basemaps for Mapinfo won’t load. MI compalins that ‘GmlXat.dll can’t be found’, with ‘Unable to link to external library’ message. Any ideas on a fix, please?

    • brendan

      Sorry, I’ve been on holiday and don’t have 12.5 on my laptop. When I’m back at work I’ll try it with 12.5 and let you know how I get on.

      • brendan

        Hi John, there were a few changes to MapInfo 12.5 which I have now accounted for in the new version of the tool. See the download link above.
        Cheers

        • John Bradford

          Cool. Thanks, Brendan. Everything seems to be in order again.

  • Ed Owen

    Hi Brendan, Really, really useful set of layers. I’ve gone into the Leaflet Provider Demo page and there are a few other layers I’d like to add to the basemaps. Ive added the additional line into the basemaps.xml to load a .png layer, but how do i create the necessary .TAB and .XML in my TileserverTABs folder?

    • brendan

      Thanks, I’m glad you’re finding it useful. Once you have successfully added the details to the basemaps.XML file, the next time you load the tool the new basemap should appear in the menu. The first time you select this basemap it will create the relevant TAB and XML files automatically. If it doesn’t show up in the menu then there is an error in the XML file. Usually related to special characters.
      Hope that helps.

  • scott

    Hi Brendan,

    Really usefull tool, i have been using it extensively, PB should have built this long ago.

    Is it possible for a user to build the mbx to connect to a local tile cache like C:OSMtileslevelfolderfolder because i have built a .htm which is good for use in a browser but i want users to be able to use it in MI.
    Best Regards

    • brendan

      Hi Scott,
      In theory it’s already possible with the existing MBX but it depends how your tilecache was generated.

      Firstly, the tiles will need to be served locally via http and accessible to your users.

      Secondly, the tile cache will need to be generated with the correct parameters (e.g EPSG:3785). Since you’re using OSM you’re might be ok as it’s probably already in EPSG:3785.

      To try it, add or edit an existing entry in the basemaps.xml file:
      URL=”http://YOUR_SERVER_IP/OSM/tiles/{z}/{x}/{y}.png”

      Hope that helps,

      Brendan

  • Nav On

    Hi, is still available this tool for download? In can’t find the link. Many thanks!

    • brendan

      Sorry, WordPress had an upgrade which broke the links, they are fixed now.
      Thanks for bringing it to my attention.

      • Nav On

        Thank you for your quickly answer and many thanks for that great tool!

  • http://www.rsc-niapp.com Phuong Do

    I’m not successful adding HERE image and HERE street map into MapInfo Pro 12.5. Anybody please help? Thank you very much.

    ———-
    Please see the code in XML :

    ——

    It always says “could not load XML…” when I tried to load the application (MBX) file into MapInfo Pro.

    • brendan

      Hi, sorry I missed your comment.

      If it’s not loading the XML then I suspect there is an error in the XML file or that it doesn’t like some of the special characters used in the URLs. e.g ©

      Try removing all the non essential parts and see if that helps.

  • Douglas Sherrard

    First and foremost, awesome extension. Thank you for taking time to develop and share this.

    I do have a question regarding the experience I receive with the extension. Everything works fine when I download it and start mapping. I have trouble when I shut down my computer and try to come back to the same map the next day. It throws an error and wont load the workspace. From there I close out mapinfo, redownload the zip file from your blog, open a blank workspace and rerun the MBX. After that it works fine until I restart my computer and then I have to do it all over again.

    Any suggestions as to what I might be doing wrong? Any knowledge or information you can provide is much appreciated.

    • brendan

      Thanks for your comment.
      What is the error message you’re getting? I’m guessing it can’t find the .TAB which was previously generated. Are you running the MBX from a temporary location? I suspect the TAB is being deleted when you restart the machine. Try unzipping to a permanent location and running from there.

      Failing that, you should be able to save a copy of the TAB you need to a separate location and then use that in your workspace.

      • Douglas Sherrard

        On the ball, Brendan. I don’t even get that kind of turn around from our in-house IT help desk.

        Your suspect is correct. It does delete the TAB. I have saved the files under “My Documents” in a “MapInfo_Basemap” folder I created. So after I start MapInfo I think double-click the MBX.

        Any suggestions on where would be a better more “permanent” location?

        Thank you for the assistance good sir.

        • brendan

          haha, you’re welcome.
          Anywhere will do, I usually go with something like C:MapinfoTools
          Just make sure you fully extract the zip file and not run the MBX from the zip as that will extract it to the ‘Temp’ folder.

  • Obet Laurel

    thanks men! it is very a useful tool

  • Mark Strong

    Not working on my version of MI 12.5 (64 bit). Clicking on “about” it tells me aI have v1.01 even though I definitely downloaded it form the lower tab.

    • Mark Strong

      Ah. Seems it works in anywhere OTHER than the MI tools folder…

      • brendan

        Hi Mark,
        If it works in other locations it’s probably a permissions issue with the MI tools folder. When you load a basemap from the menu it writes a TAB file to the location where the MBX is stored so perhaps this is where it failing.

        As for the version number, that’s probably just because I forgot to update it rather than you having the wrong version (the 10.5-12 version would fail to even load in 12.5… i think – been a while since I’ve used this tool)

  • Isireli Buwawa

    Works fine on MapInfo 12.5 (64bit). Many thanks.

  • Sleet

    Many thanks ,but I have a problem to load the URL of the google map into the XML ,such as “http://mt0.google.cn/vt/x={x}&y={y}&z={z}”.There is an error

    • brendan

      I think Google uses a different tile number scheme so that could be the problem. What is the error message?

      • Sleet

        Thank you for your attention .The error is that “This could be because the file contains invalid xml “. but In your basemaps .xml there is an url like that “http://korona.geog.uni-heidelberg.de//tiles/adminb/x={x}&y={y}&z={z}” which can be loaded .So what is the difference between them ?Please help me debug that that google’s url .I am very confused ,I am looking forward to your replying .

        • brendan

          If you post your full XML file it might help to debug. But like I said, I think Google uses a different scheme so I’m not sure it will even work anyway.

          • Sleet

            So is there any other way to load online google map into MI,Javascript or Html ? Could you help me ?

          • brendan

            It’s against Google’s T&C to use their tiles outside of the Google Maps API so I guess most people don’t bother since there are plenty of alternative basemaps available.

    • ukandy24

      Been trying the same thing – for XML you need to substitute & to & giving you something like this http://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z} You also need to change the coordinate system to “CoordSys Earth Projection 1, 104″ in the TAB file it creates. However I’m still getting an error when I try to load that TAB into mapinfo saying “An error occurred loading a Tile Server table: The remote server returned an error: (403) Forbidden. Unable to establish connection to Tile Server mt.google.com. Unable to open table Google_Maps.”

  • Kyriakos Galanis

    Hi Brendan. Thanks for the very nice tool!

  • Rob Sowerby

    Hi. I’m a basic Mapinfo user, so not a guru. Have installed Basemaps. Worked a treat first time. Next time I opened Mapinfo, got this error – “Cannot Create Tab file , Ensure “pathname”TABSexists and try again.” TABS file is there. Tried re-booting, re-installed Basmaps etc. Seems odd since nothing changed between first use and second use.
    Cheers
    Rob