Picard Master


Registrado: 18 Ene 2004Mensajes: 218Ubicación: Palamos (Girona) España
|
Publicado: Mar 26 Oct, 2004 11:44 am Asunto: añadir una capa a un TMap |
|
|
Hola, he encontrado otro componente que seguramente sera el que utilizare, ya que es mas economico y me permite leer mas formatos que MapX,ahora el problema es el siguiente:el componente es para bcb pero esta hecho en delphi y los ejemplos de las ayuda estan en pascal.por ejemplo para añadir una capa seria asi:
| Código: |
procedure MyClass.AddLayer ();
var
myExtent : TGIS_Extent;
shpType : TGIS_ShapeType;
myLayer : TGIS_LayerSHP;
layerName : String;
layerPath : String;
layerFullName : String;
begin
// Set the extent of the new layer
myExtent:=GIS.Extent;
// Set type of the shape
shpType:=gisShapeTypePolygon;
// Set a name for a layer to be created.
layerPath:=ExtractFilePath(Application.ExeName);
layerName:='Layer_'+IntToStr(GIS.Items.Count+1)+'.shp';
layerFullName:=layerPath + layerName;
// Create a new layer.
myLayer:=TGIS_LayerSHP.Create ;
// Build layer file and set the layer path and name.
myLayer.Build (layerFullName, myExtent, shpType);
myLayer.Path:=layerFullName;
myLayer.Name:=layerName;
// Add layer to the viewer.
GIS.Add (myLayer);
end;
|
si esos archivos estan en c:archivos de
programa/borland/cbuilder6/projects/visualnav/maps y se llaman
world.dxf y ocean dxf , como puedo añadirlos ?
gracias _________________ El hombre es el unico ser que tropieza dos veces en la misma piedra ( en mi caso infinitas veces) |
|