Problem: Getting StreetMap to work with MapObjects 2.x
This document provides troubleshooting steps that you can use if you find that the StreetMap data and extension will not work with your copy of MapObjects 2.1.
If you have not already done so, please check section 2.3 of the "ReadMeMO21.doc" file included during your installation of MapObjects for information on how to purchase a StreetMap license keycode. If you have purchased and are using this code, and are still having trouble using StreetMap, the suggestions in the Solution section below may help.
There are potentially many reasons why the StreetMap extension might not work properly. See the Solution section below for more information.
Solution or Workaround
The following steps are in no particular order. Review them first to see if any of them apply to you. If you are not sure, then you should try them all until StreetMap works.
Ensure that you are using the final release of MapObjects 2.1. Search your local drives to find all copies of MO20.OCX. The copy found in the C:\Program Files\Common Files\ESRI folder is the development copy. Right-click that MO20.OCX file, select Properties from the popup menu, then select the Version tab to check the version number of the OCX file. The version listed should be 188.8.131.52 or higher.
If you have more than one MO20.OCX file on your local drives, register the development copy of MO20.OCX found in the C:\Program Files\Common Files\ESRI folder. There are several ways to do this. You may be able to right-click on the MO20.OCX file and select Register from the popup menu. Another method is to run the command line below, either from the Command Prompt or from the Windows Start button's Run dialog. Check the path to the "regsvr32.exe" file, and check the path to the 184.108.40.206 version of MO20.OCX before running this command line:
Look in C:\Program Files\Common Files\ESRI for the Street20.DLL file. By default, StreetMap support is not installed during MapObjects 2.1 setup. If this DLL is not present, you will need to run the MapObjects 2.1 setup again. When you get to the Select Components portion of the setup wizard, uncheck everything and then check the Additional Data Formats box. Next, click the Data Formats button, uncheck everything and then check the StreetMap Layer Support box. Continue running setup, and reboot when prompted. Try to use StreetMap again after the machine has restarted.
Another way to ensure that the proper versions of MO20.OCX and Street20.DLL are installed and registered is to run the MapObjects Runtime executable. Here is an example of the command line and switches to run this. The /E switch is the argument to install and register the Street20.DLL which is required for StreetMap to work with MapObjects 2.1. Check your path to MO21rt.EXE, and change the command line below accordingly. Here is an example:
During your programming of MapObjects in your development environment, check to ensure that the keycode string used with the EnableStreetMap method is correct. Example:
Code: ' (The following line is Visual Basic syntax. ' Syntax may need slight adjustment for other ' development environs.) Map1.EnableStreetMap "ABC123"
Replace "ABC123" with the keycode you purchased. See section 2.3 of the "ReadMeMO21.doc" file for more information on how to purchase this license. The keycode is not listed anywhere in the MapObjects nor StreetMap package. The only way to obtain a valid keycode is to contact ESRI according to the instructions given in the "ReadMeMO21.doc".
Check the string written into the DataConnection's Database property. It must start with "[StreetMap]" (including the brackets). This should be immediately followed by a string which gives the full path to the directory containing the EDG file. This path string can be hardcoded as shown in the example below, or it can be taken from a variable.
Code: ' (The following line is Visual Basic syntax. ' Syntax may need slight adjustment for other ' development environs.) dcStreets.Database = "[StreetMap]E:\Data\Streets"
If the EDG files have been moved to a local hard drive or network location, ensure that the DataConnection's Database property has been adjusted accordingly, directory permissions are open, and mapped drives are set up if network drives are used.
Use Windows Explorer to browse the path specified for the Database property. Check to make sure that the EDG files are present in the appropriate folder.
Only certain versions of the StreetMap data will work with MapObjects 2.1. Find CD #7 of the "ESRI Data & Maps Media Kit" package, which comes in the MapObjects 2.1 box. This CD is labeled "7 - ArcGIS StreetMap USA", and it contains the correct version for use with MapObjects 2.1. Alternatively, if you own a copy of the StreetMap extension for ArcView GIS, and you have a data CD which is labeled "for StreetMap" and "Version 1.1", that CD should work as well. No other versions of StreetMap data CDs will work with MapObjects 2.1, only the two listed above.
After checking the points covered in items 1-9 above, try the included VisualBasic sample: <MapObjects 2.1 Install Dir>\samples\Vb\StreetMap\StreetMap.vbp. The code for the sample needs to be edited to work properly. In particular, the EnableStreetMap string code and the data path string must be changed as appropriate. Read the comments in the code carefully and follow the directions.
Here is a smaller, simpler VisualBasic sample to try. It is from the help topic titled, "How to add a StreetMap EDG File as a MapLayer".
Code: Option Explicit
Private Sub Form_Load() ' ' Enable the StreetMap extension. ' Map1.EnableStreetMap "YOUR_CODE_HERE" ' ' Create the MapLayer. ' Dim pLayer As New MapObjects2.MapLayer Dim pDConn As New MapObjects2.DataConnection pDConn.Database = "[StreetMap]E:\Data\Streets" ' <- YOUR PATH HERE If Not pDConn.Connect Then End ' ' Display streets for Washington DC only ' pLayer.GeoDataset = pDConn.FindGeoDataset("dc") If pLayer.Valid Then If Not Map1.Layers.Add(pLayer) Then MsgBox "Failed to add layer" End If End If End Sub