[Mapserver-users] Re: Mapserver-users digest, Vol 1 #486 - 14 msgs

Ken-ichi Ueda kueda at wso.williams.edu
Sat Apr 10 16:52:44 PDT 2004


I tried adapting your technique, but I'm still not adding points.  I  
get the same result as before: shape count increases, but no point  
displays.  I tried not adding the shape and just drawing it on the fly,  
and that worked fine, so the problem is definitely with the  
ShapefileObj.  I've included the code below.

As far as Java goes, I went back and tested the three browsers again.   
Safari fails to display anything, saying "applet no inited".  Firefox  
displays the map, the zoom tool will draw a zoom box, but it won't  
zoom, and none of the other buttons work.  IE 5.2 will display the map  
but the buttons do nothing.  Apple says it uses Sun's VM  
(http://www.apple.com/macosx/features/java/), and I don't think i've  
done anything to change that.  Firefox will apparently not work with  
JRE 1.4.1 (or above, I assume; see  
http://texturizer.net/firefox/faq.html#q2.2).  I don't have any  
experience with ming/Flash, but DM's flash demo at  
http://www.dmsolutions.ca/techserv/flashmap.html seems to work fine in  
Safari.  So do their Chameleon tools at  
http://www.mapsherpa.com/hawaii2/, which don't use Flash but may have  
the functionality you're looking for.

Ok, here's that code.  Thanks again!

//add the dbf record
       	$dbf = dbase_open(  
"/Library/WebServer/Documents/maplab/Projects/Naturalists/data/ 
test_points_shp.dbf", 2 );
         $attr = array( "5", "test point", "this is a radically awesome  
test point" );
         if( !dbase_add_record( $dbf, $attr ) ) echo "<h2>Add Record  
Failed!</h2>";
       	
       	dbase_pack( $dbf );
       	
       	//add the point
     	$targetFile = ms_newShapefileObj(  
"/Library/WebServer/Documents/maplab/Projects/Naturalists/data/ 
test_points_shp", -2 );
     	$newShape = ms_newShapeObj( MS_SHP_POINT );
     	$newLine = ms_newLineObj();
     	$newLine->addXY( $HTTP_POST_VARS['mapa_x'],  
$HTTP_POST_VARS['mapa_y'] );
     	$newShape->add( $newLine );
	$temp = $targetFile->addShape( $newShape );
	
	echo "<p>result: $temp\n";//test
         	echo "<p>result: " . $targetFile->numshapes;//test
         	echo "<p>result: " . $targetFile->type;//test
         	echo "<p>result: " . $targetFile->source;//test

         $targetFile->free();
         $newLine->free();


-Ken-ichi


On Apr 10, 2004, at 2:15 PM, blaise wrote:

> Ken-ichi Ueda wrote:
>> Hi Blaise.  Thanks for responding!  I am on OS X (10.3.3), and I   
>> haven't gotten the ROSA applet to work in Safari, or in any other   
>> browser (IE, Firefox).  The applet loads ok, but none of the tools   
>> work.  I've had other java problems with DM code, including the color  
>>  picker applet with MapLab, which, again, displays, but none of the   
>> buttons work.
>
> Hi Ken-ichi
> Well, this is bad news for the Rosa Applet and for me who am looking  
> for such a free applet working on any machine and with any operating  
> system.
> (What java virtual machine do you have with Safari ? the Sun one ?)
> Have you managed to draw your new points ?
> On my side, I am stuck in compiling mapserver-4.0.2 with the ming  
> support (that allows flash, and that could replace the Rosa  
> Applet...). Any experience with ming / flash support for MapServer ?
> bye
> blaise
>




More information about the MapServer-users mailing list