Select to view content in your preferred language

PictureMarker CompositeSymbol

3818
8
Jump to solution
07-18-2013 09:50 AM
CaseyBentz
Frequent Contributor
I am having some trouble with adding a picture marker to a composite symbol and am wondering if it is even possible. The code snippet below is called in a function to update the symbol property.

Works:
var default_sym:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE,16,0xE98300,1,0,0,0,new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,0x333333)); var hitSym:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE,hitSize,0xE98300,0); var compSym:CompositeSymbol = new CompositeSymbol(); compSym.symbols = [hitSym,default_sym]; g.symbol = compSym;


Doesn't Work:
var pms:PictureMarkerSymbol = new PictureMarkerSymbol(source, pixelSize, pixelSize); var hitSym:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE,hitSize,0xE98300,0); var compSym:CompositeSymbol = new CompositeSymbol(); compSym.symbols = [hitSym,pms]; g.symbol = compSym;


Works:
var pms:PictureMarkerSymbol = new PictureMarkerSymbol(source, pixelSize, pixelSize); g.symbol = pms;
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MehulChoksey
Esri Contributor
Could you try setting  wrapAround180="true" on the map?

View solution in original post

0 Kudos
8 Replies
MehulChoksey
Esri Contributor
Try chaging alpha from 0 to 1 in


var pms:PictureMarkerSymbol = new PictureMarkerSymbol(source, pixelSize, pixelSize); var hitSym:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE,hitSize,0xE98300,0); var compSym:CompositeSymbol = new CompositeSymbol(); compSym.symbols = [hitSym,pms]; g.symbol = compSym
0 Kudos
CaseyBentz
Frequent Contributor
When I do this, I get a transparent orange square with no picture marker.  I flopped the order I added the symbols to the composite symbol and got the same results.

Not sure if it matters, but this is a mobile project.

[ATTACH=CONFIG]26057[/ATTACH]

var pixelSize:int = 20;
var hitSize:int = 30;
var hitAlpha:Number = .5;

var pms:PictureMarkerSymbol = new PictureMarkerSymbol(source, pixelSize, pixelSize);
var hitSym:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE,hitSize,0xE98300,hitAlpha);
var compSym:CompositeSymbol = new CompositeSymbol();
compSym.symbols = [pms,hitSym];
g.symbol = compSym;
0 Kudos
MehulChoksey
Esri Contributor
What version of ArcGIS API for Flex are you using?
0 Kudos
CaseyBentz
Frequent Contributor
I am using version 3.3.  I have tried 3.4 in 2 of my applications and both fail at runtime when I attempt to launch them.
0 Kudos
MehulChoksey
Esri Contributor
Could you try setting  wrapAround180="true" on the map?
0 Kudos
CaseyBentz
Frequent Contributor
I assumed you were joking with your suggestion.  But it worked.  Can you let me in on this little joke?  How does that property effect this situation?
0 Kudos
MehulChoksey
Esri Contributor
Glad to hear that it worked for you. I Will create a bug for this particular case.

Other option to try would be  embedded pictureMarker

[Embed('assets/images/globe.png')]
var picEmbeddedClass:Class;
var pms:PictureMarkerSymbol = new PictureMarkerSymbol(picEmbeddedClass, 20, 20);



When wraparound180 property is set, a different path is executed for displaying graphics in multiple world.(displaying multiple graphics one in each world when zoomed out, determining its position in other world, panning across dateline etd.) But this comes in to the play only for geographic and Webmercator projection since wraparound is supported for only these two projections.
0 Kudos
BjornSvensson
Esri Regular Contributor
Version 3.5 was released today and includes the fix for this issue:
* PictureMarkerSymbols, based on URL source, when used as part of a CompositeSymbol only worked when wraparound was true.
0 Kudos