Select to view content in your preferred language

PictureMarkerSymbol Not displayed

1277
7
08-02-2010 07:19 AM
ShaningYu
Honored Contributor
I tried to use PictureMarkerSymbol for some customized points.  However, no marker is displayed.  The code for the PictureMarkerSymbol is below:

public var pointSym_Peolpe0:PictureMarkerSymbol = new PictureMarkerSymbol(
  "@Embed(source='com/esri/solutions/flexviewer/assets/images/icons/Icon2/People_0.png' )", 5, 5, 0, 0, 0);

The path is right.
Is anything incorrect?  Thanks for your reviewing and providing your hint.
Tags (2)
0 Kudos
7 Replies
Drew
by
Frequent Contributor
Have you confirmed the XY by testing using a SimpleMarkerSymbol(..) ? This will ensure the XY are correct and in the correct coordinate system.

Drew
0 Kudos
ShaningYu
Honored Contributor
It may be the issue.  Could you advise how to confirm XY? 
Before I used PictureMarkerSymbol, I used SimpleMarkerSymbol that worked fine.
Thanks.
0 Kudos
Drew
by
Frequent Contributor
Well it sounds like your XY is okay..
I am not using the ESRI Flex Viewer so I can not confirm your path, but usually Flex Builder will yell at you if your Embedded path is incorrect.. Do you see any warnings or get a Build  error ?

Here are a few things I would try...

- Confirm the path.
- Test it without embedding the image
- Make sure the width and height of the image are as you defined in the constructor...
- Find a sample in the ESRI Flex Viewer source code and use that to confirm it works..

Drew
0 Kudos
ShaningYu
Honored Contributor
Drew:
No warning is received for the path.  I tested without embedding image using a SimpleMarkerSymbol and it works well.  I will test again.  Thanks for your time.
Shaning
0 Kudos
Drew
by
Frequent Contributor
Try embedding the image outside of the constructor..
I know it maybe a silly thing to try, but it�??s worth a shot..
Here is some sample of the code�?�.

[Bindable]
[@Embed(source='../assets/images/myImage.png')]
private var myImage:Class;

private function XYZ():void
{

var pictureMarker:PictureMarkerSymbol = new PictureMarkerSymbol(myImage,16,16);
..
..
..

}
0 Kudos
ShaningYu
Honored Contributor
GREAT!!!  Tested successfully.  Thanks a lot!!!
0 Kudos
Drew
by
Frequent Contributor
Cool, Glad that worked..
0 Kudos