Opened 13 years ago

Last modified 6 years ago

#1757 reopened defect

Quick Plot cannot generate map picture in some non-English locale

Reported by: wuma Owned by: Mars Wu
Priority: high Milestone: 4.0
Component: General Version: 2.2.0
Severity: major Keywords:
Cc: thomaslorenzon External ID: 1406806

Description

In some non-English locale, for instance French or German where the decimal point and digit separator are not the same as English, if you run Quick Plot to generate a map picture, you will always get a message on the preview dialog saying: “The application resources required to generate the plot exceed the settings defined by the administrator”.

The reason is that Quick Plot encodes (as string) the parameters like centerX, centerY, PaperSize etc. always in English format (. as decimal point and , as digit separator) but when parsing the values with aspx, php or jsp, current culture will be used then the value will be invalid.

To fix it, the passed string values should be parsed always in English format.

Attachments (2)

ticket1757_quickplot_ajax.patch (7.5 KB ) - added by wuma 13 years ago.
ticket1757_quickplot_fusion.patch (3.4 KB ) - added by wuma 13 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by wuma, 13 years ago

r6010 to trunk

comment:3 by wuma, 13 years ago

r6012 to adsk sandbox 2.3r

2417 to fusion adsk sandbox 2.3r: http://trac.osgeo.org/fusion/changeset/2417

comment:5 by wuma, 13 years ago

Resolution: fixed
Status: newclosed

comment:6 by thomaslorenzon, 13 years ago

Resolution: fixed
Status: closedreopened
Summary: Quick Ploat cannot generate map picture in some non-English localeQuick Plot cannot generate map picture in some non-English locale

I tried to implement on MGE2012 (italian version) your patch but it doesn't work (a black image is generated). Then I had a look at GeneratePicture.php and found a possible solution. Modify row 106 as follow:

$mapAgent .="/mapserver2012/mapagent/mapagent.fcgi?VERSION=1.0.0&OPERATION=GETMAPIMAGE" .

Now for me it works but I known that it doesn't work with MGOS. Someone can change it and do it better?

Thanks, Thomas

in reply to:  6 comment:7 by wuma, 13 years ago

Replying to thomaslorenzon:

I tried to implement on MGE2012 (italian version) your patch but it doesn't work (a black image is generated). Then I had a look at GeneratePicture.php and found a possible solution. Modify row 106 as follow:

$mapAgent .="/mapserver2012/mapagent/mapagent.fcgi?VERSION=1.0.0&OPERATION=GETMAPIMAGE" .

Now for me it works but I known that it doesn't work with MGOS. Someone can change it and do it better?

Thanks, Thomas

Can you tell me your configuration? Windows or Linux, IIS or Apache? The $mapAgent cannot be changed as you mentioned, because it will not work if your Web Extension is behind a Http proxy server. And you cannot use http://locahost either, because it doesn't work with Apache + Php. http://127.0.0.1 should always work with IPv4. And with RFC 118, I plan to change the way of generating the print picture from calling Http API to calling Web Tier API. And a new MgMap::SetDisplayDpi will be exposed to support the change.

comment:8 by thomaslorenzon, 13 years ago

Cc: thomaslorenzon added

My configuration is Windows Server 2003 (Italian version) + IIS + MGE 2012 (Italian Version). I tried also with http://127.0.0.1 and it works. I think that row 105 of GeneratePicture.php must add "/mapserver2012/" (for MGE 2012) or "/mapguide/" (for MG OS). But it doesn't work.

in reply to:  8 comment:9 by wuma, 13 years ago

Replying to thomaslorenzon:

My configuration is Windows Server 2003 (Italian version) + IIS + MGE 2012 (Italian Version). I tried also with http://127.0.0.1 and it works. I think that row 105 of GeneratePicture.php must add "/mapserver2012/" (for MGE 2012) or "/mapguide/" (for MG OS). But it doesn't work.

Below code is used to get the virtual directory name from the URL:

$mapAgent .= substr($_SERVER["REQUEST_URI"], 0, strpos($_SERVER["REQUEST_URI"], "/", 1)); 

So it's not necessary to specify either mapserver2012 or mapguide. Could you use firebug to find out what the generated image src is? Is it a correct url?

comment:10 by thomaslorenzon, 13 years ago

Sorry in advance for my english and for my firebug knownledge.. How can I use firebug for debugging a php page? GeneratePicture.php doesn't show anything, just send an image

This is the image src of the preview image: <img src="GeneratePicture.php?session_id=29453cac-b9b7-11e0-8000-000c297c9304_en_7F0000010B060B050B04&amp;map_name=Sheboygan4e3265e474392&amp;print_dpi=300&amp;paper_size=297,210&amp;box=-87.72847257218196,43.74324250536751,-87.72180258119737,43.74324250536751,-87.72180258119737,43.747958660609136,-87.72847257218196,43.747958660609136&amp;normalized_box=-87.72847257218196,43.74324250536751,-87.72180258119737,43.74324250536751,-87.72180258119737,43.747958660609136,-87.72847257218196,43.747958660609136&amp;scale_denominator=2500&amp;rotation=0" id="PrintPicture" style="opacity: 1; visibility: visible;">

I try this:

  • comment out in GeneratePicture.php all the "generate image" code
  • use echo to show $mapAgent value
  • load just GeneratePicture.php passing the above parameters

I get this value for $mapAgent: http://127.0.0.1:80/mapagent/mapagent.fcgi?VERSION=1.0.0&OPERATION=GETMAPIMAGE&SESSION=f3013dac-b921-11e0-8000-000c297c9304_en_7F0000010B060B050B04&MAPNAME=Sheboygan_base4e316b81d9444&FORMAT=PNG&SETVIEWCENTERX=-87.737474152861&SETVIEWCENTERY=43.765018730747&SETVIEWSCALE=5000&SETDISPLAYDPI=300&SETDISPLAYWIDTH=4960.6299212598&SETDISPLAYHEIGHT=3507.874015748&CLIP=0

As you can see there is no "mapuide" or "mapserver2012" path.

in reply to:  10 comment:11 by wuma, 13 years ago

Replying to thomaslorenzon:

Sorry in advance for my english and for my firebug knownledge.. How can I use firebug for debugging a php page? GeneratePicture.php doesn't show anything, just send an image

This is the image src of the preview image: <img src="GeneratePicture.php?session_id=29453cac-b9b7-11e0-8000-000c297c9304_en_7F0000010B060B050B04&amp;map_name=Sheboygan4e3265e474392&amp;print_dpi=300&amp;paper_size=297,210&amp;box=-87.72847257218196,43.74324250536751,-87.72180258119737,43.74324250536751,-87.72180258119737,43.747958660609136,-87.72847257218196,43.747958660609136&amp;normalized_box=-87.72847257218196,43.74324250536751,-87.72180258119737,43.74324250536751,-87.72180258119737,43.747958660609136,-87.72847257218196,43.747958660609136&amp;scale_denominator=2500&amp;rotation=0" id="PrintPicture" style="opacity: 1; visibility: visible;">

I try this:

  • comment out in GeneratePicture.php all the "generate image" code
  • use echo to show $mapAgent value
  • load just GeneratePicture.php passing the above parameters

I get this value for $mapAgent: http://127.0.0.1:80/mapagent/mapagent.fcgi?VERSION=1.0.0&OPERATION=GETMAPIMAGE&SESSION=f3013dac-b921-11e0-8000-000c297c9304_en_7F0000010B060B050B04&MAPNAME=Sheboygan_base4e316b81d9444&FORMAT=PNG&SETVIEWCENTERX=-87.737474152861&SETVIEWCENTERY=43.765018730747&SETVIEWSCALE=5000&SETDISPLAYDPI=300&SETDISPLAYWIDTH=4960.6299212598&SETDISPLAYHEIGHT=3507.874015748&CLIP=0

As you can see there is no "mapuide" or "mapserver2012" path.

Could you let me know your URL for installed MapGuide? Is there either "mapserver2012" or "mapguide"? It seems $_SERVER["REQUEST_URI"] doesn't get your virtual directory correctly which is strange...

comment:12 by jng, 12 years ago

Milestone: 2.5

comment:13 by jng, 7 years ago

Milestone: 3.03.3

Ticket retargeted after milestone closed

comment:14 by jng, 6 years ago

Milestone: 3.34.0

Milestone renamed

Note: See TracTickets for help on using tickets.