1

enter image description here

    map = new OpenLayers.Map('map', options);
    // BASELAYER


    var google_maps = new OpenLayers.Layer.Google(
        "Google Maps", {
            numZoomLevels: 20
        }
    );

    var google_satellite = new OpenLayers.Layer.Google(
        "Google Satellite", {
            type: google.maps.MapTypeId.SATELLITE,
            numZoomLevels: 20

        }
    );
    // OVERLAYS
    tiled = new OpenLayers.Layer.WMS(
    "Kaski",
    wmsUrl,
    {
        LAYERS: 'KaskiGrup',
        transparent: true,
        visibility: true,    

    },
    {
        transitionEffect: 'none',
        isBaseLayer: false,


    }
);






    // NOKTASAL LAYERS
    wfs_layer = new OpenLayers.Layer.Vector("Point",
        {
            /*style: {
                externalGraphic: 'http://www.openlayers.org/dev/img/marker.png',
                graphicWidth: 21,
                graphicHeight: 25,
                graphicYOffset: -24
            },*/
            styleMap: new OpenLayers.StyleMap({
                "default": new OpenLayers.Style({
                    pointRadius: 10, // sized according to type attribute
                    fillColor: "#00FFFF",
                    strokeColor: "#33CCCC",
                    strokeWidth: 3,
                    graphicZIndex: 1
                }),
            }),

            strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],

            protocol: new OpenLayers.Protocol.WFS({
                version: version,
                // loading data through localhost url path
                url: wfsUrl,
                featureNS: featureNS,
                visibility: true,

                // layer name
                featureType: featureType,
                // geometry column name
                internalProjection: WGS84,
                externalProjection: WGS84_google_mercator,
                geometryName: geometryName,
                schema: schema,

            })
        });

I want to add google map on the background and overlay my wms and wfs layers but my wfs layers is not at correct location, also wms layers is at correct location. As you can see, i add google prejection on map option where is my mistake ? Thanks

1 Answer 1

1

I had originally thought that perhaps the problem was that your internalProjection and externalProjection values were reversed (and just to note that internalProjection would be used for the map background and external for your data and are used as like this

format: new OpenLayers.Format.GeoJSON({
                          internalProjection: new OpenLayers.Projection("EPSG:900913"),
                          externalProjection: new OpenLayers.Projection("EPSG:4326")})

). However, after reviewing the WFS protocol in OpenLayers docs and checking this example http://openlayers.org/dev/examples/wfs-reprojection.html, it's looking more likely that your WFS protocol isn't set up properly. Not sure which WFS version is being used from your code listing, but there are also outputFormat and readFormat options for version 1.1.0 if your data format doesn't match the ones listed. BTW, you don't need to put visibility in your protocol. That's a layer property.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.