[mapserver-users] Reference map not centering main map properly on Pan

NVohra at eq-technologic.com NVohra at eq-technologic.com
Fri Jun 28 04:41:06 EDT 2002


Hello,
     I am facing problem with refrence map. I am using PHP/MapScript for
mapserver3.5.
     The map does not get centered properly when panned with reference map.

     My code looks like this:

     if ( isset($HTTP_POST_VARS["ref_x"]) && isset($HTTP_POST_VARS
["ref_y"]) )
     {
          $extent_to_set = explode(" ",$HTTP_POST_VARS["extent"]);
          $map->setextent
($extent_to_set[0],$extent_to_set[1],$extent_to_set[2],$extent_to_set[3]);

          $my_point = ms_newpointObj();
          $my_point->setXY($HTTP_POST_VARS["ref_x"],$HTTP_POST_VARS
["ref_y"]);

          $my_extent = ms_newrectObj();
          $my_extent->setextent
($extent_to_set[0],$extent_to_set[1],$extent_to_set[2],$extent_to_set[3]);

          $zoom_factor = 1;
          $map->zoompoint($zoom_factor,$my_point,120,120,$my_extent);
     }

     Any sample code will be of great help.



     ---------------------
     Map file snippet:

     NAME DEMO
     STATUS ON
     SIZE 840 600
     EXTENT 67 8 98 37
     UNITS dd
     FONTSET "C:\Program Files\Apache Group\APACHE\htdocs\fontsw.list"
     SHAPEPATH "C:\Program Files\Apache Group\APACHE\htdocs\itasca\data"
     IMAGECOLOR 255 255 255

          REFERENCE
               IMAGE "C:\Program Files\Apache Group\APACHE\htdocs\ref.gif"
               EXTENT 67 8 98 37
               SIZE 120 120
               STATUS ON
               COLOR -1 -1 -1
               OUTLINECOLOR 255 0 0
          END

          LAYER
               NAME political
               DATA k2
               STATUS ON
               TYPE LINE
               CLASS
                    OUTLINECOLOR 255 89 89
                    COLOR 255 128 100
               END # end of class object
          END # end of layer object
     END # Map File
-----------------------------------------

Nischal Vohra
- - - - - - - - - - - -
That one last shot's a Permanent Vacation
And a how high can you fly with broken wings
Life's a journey - not a destination
And I just can't tell just what tomorrow brings -
Aerosmith
- - - - - - - - - - - -





More information about the mapserver-users mailing list