Aug 11, 2009 at 4:20 PM
Edited Aug 11, 2009 at 4:24 PM
On Map Size:
I tried setting the map to 320 x 240 and it did speed up some (it also got quite blurry as you indicated it would). But it didn’t speed up nearly dramatically as I expected. I’m estimating perhaps 20 FPS now instead
of 10 or 15, but it’s still nowhere near the 30+ without InfoStrat. :(
On Setting Location:
I’m actually setting the location in the sample application by replacing the text in the Lat / Long textbox and tabbing out. This textbox is bound to the LatLong property of the VEMap object.
When the LatLong dependency property is changed, the OnMapPositionPropertyChanged handler sets
true. On the next GraphicsEngine_PostRender,
InvalidateVESurface is called which in turn calls RaiseViewChanged. Inside of RaiseViewChanged, the
isDependencyPropertiesDirty flag is evaluated and
UpdateMapFromDP is called. This finally causes the map position to be updated.
This whole process takes around 800ms to occur on my machine and the delay does not seem to change much whether the map is sized at 768 x 576 or it’s sized at 320 x 240. Interestingly, when I changed the button click handler
in the sample to directly set the LatLong property rather than calling FlyTo, it changed almost IMMEDIATELY. So the delay seems to be in the binding process, but that doesn’t seem right. So I did some additional debugging.
Here’s the line of code that executes in the button handler:
map.LatLong = new
When that code executes, OnMapPositionPropertyChanged get’s called 4 times:
1 Ticks: 633855853388421371 Position: 38.9444195081574,-77.0630161230201
2 Ticks: 633855853389151444 Position: 14.7488499987245,-104.107306455295
3 Ticks: 633855853389651494 Position: 38.9444195080317,-77.0630161230201
4 Ticks: 633855853389691498 Position: 9992953.37003692
When I paste in the exact same values into the TextBox and
binding occurs, OnMapPositionPropertyChanged also gets called 4 times:
1 Ticks: 633855853885041028 Position: 20.9444195080288,-77.0630161230201
2 Ticks: 633855853888621386 Position: 5.9444195080288,-77.0630161230201
3 Ticks: 633855853889421466 Position: 20.9444195080259,-77.0630161230201
4 Ticks: 633855853889441468 Position: 9992953.37003629
However, notice the times between each update. When the LatLong is updated from the button click, there are very short times between the updates:
Between 1-2: 729,984 ticks
Between 2-3: 499,968 ticks
Between 3-4: 40,064 ticks
Total Update Ticks from Button: 1,270,016
When the update is from a data binding, the updates are MUCH longer:
Between 1-2: 3,580,032 ticks
Between 2-3: 800,000 ticks
Between 3-4: 19,968 ticks
Total Update Ticks from Data Binding: 4,400,000
That means it takes 3.4 times longer to update the LatLong property from a data binding as it does from a button click.
Oh, and to answer your last two questions: Yes, I’m using broadband and No, I don’t see a delay loading tiles. In fact, just to be sure I did rotate-pause-rotate all around the globe before I started these tests to
make sure everything was already loaded and cached.
Thanks for your time and for creating this library. I'm a big fan.