[mapguide-users] Selection Color w/ DWF Viewer??

Stephen Park stephen.park at westerncorrosion.com
Fri Nov 17 12:29:49 EST 2006


That code works perfectly.  Thanks a million. Wasn't aware of the separate
EMap API thanks for the heads-up. 

 

 

Cheers, 

 

Steve

 

From: Walt Welton-Lair [mailto:walt.welton-lair at autodesk.com] 
Sent: Thursday, November 16, 2006 5:15 PM
To: users at mapguide.osgeo.org
Subject: RE: [mapguide-users] Selection Color w/ DWF Viewer??

 

Currently you can't set the DWF selection color through MapGuide, but there
is supported API on the DWF Viewer.

 

I assume you're trying to set the selection color in the context of EMap
(the flavor of DWF that MapGuide uses).  The thread at
discussion.autodesk.com appears to assume EPlot, which is why your API calls
fail.

 

Here's a JavaScript method that shows how to set the selection color when
viewing an EMap DWF:

function SetSelectionColorRed()
{
    var selectionColor = DWFViewer.DocumentHandler.DefaultSelectionColor;
    selectionColor.setColor(255, 0, 0, 127); // red, 50% transparent
    DWFViewer.DocumentHandler.DefaultSelectionColor = selectionColor;
}

You could stick that in dwfmappane.templ and call it during initialization.

 

I've also attached a sample HTML file which exercises some of the DWF EMap
API, including the selection color.  (It tries to open the Sheboygan sample
map - if you don't have that on your server you'll have to modify the file
to load a different map.)

 

Remember though - all this API applies only to DWF and not AJAX.

 

Walt

 

  _____  

From: Stephen Park [mailto:stephen.park at westerncorrosion.com] 
Sent: Friday, November 17, 2006 12:17 AM
To: users at mapguide.osgeo.org
Subject: [mapguide-users] Selection Color w/ DWF Viewer??

Hi, 

 

Has anybody had success with changing the selection color in the DWF viewer?
I see several posts asking about this, but no successful resolution.  Is
this not supported??

 

If it can't be set in the client, is there any way to do it on the back end
(layer, map, or web layout attribute that I'm overlooking) ??

 

I have looked at the Autodesk sample code for editing the selection color in
JavaScript and got it to work ok with a static html page. I cannot get it to
work with the DWF viewer object that is generated by MGOS however. I've
tried extending the javascript that creates the DWFViewer object in the
"dwfmappane.templ" & "initdwfctrl.js" files without success. For some
reason, attempting to write  to the DWFViewer.Viewer.ObjectSelectedColor
property gives an "Object doesn't support this property or method"
exception. I've tried just about every other combination of properties I can
find from the 6.x and 7.x DWF API documentation with no success. 

 

Here's some more background from an Autodesk thread: 

http://discussion.autodesk.com/thread.jspa?threadID=520707

 

Any Help ? 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20061117/56b98f32/attachment.html


More information about the Mapguide-users mailing list