[Cartoweb-users] idRecenterLayer not working

Alexandre Fellay alexandre.fellay at camptocamp.com
Mon Dec 19 12:25:48 EST 2005


Hi Dirk,

ID recentering has to be done on a msLayer, not a CW layer; in your case, you 
should have in location.ini :

idRecenterLayers = Gemeinden, Landkreise, Ortschaften

It's probably not important for your present problem, but the metadata 
exported_values is useless here.

Alexandre Fellay
Dirk Jesko wrote:
> Hello,
> 
> eventhough my configuration is almost identical to that of demoCW3, the 
> idRecenterLayer does not work. I always get "Recenter Id canceled, 
> unable to find selected Id."
> 
> The configuration is as follows:
> 
> server location.ini:
> recenterMargin = 10
> recenterDefaultScale = 50000
> 
> client location.ini:
> idRecenterActive = true
> idRecenterLayers = layLk, layGem, layOrt
> 
> all three Layers are defined in layers.ini as follows:
> 
> layers.grpNavteq.className = LayerGroup
> layers.grpNavteq.label = "Grenzen"
> layers.grpNavteq.children =  layLk, layGem, layOrt
> 
> layers.layLk.className = Layer
> layers.layLk.msLayer = Landkreise
> layers.layLk.label = Landkreise
> 
> layers.layGem.className = Layer
> layers.layGem.msLayer = Gemeinden
> layers.layGem.label = Gemeinden
> 
> layers.layOrt.className = Layer
> layers.layOrt.msLayer = Ortschaften
> layers.layOrt.label = Ortschaften
> 
> The layers look like
> 
>  LAYER
>    NAME           "Gemeinden"
>    CONNECTIONTYPE postgis
>    CONNECTION     "user=web password=... dbname=... host=... port=..."
>    DATA           "the_geom from lgst.sel_admingebiete using SRID=4326"
>    FILTER         "feat_type='GEMEINDE'"
>    STATUS         ON
>    TYPE           POLYGON
>    MAXSCALE       500000
>    TOLERANCE      20
> 
>    PROJECTION
>      "init=epsg:4326"
>      "towgs84=-598.1,-73.7,-418.2,-0.202,-0.045,2.455,-6.70"
>    END
> 
>    METADATA
>      "exported_values" "id_attribute_string"
>      "id_attribute_string" "feat_name|string"
>    END
> 
>    LABELITEM  "feat_name"
>    LABELMAXSCALE      250000
> 
>    CLASS
>      NAME         "Gemeinden"
>      STYLE
>        SYMBOL "circle"
>        SIZE 1
>        COLOR        -1 -1 -1
>        OUTLINECOLOR 255 128 0
>      END
>      LABEL
>        ANGLE 0
>        WRAP "_"
>        COLOR 102 255 153
>        SHADOWCOLOR 0 0 0
>        SHADOWSIZE 1 1
>        TYPE TRUETYPE
>        FONT "arial-bold"
>        SIZE 10
>        ANTIALIAS TRUE
>        POSITION CC
>        PARTIALS TRUE
>        MINDISTANCE 20
>        BUFFER 4
>      END
>    END
>  END
> 
> Some more information:
> 
> - No query is issued to Postgres (I checked it in the log file)
> - It seems that not all attributes of the IdSelection object are filled. 
> This is what it looks like at the end of handleIdRecenter:
> 
> [0] => IdSelection Object
> 
>                        (
>                            [layerId] => layLk
>                            [idAttribute] =>                            
> [idType] =>                            [selectedIds] => Array
>                                (
>                                    [0] => Magdeburg
>                                )
> 
>                            [className] => IdSelection
>                        )
> 
> 
> I would appreciate if someone could tell me why it does not work.
> 
> Kind regards,
> Dirk
> 
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users


More information about the Cartoweb-users mailing list