Manually triggering a redraw on AnyMap - anychart

on mobile devices the map renders sometimes a bit buggy.. markers are moved or too big.. can't really describe what happens there, it just looks really weird. However it does fade away when I move the map a bit, so I guess they are redrawn that moment. So to do that automatically I was listening to some events and then moved the map just for a pixel.. is there some better way to trigger a redraw? as everybody can see the map moving for a pixel.
AnyIdeas?
//edit: after testing a bit more I can say that moving the map using the move method doesn't trigger a redraw, it only works if I move the map myself, e.g. by touch gesture
//edit2: for now I am using anyMap.zoom(1) for triggering that redraw, it works but seems like a hacky solution

There is a bug in 7.13.0, AnyChart team will try to fix it in 7.13.1 which is scheduled do be released in a couple of weeks. There is no good workaround at the moment, unfortunately.

Related

React batching commit phase across renders

I've looked far and wide and can't find the answer to this:
Use case is scrolling a mouse wheel to zoom in.
Every time the wheel is moved a notch, an update is issued with a new level of zoom.
If a new setState is called before the previous one is finished and displayed, it will start processing the next call. However, react will not display the results of the previous render on the screen!
So, if i molest the scroll wheel, it will push dozens of render calls before actually showing anything on the screen, causing very poor user experience. (Here's the video: https://youtu.be/YRVK8uoVml0)
I don't know hot to force it to draw each render on screen.
And please, not answers like "You shouldn't be doing that", or "Just fire one update at a time". Only answer if you actually know the answer. Thank you.

Auto Scrolling Within a View with React Native

Currently working on a project where I want to implement Auto Scrolling in a view. Is this possible with React Native? I have searched the internet and have not come across anything that shows this capability.
Most Stack Overflow questions and YouTube videos deal with scrolling between different views (not within the same view), scrolling to the bottom (with Scroll To), infinite scrolling, or scrolling responsively. But I haven't been able to find anything dealing specifically with auto-scrolling within a given view.
Please let me know. Thank you in advance.
Something that just came to my mind would be like...
Store current x and y offset values of the scrollview in the component's state, setState every 'x' seconds with the new offset and call scrollTo() method of scrollview. That would change the x and y offset repetitively and make it looks like is auto scrolling.
PS: I know is not a full solution and should be posted in the comments section but I'm not able to comment yet... hope this helps anyway :)

Lagging silverlight app

I've been playing around with Silverlight 5 and started putting together a little game. It's nothing special and it's purely to just play around.
If you look at the link below you'll notice that it's lagging a bit.
Link(Just use the arrow keys): http://www.netauto.co.za/WIP/GameTest.html
Basically I'm using a Storyboard to scroll the road and move the cars on the screen with every tick. At first I used the CompositionTarget.Rendering, but I was having the same problem. So I thought I'll try a Storyboard, but it made no difference.
There is a second timer that adds a vehicle in a random lane with every tick. They get removed once they go off screen. Disabling this timer makes no difference.
CPU usage is almost none. Also tried it on another PC and it was exactly the same.
I would post some code, but there's quite a bit of it and as I'm just fooling around it's a bit of a mess 0.o
Any ideas on how I can move the objects around without that lag?
I'm using Silverlight 5.
Thank you
You can try to use BitmapCache on the scrolling road and cars, if you are not already. This can cut down on the traffic to the GPU.
More links: One, Two.

Is there any way to make a MapPolyline have better performance on WP7

I'm currently using the Silverlight Map control for WP7, and am trying to visualize driving directions on the map. In order to highlight the route needed, I am using a MapLayer with a MapPolyline. The problem is that even with CacheMode set to BitmapCache, the MapPolyline area gets redrawn whenever the user pans or zooms the map. I've used other controls such as Ellipses or Pushpins, and with BitmapCache on, none of them redraw and give the same performance hit as MapPolyline.
Here's a quick example
<maps:Map ZoomLevel="3">
<maps:MapPolyline Name="line" Stroke="Red" StrokeThickness="9">
<maps:MapPolyline.CacheMode>
<BitmapCache/>
</maps:MapPolyline.CacheMode>
<maps:MapPolyline.Locations>
<maps:LocationCollection>
<geo:GeoCoordinate Latitude="33" Longitude="33"/>
<geo:GeoCoordinate Latitude="36" Longitude="33"/>
<geo:GeoCoordinate Latitude="33" Longitude="36"/>
</maps:LocationCollection>
</maps:MapPolyline.Locations>
</maps:MapPolyline>
</maps:Map>
If you set App.Current.Host.Settings.EnableRedrawRegions = true; you can see the redrawing that occurs. The performance is particularly bad when you have a larger polyline and zoom in closer.
Is there anything that can be done to help? The native Bing Maps has pretty smooth route drawing, so I would think that there should be a way to solve this?
Thanks!
Can you explain a bit more what the problem is?
I've got an app - RunSat - in which I draw polylines with several hundred points (e.g. I just looked at a 3 hour long bike ride) and this draws fine - including during zoom operations.
I don't understand the problem - even using the sample code above. To help - are you testing on a phone or on the emulator?
As for CacheMode and BitmapCache, I'm really not sure about using these settings for the map - I don't use them in RunSat if that helps - I just leave the phone alone to work out its own GPU drawing.

Bing maps two-way binding to Center property. Animation problem

There is an example of two-way binding to Center property from Micrsoft guys.
You can find it here.
Its sample works fine, but they disabled full animation. When I set AnimationLevel="Full" and use the Compass I get trembling picture.
I really like aminations effects and don't want to turn it off.
Are there any ways to get working Compass and keep full animation?
This is a known problem and as far as i know, it hasn't been fixed. I too would very much like it to be fixed.
When full animation is on and the map is moved, it will move the map in an arch (zooms out and then back in). However, small distance movements still use the arch and this creates the shaking.
I have searched extensively (4 months ago) for a good work around for this problem.
I didn't find anything other than turning off the full animation.

Resources