Spatialite sample data provider, Spatialite, Sample data provider – Pitney Bowes MapXtreme User Manual

Page 504

Advertising
background image

Appendix D: Extensible Data Providers

SpatiaLite Sample Data Provider

MapXtreme v7.1

511

Developer Guide

Before moving on, you should add support for the SearchByEnvelope method. This will help you get
a feel for the performance of your data provider since you now have the ability to send back to
MapXtreme only the features that it needs to render the map. You can also turn back on the InfoTip
setting and set the InfoTip expression to various values to see if you are getting the right data
passed up to MapXtreme. If your performance is unacceptable, this would be a good time to
evaluate your design and tune it before adding more complexity.

Implementing the feature accessor interface would be the next major hurdle. The easiest way to test
this interface is to create a resultset feature collection and then enumerate through the features.
Internally, the resultset feature collection caches the keys for the records that satisfy the search
criteria and then uses a feature accessor whenever the resultset is accessed.

Once you have gotten all of these pieces working you have done the largest portion of the hardest
work for building your data provider. You will most likely want to then focus on building a persistence
provider so that you can persist your definitions into a MapXtreme workspace file. This would be a
good time to look into the new WorkspaceManager extensibility capabilities and consider adding a
WorkspaceManager extension that provides some user interface for defining a table and enables
the hooks into the persistence provider extensions so you can set up and create a workspace and
also read workspaces with your data provider persistence content.

To this point, you should focus on testing your data provider in a simple desktop application
environment. Once you have persistence implemented, it would be a good time to start thinking
about a web-based deployment. This will require serialization support so that the table or the entire
catalog or session can be serialized across user requests.

SpatiaLite Sample Data Provider

Included in the Extensible Data Provider SDK is a sample implementation of a data provider that
highlights many of the capabilities of the Extensible Data Provider architecture.
MapInfo.SpatiaLite.sln is a Visual Studio solution that uses an SQLite3 Ado.Net data provider to
establish a connection to an underlying SQLite3 database and open tables in a MapXtreme
application.

This sample implementation also highlights other extensible aspects of MapXtreme, including
autoloading custom code at session initialization, and extending the capabilities of Workspace
Manager. This sample is located in the \Samples\DataProviders folder under your MapXtreme
installation directory.

L

Unlike MapXtreme’s other sample applications that compile and provide a runnable
application, this sample implementation yields .NET assemblies. The focus on the
development for this sample was to showcase extensibility options in MapXtreme rather than
a working application.

MapInfo.SpatiaLite.sln contains two projects:

SpatiaLite Data Provider

SpatiaLite Workspace Manager Extension

Advertising