Problem with geoshowbyzoomlevel in C#

rlisario
11-07-2007, 01:28 PM
I'm trying to use DisplayDataMap with geoshowdataby=geoshowbyzoomlevel but not work; give an error geography type

I've try same code with same import file with geoshowdataby=georegion1 or with geoshowdataby=georegion2 or with geoshowdataby=geopostal1 and it's all ok.

The file that import has name, latitude, longitude and data.

The same file imported with MapPoint Application work with zoom level

Somebody has used DisplayDataMap with geoshowdataby=geoshowbyzoomlevel ?

Thanks,
Rinaldo

Eric Frost
11-17-2007, 06:16 AM
Have you tried importing the file through the MapPoint wizard interface (not code) and choose the zoom by all levels option - does it give you that option?

Can you post a sample part of the file as an attachment here?

Eric

rlisario
11-20-2007, 02:25 AM
Dear Eric,

The strangeness that is through the MapPoint wizard interface to import the same file csv (that i've attach) is all ok.

The my code in C# is:

object[,] arrObjCampi = new object[4, 2];
arrObjCampi[0, 0] = "Nome";
arrObjCampi[0, 1] = MapPoint.GeoFieldType.geoFieldName;
arrObjCampi[1, 0] = "Latitudine";
arrObjCampi[1, 1] = MapPoint.GeoFieldType.geoFieldLatitude;
arrObjCampi[2, 0] = "Longitudine";
arrObjCampi[2, 1] = MapPoint.GeoFieldType.geoFieldLongitude;
arrObjCampi[3, 0] = "Fatturato";
arrObjCampi[3, 1] = MapPoint.GeoFieldType.geoFieldData;

m_ds1 = pMappa.ActiveMap.DataSets.ImportData(System.IO.Pat h.Combine(Application.StartupPath, "provaRivenditori2.csv"), arrObjCampi, MapPoint.GeoCountry.geoCountryItaly, MapPoint.GeoDelimiter.geoDelimiterSemicolon, 0);
object objNomeParametro = "Fatturato";
object missing = System.Type.Missing;

MapPoint.Field objParametro = m_ds1.Fields.get_Item(ref objNomeParametro);
MapPoint.DataMap dm = m_ds1.DisplayDataMap(MapPoint.GeoDataMapType.geoDa taMapTypeShadedArea, objParametro, MapPoint.GeoShowDataBy.geoShowByZoomLevel, MapPoint.GeoCombineDataBy.geoCombineByAdd, MapPoint.GeoDataRangeType.geoRangeTypeContinuous, MapPoint.GeoDataRangeOrder.geoRangeOrderDefault, 13, 0, missing, missing, missing, missing, missing);

Thanks for help,
Rinaldo

 
Web mp2kmag.com
mapforums.com