[Cartoweb-dev] Problem pdfRotate

Oliver Christen oliver.christen at camptocamp.com
Tue Mar 13 09:43:00 EST 2007


the pdfRotate is causing such problem because it was developped later and 
hence its flow of operation is outside the main dhtml flow, causing such 
conflicts. To be more precise, an additional function call 
("hidePdfFeature()") is attached to the tool buttons when using pdfRotate, 
so each tool button have: 1 functions call for activation of itself, 1 
function call for the deactivation of the pdfRotate tool. There is no way to 
know exactly which function will be called first and which will finish 
first, hence causing the kind of problems you noticed

in the case of outline, the problem is as you stated it, outline is 
activated before pdfRotate is deactivated

one possibility is to create some kind of generic tool switcher function 
that will be called when changing tools instead of the actual 
"mainmap.*toolname*('map');" and "hidePdfFeature()" attached to the tools 
buttons.

that tool switcher will then call the specific tools cleaner and initializer 
functions in order, first the the "hidePdfFeature()" then the 
"mainmap.*toolname*('map');"
that way, all tools follow the same flow and their activation/deactivation 
is not random

Regards,
Oliver

----- Original Message ----- 
From: "Dirk Jesko" <ml.dje at geocontent.de>
To: <cartoweb-dev at lists.maptools.org>
Sent: Tuesday, March 13, 2007 9:14 AM
Subject: [Cartoweb-dev] Problem pdfRotate


> Hello,
>
> I encountered the following problem: First, the preview rectangle for the 
> pdfExport using pdfRotate is activated. Now I change the tool. In most 
> cases the preview rectangle is removed as expected. However, some tools 
> produce a JavaScript error instead of removing the rectangle, e.g. outline 
> and measure tools. So far I could narrow this down to the following:
>
> If an outline tool is selected, the corresponding outline_* function 
> defined in dhtmlInit.js is called first. This function sets the current 
> Layer to "outline_*". Afterwards, hidePdfFeature from dhtmlPdf.js is 
> called and tries to hide the "pdf_overview" feature which seems to be a 
> child of map_drawing. But, since the currentLayer is now "outline_*" and 
> not "map_drawing", the call
>
> aDisplay.currentLayer.removeChild(aDisplay.getDisplayFeature(feature));
>
> fails, because there is no such child.
>
> I see two solutions:
>
> 1. hidePdfFeature should be called before any function that changes the 
> current Layer.
>
> 2. hidePdfFeature should not use the currentLayer property of aDisplay, 
> but access "map_drawing" directly.
>
> Unfortunately, I do not know how to realize any of these. Therefore, any 
> suggestion would be very helpful.
>
>
> Thanks,
> Dirk
>
>
> _______________________________________________
> Cartoweb-dev mailing list
> Cartoweb-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-dev
> 



More information about the Cartoweb-dev mailing list