Imagemaps always empty

Bob Bruce covariance at SHAW.CA
Thu Apr 14 22:52:25 PDT 2005


On Thu, 14 Apr 2005 16:24:10 +0200, =?ISO-8859-1?Q?St=E9phane_RIFF?=
<stephane.riff at CERENE.FR> wrote:

>Another thought on mapserver source.
>In mapdraw.c, the function "msDrawShape" :
>There a switch on layer type in case MS_LAYER_POINT
>
>    there is a loop on "shape->line[j].numpoints" but if it's a point layer
>    i think there is only one point so shape->line[0].point[0] is the
>point we want to draw.
>    If we agree that the shape can only have one point we can pass a
>shape object to "msDrawMarkerSymbol"
>    instead of a point object and in mapimagemap.c in the function
>"msDrawMarkerSymbolIM" we can get the point x,y
>    with shape->line[0].point[0] and the shape index with shape->index
>so we can get the point index in datasource
>    like polygons
>
>So my question is why point layer are process like a polygon layer by
>msDrawShape ?
>
>
>Stéphane RIFF wrote:
>
>> I found why it doesn't work.
>> When looking in mapimagemap.c i found
>> that only symbol "0" are process so in the mapfile
>> you have to set all your symbols to "0" or nothing process
>>
>> Another question how can i get id of a pointObj so i can query
>> (shapefile or postgis) to get data from datasource instead of the
>> layer name ???
>>
>> Stéphane RIFF wrote:
>>
>>> Hi
>>>
>>> I tried to make imagemap support to work with no success.
>>>
>>> I have a mapfile create with phpmapscript. there is one point layer,
>>> this mapfile draws fine so i can see my symbols in a png image.
>>>
>>> Now i take the same mapfile with :
>>> IMAGETYPE imagemap
>>>
>>> OUTPUTFORMAT
>>>    NAME imagemap
>>>     DRIVER imagemap
>>>     FORMATOPTION "POLYHREF=#"
>>>     FORMATOPTION "SYMBOLHREF=#"
>>>     FORMATOPTION "SUPPRESS=YES"
>>>     FORMATOPTION "MAPNAME=map_test"
>>>     FORMATOPTION "POLYMOUSEOUT=alert('poly out');"
>>>     FORMATOPTION "POLYMOUSEOVER=alert('poly  %s');"
>>>         FORMATOPTION "SYMBOLMOUSEOUT=alert('symbol out');"
>>>     FORMATOPTION "SYMBOLMOUSEOVER=alert('symbol %s');"
>>>     MIMETYPE "text/html"
>>>  END
>>>
>>> With phpmapscript i do that :
>>> $imagemap =
>>> ms_newMapObj("/var/www/html/map/imagemap.map","/var/www/html/map/");
>>> $htmlmap = $imagemap->draw();
>>> $htmlmap->saveImage("/var/tmp/test.html", $imagemap);
>>>
>>> Here comes the problem : there is no error and tha imagemap file is
>>> write well but i always get this in "/var/tmp/test.html":
>>> <map name="map_test" width="600" height="600">
>>> </map>
>>>
>>> I use mapserver 4.4.2 , postgis , phpmapscript on redhat box.
>>>
>>> Every advice are welcome
>>> Thanks
>>>
>>>
>>
>>
>>

Stéphane:
          I have been doing some work on this very area with some help from
Frank Warmerdam and Assefa Yewondwossen. The reason that the points are
being retrieved and used is that these points trace the outline of the point
object.

   However the work that was done on the code did not provide the ID of the
point objects to the mapimagemap.c module for inclusion in the image map
code to the web page. So I proceeded to modify some modules to pass the IDs
down to this code and actually output them to the image maps. These changes
were only implemented for VECTOR type symbols. Now I am getting image maps
outlining the point symbols with the point IDs included in the event calls.

   My changes required making changes to the mapdraw.c module which is at a
high level in the code and also I only modified the PHP version of
MapScript. To this date I haven't submitted my changes to the system since I
don't know how to go about doing this.

   Currently I am having trouble with my build on my Windows system but I
don't think it is caused by my changes since I have seen other people
reporting these problems on the list. I will try submitting my changes to
the list soon though.

  I would be happy to provide you with my code changes if you want to try
building this on your Redhat system. Just let me know if you want me to send
this to you.

       Bob Bruce, Winnipeg, Manitoba



More information about the MapServer-users mailing list