×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    4

    Question Slow animation when collapsing Border on Map

    Hi guys,

    I have created mapoverlays which contain a border and grid. When a user clicks on a pushpin, I set the visibility of the border and then when a user clicks on it again, I collapse the visibility, but on my Lumia 920, I can actually see the border with controls fading away, its not disappearing immediately like for example on the location map pushpins of Nokia itself?

    Is there any reason for that?

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    548

    Re: Slow animation when collapsing Border on Map

    Could you post some sample code of where you're changing the visibility of the elements?

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    4

    Re: Slow animation when collapsing Border on Map

    Grid grid = (Grid)sender;
    var image = (Image) grid.Children[0];
    var border = (Border)grid.Children[1];
    var path = (Polygon)grid.Children[2];
    if (border.Visibility == Visibility.Visible)
    {
    border.Visibility = Visibility.Collapsed;
    path.Visibility = Visibility.Collapsed;
    }
    else
    {
    border.Visibility = Visibility.Visible;
    path.Visibility = Visibility.Visible;
    var cycleStationOnImage = (CycleStation)image.Tag;
    myMap.SetView(cycleStationOnImage.GeoLocation,18,MapAnimationKind.Parabolic);
    }

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    548

    Re: Slow animation when collapsing Border on Map

    Quote Originally Posted by morfasie View Post
    Grid grid = (Grid)sender;
    var image = (Image) grid.Children[0];
    var border = (Border)grid.Children[1];
    var path = (Polygon)grid.Children[2];
    if (border.Visibility == Visibility.Visible)
    {
    border.Visibility = Visibility.Collapsed;
    path.Visibility = Visibility.Collapsed;
    }
    else
    {
    border.Visibility = Visibility.Visible;
    path.Visibility = Visibility.Visible;
    var cycleStationOnImage = (CycleStation)image.Tag;
    myMap.SetView(cycleStationOnImage.GeoLocation,18,MapAnimationKind.Parabolic);
    }
    Can I get a snippet of your XAML too?

  5. #5
    Registered User
    Join Date
    Mar 2013
    Posts
    4

    Re: Slow animation when collapsing Border on Map

    <phone:PanoramaItem Header="Locations" >
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,10,0,0">
    <maps:Map x:Name="myMap"
    PedestrianFeaturesEnabled="True"
    LandmarksEnabled="True" Pitch="30" HorizontalAlignment="Left" Width="415" Margin="5,-48,0,0" ZoomLevel="10" Center="-27.46758,153.027892">
    <my:MapExtensions.Children>
    <my:UserLocationMarker x:Name="UserLocationMarker" Visibility="Collapsed"/>
    </my:MapExtensions.Children>
    </maps:Map>
    </Grid>
    </phone:PanoramaItem>
    I create the pushpin and border etc in code

    // Actual Icon for PushPin
    MapOverlay pin1 = new MapOverlay();
    pin1.GeoCoordinate = station.GeoLocation;
    pin1.PositionOrigin = new Point(0.5, 1);

    Image img = new Image();
    img.Source = new BitmapImage(new Uri(station.PushPinColor, UriKind.RelativeOrAbsolute));
    // img.Tap += ManualPushPinTapEvent;
    img.Tag = station;
    img.Hold += img_Hold;

    // Content Above Pin
    Border border = new Border();
    border.Visibility = Visibility.Collapsed;
    border.BorderBrush = new SolidColorBrush(customBlue);
    border.BorderThickness = new Thickness(5.0);
    border.Opacity = opacityForContent;
    // Add the controls to the grid
    myGrid.Children.Add(img);
    myGrid.Children.Add(border);
    myGrid.Children.Add(polygon);

    pin1.Content = myGrid;
    markerLayer.Add(pin1);
    Left out creating of all grid and polygon etc

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    548

    Re: Slow animation when collapsing Border on Map

    I wasn't able to re-create the issue so I'll just give some general advice and/or things to try...

    A) Try a less complex 'pin' and see if the issues persists - just have a plain Grid with a background colour, make sure Opacity is set to 1, then use the Tap event to hide and show the grid.

    B) When running code on your device (Lumia 920), try running the app in Release mode (ie. no debugger attached).

    Also, I notice from the XAML code that your Map is inside a Panorama. It's not good practice to use a Map inside a panorama as when you swipe-left, the expectation is that Panorama will move, not the Map.

  7. #7
    Registered User
    Join Date
    Mar 2013
    Posts
    4

    Re: Slow animation when collapsing Border on Map

    Quote Originally Posted by theothernt View Post
    I wasn't able to re-create the issue so I'll just give some general advice and/or things to try...

    A) Try a less complex 'pin' and see if the issues persists - just have a plain Grid with a background colour, make sure Opacity is set to 1, then use the Tap event to hide and show the grid.

    B) When running code on your device (Lumia 920), try running the app in Release mode (ie. no debugger attached).

    Also, I notice from the XAML code that your Map is inside a Panorama. It's not good practice to use a Map inside a panorama as when you swipe-left, the expectation is that Panorama will move, not the Map.
    Thanks, will try and let you know

Similar Threads

  1. Replies: 5
    Last Post: 2010-11-29, 07:25
  2. Slow GIF animation
    By lenclud in forum Symbian
    Replies: 1
    Last Post: 2009-01-15, 07:56
  3. slow slow Series_60_MIDP_Concept_SDK_BETA_0_3_1 emmulator
    By dd_plus in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2004-08-09, 10:33
  4. How to add a border for CEikEdwin?
    By yinjialiang in forum Symbian
    Replies: 6
    Last Post: 2004-05-07, 17:56
  5. CEiKEdwin border
    By ayulo in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-06-28, 16:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×