×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    18

    Question Map.TransformCenter

    There is a property Map.TransformCenter that is not very good documented. I have set different values (from 0 to 1), but didn't saw any difference. What does this property do?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Map.TransformCenter

    http://msdn.microsoft.com/en-us/libr...vs.105%29.aspx says: "TransformCenter Gets or sets a value to which the center of the map control is transformed."

    so try it with a point instead of integer

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    18

    Re: Map.TransformCenter

    are you kidding me???? of corse I have set the point with different values (0 - 1). But nothing have changed. What does it do?

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Map.TransformCenter

    Next time, when you refer a docs, you could give a link where you found it. Also as I can not read your mind, you might want to show code on things you have done, so I would not need to guess. Currently not having my WP8 environment with this machine so can not test how the API would work.

    Anyway, as the value set there is point, i.e. it has X & Y values, I would not thing that value max to 1 would have any difference really. The docs are bad, but I would assume that the change could be actually in visible pixels, so would suggest trying out higher value.

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,699

    Re: Map.TransformCenter

    The 0-1 thing probably comes from earlier experience with viewports of various graphical libraries. So it is not a mark of insanity or something like that.
    However I have not found reference to viewports in this context, and especially the paragraph
    Quote Originally Posted by Remarks
    After you set the value of the TransformCenter property for the Map control, the Center property continues to return the previous center until you set the Center to the same value as the TransformCenter.
    suggest that TransformCenter is something geographical too (on the other hand, http://msdn.microsoft.com/en-us/libr...v=vs.105).aspx works with GeoCoordinate, so speaking about 'same' remains to be confusing to me)

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Map.TransformCenter

    Was thinking the same (that it would be geo coordinate), but was thinking to trust the actual definition , in which the value is point (i.e. its int,int point, where geocoordinate would be double,double +additional information one..)

  7. #7
    Registered User
    Join Date
    Jan 2012
    Posts
    18

    Re: Map.TransformCenter

    I'm sorry for over reacting, but after your first post about polyline I was "confused"
    The value must be between 0 and 1 else you get an exception. I would assume that it is a pivot center of heading rotation in %. This is what I'm looking for. But it does not work.

  8. #8
    Registered User
    Join Date
    Jan 2012
    Posts
    18

    Re: Map.TransformCenter

    There is no answer on Microsoft forums either

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    950

    Re: Map.TransformCenter

    Quote Originally Posted by nesher_hh View Post
    There is no answer on Microsoft forums either
    I dont have a way to test this now, but reading this:
    "After you set the value of the TransformCenter property for the Map control, the Center property continues to return the previous center until you set the Center to the same value as the TransformCenter.

    Don’t use the Latitude property and the Longitude property to set the center of the Map control. Instead, create a new GeoCoordinate object and assign it to the Center property."

    So what I read here is that if you set TransformCenter to something different, it will probably change the map visually (or something else, your guess is as good as mine because I cant test right now) but the Center property will remain the same, until you set it to the same coordinates as TransformCenter. What's confusing here is that Center assume a GeoCoordinate and TransformCenter a Point. So I'm assuming that you should use a GeoCoordinate and convert it to a Point with MapPointConverter.

    http://msdn.microsoft.com/en-us/libr...vs.105%29.aspx

    See if that helps.

  10. #10
    Registered User
    Join Date
    Jan 2012
    Posts
    18

    Re: Map.TransformCenter

    TransformCenter is a pivot point about which the map will rotate. It is measured in %. Where 0.5, 0.5 is a center of a map control.
    If you bind any property of Map to a view model you have to use TwoWay mode. Seems like a bug, normally you don't have to do this, but the Map control won't work if you don't do this.

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    950

    Re: Map.TransformCenter

    Quote Originally Posted by nesher_hh View Post
    TransformCenter is a pivot point about which the map will rotate. It is measured in %. Where 0.5, 0.5 is a center of a map control.
    If you bind any property of Map to a view model you have to use TwoWay mode. Seems like a bug, normally you don't have to do this, but the Map control won't work if you don't do this.
    Ok now I get it. Thanks for sharing.

Posting Permissions

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