MapWinGIS:SampleCode-C++ Builder 6

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

Para agregar una capa (layer) en un mapa (TMap) en C++ Builder 6.0, despu??s de varios intentos pude hacerlo con el siguiente c??digo:

Ojo, No utilizarlo cuando se crea el formulario principal (funci??n FormCreate).



//---------------------------------------------------------------------------

void __fastcall TForm1::ToolButton1Click(TObject *Sender)
{
    IShapefilePtr shapefile1;
    shapefile1.CreateInstance(CLSID_Shapefile);
/* this is the alternatif if using OpenFileDialog
        IShapefilePtr shapefile1;
        WideString filename;
        if (OpenVector->Execute())
        {
                shapefile1.CreateInstance(CLSID_Shapefile);

                filename = OpenVector->FileName;

                shapefile1->Open(filename.c_bstr(), NULL );
                Map->AddLayer(shapefile1,true);
        }
*/
    BSTR filename=SysAllocString(L"C:\\Documents and Settings\\Administrador\\Mis documentos\\SharpDevelop Projects\\GISSampleApplication01\\GISSampleData\\Nile.shp");

    shapefile1->Open(filename, NULL );

    Map1->AddLayer(shapefile1,true);

}

//---------------------------------------------------------------------------

Con el resultado siguiente: File:Screenshot.JPG

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:SampleCode-C%2B%2B_Builder_6"

This page has been accessed 2,633 times. This page was last modified on 26 August 2009, at 09:12.