none
How to cause GeoCoordinate.IsUnknown Property to be false? RRS feed

  • Question

  • The .Net 4 GeoCoordinate.IsUnknown property is read only and seems to be set to false when new Pushpin() is called, even though the Location information is not yet valid (set).

    The property is not useful if it can not be set to false.

    How can I cause GeoCoordinate.IsUnknown Property to be false?

     
    Wednesday, May 2, 2012 3:35 PM

All replies

  • Hi DonBaechtel,

    Thank you for posting on this forum.

    According to this documentation: http://msdn.microsoft.com/en-us/library/system.device.location.geocoordinate.isunknown.aspx 

    Gets a value that indicates whether the GeoCoordinate does not contain latitude or longitude data.

    true if the GeoCoordinate does not contain latitude or longitude data; otherwise, false.

    So, the simple way is to set the latitude or longitude value.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 3, 2012 11:17 AM
    Moderator
  • Setting the latitude or longitude vale would tend to set the IsUnknown property to False.

    But how do you set it to True?

    The value for IsUnknow is initially False. There doesn't seem to be any way to set it to True.

    Thursday, May 3, 2012 11:32 AM
  • Hi Donbaechtel,

    How about making a new GeoCoordinate object.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Thursday, May 3, 2012 12:23 PM
    Moderator
  • I did make a new GeoCoordinate object (actually a PushPin) and the IsUnknown property was initialized to False.

    This doesn't seem to be proper that the IsUnknown is set False before the value for the GeoCoordinate is set to a value other than 0,0.

    What can I do to have IsUnknown set or initialized to True?

    Thursday, May 3, 2012 12:34 PM
  • I did make a new GeoCoordinate object (actually a PushPin) and the IsUnknown property was initialized to False.

    This doesn't seem to be proper that the IsUnknown is set False before the value for the GeoCoordinate is set to a value other than 0,0.

    What can I do to have IsUnknown set or initialized to True?

    Hi DonBaechtel,

    Sorry for delay response.

    I have research on this during the leave, and I found it is hard to achieve this goal so far.

    So I think it should be reasonable although you just create a new instance of this kind of object: the original coordinate is (0,0), it is a valid value, and thus the Isunknown is false.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 15, 2012 1:58 PM
    Moderator
  • But what good is the boolean property IsUnknown if it is always false and can never be set True?

    I wanted to use the IsUnknown property to know when an event handler had stored a new value in a GeoCoordinate variable. But since the IsUnknown value is always false, I can't do that. I do not like checking the coordinates for (0,0) instead. That just doesn't fell right.

    Can this be registered at Microsoft as a BUG ? When a new GeoCoordinate variable is created, the IsUnknown property should be set to False, regardless of the values initialized for the Location.  Otherwise, what purpose does IsUnknown serve? How do you use it to tell when the Location is set?

    Tuesday, May 15, 2012 2:15 PM
  • Hi Don,

    This may not a bug, anyway, you can report this on the connect site: http://connect.microsoft.com/VisualStudio/ 

    Microsoft will check your concerns.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 16, 2012 5:32 AM
    Moderator
  • I think I may have found a way of getting IsUnknown to be true.  If either the latitude or longitude are Double.NaN, the IsUnknown property will be true.
    Wednesday, February 19, 2014 7:37 PM