[Chameleon] Displaying MySQL point over MapDHTML or MapImageSharedResource widgets

Bart van den Eijnden bartvde at xs4all.nl
Tue Nov 15 14:59:53 EST 2005


Hi,

with respect to your MySQL points, I would suggest looking at 
Mapserver's Virtual Spatial Data through OGR. You could use an ODBC 
connection, or compile GDAL/OGR against the MySQL client.

See also here:
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?VirtualSpatialData

I would suggest sticking with the MapDHTML widget.

Best regards,
Bart

Carlo Tronnberg wrote:

> Dear List,
>
> Sorry for this rather long message, but I need to get an answer as 
> soon as possible and want to be clear from the beginning. I have a 
> feeling that this can be useful to MANY newbies like me out there.
>
> I have some MySQL data (basically latitude, longitude, color of the 
> icon) that I want to plot on a map.
>
> This is rather urgent...
>
> 1.
> I use the SQLQuery Widget to get the data and tried out the 
> "MapImageSharedResource" Widget which sounded very promising, 
> extracting directly the points from the sharedresource returned by the 
> SQLQuery.
>
> Here is an extract of the code I used with the 
> "MapImageSharedResource" Widget:
> __________
> <CWC2 Type="SQLQuery" sqlquery="SELECT latitude, longitude FROM 
> dealer" Server="localhost" DBTYPE="MYSQL" Database="test2" 
> UserName="root" Password="1234" SharedResourceName="MyResult2">
>    <ONEVENT Event="ConnectFailed" Text="Connection failed."/>
>    <ONEVENT Event="SelectDBFailed" Text="Databse don't exist."/>
>    <ONEVENT Event="QueryFailed" Text="Query failed."/>
>    <ONEVENT Event="NoRowReturned" Template="noresult"/>
>    <ONEVENT Event="GeocodeFailed" Template="error"/>
> </CWC2>
>
> <CWC2 TYPE="MapImageSharedResource" id="inline" Width="500" 
> Height="250" Navigable="false" Transparent="true" SYMBOLOVERLAP="true" 
> AUTOEXTENT="false">
>    <POINTS NAME="START" SRNAME="MyResult_IMAGE" SRLATCOL="latitude" 
> SRLONCOL="longitude" type="unique" LABEL="Team [$MyResult_IMAGE.Id]"/>
>    <MAP POINT="START" TYPE="STYLE" PARAM="color" VALUE="00FF00"/>
>    <MAP POINT="START" TYPE="STYLE" PARAM="size" VALUE="25"/>
>    <POINTS NAME="END" SRNAME="Elu" SRLATCOL="gps_lat_degree" 
> SRLONCOL="gps_long_degree" type="unique" LABEL="Team [$Elu.team_id]"/>
>    <MAP POINT="END" TYPE="STYLE" PARAM="color" VALUE="0000FF"/>
>    <MAP POINT="END" TYPE="STYLE" PARAM="size" VALUE="20"/>
> </CWC2>
> ___________
> Unfortunately this doesn't work well. After some tweaking I got the 
> map generated OK but a lot of error messages in the web page which 
> cannot be removed.
>
> Error message:
> Notice: Undefined property: sName in 
> C:\ms4w\apps\chameleon\htdocs\common\wrapper\map_session.php on line 
> 1073.
>
> I went through all the material online I could find but I simply could 
> not make it work well. Am I missing something?
>
> I use ms4w_1.2.2 and chameleon_ms4w-2.2
> Is it possible that the versions I use do not work properly (too 
> new?). I also tried ms4w_1.3.0 but that gave even more errors with PHP 
> (not even the Cameleon samples worked!)
>
> 2.
> I have generated a pretty nice environment based on the Chameleon 
> samples, using the MapDHTML widget for the map. Unfortunately I do not 
> know how to get MySQL points on it via the mapserver.
>
> Can the MapDHTML Widget also get points added to it in the same way as 
> the MapImageSharedResource Widget can?
>
> 3.
> Anotherway around... If the MapImageSharedResource works correctly, is 
> it possible to make it behave as the MapDHTML widget (Navigation...) 
> so it can be integrated instead of it in the Chameleon samples?
>
> A lot of questions from a desesperate newbie... (I went through the 
> Mailing lists and could not get the answers...)
>
> Best Regards,
>
> Carlo Tronnberg
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
>
>



More information about the Chameleon mailing list