FW: [UMN_MAPSERVER-USERS] Distance tool in ROSA (missed some info from first post)

Dirk-Jan Huisman d.huisman at INGBCC.NL
Thu May 12 01:38:13 EDT 2005


Hi,

I use this code outside the case "DIST". Every time the map is drawed I
calculate the cellsize. And it works fine.

// set the cellsize of the map
$minimumX = $oMap->extent->minx;
$maximumX = $oMap->extent->maxx;
	             	
$realcoordinates = $maximumX - $minimumX ;

$pixelsize = $realcoordinates / MAP_WIDTH ;
$pixelsize = $pixelsize / 1000 ;

Regards, Dirk


-----Oorspronkelijk bericht-----
Van: Kevin Grootendorst [mailto:kgrootendorst at BAIRD.COM]
Verzonden: woensdag 11 mei 2005 17:43
Aan: MAPSERVER-USERS at LISTS.UMN.EDU
Onderwerp: Re: [UMN_MAPSERVER-USERS] FW: [UMN_MAPSERVER-USERS] Distance
tool in ROSA (missed some info from first post)


Steve,
Did you come across a solution to your problem?
I'm having a similar situation, where the distances being measured are
way
off (eg. a 3km feature is measured as being 1.7km)

Kevin

On Thu, 5 May 2005 15:47:45 +1000, Stephen Baxter
<steve at STAFF.PIPENETWORKS.COM> wrote:

>
>
>Hello,
>
>I hacked up the output from Gmap Factory to include the Distance Tool.
>Specificially I changed the following:
>
>gmf_apps\project\project.php to include :
>-----------------------------------------
>
>case "DIST":
>$cellsize = $oMap->cellsize ;
>$cellsize2 = $cellsize / 1000 ;
>echo "<param name=\"TB_BUT_dist_IMG\" ".
>"value=\"./images/icon_dist1.gif\">\n";
>echo "<param name=\"TB_BUT_dist_IMG_PR\" ".
>"value=\"./images/icon_dist2.gif\">\n";
>echo "<param name=\"TB_BUT_dist_HINT\" ".
>"value=\"Measure Distance\">\n";
>echo "<param name=\"TB_BUT_dist_INPUT\" ".
>"value=\"dist\">\n";
>echo "<param name=\"TB_BUT_dist_NAME\" ".
>"value=\"ROSA_CMD\">\n";
>ECHO "<PARAM NAME=\"PIXEL_SIZE\" VALUE=\"".$cellsize2."\">";
>echo "<PARAM NAME=\"TB_BUT_dist_CURSOR_TYPE\" VALUE=\"CROSSHAIR\">";
>echo "<param name=\"TB_BUT_dist_VALUE\" ".
>"value=\"ruler\">\n";
>echo "<PARAM NAME=\"DIST_MSG\" ".
>"value=\"Approximative distance: %s Kms\">n";
>
>break;
>
>AND
>
>case "DIST":
>return "DIST";
>break;
>
>As per
>http://lists.maptools.org/pipermail/maplab-users/2004-May/001197.html
>
>
>gmf_apps\project\project_contents.php to include :
>--------------------------------------------------
>
>array_push( $aszROSATools, "DIST" );
>
>
>But my issue is that when I zoom in on an area of the map it seems
>to not reset the cellsize to the new value for the new zoom level.
>I am fairly sure that this is not caused by browser caching issues
>as I have tried on Exploder and Firefox and they both have the same
>issues.
>
>I even put :
>
>$cellsize = $oMap->cellsize ;
>$cellsize2 = $cellsize / 1000 ;
>
>In the 'case "ZOOM_IN":'  area in order to get it to recalculate the
>cellsize but to no avail.
>
>If I press the redraw button at the new zoom level it seems to reset it
>and all goes well, the correct distance is represented by the tool, not
>the distance at the old resolution. I have also tried forcing a browser
>reload and that does not seem to fix it.
>
>I am not sure if it is related but the 'Zoom to fullest extents' seems
>to need to be pressed twice as well before it works, in that once you
>press it the map redraws but to the zoom in area - not to fullest
>extent.
>
>The re-centre tool does seem to fix it though, as does activating the
>'i' tool.
>
>I am thinking that the web server or similar may be keeping some pesky
>state somewhere that needs to be dealt with - maybe !
>
>Any help appreciated.
>
>
>
>--
>Stephen Baxter
>Technical Director - PIPE Networks
>
>Winner Australian Telecommunications Users Group 2005 award for
>'Best Communication Solution for Large Business'
>
>Peering,IX points and dark fiber in Australia.
>Largest peering network downunder.
>
>phone : 07 3233 9800/ 0417 818 695
>fax   : 07 3220 1800
>web   : www.pipenetworks.com
>
>
------------------------------------------------------------------------------
Prins Mauritsstraat 17, Postbus 75, 4140 AB Leerdam
Telefoon (0345) 63 96 96, Fax (0345) 63 96 66,
E-mail post at ingbcc.nl
Internet www.ingbcc.nl
------------------------------------------------------------------------------
Deze e-mail en de eventuele bestanden die meegezonden zijn, zijn vertrouwelijk en alleen bedoeld voor het gebruik door de individu of instelling aan wie deze e-mail geadresseerd is. Als u deze e-mail onterecht ontvangen heeft wilt u het ons dan laten weten.
------------------------------------------------------------------------------
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the system manager.
------------------------------------------------------------------------------



More information about the mapserver-users mailing list