Hello Armin, On Fri, 09 Jun 2006 13:31:49 +0200 "Armin Burger" <armin.burger at gmx.net> wrote:
> > > > > > > The layers for templates should have set the status to 'OFF' and > > > should not be referenced in allGroups in config.ini if they are > > > only templates for dynamic layers. One could probably also define > > > a second map file just for the dynamic layers, but I don't know > > > if one can transfer the layer definition from one map to another. > > > > OK, now I have some problems. My template does not get recognized by > > pmapper. It is simple and called 'template'. > > > > The getLayerByName() inside dyn_createMSlayer() fails. but I cannot > > say why. > > basically I need to do: > > $templateLayer = $this->map->getLayerByName($templateLayName); > > $newMSLayer = $templateLayer; > > $newMSLayer->setMetaData("DESCRIPTION", $dyn_descr); > > $newMSLayer->set("name", $dyn_name); > > $newMSLayer->set("status", "ON"); > > $newMSLayer->set("data", $dyn_data); > > > > This does not work with my template layer, but with others already > > in the mapfile?! > > > > What is wrong here? > > > > what do you mean with "others already in the mapfile"? Where is your > template layer located? It has to be in the the map file... The template layer is the last layer in my mapfile which I use in my app. it looks like this: # template-layer for the shortest path example LAYER NAME "template_dataset" CONNECTION "gml/template.gml" CONNECTIONTYPE OGR TYPE LINE GROUP "analysis" STATUS OFF METADATA "DESCRIPTION" "RESULT" END DUMP true TEMPLATE "ttt" PROJECTION "init=epsg:4326" END CLASS NAME "template" STYLE COLOR 0 0 0 SIZE 5 END END END With "other layer in Mapfile" I mean my "normal" layers in this mapfile. getlayerbyname() works when I use those layers. Cheers Stephan -- GDF Hannover - Solutions for spatial data analysis and remote sensing Hannover Office - Mengendamm 16d - D-30177 Hannover Internet: www.gdf-hannover.de - Email: holl at gdf-hannover.de Phone : ++49-(0)511.39088507 - Fax: ++49-(0)511.39088508