# Add rotation to PointMarkerStyle based on some feature column

**URL:** <https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988>\
**Category:** MVC\
**Created:** [December 5, 2012, 3:37am UTC](https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988 "2012-12-05T03:37:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sindre](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/sindre/32/24981_2.png) [@Sindre](https://community.thinkgeo.com/u/Sindre)\
**Post date:** [December 5, 2012, 3:37am UTC](https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988/1 "2012-12-05T03:37:55Z")

</div>

Hello,

I&nbsp;am&nbsp;currently&nbsp;in&nbsp;the&nbsp;process&nbsp;of&nbsp;converting&nbsp;our&nbsp;app&nbsp;from&nbsp;MapSuite&nbsp;Web&nbsp;Forms&nbsp;edition&nbsp;to&nbsp;MVC&nbsp;and&nbsp;I&nbsp;want&nbsp;to&nbsp;move&nbsp;some&nbsp;of&nbsp;the&nbsp;logic&nbsp;from&nbsp;javascript&nbsp;server-side.&nbsp;Previously,&nbsp;we&nbsp;have&nbsp;been&nbsp;creating&nbsp;the&nbsp;feature&nbsp;layer&nbsp;using&nbsp;OpenLayers&nbsp;vector&nbsp;layer&nbsp;and&nbsp;GML&nbsp;format.&nbsp;I&nbsp;am&nbsp;now&nbsp;instead&nbsp;using&nbsp;InMemoryMarkerOverlay.

One&nbsp;of&nbsp;the&nbsp;things&nbsp;I&nbsp;need&nbsp;to&nbsp;accompish&nbsp;is&nbsp;this:

  
&nbsp;&nbsp;&nbsp;&nbsp;- Each&nbsp;marker&nbsp;should&nbsp;be&nbsp;rendered&nbsp;with&nbsp;(1)&nbsp;a&nbsp;specific&nbsp;image&nbsp;AND&nbsp;&nbsp;(2)&nbsp;rotation&nbsp;based&nbsp;on&nbsp;column&nbsp;values&nbsp;in&nbsp;the&nbsp;feature.&nbsp;I&nbsp;am&nbsp;using&nbsp;ValueMarkerStyle&nbsp;with&nbsp;a&nbsp;"color"&nbsp;column&nbsp;name&nbsp;to&nbsp;accomplish&nbsp;(1),&nbsp;however,&nbsp;based&nbsp;on&nbsp;another&nbsp;column&nbsp;value&nbsp;"angle"&nbsp;I&nbsp;need&nbsp;to&nbsp;apply&nbsp;a&nbsp;rotation&nbsp;to&nbsp;the&nbsp;WebImage.&nbsp;&nbsp;With&nbsp;OpenLayers&nbsp;I&nbsp;was&nbsp;able&nbsp;to&nbsp;do&nbsp;this&nbsp;using&nbsp;a&nbsp;style&nbsp;map&nbsp;to&nbsp;set&nbsp;the&nbsp;correct&nbsp;image&nbsp;based&nbsp;on&nbsp;the&nbsp;value&nbsp;of&nbsp;"color",&nbsp;and&nbsp;access&nbsp;the&nbsp;"angle"&nbsp;column&nbsp;value&nbsp;of&nbsp;the&nbsp;feature&nbsp;using&nbsp;the&nbsp;special&nbsp;syntax&nbsp;"${angle}".  
  
&nbsp;&nbsp;&nbsp;&nbsp;  
  
&nbsp;&nbsp;&nbsp;&nbsp;How&nbsp;can&nbsp;I&nbsp;accomplish&nbsp;the&nbsp;same&nbsp;server-side?&nbsp;This&nbsp;post&nbsp;shows&nbsp;something&nbsp;similar:  
  
&nbsp;&nbsp;&nbsp;&nbsp;gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/9565/afv/topic/Default.aspx&nbsp;  
  
&nbsp;&nbsp;&nbsp;&nbsp;  
  
&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;tried&nbsp;something&nbsp;like&nbsp;the&nbsp;following&nbsp;but&nbsp;it&nbsp;is&nbsp;not&nbsp;working:
  

  

`var markerStyle = new ValueMarkerStyle("color");var image = new WebImage("red_image.png");image.RotationAngle = float.Parse("[#angle#]");markerStyle.ValueItems.Add(new MarkerValueItem("red", new PointMarkerStyle(image)));`&nbsp;

  
&nbsp;&nbsp;&nbsp;&nbsp;- Secondly,&nbsp;I&nbsp;am&nbsp;contemplating&nbsp;whether&nbsp;to&nbsp;use&nbsp; **InMemoryMarkerOverlay&nbsp;** or&nbsp; **InMemoryFeatureLayer.&nbsp;** For&nbsp;some&nbsp;reason&nbsp;I&nbsp;am&nbsp;seeing&nbsp;slightly&nbsp;better&nbsp;performance&nbsp;(less&nbsp;lag&nbsp;when&nbsp;panning/zooming)&nbsp;with&nbsp;the&nbsp;InMemoryFeatureLayer&nbsp;with&nbsp;about&nbsp;900&nbsp;features,&nbsp;however,&nbsp;I&nbsp;am&nbsp;uncertain&nbsp;whether&nbsp;it&nbsp;will&nbsp;support&nbsp;my&nbsp;requirements&nbsp;to&nbsp;use&nbsp;marker&nbsp;popups&nbsp;and&nbsp;feature&nbsp;selection?&nbsp;I&nbsp;would&nbsp;like&nbsp;your&nbsp;advise&nbsp;on&nbsp;this.&nbsp;Also,&nbsp;when&nbsp;I&nbsp;use&nbsp;the&nbsp;InMemoryFeatureLayer&nbsp;there&nbsp;is&nbsp;some&nbsp;rendering&nbsp;issue&nbsp;with&nbsp;the&nbsp;features.&nbsp;When&nbsp;I&nbsp;pan&nbsp;the&nbsp;map&nbsp;the&nbsp;visible&nbsp;markers&nbsp;"flicker"&nbsp;on&nbsp;the&nbsp;screen&nbsp;until&nbsp;they&nbsp;move&nbsp;to&nbsp;the&nbsp;new&nbsp;positions.
  
&nbsp;&nbsp;&nbsp;&nbsp;- Lastly,&nbsp;how&nbsp;do&nbsp;I&nbsp;change&nbsp;the&nbsp;mouse&nbsp;cursor&nbsp;into&nbsp;a&nbsp;hand/pointer&nbsp;when&nbsp;someone&nbsp;mouse&nbsp;over&nbsp;a&nbsp;feature/marker?&nbsp;Again,&nbsp;I&nbsp;was&nbsp;able&nbsp;to&nbsp;set&nbsp;this&nbsp;with&nbsp;the&nbsp;OpenLayers&nbsp;style&nbsp;map.
  

  

I&nbsp;hope&nbsp;you&nbsp;can&nbsp;help.&nbsp;If&nbsp;there&nbsp;is&nbsp;some&nbsp;way&nbsp;to&nbsp;accomplish&nbsp;the&nbsp;above&nbsp;by&nbsp;"applying"&nbsp;the&nbsp;style&nbsp;client&nbsp;side,&nbsp;while&nbsp;still&nbsp;managing&nbsp;features/layer&nbsp;on&nbsp;the&nbsp;server&nbsp;I&nbsp;suppose&nbsp;that&nbsp;would&nbsp;be&nbsp;okay&nbsp;too.

Thank&nbsp;you,  
  
Sindre

---

<div class="post-metadata">

**Author:** ![Eric2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/8c91f0/32.png) [@Eric2](https://community.thinkgeo.com/u/Eric2)\
**Post date:** [December 11, 2012, 3:12pm UTC](https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988/2 "2012-12-11T15:12:03Z")

</div>

I&nbsp;have&nbsp;an&nbsp;idea&nbsp;for&nbsp;you.&nbsp;&nbsp;You&nbsp;could&nbsp;create&nbsp;different&nbsp;images&nbsp;rotated&nbsp;at&nbsp;different&nbsp;angles,&nbsp;and&nbsp;use&nbsp;these&nbsp;distinct&nbsp;images&nbsp;to&nbsp;create&nbsp;your&nbsp;rotations.

---

<div class="post-metadata">

**Author:** ![Sindre](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/sindre/32/24981_2.png) [@Sindre](https://community.thinkgeo.com/u/Sindre)\
**Post date:** [December 13, 2012, 3:45pm UTC](https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988/3 "2012-12-13T15:45:19Z")

</div>

Thanks,&nbsp;but&nbsp;I&nbsp;don’t&nbsp;see&nbsp;how&nbsp;that&nbsp;would&nbsp;help.&nbsp;I&nbsp;would&nbsp;still&nbsp;need&nbsp;to&nbsp;figure&nbsp;out&nbsp;the&nbsp;angle&nbsp;for&nbsp;the&nbsp;feature&nbsp;when&nbsp;the&nbsp;style&nbsp;is&nbsp;applied.&nbsp;Is&nbsp;there&nbsp;really&nbsp;no&nbsp;way&nbsp;to&nbsp;achieve&nbsp;this?&nbsp;Some&nbsp;“OnStyleApplying”&nbsp;event/method&nbsp;or&nbsp;something&nbsp;I&nbsp;could&nbsp;override&nbsp;to&nbsp;check&nbsp;the&nbsp;column&nbsp;values&nbsp;of&nbsp;the&nbsp;feature&nbsp;and&nbsp;apply&nbsp;the&nbsp;correct&nbsp;angle&nbsp;accordingly?

---

<div class="post-metadata">

**Author:** ![Sindre](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/sindre/32/24981_2.png) [@Sindre](https://community.thinkgeo.com/u/Sindre)\
**Post date:** [December 17, 2012, 5:51am UTC](https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988/4 "2012-12-17T05:51:18Z")

</div>

Just&nbsp;to&nbsp;let&nbsp;you&nbsp;know,&nbsp;I&nbsp;figured&nbsp;out&nbsp;a&nbsp;way&nbsp;around&nbsp;this&nbsp;by&nbsp;using&nbsp;multiple&nbsp;“nested”&nbsp;ValueMarkerStyle’s.&nbsp;The&nbsp;first&nbsp;ValueMarkerStyle&nbsp;targets&nbsp;the&nbsp;“color”&nbsp;property&nbsp;and&nbsp;has&nbsp;a&nbsp;marker&nbsp;style&nbsp;ValueMarkerStyle&nbsp;which&nbsp;targets&nbsp;the&nbsp;rotation.&nbsp;Thus,&nbsp;I&nbsp;was&nbsp;able&nbsp;to&nbsp;select&nbsp;both&nbsp;the&nbsp;correct&nbsp;image&nbsp;and&nbsp;apply&nbsp;the&nbsp;RotationAngle&nbsp;based&nbsp;on&nbsp;column&nbsp;values&nbsp;on&nbsp;the&nbsp;feature.

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [December 18, 2012, 3:26am UTC](https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988/5 "2012-12-18T03:26:18Z")

</div>

&nbsp;Hello&nbsp;Sindre,

&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;sharing&nbsp;your&nbsp;experience!  
&nbsp;  
&nbsp;And&nbsp;for&nbsp;your&nbsp;second&nbsp;question,&nbsp;yes&nbsp;using&nbsp;InMemoryFeatureLayer&nbsp;will&nbsp;have&nbsp;better&nbsp;performance&nbsp;because&nbsp;InMemoryMarkerOverlay&nbsp;we&nbsp;will&nbsp;pass&nbsp;all&nbsp;the&nbsp;points&nbsp;information&nbsp;to&nbsp;client&nbsp;side&nbsp;then&nbsp;initialize&nbsp;the&nbsp;marker&nbsp;by&nbsp;OpenLayer,&nbsp;it&nbsp;will&nbsp;cost&nbsp;time,&nbsp;also&nbsp;InMemoryFeatureLayer&nbsp;you&nbsp;can&nbsp;use&nbsp;ClusterMarkerStyle&nbsp;to&nbsp;get&nbsp;better&nbsp;performance&nbsp;facing&nbsp;too&nbsp;many&nbsp;markers.  
&nbsp;  
&nbsp;For&nbsp;your&nbsp;third&nbsp;question,&nbsp;you&nbsp;can&nbsp;register&nbsp;the&nbsp;mouseover&nbsp;event&nbsp;in&nbsp;the&nbsp;client&nbsp;side,&nbsp;then&nbsp;change&nbsp;the&nbsp;mouse&nbsp;cursor&nbsp;by&nbsp;JS,&nbsp;please&nbsp;check&nbsp;the&nbsp;code&nbsp;below:  
`<script language="javascript" type="text/javascript">          var OnMapCreating = function (map) {             OpenLayers.Layer.Markers.prototype.addMarker = function (marker) {                 this.markers.push(marker);                   if (this.opacity != null) {                     marker.setOpacity(this.opacity);                 }                   if (this.map && this.map.getExtent()) {                     marker.map = this.map;                     this.drawMarker(marker);                 }                   // Register the mouse hover event                 marker.events.register('mouseover', marker, function (evt) {                     document.getElementsByTagName("body")[0].style.cursor = pointer;                 });             }         }`  
&nbsp;Regards,  
&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Sindre](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/sindre/32/24981_2.png) [@Sindre](https://community.thinkgeo.com/u/Sindre)\
**Post date:** [December 18, 2012, 3:45am UTC](https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988/6 "2012-12-18T03:45:35Z")

</div>

Thanks&nbsp;Gary.&nbsp;Works&nbsp;great&nbsp;with&nbsp;the&nbsp;cursor&nbsp;workaround.&nbsp;Will&nbsp;it&nbsp;work&nbsp;with&nbsp;features&nbsp;created&nbsp;in&nbsp;InMemoryFeatureLayer&nbsp;as&nbsp;well?&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;still&nbsp;experience&nbsp;this&nbsp;issue&nbsp;which&nbsp;I&nbsp;described&nbsp;in&nbsp;my&nbsp;first&nbsp;post:&nbsp;"Also,&nbsp;when&nbsp;I&nbsp;use&nbsp;the&nbsp;InMemoryFeatureLayer&nbsp;there&nbsp;is&nbsp;some&nbsp;rendering&nbsp;issue&nbsp;with&nbsp;the&nbsp;features.&nbsp;When&nbsp;I&nbsp;pan&nbsp;the&nbsp;map&nbsp;the&nbsp;visible&nbsp;markers&nbsp;"flicker"&nbsp;on&nbsp;the&nbsp;screen&nbsp;until&nbsp;they&nbsp;move&nbsp;to&nbsp;the&nbsp;new&nbsp;positions."&nbsp;  
&nbsp;&nbsp;  
&nbsp;When&nbsp;I&nbsp;drag&nbsp;the&nbsp;map&nbsp;and&nbsp;release&nbsp;the&nbsp;mouse&nbsp;button,&nbsp;the&nbsp;feature&nbsp;show&nbsp;on&nbsp;the&nbsp;previous&nbsp;position&nbsp;for&nbsp;a&nbsp;split&nbsp;second&nbsp;while&nbsp;the&nbsp;map&nbsp;re-renders&nbsp;it&nbsp;seems.&nbsp;This&nbsp;does&nbsp;not&nbsp;happen&nbsp;with&nbsp;the&nbsp;InMemoryMarkerOverlay.

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [December 18, 2012, 7:43pm UTC](https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988/7 "2012-12-18T19:43:36Z")

</div>

Hello&nbsp;Sindre,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Client&nbsp;side&nbsp;mouse&nbsp;over&nbsp;event&nbsp;is&nbsp;not&nbsp;working&nbsp;on&nbsp;features,&nbsp;because&nbsp;openlayer&nbsp;doesn’t&nbsp;have&nbsp;such&nbsp;thing&nbsp;as&nbsp;a&nbsp;feature,&nbsp;so&nbsp;when&nbsp;we&nbsp;draw&nbsp;a&nbsp;feature&nbsp;we&nbsp;will&nbsp;process&nbsp;it&nbsp;as&nbsp;a&nbsp;image&nbsp;in&nbsp;the&nbsp;server&nbsp;side&nbsp;first,&nbsp;draw&nbsp;a&nbsp;image&nbsp;in&nbsp;the&nbsp;client&nbsp;side,&nbsp;that’s&nbsp;one&nbsp;reason&nbsp;InMemoryFeaturelayer&nbsp;is&nbsp;faster&nbsp;than&nbsp;InMemoryMarkerOverlay.&nbsp;And&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;determine&nbsp;if&nbsp;your&nbsp;mouse&nbsp;is&nbsp;hover&nbsp;a&nbsp;feature,&nbsp;the&nbsp;only&nbsp;way&nbsp;is&nbsp;call&nbsp;ajax&nbsp;each&nbsp;time&nbsp;when&nbsp;you&nbsp;mouse&nbsp;move,&nbsp;and&nbsp;check&nbsp;if&nbsp;mouse&nbsp;location&nbsp;is&nbsp;intersection&nbsp;with&nbsp;the&nbsp;shape,&nbsp;that&nbsp;costs&nbsp;too&nbsp;many&nbsp;resource&nbsp;and&nbsp;is&nbsp;unacceptable.&nbsp;  
&nbsp;&nbsp;  
&nbsp;About&nbsp;the&nbsp;issue&nbsp;you&nbsp;mentioned,&nbsp;can&nbsp;you&nbsp;provide&nbsp;a&nbsp;sample&nbsp;that&nbsp;I&nbsp;can&nbsp;recreate&nbsp;your&nbsp;problem?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Sindre](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/sindre/32/24981_2.png) [@Sindre](https://community.thinkgeo.com/u/Sindre)\
**Post date:** [January 2, 2013, 5:03am UTC](https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988/8 "2013-01-02T05:03:39Z")

</div>

Gary,&nbsp;  
  
Thanks.&nbsp;  
  
  
  
Regarding&nbsp;the&nbsp;issue,&nbsp;please&nbsp;see&nbsp;attached&nbsp;code.&nbsp;  
  
  
  
The&nbsp;"flickering"&nbsp;bug&nbsp;is&nbsp;very&nbsp;visible.&nbsp;Just&nbsp;drag&nbsp;the&nbsp;map&nbsp;and&nbsp;you&nbsp;will&nbsp;see&nbsp;the&nbsp;two&nbsp;red&nbsp;markers&nbsp;flicker.&nbsp;  
  
  
  
`  @{Html.ThinkGeo().Map("Map1", new System.Web.UI.WebControls.Unit(100, System.Web.UI.WebControls.UnitType.Percentage), 510)                         .WebConfigRegisterMode(WebConfigRegistrationMode.Manual)                         .ResourceDeploymentMode( ResourceDeploymentMode.Manual)                         .CurrentExtent(-12400000, 12000000, 1240000, -1240000)                         .MapBackground(new BackgroundLayer(new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))))                         .MapUnit(GeographyUnit.Meter)                         .CustomOverlays(overlays =>                         {                             //overlays.WorldMapKitWmsWebOverlay();                             overlays.GoogleOverlay("GoogleMap", GoogleMapType.Normal).IsBaseOverlay(true);                              var projection = new ManagedProj4Projection(                                 ManagedProj4Projection.GetWgs84ParametersString(),                                 ManagedProj4Projection.GetGoogleMapParametersString());                                                          projection.Open();                             InMemoryFeatureLayer mapShapeLayer = new InMemoryFeatureLayer();                             mapShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.SimpleColors.Red, 20);                             mapShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;                             mapShapeLayer.InternalFeatures.Add(projection.ConvertToExternalProjection(new Feature(new PointShape(-70, 20))));                             mapShapeLayer.InternalFeatures.Add(projection.ConvertToExternalProjection(new Feature(new PointShape(-40, 30))));                             projection.Close();                                                          overlays.LayerOverlay("OverLayer").TileType(TileType.SingleTile).IsBaseOverlay(false).Layer("InMemoryFeatureLayer", mapShapeLayer);                          })                         .Render(); `

&nbsp;

### Update:&nbsp;
  

I&nbsp;noticed&nbsp;that&nbsp;the&nbsp;problem&nbsp;is&nbsp;related&nbsp;to&nbsp;the&nbsp;TileType&nbsp;setting.&nbsp;When&nbsp;using&nbsp;TileType.MultipleTile&nbsp;the&nbsp;problem&nbsp;is&nbsp;alleviated.&nbsp;Although,&nbsp;if&nbsp;you&nbsp;move&nbsp;the&nbsp;map&nbsp;all&nbsp;the&nbsp;way&nbsp;to&nbsp;the&nbsp;bottom&nbsp;(South),&nbsp;so&nbsp;that&nbsp;the&nbsp;two&nbsp;markers&nbsp;disappears&nbsp;from&nbsp;the&nbsp;viewport&nbsp;they&nbsp;will&nbsp;flicker/appear&nbsp;for&nbsp;a&nbsp;split&nbsp;second&nbsp;over&nbsp;Antarctica.

Any&nbsp;ideas?

Also,&nbsp;I&nbsp;would&nbsp;like&nbsp;to&nbsp;ask&nbsp;you&nbsp;what&nbsp;is&nbsp;the&nbsp;recommended&nbsp;way&nbsp;to&nbsp;add&nbsp;a&nbsp;InMemoryFeatureLayer?&nbsp;To&nbsp;CustomOverlays&nbsp;as&nbsp;a&nbsp;LayerOverlay&nbsp;or&nbsp;to&nbsp;the&nbsp;Layers&nbsp;collection&nbsp;of&nbsp;the&nbsp;DynamicOverlay?&nbsp;Is&nbsp;there&nbsp;a&nbsp;difference&nbsp;beside&nbsp;semantically?&nbsp;Performance&nbsp;wise?

I&nbsp;look&nbsp;forward&nbsp;to&nbsp;your&nbsp;prompt&nbsp;feedback.

&nbsp;

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [January 4, 2013, 9:04pm UTC](https://community.thinkgeo.com/t/add-rotation-to-pointmarkerstyle-based-on-some-feature-column/3988/9 "2013-01-04T21:04:26Z")

</div>

Hello&nbsp;Sindre,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;the&nbsp;further&nbsp;information,&nbsp;the&nbsp;problem&nbsp;is&nbsp;using&nbsp;single&nbsp;tile,&nbsp;in&nbsp;single&nbsp;tile,&nbsp;every&nbsp;pan&nbsp;means&nbsp;the&nbsp;extent&nbsp;changes,&nbsp;so&nbsp;the&nbsp;map&nbsp;will&nbsp;totally&nbsp;redraw,&nbsp;but&nbsp;InMemoryFeatureLayer&nbsp;won’t&nbsp;draw&nbsp;until&nbsp;the&nbsp;mouse&nbsp;release.&nbsp;So&nbsp;this&nbsp;make&nbsp;the&nbsp;“flickering”,&nbsp;but&nbsp;this&nbsp;is&nbsp;for&nbsp;improve&nbsp;the&nbsp;singletile&nbsp;performance,&nbsp;so&nbsp;we&nbsp;won’t&nbsp;modify&nbsp;this.&nbsp;  
&nbsp;&nbsp;  
&nbsp;And&nbsp;you&nbsp;mentioned&nbsp;when&nbsp;you&nbsp;use&nbsp;MultipleTile,&nbsp;the&nbsp;problem&nbsp;is&nbsp;“alleviated”,&nbsp;so&nbsp;you&nbsp;mean&nbsp;the&nbsp;problem&nbsp;gone?&nbsp;Or&nbsp;just&nbsp;disappear&nbsp;not&nbsp;frequency?&nbsp;I&nbsp;have&nbsp;tested&nbsp;in&nbsp;my&nbsp;side&nbsp;with&nbsp;your&nbsp;code,&nbsp;with&nbsp;MultiPleTile,&nbsp;everything&nbsp;going&nbsp;fine,&nbsp;can&nbsp;you&nbsp;guide&nbsp;me&nbsp;how&nbsp;to&nbsp;recreate&nbsp;your&nbsp;problem?&nbsp;  
&nbsp;&nbsp;  
&nbsp;To&nbsp;add&nbsp;a&nbsp;InMemoryFeatureLayer,&nbsp;you&nbsp;can&nbsp;added&nbsp;into&nbsp;both&nbsp;overlays,&nbsp;and&nbsp;there&nbsp;isn’t&nbsp;any&nbsp;performance&nbsp;difference&nbsp;just&nbsp;different&nbsp;overlay&nbsp;draw&nbsp;on&nbsp;different&nbsp;z-index&nbsp;and&nbsp;have&nbsp;different&nbsp;drawing&nbsp;order,&nbsp;most&nbsp;time&nbsp;we&nbsp;will&nbsp;add&nbsp;it&nbsp;into&nbsp;LayerOverlay.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
