|
MakeDelayedMap is not returning correct parameters |
Posted by at on Mar-07-2022 10:55 |
|
Hi,
We recently encountered a weird issue where the $c->makeDelayedMap is returning "ret&" string instead of the usual url parameters needed to retrieve the image maps in the session. This is only happening to a particular server, all other servers that we installed our application is working fine. We can verify that the session is working since the charts are displayed and zooming feature is working also.
The server(in PHP with our app in it) is in a private local network and we can only browse/use the app using a computer connected to that network via remote desktop.
Can you advice what could be the possible cause of the issue and ways to troubleshoot it?
Thanks. |
Re: MakeDelayedMap is not returning correct parameters |
Posted by at on Mar-07-2022 10:57 |
|
Slight correction, not $c->makeDelayedMap() but $viewer->makeDelayedMap() |
Re: MakeDelayedMap is not returning correct parameters |
Posted by Peter Kwan on Mar-07-2022 17:27 |
|
Hi at,
Note that in ChartDirector 7. the makeDelayedMap will no longer delayed the map. Typically, makeDelayedMap will be used like:
$viewer->setImageMap("getchart.php?".$viewer->makeDelayedMap($imageMap));
In ChartDirector 7, the makeDelayedImage will just return the $imageMap unchanged. The WebChartViewer will ignore all characters before the first "<" character (because an image map should start with an HTML tag). So the "getchart.php?" part will be ignore and the above code should be equivalent to a regular image map:
$viewer->setImageMap($imageMap);
The makeDelayedMap was introduced long time ago when the Internet is much slower. It delays the image map so that the web page can be loaded faster, at the expense of heavier server overhead, and that the user may need to await sometime for the chart to be responsive to mouse actions (such as displaying tooltips). Nowadays people can even watch video over the Internet, so it is fast enough and the delay would not be necessary. We suggest existing code that uses makeDelayedMap can be simplified to use "$viewer->setImageMap($imageMap);" directly.
For your case, if you are not using ChartDirector 7 and still want to use makeDelayedMap, please modify the code to:
$aaa = $imageMap;
$bbb = $viewer->makeDelayedMap($imageMap)
$viewer->setImageMap("getchart.php?".$bbb);
Then somewhere in your HTML code, please use:
<xmp>
=============
<?php echo $aaa ?>
=============
<?php echo $bbb ?>
=============
</xmp>
The above will display the original image map in text, and also the output of the makeDelayedMap. Please check if they are what you expect. If they looks incorrect, please copy and paste the output to a text edit, and attach it to your message. (If you copy and paste directly to the forum, because the content are HTML tags itself, the forum software may filter out some of them.)
If the output looks correct, please open the developer window of your browser (in Chrome, press F12), and monitor the network. You should see the "getchart.php" network request and response. Check if the response is the correct image map.
If your web page is accessible from the Internet, please let me know the URL. I can use my browser to check if the web page and network exchange to see if there is anything unusual. You can email the URL to me at pkwan@advsofteng.net
Regards
Peter Kwan |
Re: MakeDelayedMap is not returning correct parameters |
Posted by at on Mar-08-2022 16:10 |
|
Hi Peter,
Unfortunately, it's not accessible from the internet. As I mentioned, it's the MakeDelayedMap call that's is returning the 'ret&' string ($bbb from your sample code above) which is weird.
But this made me realize and since you deprecated it in your latest release, to not use the makeDelayedMap anymore, will check if this somehow solves the issue.
Thanks. |
Re: MakeDelayedMap is not returning correct parameters |
Posted by Peter Kwan on Mar-08-2022 17:09 |
|
Hi at,
May be you can remove the makeDelayedMap to see it can solve the problem, that is, just use:
$viewer->setImageMap($imageMap);
If you need to use makeDelayedMap, and the problem only occurs on one machine, my speculation is:
(a) The makeDelayedMap method in "phpchartdir.php" is corrupted. The "phpchartdir.php" is just a text file like any php file, and there may be a very small chance that it is altered by accident.
(b) May be some $imageMap text strings will trigger the problem. If it is possible to provide the $aaa and $bbb, I would try to see if I can reproduce the problem.
Regards
Peter Kwan |
Re: MakeDelayedMap is not returning correct parameters |
Posted by at on Mar-09-2022 17:17 |
|
Hi Peter, not using the makeDelayedMap works. Unfortunately, I have a very limited access and can't really debug further. Gonna have to settle with not using the makeDelayedMap for that server.
Thanks. |
|