1

I'm using HERON with Google maps, everything seems to be fine except for the getFeatureInformation. I don't know if it's the layer sequence or the proxy setup or something else, because during the process of my research I saw a couple of people mentioning those to be the problem at times.

Attached is my code:

Ext.namespace("Heron");
OpenLayers.ProxyHost = "http://localhost:8080/cgi-bin/proxy.cgi";  
Heron.layout = {
    xtype: 'panel',
    id: 'hr-container-main',
    layout: 'border',  
    items: [
        {
            xtype: 'panel',  
            id: 'hr-menu-left-container',
            layout: 'accordion',
            region : "west",
            width: 240,
            collapsible: true,
            split   : true,
            border: false,
            items: [
                { xtype: 'hr_layertreepanel',
                    contextMenu: [
                        { xtype: 'hr_layernodemenulayerinfo' },
                        { xtype: 'hr_layernodemenuzoomextent' },
                        { xtype: 'hr_layernodemenuopacityslider'}
                    ]
                }
            ]
        },
        { xtype: 'panel',   
          id: 'hr-map-and-info-container',
          layout: 'border',
          region: 'center',
          width: '100%',
          collapsible: true,
          split : true,
          border: false,
          items: [
                { xtype: 'hr_mappanel',
                  id: 'hr-map',
                  region: 'center',
                  collapsible : false,
                  border: false,
                  hropts: {
                        settings :
                        { projection: 'EPSG:4326',
                          displayProjection: new OpenLayers.Projection("EPSG:4326"),
                          units: 'm',
                          maxExtent: new OpenLayers.Bounds(1247348.5486233, -4263307.2348958,                                             4260801.9513187, -2448386.4355452),
                          center: new OpenLayers.LonLat(3094067.15174,-2937583.41650).transform(
                                ([3094067.15174,-2937583.41650], 'EPSG:4326', 'EPSG:3857')),
                          maxResolution: 'auto',
                          xy_precision: 5,
                          zoom: 12,
                          theme: null
                        },
                        layers : [
                            new OpenLayers.Layer.OSM(),
                            new OpenLayers.Layer.WMS(
                                    "World Cities (OpenGeo)",
                                    'http://suite.opengeo.org/geoserver/ows?',
                                    {layers: "cities", transparent: true, format: 'image/png'},
                                    {singleTile: true, opacity: 0.9, isBaseLayer: false, visibility: true,
                                        noLegend: false, featureInfoFormat: 'application/vnd.ogc.gml', transitionEffect: 'resize'
                                     }
                            ),

                            new OpenLayers.Layer.WMS(
                                    "South Africa",
                                    "http://gis.lib.virginia.edu:8080/geoserver/South_Africa/wms", { 
                                    layers: 'South_Africa:ponet_polygon',
                                    transparent: true
                                }, {

                                    displayOutsideMaxExtent: true,
                                    singleTile: true, 
                                    opacity: 0.9, 
                                    isBaseLayer: false, 
                                    visibility: true, 
                                    noLegend: false, 
                                    featureInfoFormat: "application/vnd.ogc.gml"
                                }),

                                new OpenLayers.Layer.WMS(
                                        "Outer layer",
                                        "http://gis.lib.virginia.edu:8080/geoserver/South_Africa/wms", {
                                        layers: 'South_Africa:popoint_point',
                                        transparent: true 
                                    }, {
                                        singleTile: true, 
                                        opacity: 0.9, 
                                        isBaseLayer: false,
                                        visibility: true,
                                        noLegend: false,
                                        featureInfoFormat: "application/vnd.ogc.gml"
                                    }),

                                 new OpenLayers.Layer.WMS("Madibeng Road Network",
                                            "http://localhost:8080/geoserver/cite/wms", {
                                                layers: "Madibeng_LM_RoadNetwork0",
                                                transparent: true,
                                                format: "image/gif"
                                            }, {
                                                buffer: 0,
                                                featureInfoFormat: 'application/vnd.ogc.gml'
                                            }),
                                            new OpenLayers.Layer.WMS("Dihlabeng Place Names",
                                            "http://localhost:8080/geoserver/cite/wms", {
                                                layers: "Dihlabeng_Place_Names",
                                                transparent: true,
                                                format: "image/gif"
                                            }, {
                                                buffer: 0,
                                                featureInfoFormat: 'application/vnd.ogc.gml'
                                            }),

                            // google layers dropped download
                                    new OpenLayers.Layer.Google(
                                    "Google Satellite",
                                    {type: google.maps.MapTypeId.SATELLITE, visibility: true},
                                    {singleTile: false, buffer: 0, isBaseLayer: false}

                            ),

                            new OpenLayers.Layer.Google(
                                    "Google Streets", // the default
                                    {type: google.maps.MapTypeId.ROADMAP, visibility: false},
                                    {singleTile: false, buffer: 0, isBaseLayer: false}
                            ),

                            new OpenLayers.Layer.Google(
                                    "Google Terrain",
                                    {type: google.maps.MapTypeId.TERRAIN, visibility: false},
                                    {singleTile: false, buffer: 0, isBaseLayer: false}
                            ),
                            //end of google

                        ],
                        toolbar: [
                                {type: "featureinfo", options: {
                                pressed: true,
                                getfeatureControl:{
                                    hover:true,
                                    drillDown:false,
                                    maxFeatuures:1

                                },
                                popupWindow: {
                                    width: 360,
                                    height: 200,
                                    featureInfoPanel: {
                                        showTopToolbar: true,
                                        //displayPanels: ['Table'],
                                        displayPanels: ['Grid'],

                                        // Should column-names be capitalized? Default true.
                                        columnCapitalize: true,

                                        // Export to download file. Option values are 'CSV', 'XLS', default is no export (results in no export menu).
                                        exportFormats: ['CSV', 'XLS', 'GMLv2', 'Shapefile', 'GeoJSON', 'WellKnownText'],
                                        // Export to download file. Option values are 'CSV', 'XLS', default is no export (results in no export menu).
                                        // exportFormats: ['CSV', 'XLS'],
                                        maxFeatures: 10
                                    }
                                }
                            }},
                            {type: "-"} ,
                            {type: "pan"},
                            {type: "zoomin"},
                            {type: "zoomout"},
                            {type: "zoomvisible"}, 
                            {type: "-"} ,
                            {type: "zoomprevious"},
                            {type: "zoomnext"},
                            {type: "-"},
                            {type: "measurelength", options: {geodesic: true}},
                            {type: "measurearea", options: {geodesic: true}}
                        ]
                    }
                }
            ]
        }
    ]
};
13
  • the first thing to do is open up the network tab in debugging (where this is depends on your browser - try F12) and see what request is being sent when you click on the button, then try that in the browser.
    – Ian Turton
    Jul 21 '15 at 11:12
  • @iant thanks for the advice but I'm not sure how to read through this page, however I thought to show you snapshots of what I press the button imgur.com/a/GUQ7a#0 and after I press where I want to retrieve the feature information imgur.com/a/GUQ7a#1
    – eldix_
    Jul 21 '15 at 13:05
  • scroll down that page and you should see urls that contain getFeatureInfo - try clicking on those and chosing open in new tab
    – Ian Turton
    Jul 21 '15 at 13:06
  • I can't find that here or else I'm looking in the wrong place.
    – eldix_
    Jul 21 '15 at 13:21
  • see jetbrains.com/webstorm/help/debugging-javascript.html for a guide to get yyou started
    – Ian Turton
    Jul 21 '15 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.