Hello,

I have some features in GeoJSON format I want to display, so I did this:

[code]
        var vectorLayer = null;

        var vectorStyle =
        {
            graphicName: 'square',
            strokeColor: '#222',
            fillColor: '#222'
        };

        var styleDefault = OpenLayers.Util.applyDefaults(
            vectorStyle,
            OpenLayers.Feature.Vector.style['default']
        );

        vectorLayer = new OpenLayers.Layer.Vector('search',
        {
            styleMap: new OpenLayers.StyleMap(
            {
                'default': styleDefault
            }
            ),
            displayInLayerSwitcher: true
        }
        );
[/code]

but they don't appear in the map, my question is if this is enough to get the 
features displayed or do I need something else there? if this is enough, I 
should think that this problem is about how the features are being read by OL. 
In fact, this doesn't work either:

var ll = new OpenLayers.LonLat(feature.geometry.x, feature.geometry.y);
mapPanel.map.setCenter(ll);

I get: 

feature is not definedvar ll = new OpenLayers.LonLat(feature.geometry.x, 
feature.geometry.y);
why should this happen? thanks in advance


__________________________________________________________________________________________
Piensa en el medio ambiente - mantenlo en la pantalla. NO lo imprimas si NO es 
necesario.
Think green - keep it on the screen. Do NOT print if it is NOT necessary.
Denken Sie an die Umwelt - bewahren Sie es auf dem Bildschirm. Drucken Sie 
NICHT, wenn es NICHT notwendig ist.

                                          
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to