[mapguide-users] Newbie's learning curve - custom scripts

Krunoslav a_krunoslav at gmx.net
Tue Apr 3 02:18:37 EDT 2007


Hi all.

So far I learned, with your help:

- preparing and putting raster images on the map
- creating layers from SHP files
- connecting to database
- tweak an ajax viewer

I'm already writing howto on this topics, to help newbies like me to get
started with mapguide. I knew I will come to the point where Studio is not
enough and I'll have to dig deeper into the code, and it seems like this is
it.

My next step is to get familiar with Mapguide's workflow and to better
understand it's functions, so I would be able to write my custom scripts for
different functions. I'm familiar with PHP and MySQL, but I'm also willing
to learn other stuff which would be necessary. Although I read documentation
of Viewer API, I still didn't succeed in implementing my own scripts in
mapguide. If you would help me with this simple example, I'm sure I would
understand mapguide's code processing much better. So, what I'm trying to
achieve:

I draw one layer from mysql database, and fetch object's properties: "ID,
owner, age". I have directory "pictures" which has pictures with filenames
like $ID.jpg

I would like to achieve: when I double-click on some object on the map, to
see in the properties pane the following:

<?php
//connecting to database part
?>
<table>
<tr><td colspan="2">Properties:</td></tr>
<tr><td>ID:</td><td><? echo object[id] ?></td></tr>
<tr><td>Owner:</td><td><? echo object[owner] ?></td></tr>
<tr><td>Age:</td><td><? echo object[age] ?></td></tr>
<tr><td colspan="2"> ../pictures/$id.jpg </td></tr>
</table>

Of course, this isn't the exact code, but I'm sure you see what I'm trying
to achieve. So let's say this is properties.php

How do I connect properties.php with double-click action and where do I
define to display this script in properties frame?  Also, how do I pass
parameter ID from object's ID on the map to the script?
-- 
View this message in context: http://www.nabble.com/Newbie%27s-learning-curve---custom-scripts-tf3510030s16610.html#a9804315
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list