Y Co-ordinates returning a decimal when embedded in Drupal

23 views
Skip to first unread message

Thomas Miles

unread,
Sep 25, 2013, 10:02:10 AM9/25/13
to leafl...@googlegroups.com
Hi,

I posted this on GIS exchange. I have a working map in a standard HTML page, however when I transfer it to Drupal using php requires, or embedding the code, I get an issue that the X coordinate is a whole number while the Y a decimal. Comparing this to my working URL the only difference in URL is the last Y coordinate which should be a whole number not a decimal.


http://xxxxxxxxxx:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=medford:parks,RIVERFLIES_READONLY:sites_tbl&QUERY_LAYERS=medford:parks,RIVERFLIES_READONLY:sites_tbl&STYLES=&BBOX=-1.676788330078125,54.409340183768315,-0.6406402587890625,54.64841250231667&FEATURE_COUNT=10&HEIGHT=600&WIDTH=1509&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X=680&Y=257.4345623

This is the code that works outside of drupal but causes the issue when embedded.


 var popup = L.popup();
   function onMapClick(e) {
            var latlngStr = '(' + e.latlng.lat.toFixed(3) + ', ' + e.latlng.lng.toFixed(3) + ')';
            var BBOX = map.getBounds().toBBoxString();
            var WIDTH = map.getSize().x;
            var HEIGHT = map.getSize().y;
            var X = e.containerPoint.x;
            var Y = e.containerPoint.y;
            var URL = 'http://10.0.10.204:8080/geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=medford:parks,RIVERFLIES_READONLY:sites_tbl&QUERY_LAYERS=medford:parks,RIVERFLIES_READONLY:sites_tbl&STYLES=&BBOX='+BBOX+'&FEATURE_COUNT=5&HEIGHT='+HEIGHT+'&WIDTH='+WIDTH+'&FORMAT=image%2Fpng&INFO_FORMAT=text%2Fhtml&SRS=EPSG%3A4326&X='+X+'&Y='+Y;
               alert(URL);

           popup.setLatLng(e.latlng);
           popup.setContent("<iframe src='"+URL+"'  width='500' height='180' frameborder='0'><p>Your browser does not support iframes.</p></iframe>");
            map.openPopup(popup);
    }
    map.on('click', onMapClick);

Thomas Miles

unread,
Sep 27, 2013, 9:32:57 AM9/27/13
to leafl...@googlegroups.com
I did a little research, it is just the Y coordinate that is effected. If I replace the Y coordinate for the X I get a working URL however obviously it wont work because I need the Y. But it shows the X coordinate is not effected.
Reply all
Reply to author
Forward
0 new messages