|
||||
[Chameleon] Pixel to Geo Conversion problemsJ. Delfos delfos18@yahoo.comMon, 1 Mar 2004 16:49:29 -0800 (PST)
|
Jeff, Perhaps your javascript variables are not yet initialised. I'm not sure whether variables such as goCWCJSAPI.oMap.maxx are initialised before any javascript is actually used. Perhaps on the "ONLOAD" you can initialise them with the form variables. The form variable MAP_EXTENTS_MINX would be the one that could get outdated when you use javascript. What I think might be happening is that when you zoom, only the javascript map-extents variables (goCWCJSAPI.oMap.maxx, etc.) get used and updated. As soon as you use your print widget, it might actually try to access the MAP_EXTENTS_MINX form variable (which is not up to date). That's why after every javascript operation (e.g. zoom), it might help to update the form variables. Are you sure you included the CWCJSAPI widget properly? Jacob --- Jeff Hamm <jeff@planyukon.ca> wrote: --------------------------------- Jacob; Thanks for your reply. I was doing some modifications to create a Query by Polygon function.The function performs an initial querybypoint to retrieve the initial shape,which is then used to querybyshape on other layers. I was having problems grabbing the current map extents, so I implementeda similar approach to your suggestion, using the form: $nMinX = {$this->mszHTMLForm}.MAP_EXTENTS_MINX.value. In trying the goCWCJSAPI approach you suggested, I found that goCWCJSAPIwas undefined. This might be a more fundamental problem, but for now Isimply scrapped the values off the form. Is there a definitive test soI can tell if the CWCJSAPI is functioning? BTW, I also found it necessary to change the value of nInversePix inthe pixeltogeo conversion (around line 225 in the map_query.php wrapper)from 1 to 0 for the conversion of x coordinates. I haven't attempted a fix on the printwidget yet, although I'm surea similar workaround is doable. Still wondering why the $oMap values aren'tupdated by the Zoom widget though :-( Jeff "J. Delfos" wrote:I have had similar problems, though not exactly thesame. The problems I had were that changes made to the map extent by javascript parts (e.g. zooming and recentering) were forgotten as soon as I submitted theform; it went back to the original extent. I patched it by pasting this code into the "clickUpdateMap" function, in Updatemap.Widget.php: {$this->mszHTMLForm}.MAP_EXTENTS_MINX.value = goCWCJSAPI.oMap.minx; //custom added, not to lose extents {$this->mszHTMLForm}.MAP_EXTENTS_MAXX.value = goCWCJSAPI.oMap.maxx; {$this->mszHTMLForm}.MAP_EXTENTS_MINY.value = goCWCJSAPI.oMap.miny; {$this->mszHTMLForm}.MAP_EXTENTS_MAXY.value = goCWCJSAPI.oMap.maxy; This makes sure that the form variables for your extent are up to date compared to what your javascript did, when you submit the form. Perhaps you should try having it execute this code prior to using the functions which currently aren't working, to make sure your form variables are current before it does any processing. regards, Jacob --- Jeff Hamm <jeff@planyukon.ca> wrote: > > I've previously reported that my PrintWidget did not use the updated > extents of my DHTML map (e.g. after a zoom operation). It appearsthat > my 'stock versions' of Query and ROI widgets are also affected (under > IE5.5). > In the case of Query, I used debug messages to discover the valuesof > click coords, and its clearly evident that the min/max extent arealways > the same. For the ROI widget, defined regions are displayed as though > the map were displayed at full extent. If I zoom in, define an ROI,the > region appears scaled and positioned according to the original extents. > > REcenter widget works OK, but it doesn't do a pixeltogeo conversion,so > I'm wondering where to look for the problem. > > Anyone experiencing similar problems? suggestions? > To reproduce the problem, try doing a point query at a couple of > different display extents here: atlas.planyukon.ca/chameleon/htdocs > > Thanks > Jeff Hamm > YLUPC > Yukon, CANADA > _______________________________________________Chameleon mailing listChameleon@lists.maptools.orghttp://lists.maptools.org/mailman/listinfo/chameleon __________________________________ Do you Yahoo!? Get better spam protection with Yahoo! Mail. http://antispam.yahoo.com/tools
This archive was generated by Pipermail. |
MapTools.org -- Hosted by DM Solutions Group |