/**
 * Copyright 2012 Geoinformation Systems, TU Dresden
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *    http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */

/**
 * This class handles feature info requests and preparing response for gui.
 * 
 * @author Christin Henzen, Hannes Tressel. Professorship of Geoinformation Systems
 */
var markers;
var service_url, service_version, service_srs;

/**
 * This method is used to register an event listener that sets the marker on the map, when the user has clicked into the map.
 * Further, the feature info response is initialized and embedded.
 *
 * @param time_info - string param that is set to "time", if the service is time enabled and empty if not.
 */
var infoControls;
 
function bindFeatureControls(time_info) {
    //getting general information of web service
    var service_JSON;
    wmsDescription_Store.fetchItemByIdentity({
        identity: "serviceDescriptionParam",
        onItem: function(item, request) {
            service_JSON = item;
        }
    });
    service_url = wmsDescription_Store.getValue(service_JSON, "url");
    service_version = wmsDescription_Store.getValue(service_JSON, "version");
    service_srs = wmsDescription_Store.getValue(service_JSON, "srs");

    map.on("singleclick", function(evt) {
        map.getLayers().forEach(function(layer) {
            if (layer.getProperties().title === layer_Array[vis_layer_number].getProperties().title) {
                var resolution = map.getView().getResolution();
                var projection = map.getView().getProjection();
                var source = layer.getSource().getGetFeatureInfoUrl(evt.coordinate, resolution, projection, {
                    "INFO_FORMAT": "text/html",
                });
                if (typeof source != null) {
                    require(["dojo/dom-attr", "dojo/io-query"], function(domAttr, ioQuery) {
                        var sourceObject = ioQuery.queryToObject(source);
                        if (time_info === "time") {
                            var url = "featureInfo_compare.jsp?url=" + service_url + "&request=GetFeatureInfo&service=WMS" + "&version=" + sourceObject.VERSION + "&query_layers=" + sourceObject.QUERY_LAYERS + "&crs=" + sourceObject.SRS + "&bbox=" + sourceObject.BBOX + "&width=" + sourceObject.WIDTH + "&height=" + sourceObject.HEIGHT + "&I=" + sourceObject.X + "&J=" + sourceObject.Y + "&time=" + sourceObject.time;
                            domAttr.set("featureInfo_frame", "src", url);
                        } else {
                            var url = "featureInfo_compare.jsp?url=" + service_url + "&request=GetFeatureInfo&service=WMS" + "&version=" + sourceObject.VERSION + "&query_layers=" + sourceObject.QUERY_LAYERS + "&crs=" + (typeof sourceObject.CRS != "undefined" ? sourceObject.CRS : sourceObject.SRS) + "&bbox=" + sourceObject.BBOX + "&width=" + sourceObject.WIDTH + "&height=" + sourceObject.HEIGHT + "&I=" + (typeof sourceObject.X != "undefined" ? sourceObject.X : sourceObject.I) + "&J=" + (typeof sourceObject.Y != "undefined" ? sourceObject.Y : sourceObject.J) + "&time=x";
                            domAttr.set("featureInfo_frame", "src", url);
                        }
                    });
                }

                /* remove existant Overlays */
                map.getOverlays().forEach(function(overlay) {
                    map.removeOverlay(overlay);
                });

                /*create overlay image*/
                var overlayElement = null;
                require(["dojo/dom-construct", "dojo/query"], function(domConstruct, domStyle) {
                    overlayElement = domConstruct.create("img", {
                        src: 'js/ol3/resources/marker-blue.png',
                        style: {
                            position: "absolute",
                            top: "-25px",
                            left: "-10.5px",
                            color: "darkslateblue"
                        }
                    });
                });

                /* create overlay */
                var overlay = new ol.Overlay({
                    position: evt.coordinate,
                    element: overlayElement
                });

                map.addOverlay(overlay);
            }
        });
    });
}
@@ -52,18 +52,17 @@
 esden%0A *
- 
 %0A
+
  * Licen
@@ -233,17 +233,16 @@
 se at%0A *
- 
 %0A *    h
@@ -285,17 +285,16 @@
 E-2.0%0A *
- 
 %0A * Unle
@@ -609,17 +609,16 @@
 ense.%0A *
- 
 %0A */%0A%0A/*
@@ -697,17 +697,16 @@
  gui.%0A *
- 
 %0A * @aut
@@ -845,16 +845,36 @@
 ice_srs;
+%0Avar featureInfoUrl;
 %0A%0A/**%0A *
@@ -1200,10 +1200,9 @@
 ls;%0A
- 
 %0A
+
 func
@@ -1752,24 +1752,61 @@
 tion(evt) %7B%0A
+        last_event = evt.coordinate;%0A
         map.
@@ -2066,32 +2066,159 @@
 etProjection();%0A
+                console.log(evt.coordinate);%0A                console.log(resolution);%0A                console.log(projection);%0A
                 
@@ -2359,16 +2359,16 @@
 /html%22,%0A
-
         
@@ -2371,32 +2371,73 @@
             %7D);%0A
+                featureInfoUrl = source;%0A
                 
@@ -4980,8 +4980,9 @@
    %7D);%0A%7D
+%0A

Update feature_info_setting.js