Showing posts with label Tutorial. Show all posts
Showing posts with label Tutorial. Show all posts

Monday, 9 August 2010

New Performance Improvements

Welcome to another installment about the development of 3D onto Bing Maps Silverlight control (University of Otago - Interactive Campus Map, iMap)

Recently the performance of iMap has become rather slow, which an increase in displayed elements.

I have started to improve performance of loading/usability by removing objects (buildings) from the visual tree if they do not fit in the current viewable area, then adding them back in when they are within the viewable area.

One performance downside of this is that the adding and removing of a large number of UIElements form the visual tree such as when going from viewing the whole of the Dunedin campus to viewing the Invercargill campus is slow and the application freezes and the view does not transition to the new location it just jumps.
There may be some background way to remove these items without the performance loss, which is something I will look into.

Thank you for the positive comments we have received for the application and please if you have any please use the "iMap Feedback" button at the bottom left of the application to send us any feedback.

Duncan

Tuesday, 19 January 2010

Bing Maps with 3D Buildings: Some Detail

Hello to all whom are interested.

I was asked if I could expalin how I setup the binding of psudo 3D (3D transofrmed to 2D) buildings to the Bing Maps Silverlight control.

Here is a basic overview, I will do into more detail later.

On the map I have a Canvas bound to a LocationRect which is at the Longitude/Latitude bounds of each building.

To handle scaling I have setup handling of the LayoutUpdated event on the Canvas, passing in the Canvas as a paramater, using an EventHandler Delegate, since the LayoutUpdated event does not pass in a sender object.

In this handler I get the Transform from the canvas to the Map control so I can transform the position of the Canavs to the position on the screen, this is where I set the Canvas.Left and Canvas.Top onf the Model Canvas to the same screen position.
Then I also get the ActualWidth and ActualHeight of the Canvas on the Map control and use a ScaleTransform to scale up the Models Canvas.

Then Model Canvas is added to a Canvas that sits over the Map control (in the same clip region as the map so the models disapear is their base is not visible on the Map.

The model canvas contains the psudo 3D object to display on it.

In the next post I will provide more detail on how to convert 3D into 2D space, and also how to speed up transofrmation calcullations by only rendering updating visible objects.