<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Thanks Bart for the tip! This is MUCH
better.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have a slight problem still: </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>If I use in the 'virtual.ovf' file the SrcLayer
tag, there are no problems. </FONT></DIV>
<DIV><FONT face=Arial size=2><OGRVRTDataSource><BR>
<OGRVRTLayer name="mylayer"><BR>
<SrcDataSource>ODBC:elu/Elu51221!@eluodbc</SrcDataSource>
<BR> <SrcLayer>lineup</SrcLayer><BR> <GeometryType>wkbPoint</GeometryType>
<BR>
<LayerSRS>WGS84</LayerSRS><BR> <GeometryField
encoding="PointFromColumns" x="gps_lat_degree" y="gps_long_degree"/>
<BR>
</OGRVRTLayer><BR></OGRVRTDataSource></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>BUT! If I want to execute an SQL Query (which I
DO!) with the SrcSQL tag, as follows,</FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT face=Arial size=2><OGRVRTDataSource><BR>
<OGRVRTLayer
name="mylayer2"><BR>
<SrcDataSource>ODBC:elu/Elu51221!@eluodbc</SrcDataSource><BR>
<SrcSQL>SELECT lineup.* FROM lineup WHERE lineup.team_id = 71
</SrcSQL><BR>
<GeometryType>wkbPoint</GeometryType>
<BR>
<LayerSRS>WGS84</LayerSRS><BR>
<GeometryField encoding="PointFromColumns" x="gps_lat_degree"
y="gps_long_degree"/> <BR>
</OGRVRTLayer><BR></OGRVRTDataSource></FONT></DIV></BLOCKQUOTE>
<DIV><FONT face=Arial size=2>Then mapserver will not generate the map. (Nothing
comes out then, not even the other existing layers)</FONT></DIV>
<DIV><FONT face=Arial size=2>I ran both versions of the ovf file with ogrinfo
and the SrcSQL version threw an ERROR 1: SetAttributeFilter() not supported on
ExecuteSQL() results.</FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT face=Arial size=2>C:\ms4w\apps\elu\map>ogrinfo -ro virtual.ovf
mylayer<BR>INFO: Open of `virtual.ovf'<BR>using driver `VRT'
successful.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Layer name: mylayer<BR>Geometry: Point<BR>Feature
Count: 35<BR>ERROR 1: SetAttributeFilter() not supported on ExecuteSQL()
results.<BR>Extent: (0.000000, 0.000000) - (42.000000, 18.000000)<BR>Layer SRS
WKT:<BR>GEOGCS["WGS 84",<BR>
DATUM["WGS_1984",<BR> SPHEROID["WGS
84",6378137,298.257223563,<BR>
AUTHORITY["EPSG","7030"]],</FONT></DIV>
<DIV><FONT face=Arial size=2>etc ....</FONT></DIV></BLOCKQUOTE>
<DIV><FONT face=Arial size=2>Even the simplest SQL query will cause the same
problem.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here is the layer I am using:</FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT face=Arial size=2>
LAYER<BR> NAME "All
Stations"<BR> TYPE
POINT<BR> CONNECTIONTYPE
OGR<BR> CONNECTION
"virtual.ovf"<BR> DATA
"mylayer"<BR> STATUS
ON<BR> # LABELITEM lineup.team_id #may
need to use table.name or just name depending on your OVF
file.<BR>
PROJECTION<BR>
"init=epsg:4326"<BR>
END<BR>
CLASS<BR> SYMBOL
2<BR> SIZE
16<BR> COLOR 100 100
100<BR>
LABEL<BR> SIZE
MEDIUM<BR> TYPE
BITMAP<BR> COLOR 0 0
0<BR>
END<BR> END<BR>
END</FONT></DIV></BLOCKQUOTE>
<DIV><FONT face=Arial size=2>What am I doing wrong?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Best regards,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Carlo</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>----- Original Message ----- </FONT>
<DIV><FONT face=Arial size=2>From: "Bart van den Eijnden" <</FONT><A
href="mailto:bartvde@xs4all.nl"><FONT face=Arial
size=2>bartvde@xs4all.nl</FONT></A><FONT face=Arial size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>To: "Carlo Tronnberg" <</FONT><A
href="mailto:temp@chello.hu"><FONT face=Arial
size=2>temp@chello.hu</FONT></A><FONT face=Arial size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>Cc: <</FONT><A
href="mailto:chameleon@lists.maptools.org"><FONT face=Arial
size=2>chameleon@lists.maptools.org</FONT></A><FONT face=Arial
size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>Sent: Tuesday, November 15, 2005 20:59</FONT></DIV>
<DIV><FONT face=Arial size=2>Subject: Re: [Chameleon] Displaying MySQL point
over MapDHTML or MapImageSharedResource widgets</FONT></DIV></DIV>
<DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV><FONT face=Arial
size=2>> Hi,<BR>> <BR>> with respect to your MySQL points, I would
suggest looking at <BR>> Mapserver's Virtual Spatial Data through OGR. You
could use an ODBC <BR>> connection, or compile GDAL/OGR against the MySQL
client.<BR>> <BR>> See also here:<BR>> </FONT><A
href="http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?VirtualSpatialData"><FONT
face=Arial
size=2>http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?VirtualSpatialData</FONT></A><BR><FONT
face=Arial size=2>> <BR>> I would suggest sticking with the MapDHTML
widget.<BR>> <BR>> Best regards,<BR>> Bart<BR>> <BR>> Carlo
Tronnberg wrote:<BR>> <BR>>> Dear List,<BR>>><BR>>> Sorry
for this rather long message, but I need to get an answer as <BR>>> soon
as possible and want to be clear from the beginning. I have a <BR>>>
feeling that this can be useful to MANY newbies like me out
there.<BR>>><BR>>> I have some MySQL data (basically latitude,
longitude, color of the <BR>>> icon) that I want to plot on a
map.<BR>>><BR>>> This is rather urgent...<BR>>><BR>>>
1.<BR>>> I use the SQLQuery Widget to get the data and tried out the
<BR>>> "MapImageSharedResource" Widget which sounded very promising,
<BR>>> extracting directly the points from the sharedresource returned by
the <BR>>> SQLQuery.<BR>>><BR>>> Here is an extract of the
code I used with the <BR>>> "MapImageSharedResource" Widget:<BR>>>
__________<BR>>> <CWC2 Type="SQLQuery" sqlquery="SELECT latitude,
longitude FROM <BR>>> dealer" Server="localhost" DBTYPE="MYSQL"
Database="test2" <BR>>> UserName="root" Password="1234"
SharedResourceName="MyResult2"><BR>>> <ONEVENT
Event="ConnectFailed" Text="Connection
failed."/><BR>>> <ONEVENT Event="SelectDBFailed"
Text="Databse don't exist."/><BR>>> <ONEVENT
Event="QueryFailed" Text="Query failed."/><BR>>>
<ONEVENT Event="NoRowReturned"
Template="noresult"/><BR>>> <ONEVENT
Event="GeocodeFailed" Template="error"/><BR>>>
</CWC2><BR>>><BR>>> <CWC2 TYPE="MapImageSharedResource"
id="inline" Width="500" <BR>>> Height="250" Navigable="false"
Transparent="true" SYMBOLOVERLAP="true" <BR>>>
AUTOEXTENT="false"><BR>>> <POINTS NAME="START"
SRNAME="MyResult_IMAGE" SRLATCOL="latitude" <BR>>> SRLONCOL="longitude"
type="unique" LABEL="Team
[$MyResult_IMAGE.Id]"/><BR>>> <MAP POINT="START"
TYPE="STYLE" PARAM="color" VALUE="00FF00"/><BR>>>
<MAP POINT="START" TYPE="STYLE" PARAM="size"
VALUE="25"/><BR>>> <POINTS NAME="END" SRNAME="Elu"
SRLATCOL="gps_lat_degree" <BR>>> SRLONCOL="gps_long_degree" type="unique"
LABEL="Team [$Elu.team_id]"/><BR>>> <MAP
POINT="END" TYPE="STYLE" PARAM="color"
VALUE="0000FF"/><BR>>> <MAP POINT="END"
TYPE="STYLE" PARAM="size" VALUE="20"/><BR>>> </CWC2><BR>>>
___________<BR>>> Unfortunately this doesn't work well. After some
tweaking I got the <BR>>> map generated OK but a lot of error messages in
the web page which <BR>>> cannot be removed.<BR>>><BR>>> Error
message:<BR>>> Notice: Undefined property: sName in <BR>>>
C:\ms4w\apps\chameleon\htdocs\common\wrapper\map_session.php on line
<BR>>> 1073.<BR>>><BR>>> I went through all the material
online I could find but I simply could <BR>>> not make it work well. Am I
missing something?<BR>>><BR>>> I use ms4w_1.2.2 and
chameleon_ms4w-2.2<BR>>> Is it possible that the versions I use do not
work properly (too <BR>>> new?). I also tried ms4w_1.3.0 but that gave
even more errors with PHP <BR>>> (not even the Cameleon samples
worked!)<BR>>><BR>>> 2.<BR>>> I have generated a pretty nice
environment based on the Chameleon <BR>>> samples, using the MapDHTML
widget for the map. Unfortunately I do not <BR>>> know how to get MySQL
points on it via the mapserver.<BR>>><BR>>> Can the MapDHTML Widget
also get points added to it in the same way as <BR>>> the
MapImageSharedResource Widget can?<BR>>><BR>>> 3.<BR>>>
Anotherway around... If the MapImageSharedResource works correctly, is
<BR>>> it possible to make it behave as the MapDHTML widget
(Navigation...) <BR>>> so it can be integrated instead of it in the
Chameleon samples?<BR>>><BR>>> A lot of questions from a desesperate
newbie... (I went through the <BR>>> Mailing lists and could not get the
answers...)<BR>>><BR>>> Best Regards,<BR>>><BR>>> Carlo
Tronnberg<BR>>>
_______________________________________________<BR>>> Chameleon mailing
list<BR>>> </FONT><A href="mailto:Chameleon@lists.maptools.org"><FONT
face=Arial size=2>Chameleon@lists.maptools.org</FONT></A><BR><FONT face=Arial
size=2>>> </FONT><A
href="http://lists.maptools.org/mailman/listinfo/chameleon"><FONT face=Arial
size=2>http://lists.maptools.org/mailman/listinfo/chameleon</FONT></A><BR><FONT
face=Arial size=2>>><BR>>><BR>></FONT></BODY></HTML>