The MapAPI 1.0 is deprecated. Please use the new MapAPI 1.1.





« Previous chapter 8: Projection   Back to Index   Next chapter 10: Multi-Language Support »

Chapter 9: Security and Access Protection

If you want to make sure that you are the only one using the mapsuite services, if you want to track the use of mapsuite services for different products, or even if you want to offer the mapsuite services to your corporate customers; with the security and access protection you can manage all the tracking and the limitations in a very simple way.

9.1 The Accessfilter

The configuration file of your access filter is specified in the iwconfig.xml file, which can be found under the TOMCAT webapps directory (MapAPI-1.0/WEB-INF/classes). Change the value of the parameter accessfilter by your needs.


<parameter name="accessfilter" value="C:/Programme/Apache Software Foundation/Tomcat 5.5/conf/mapsuite.accessfilter" />

With this file you can define which domains shall have access to your services. For tracking purposes you can add a CNR (customer number) and/or a PNR (product number) optionally. Each line represents an entry. Information like CNR and PNR are seperated by commas.

If the mapsuite.accessfilter does not exists or has no entries, everyone has access to the mapsuite services!

Here a little example how an accessfilter could look like:

#
# File: mapsuite.accessfilter
#
# This is the configuration file for the mapsuite accessfilter.
# The file contains a list of comma separated values. 
# 
# Fields:
#
# 1.) referer or remotehost 	
#
# 2.) customer id 		
#
# 3.) product id
#

mydomain.de
mycustomer.de, 01
mybigcustomer.de, 02, 1
mybigcustomer2.de, 02, 2
mybigcustomer3.de, 02, 3

9.2 Setting CNR and PNR

The CNR and PNR are set by javascript. You have to use the setter methods from the IWAccessFilter class. Below you see the example from chapter 1 with CNR and PNR set.

<html>
	<head>
		<title>Mapping Example</title>
		
		<script type="text/javascript" src="http://iw.mapandroute.de/MapAPI-1.0/js/mapping.js"></script>
		
		<script type="text/javascript">
			function initialize()
			{

				var map = new IWMap(document.getElementById('divMap'));
					
				IWAccessFilter.setCNR(1);
				IWAccessFilter.setPNR(2);
				
				var coordinate = new IWCoordinate(267362, 214497);
				map.setCenter(coordinate);
			}
		</script>
		
	</head>
	<body onload="initialize();">
		<div id="divMap" style="background-color: #dddddd; width: 450px; height: 300px"></div>
	</body>
</html>

« Previous chapter 8: Projection   Back to Index   Next chapter 10: Multi-Language Support »