public void TrackCars(AxMap axMap1, string dataPath) { if (!InitMap(axMap1, dataPath)) { return; } string filename = dataPath + "path.shp"; if (!File.Exists(filename)) { MessageBox.Show("Path.shp wasn't found: " + dataPath); return; } int handle = axMap1.AddLayerFromFilename(filename, tkFileOpenStrategy.fosAutoDetect, false); var sf = axMap1.get_Shapefile(handle); var service = new CarService(axMap1.Extents as Extents, sf, 20); _carShapefile = CreateCarShapefile(service); _carShapefile.Volatile = true; _carShapefile.CollisionMode = tkCollisionMode.AllowCollisions; axMap1.AddLayer(_carShapefile, true); axMap1.ZoomToLayer(handle); service.StateChanged += ServiceStateChanged; }
public int AddFromFilename(string filename, FileOpenStrategy openStrategy = FileOpenStrategy.AutoDetect, bool visible = true) { return(_axMap.AddLayerFromFilename(filename, (tkFileOpenStrategy)openStrategy, visible)); }