| ASP compatibility
You can use Mpp with ASP.
First you install it on the server then you can call the application object as any COM object.
<%option explicit %>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
dim oApp, oMap, strUID
'Instantiate your objects
Set oApp = Server.CreateObject("MapPoint.Application.eu")
set oMap = oApp.newMap
'Set up application and objects to use
oApp.Visible = False
oApp.UserControl = False
call shadedAreas
private sub shadedAreas ()' Here I import a serie of data by postcode in the UK
dim strCsvPath, objDataMap, oDs
'Change the map style to display DataMap
oApp.ActiveMap.MapStyle = 2
'CSV text file (242 is for geoCountryUnitedKingdom, 44 for geoDelimiterComma and 0 for geoImportFirstRowIsHeadings)
Set oDS = oApp.ActiveMap.DataSets.ImportData("c:\book1.csv", ,242,44,0)
'Create the data map ( 1 is for geoDataMapTypeShadedArea, for 1 geoRangeTypeContinuous and 13 for geoColorScheme)
Set objDataMap = oDS.DisplayDataMap(1, oDS.Fields(2),,,1,,13)
'obviously save the map
call SaveMap
end sub
private sub SaveMap()
Set oMap = oApp.ActiveMap
oMap.DataSets.ZoomTo
oMap.Altitude = oMap.Altitude * 1.3
'Save the map as a web page (toto is just a dummy name for the file)
oMap.SaveAs "c:\toto",2, True ' (2 is for geoFormatHTMLMap)
end sub
'Quit without saving
oApp.ActiveMap.Saved = true
oApp.Quit
%>
<title>map</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head><body>[img]file:///C|/toto_files/image_map.gif[/img]</body>
</html> |