ksoto13

How to draw an offset shape without using setOffset?

Discussion created by ksoto13 on Mar 13, 2012
Latest reply on Mar 13, 2012 by stevel
Say I have the following:

var shape = new esri.geometry.Point(somex, somey, new esri.SpatialReference({wkid:4326}));
var simpleMarkerSymbol = new esri.symbol.SomeSymbol(-Insert Attributes Here-);
var graphic = new esri.Graphic(shape, simpleMarkerSymbol);

I want to be able to draw a shape that is 5 pixels north, and 5 pixels right of the shape I just specified. How do I accomplish this?

I know setOffset(5,5) on the marker allows me to do an offset from a point, but it is important for me to know the lat long where I am drawing. Is there some way I could convert from lat long (the somex, somey) to pixel coordinates, add 5 each each of them, then covert back to lat long for the new "offset" point I want to create?

Outcomes