Depending on your organization's requirements, you may need to create your own custom
tile caching mechanism. For example, the built-in tile caching mechanism included
with the Spatial Module caches tiles on the file system. If instead
you want to cache your tiles in a database, you will need to create your own custom
tile caching mechanism.
To create your own tile caching mechanism, use the following steps:
-
Create a Java class that implements the following interface:
com.mapinfo.midev.service.maptiling.cache.ITileCache
Note: Your implementing class must contain a default (no arguments)
constructor.
The ITileCache interface class is packaged in this JAR
file:
Spectrum_install_dir/server/modules/spatial/lib/midev-service-maptiling-1.3.0.jar
For information about each of the ITileCache methods you
will need to implement, see the ITileCache Javadoc file
located here:
Spectrum_install_dir/server/modules/spatial/javadoc
-
Package your implementing class into a JAR file, and place a copy of the JAR
file in this directory:
Spectrum_install_dir/server/modules/spatial/lib
-
Add the
maptiling.tilecache.class
key and full qualified class name as its value in the Management Console.
-
Open the Management Console.
-
From the Resources menu, select Spatial.
-
Expand the Java Properties list.
-
Click the Add Property button and Scroll to the bottom of the list to the new property entry.
-
In the Name field, type
maptiling.tilecache.class
and in the Value field type the full qualified class name.
-
Scroll to the top of the screen and click Save.
-
Pull the named configuration file for the Map Tiling Service
(MapTilingConfiguration.xml) out of the repository using
your preferred WebDAV tool.
The default location of the MapTilingConfiguration.xml
file in the repository is:
http://<server>:<port>/RepositoryService/repository/default/Configuration
-
Using a text editor, add any initialization settings for the cache to the
MapTilingConfiguration.xml named configuration file.
Each initialization setting is added to a <Property>
element that is a child of the <Cache> element in the
configuration file. Each <Property> element has a
name attribute and a value
attribute which holds the name and value of the initialization setting.
-
Re-add the named configuration file back into the repository using your WebDAV
tool.
The Map Tiling Service will now use your custom tile caching mechanism to cache the
map tiles.