[OpenLayers-Users] Issue: Graticule control's width extending beyond baselayer's width

ameet chaudhari ameet_ch at rediffmail.com
Mon Jun 10 06:23:32 PDT 2013


Hi, I want the width of the Graticule control to be same as that of the baselayer. But it is extending beyond baselayer boundaries on both the sides, right and left. (Screenshot attached) 'targetSize' is not working. 
Is Graticule's width always the same as the map container division's width? But reducing the map container division's width clipped the Graticule, it didn't reduce the size. Please help, Thanks in advance
Ameet

Here is my code:

var map = new OpenLayers.Map('map',	{
	maxExtent: [-180, -90, 180, 90],
	resolutions: [0.3515625, 0.17578125, 0.087890625, 0.0439453125,0.02197265625, 
                      0.010986328125],
	controls: [
	    new OpenLayers.Control.Navigation(),
            new OpenLayers.Control.PanZoomBar(),
	    new OpenLayers.Control.Graticule({
		numPoints: 1, 
                //targetSize: 550,
		labelled: true
	    })
	]
});
	
var baseLayer = new OpenLayers.Layer.WMS(
	"Global Imagery",
	geoserverUrl + "wms",
	{layers: "world_land"},
	{
	    maxExtent: [-180, -90, 180, 90]
	}
);

map.addLayer(baseLayer);
map.zoomToMaxExtent();

HTML code:

    
    			
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130610/d1de52f0/attachment.html>


More information about the Users mailing list