Select to view content in your preferred language

Drawing marker symbols in a UIComponent now works sporadically

877
4
Jump to solution
04-13-2012 06:19 AM
TyroneLigon
Deactivated User
Finally moved to Flex 4 and the 2.5 API...I have a function that grabs all the graphics from a particular point, picks out the objects with a point geometry, and displays the graphic's symbol and attribute information in the map's info window. The code to get and display the graphic is the following:

private function createSwatchFromGraphic(g:Graphic, m:Map):UIComponent {   var swatch:UIComponent = new UIComponent;   var sym:Symbol = g.symbol;   sym.draw(swatch, new MapPoint(), null, m);   swatch.x = swatch.y = 0;    return swatch; }


I'm sure I got this code from one of Master Scheitlin's posts :o, and it's always worked just fine. Now I find it only works if the current map extent includes the original map extent's center. Any ideas?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Tyrone,

   It has been a while since I have messed with symbol.draw but see if setting the mapPoint to the graphics geomerty in the draw function (since you are only dealing with points).

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Tyrone,

  Now that you have moved up in API's you should switch to use the symbols.createSwatch function.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:
0 Kudos
TyroneLigon
Deactivated User
The good news: that's a great function to have and I'm glad it's in the API.

The bad news: the majority of my marker symbology are composite symbols comprised of text symbols and picture marker symbols that are actually .swf files, and as such they're not supported in the createSwatch function.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Tyrone,

   It has been a while since I have messed with symbol.draw but see if setting the mapPoint to the graphics geomerty in the draw function (since you are only dealing with points).
0 Kudos
TyroneLigon
Deactivated User
JACKPOT!!!

Thanks, Robert...
0 Kudos