This code set works for me in IE but not in Firefox and chrome.What is the problem? Map is showing in all browsers ,but when i click on point of map nothing showing in Firefox and chrome.

Welcome any idea!

<!DOCTYPE html>
<html lang='en'>
<title>My OpenLayers Map</title>
 <script type='text/javascript' src='OpenLayers.js'></script>
 <link rel="stylesheet" href="1.css" type="text/css">
 <link rel="stylesheet" href="2.css" type="text/css">
 <script type='text/javascript'>
 var map;
 function init() {
 map = new OpenLayers.Map('map_element', {
 projection: 'EPSG:5235',
 maxExtent: new OpenLayers.Bounds(105097.88755998248, 181965.81596899,
 107146.57905998248, 183739.10926899),
 maxResolution: 156543.0339,
 units: 'm'

var wms1 = new OpenLayers.Layer.WMS('OpenLayers      WMS','http://localhost:8080/geoserver/sac/wms',{layers: 'sac:Luse'},{});
var highlight = new OpenLayers.Layer.Vector("Highlighted Features", {displayInLayerSwitcher: false, isBaseLayer: false });


    info = new OpenLayers.Control.WMSGetFeatureInfo({
        url: 'http://localhost:8080/geoserver/sac/wms', 
        title: 'Identify features by clicking',
        queryVisible: true,
        eventListeners: {
            getfeatureinfo: function(event) {
                map.addPopup(new OpenLayers.Popup.FramedCloud(

    map.addControl(new OpenLayers.Control.LayerSwitcher());

 <body onload="init()">
  <h1 id="title">Feature Info in Popup</h1>

  <div id="tags">
    WMS, GetFeatureInfo, popup

  <p id="shortdesc">
    Demonstrates the WMSGetFeatureInfo control for fetching information
    about a position from WMS (via GetFeatureInfo request).  Results
    are displayed in a popup.

  <div id="map_element" class="smallmap"></div>

  <div id="docs"></div>

I have the same problem, and i removed from OpenLayers.Popup.FramedCloud the FrameCloud part. Also I added a line (i modified for your implementation)

layerUrls: ['http://localhost:8080/geoserver/sac/wms'],


url: 'http://localhost:8080/geoserver/sac/wms', 

which should be modified by eliminating 'sac'.

Now i get the pop-up but not the content i want. But it is a small step ahead.



can you try adding proxyhost for getting information? i am not sure proxy host will solve this problem, but it is useful to try and dont forget adding defination of variables, sometimes they really being big problem...

var info;

and proxyhost:

OpenLayers.ProxyHost = "proxy.cgi?url=";

some information about proxyhost you can read this.

i hope it helps you...

  • Thanks for your answer.But i am using same port.I use tomcat and geoserver in 8080 port.So i think this is not a proxy problem. – sacprasanna May 2 '12 at 8:57
  • Ohh it woks in IE after removing duplicated /HTML tag but not works GETfeature part in firefox or chorme.Any idea? – sacprasanna May 2 '12 at 10:15

The problem is localhost - change it to the IP address (or web address) of the machine and it works OK -just fixed the same problem - now works in all 3 browsers. Chrome and Firefox obviously deal with these differently than IE.

Your Answer

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

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