The main responsibility of a ESRIMapOLAPDataModel is to map data members from an OLAP data structure to the color of map regions. bar chart.
To access OLAP data for a graph, you must know the name of the OLAP host server and connect to that server with a valid username and password. To use the OLAP data in an ESRIMapOLAPDataModel, you must
The following code fragment generates a map chart that shows product sums for selected products and years on the map, with each state being colored by it's response value.
// Create strings to store an SQL query, the OLAP server name,
// and the connection port.
String OLAP_QUERY="SELECT CROSSJOIN({[GEOGRAPHY].[USREGION].MEMBERS},"
+ "{[PRODUCTLINE].[PRODUCT].MEMBERS}) ON COLUMNS,"
+ "{[TIME].[YEAR].MEMBERS} ON ROWS "
+ "FROM MYOLAPCUBE WHERE ([Measures].[ACTUAL_SUM])"; // specify valid OLAP source
String OLAP_SERVER="myOlapServer.com"; // use a valid server name
int OLAP_PORT=8800; // use a valid port
// Create an ESRIMapOLAPDataModel from an OLAPDataSet.
ESRIMapOLAPDataModel olapDataModel = null;
try {
// OLAPDataSet arguments: host, port, username, pwd, query
olapDataModel=new ESRIMapOLAPDataModel(
new OLAPDataSet(OLAP_SERVER, OLAP_PORT, "myUsername", "myPwd",
OLAP_QUERY));
} catch (Exception ex) { ex.printStackTrace(); }
// Create a ESRIMap tbean that uses the ESRIMapOLAPDataModel as its data model
OLAPESRIMapChart mapChart=new OLAPESRIMapChart();
mapChart.setDataModel(olapDataModel);