[mapserver-users] imagemaps using php mapscript?

Steve Lime Steve.Lime at dnr.state.mn.us
Tue Mar 31 14:28:48 EDT 2009


It was to the list. Basically it said you have to do a query before
processing
the results through a template. I didn't see a query in your code.

I don't think browse templates work through that mechanism.

Steve

>>> On 3/31/2009 at 12:23 PM, in message
<BAY117-W28789309040BD0942AF1A6F98A0 at phx.gbl>, "P. R.M."
<romero619 at hotmail.com> wrote:

> Steve,
> sorry I never saw your reply go by.
> did you respond to the list or personally?
> could you please repost your response?
> 
> P.ROmero
> 
> ----------------------------------------
>> Date: Tue, 31 Mar 2009 11:10:39 -0500
>> From: Steve.Lime at dnr.state.mn.us 
>> To: romero619 at hotmail.com; mapserver-users at lists.osgeo.org 
>> Subject: RE: [mapserver-users] imagemaps using php mapscript?
>>
>> I sent a reply about having to query before processing through a
>> template. Did you
>> not get that?
>>
>> Steve
>>
>>>>> On 3/30/2009 at 9:19 PM, in message
>> , "P. R.M."
>> wrote:
>>
>>> Im bumping this message, hoping for some help/feedback (see
below).
>>>
>>> is there a problem with the mapserver mailing list?
>>> - several questions have gone by in the past few days (from both
>> myself and
>>> other users) without any responses...
>>>
>>> Please help,
>>>
>>> Thanks,
>>> P.Romero
>>>
>>> ----------------------------------------
>>>> From: romero619 at hotmail.com 
>>>> To: iacovlev.pavel at gmail.com; mapserver-users at lists.osgeo.org 
>>>> Subject: RE: [mapserver-users] imagemaps using php mapscript?
>>>> Date: Sat, 28 Mar 2009 13:08:27 -0700
>>>> CC:
>>>>
>>>>
>>>> thanks, but that didnt help much.
>>>> I have this:
>>>>
>>>> $map = ms_newMapObj("/data/www/html/test/test.map");
>>>> $img=$map->draw();
>>>>
>>>> $tmparray["img_url"] = $img->saveWebImage();
>>>>
>>>> # remove '/data/www/html' directory prefix
>>>> # from the resulting url string
>>>>
>>>> $tmparray["img_url"] =
>>> substr($tmparray["img_url"],14,strlen($tmparray["img_url"]));
>>>>
>>>> $html=$map->processquerytemplate($tmparray);
>>>> echo $html;
>>>>
>>>> However, the processquerytemplate() function is not processing
the
>> data in
>>> my points layer.
>>>> the imagemap html tags are empty, even though the points from my
>> points
>>> layer are correctly being drawn on the map image.
>>>>
>>>> Here's the relevant sections of my mapfile, including my points
>> layer:
>>>>
>>>> OUTPUTFORMAT
>>>> NAME 'html'
>>>> DRIVER 'TEMPLATE'
>>>> MIMETYPE 'text/html'
>>>> FORMATOPTION 'FILE=/data/www/html/test/testmap.html'
>>>> END
>>>> QUERYMAP
>>>> STATUS ON
>>>> STYLE NORMAL
>>>> END
>>>> WEB
>>>> QUERYFORMAT 'html'
>>>> LOG "/data/www/html/test/mslog"
>>>> IMAGEPATH "/data/www/html/images/mapserver/tmp/"
>>>> IMAGEURL "/data/www/html/images/mapserver/tmp/"
>>>> MAXSCALE 15500000
>>>> END
>>>> LAYER
>>>> NAME "mypoints"
>>>> STATUS DEFAULT
>>>> CONNECTIONTYPE OGR
>>>> CONNECTION "test.ovf"
>>>> DATA "mypoints"
>>>> TYPE POINT
>>>> TEMPLATE "/data/www/html/test/testmap.html"
>>>> CLASS
>>>> NAME "None"
>>>> STYLE
>>>> SYMBOL 'arrow'
>>>> ANGLE [ADIR]
>>>> SIZE [MAG]
>>>> END
>>>> END
>>>> END
>>>>
>>>> the documentation says that the processquerytemplate() function
>> apparently
>>> only processes at the mapobject layer, so it doesnt seem to
process
>> each
>>> layer. Is this correct?
>>>>
>>>> How can I process the html template file using the points in my
>> points
>>> layer?
>>>>
>>>> Please help,
>>>> Thanks,
>>>> P.Romero
>>>> ________________________________
>>>>> Date: Sat, 28 Mar 2009 21:29:35 +0200
>>>>> Subject: Re: [mapserver-users] imagemaps using php mapscript?
>>>>> From: iacovlev.pavel at gmail.com 
>>>>> To: romero619 at hotmail.com 
>>>>>
>>>>> $image = $map->draw();
>>>>>
>>>>> ob_start();
>>>>> $image->saveimage('');
>>>>> $image = imagecreatefromstring(ob_get_contents());
>>>>> $contents = ob_get_contents();
>>>>> ob_end_clean();
>>>>>
>>>>> imagepng($image);
>>>>>
>>>>>
>>>>> 2009/3/28 P.Romero>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> How can this example:
>>>>>
>>>>>
>>>>>
>>>>> http://mapserver.org/output/imagemaps.html?highlight=imagemap 
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> be implemented using php mapscript?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> More specifically, how can the html output for the imagemap
>>>>> be separated from the imageobject, and stored into a php
variable?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Im hoping for something like….
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> $map = ms_newMapObj("mymapfile.map");
>>>>>
>>>>>
>>>>>
>>>>> $map_img=$img=$map->draw();
>>>>>
>>>>>
>>>>>
>>>>> $imagemap_html=$map->get_html_output();
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ...and then I can separately handle the image & html
>>>>> output.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Is this possible?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Please help,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>>
>>>>>
>>>>> P.Romero
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>>
>>>>> mapserver-users mailing list
>>>>>
>>>>> mapserver-users at lists.osgeo.org 
>>>>>
>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users 
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> http://iap.md, The future is open
>>>> _________________________________________________________________
>>>> Express your personality in color! Preview and select themes for
>> Hotmail®.
>>>>
>>>
>> 
>
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_W

> 
>>
>>>
>> 
>
L_HM_express_032009#colortheme_______________________________________________
>>>> mapserver-users mailing list
>>>> mapserver-users at lists.osgeo.org 
>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users 
>>> _________________________________________________________________
>>> Express your personality in color! Preview and select themes for
>> Hotmail®.
>>>
>>
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_

>>
>>>
>> 
>
WL_HM_express_032009#colortheme______________________________________________
>>> _
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org 
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users 
> _________________________________________________________________
> Hotmail® is up to 70% faster. Now good news travels really fast.
>
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009


More information about the mapserver-users mailing list