[OpenLayers-Users] 512 image scaling problems

Gary Townsend (Spatial Mapping Ltd.) garyt at spatialmapping.com
Wed Jul 26 16:38:11 CDT 2006


I am trying to rework my search page at http://www.resmap.com/imgsearch3.asp
I am having a problem with image scaling though I would like to use an image
with a width of 750 I have my default image size in mapserver set for
750x750 I have the map tag defined within the web page as 

 

        #map {

            width: 750px;

            height: 750px;

            border: 1px solid black;

        }

However when the web page loads the image is no where near the full size of
the map box. If I double the map to 1024x1024 voila it fills the whole box.
When I use a zoom level of 1.5 in the setCenter it fills the map box but the
drag functions of the box are off center. The following is my init script:

        function init(){

            var map = new OpenLayers.Map('map');

 

            var ol_wms = new OpenLayers.Layer.WMS.Untiled(
"Globe","http://www.resmap.com/resmapserver/mapserv.exe?map=C:/Inetpub/Resma
pRoot/ResmapSearch2.map", {layers: 'Globe', format: 'png'} );

                  var pb_wms = new
OpenLayers.Layer.WMS.Untiled("Borders","http://www.resmap.com/resmapserver/m
apserv.exe?map=C:/Inetpub/resmaproot/ResmapSearch2.map", {layers:
'PoliticalBoundaries',format: 'gif', transparent:'true'} );

 

            map.addLayers([ol_wms,pb_wms]);

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

            map.setCenter(new OpenLayers.LonLat(0, 0));

                  map.events.register("zoomend",map,function(e){

                        var mapBounds = new OpenLayers.Bounds();

                        mapBounds = map.getExtent();

                        document.forms[0].txtMinX.value = mapBounds.left;

                        document.forms[0].txtMinY.value = mapBounds.bottom;

                        document.forms[0].txtMaxX.value = mapBounds.right;

                        document.forms[0].txtMaxY.value = mapBounds.top;

                  });

            map.zoomToFullExtent();

        }

 




Gary Townsend (Application & Web Developer)

Spatial Mapping Ltd.

Prince George, B.C., Canada

Phone: (250) 564 1928 Fax: (250) 564 0751

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-viper.python-hosting.com/pipermail/users/attachments/20060726/890f5ed3/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 2948 bytes
Desc: not available
Url : http://mailman-viper.python-hosting.com/pipermail/users/attachments/20060726/890f5ed3/attachment.jpe


More information about the Users mailing list