1

I was wondering if you could help me with something I am trying??

Created a heatmap from a sql point table using sld in GeoServer.

Displays fine as a preview:-

It looks tiled when I publish it to the web mapped:-

Here is my HTML Code:-

<meta charset="utf-8">
<script src="http://www.openlayers.org/api/2.11/OpenLayers.js"></script>
<script>



    var map, layer;

    function init(){
        var epsg900913 = new OpenLayers.Projection("EPSG:900913");
        var epsg4326 = new OpenLayers.Projection("EPSG:4326");
        var cent=new OpenLayers.LonLat(143.841243,-37.833563).transform(epsg4326,epsg900913);

                                            var osm = new OpenLayers.Layer.OSM("Open Street Map");

                                            awms = new OpenLayers.Layer.WMS("GPS Boundary", "http://172.16.3.68:8080/geoserver/GPS/wms",
            {
                version: "2.5.2" ,
                layers: "GPS:LGA_POLYGON_GPS",
                transparent: true,
                tiled: true
            },
            {
                visibility: true,
                sphericalMercator: true,
                displayOutsideMaxExtent: true // Will not appear with certain zooms without this option
            }
        );

                                            bwms = new OpenLayers.Layer.WMS("House Points", "http://172.16.3.68:8080/geoserver/GPS/wms",
            {
                version: "2.5.2" ,
                layers: "GPS:House Points",
                transparent: true,
                tiled: true
            },
            {
                visibility: true,
                sphericalMercator: true,
                displayOutsideMaxExtent: true // Will not appear with certain zooms without this option
            }
        );

        cwms = new OpenLayers.Layer.WMS("Animals Heatmap", "http://172.16.3.68:8080/geoserver/GPS/wms",
            {
                version: "2.5.2" ,
                layers: "GPS:Animals",
                format: 'image/png',
                transparent: true,
                singleTile: true, 
                ratio: 1
            },
            {
                visibility: false,
                sphericalMercator: true,
                displayOutsideMaxExtent: true // Will not appear with certain zooms without this option
            }
        );



        map = new OpenLayers.Map("map",{
            layers:[osm,awms,bwms,cwms],
            center: cent,
            zoom: 10
        });

                                            var switcherControl = new OpenLayers.Control.LayerSwitcher();
                                            map.addControl(switcherControl);
                                            switcherControl.maximizeControl();

//Variable Scale Bar var scaleline = new OpenLayers.Control.ScaleLine({ div: document.getElementById("scaleline-id") }); map.addControl(scaleline);

                                            map.addControl(new OpenLayers.Control.MousePosition({element: $('location')}));

                                            }              

</script>

example of in HTML

  • I suppose that your application is still sending tiled requests to WMS even I see that you have singleTile: true there. Verify by checking the outgoing requests with Firebug or something like that. – user30184 Sep 11 '14 at 7:29
  • Using Firebug ,I changed the DOM for the dwms layer to show singletile: true. Closed Firebug and layer showed correctly. Until I refresh the page and then it went back to the way it was. How do I save the change so it works after a refresh?? – Timmy Warfe Sep 12 '14 at 2:32
  • I don't know but you can change to title ans tags because your problem is not in Geoserver nor heatmap, it is plain OpenLayers question. Note that the "version" means version of WMS, not Geoserver version. – user30184 Sep 12 '14 at 4:32
  • Thanks for your help user30184. I worked out that I had the option of singletile in the incorrect part of the code. Is all working fine now. :) – Timmy Warfe Sep 22 '14 at 4:50

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.