[Qgis-developer] Re: regarding "Write a simple mapping application using the new QGIS Canvas API" blog

Tim Sutton tim at linfiniti.com
Tue Feb 13 18:51:28 EST 2007


Hi

Its better to write on the qgis-dev mailing list (and to search on the
mailing list before you write!). This question has already been
answered on the mailing list, but since I still need to update the
tutorial here is a work around:

QString myLayerPath = "/data/gis/mylayer.shp";
QString myLayerBaseName = "mylayer";
QString myProviderName = "ogr";

QgsVectorLayer * mypLayer =
      new QgsVectorLayer(myLayerPath, myLayerBaseName, myProviderName);

Search the mailing list for 'myLayerBaseName' for more details..

Regards

Tim

2007/2/13, satya satya <satya341 at gmail.com>:
> Hi tim,
>  How r u doing??
>  Sorry for sending you personal mail for help.
>  I excuted the code you have given, it worked fine.
>  The problem started when i changed "myLayerBaseName" variable value, Even
> though i changed the BaseName , still it is showing the previous map.
>  I tried the same program by including
>  QgsMapCanvas myMapCanvas(0, 0);
>  QgsMapLayerRegistry::instance()->removeAllMapLayers();
>  after app.exec().
>  but no luck.
>  Could you please help me out in this.
>  Thanking you
>  cheers
>  satya
>


-- 
-- 
Tim Sutton

Visit http://qgis.org for a great Open Source GIS
Home Page: http://linfiniti.com
Skype: timlinux
MSN: tim_bdworld at msn.com
Yahoo: tim_bdworld at yahoo.com
Jabber: timlinux
Irc: timlinux on #qgis at freenode.net



More information about the Qgis-developer mailing list