[mapguide-users] Problems With the phpviewersample's Theme Layer on Fusion?? Here's my solution

Tom Lazo tom.lazo at hotmail.com
Fri Jun 26 17:20:50 EDT 2009


Well, Hi all. Buen dia a todos!.

<<As i say in all my posts... excuse me but my english sucks...well i'll
continue. Sincerity first.>>

Ok, I'm tired of just posting problems...so today i'll post a solution, so
let's go.
Anyone who has tried to use the famous and usefull phpviewersexample's theme
layer must have been noticed that it doesn't run, well i know cos i had that
problem... so i'll tell u what i did.

1.- Point to the thememain.php page:

add this extension on u'r ApplicationDefinition's taskpane widget. 

     <Widget xsi:type="WidgetType">
      <Name>TaskPane2</Name>
      <Type>TaskPane</Type>
      <StatusItem/>
      <Extension>
        <MenuContainer>TaskContextMenu</MenuContainer>
		<InitialTask>../../../../phpviewersample/theme/thememain.php</InitialTask>
      </Extension>
    </Widget>

My appdef is on C:\Archivos de
Programa\MapGuideOpenSource2.0\WebServerExtensions\www\fusion\templates\mapguide\maroon)
so u have to add or remove as many ../ as needed.

2.- Modify the thememain.php

 Add the <script language="javascript"
src="../../fusion/MapGuide/MapGuideViewerApi.js"></script> line because
we're gonna use this fusion's library.
  
  <html>
  <head>
    <title>Theme Layer</title>
    <link rel="stylesheet" href="../styles/gt.css" type="text/css">
    <script language="javascript"
src="../../viewerfiles/browserdetect.js"></script>
    <script language="javascript" src="../json.js"></script>
    <script language="javascript"
src="../../fusion/MapGuide/MapGuideViewerApi.js"></script>

3.- Modify the MapGuideViewerApi.js

Well, i read on a post about this issue. That person said that he was using
the Refresh function and noth happened, well i found a solution...the
Refresh function just redraw the map...and we need a reload just to update
the legend xD...just for that...well so...change this lines on
MapGuideViewerApi

function Refresh() {
    var Fusion = window.top.Fusion;
	
    var mapWidget = Fusion.getWidgetById(mapWidgetId);
	var legendWidget = Fusion.getWidgetById('Legend');
    if (mapWidget && mapWidget.isMapLoaded()) {
        //mapWidget.redraw();
		mapWidget.reloadMap();
		
    }
}

Oh yeah..i forgot the mapguideviewerapi comma's problem...there are some
extra commas on the document . Actually i dun remenber where they are >.<,
just look at the posts.

4.- Change the arearuletemplate.xml

I found this sol on a post...so thanks to that person..well i'll put it here
too..

I had the LayerDefinition version problem...cos phpviewer(...) use the
LayerDef's 1.0.0 version and i use the 1.2.0 ver.. so for those who use the
same version that i, apply this change..

On the arearuletemplate.xml add this line
<SizeContext>DeviceUnits</SizeContext>

<AreaRule>
 <LegendLabel>%s</LegendLabel>
 <Filter>%s</Filter>
 <AreaSymbolization2D>
  <Fill>
   <FillPattern>Solid</FillPattern>
   <ForegroundColor>%s</ForegroundColor>
   <BackgroundColor>FF000000</BackgroundColor>
  </Fill>
  <Stroke>
   <LineStyle>Solid</LineStyle>
   <Thickness>0</Thickness>
   <Color>%s</Color>
   <Unit>Inches</Unit>
   <SizeContext>DeviceUnits</SizeContext>
  </Stroke>
 </AreaSymbolization2D>
</AreaRule>


Because the 1.0.0 ver did not need that line... srry I'm not very technical
in my explanations, but..xD

-------------------------------------------------------------------------------------------------

Ehmm, i think that's all, please notice me if u have any problem:
tom.lazo at hotmail.com

Thanks

C U.

Stygy / Tom 






-- 
View this message in context: http://n2.nabble.com/Problems-With-the-phpviewersample%27s-Theme-Layer-on-Fusion---Here%27s-my-solution-tp3164056p3164056.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list