edmistj
11-10-2003, 02:02 PM
Can someone give me some guidance on how to get MapPoint running on a webpage using ActiveX. I'm using the html below and I just get a blank box.
<HTML>
<HEAD>
<TITLE>New Page</TITLE>
</HEAD>
<BODY>
<OBJECT ID="MappointControl1" WIDTH=665 HEIGHT=533
CLASSID="CLSID:8F78D7FC-BAE4-46A4-A79A-052356AB3DD4">
<PARAM NAME="BorderStyle" VALUE="0">
<PARAM NAME="MousePointer" VALUE="0">
<PARAM NAME="TabStop" VALUE="-1">
<PARAM NAME="Appearance" VALUE="1">
<PARAM NAME="PaneState" VALUE="3">
<PARAM NAME="UnitsOfMeasure" VALUE="0">
</OBJECT>
</BODY>
</HTML>
calhoun
11-12-2003, 03:02 PM
I don't believe that this is officially supported by Microsoft. In fact, if you deploy a webpage, you may want to carefully review the licensing for MapPoint to see if what you are doing is legal. That being said, I have done some MapPoint stuff via ASP and JavaScript.
You need to initialize the mappoint control. After declaring it on the page with the <object> tag, you just have declared a container for the control. Try the following function:
<script language="JavaScript">
function initializeMappointControl() {
// This function initializes the mappoint control with North America map
MappointControl.NewMap(1);
}
</script>
Then you need to call that function somewhere in the body of your html (for example, after the closing </object> tag) You can handle all sorts of events from the control, add points, whatever, but I was never able to get rid of a warning that appears in IE when accessing the page. Let me know how that works for you.
HTH
calhoun
Anonymous
06-25-2004, 05:39 AM
Hi edmistj,
I tried to do the same what you tell, but I haven't can do it. Putting your code in a normal html page, you don't get to load the activex control, furthermore, the javascrit code of calhoun, it isn't be able to load mappoint due to the container never arrive to load.
Has you get to integrate Mappoint in a webpage using activex? I really haven't can, and I would like to can do it.
Thanks in advance. Regards,
Raymond
Anonymous
09-23-2004, 05:02 PM
This code works, be sure the MappointController.ocx is in the system32 folder and the ocx is registered using Regsvr32.
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<title>Test MapPoint</title>
<SCRIPT LANGUAGE="JavaScript">
function initMap()
{
MappointControl1.NewMap( 1 );
}
</SCRIPT>
</head>
<body lang=EN-US>
Test MapPoint</p>
</p>
<object classid="CLSID:8F78D7FC-BAE4-46A4-A79A-052356AB3DD4"
id=MappointControl1 width=192 height=192>
<param name=BorderStyle value=0>
<param name=MousePointer value=0>
<param name=TabStop value=-1>
<param name=Appearance value=1>
<param name=PaneState value=3>
<param name=UnitsOfMeasure value=0>
</object>
</p>
<SCRIPT>
initMap();
</SCRIPT>
</body>
</html>