Imagemaps always empty

Stéphane RIFF stephane.riff at CERENE.FR
Thu Apr 14 10:24:10 EDT 2005


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
>>
>>
>
>
>



More information about the mapserver-users mailing list