×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2013
    Posts
    52

    Use of BingMapsTask on WP8 and WP7 gives different result

    So I've been using the BingMapsTask since wp7 to show a specific location that the user has selected in the app. But since wp8, the behaviour has changed! How can we still use the BingMapsTaks?

    To run this code, be sure to change your region settings to BELGIUM - DUTCH. When you do this, the code will show correct location in WP7 emulator, but on WP8 it won't! ( see images for settings and result )
    Demo app on GitHub

    Code:
    GeoCoordinate location = new GeoCoordinate(51.40205, 4.46802);
    
    BingMapsTask task = new BingMapsTask();
    task.Center = location;
    task.SearchTerm = location.ToString();
    task.ZoomLevel = 9;
    task.Show();


    Good:



    Bad:


  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2012
    Location
    Morocco
    Posts
    292

    Re: Use of BingMapsTask on WP8 and WP7 gives different result

    Hello,
    You should use MapsTask in WP8 instead of BingMapsTask.
    Yassine,

  3. #3
    Registered User
    Join Date
    Jun 2013
    Posts
    52

    Re: Use of BingMapsTask on WP8 and WP7 gives different result

    It's one code base... so seperation is not possible. In other words it's a wp7 project, that is deployed to the store... so wp8 users can also download it.

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    429

    Re: Use of BingMapsTask on WP8 and WP7 gives different result

    While not being an elegant solution you can use Reflection to call the correct task according to the OS version you're running on. The approach is being outlined for another feature that is implemented differently on WP7 and WP8 in this wiki article - hope it helps: http://developer.nokia.com/Community...dows_Phone_app

  5. #5
    Registered User
    Join Date
    Jan 2013
    Posts
    34

    Re: Use of BingMapsTask on WP8 and WP7 gives different result

    You can create two application projects (one for WP7 and another for WP8) and one (or more) library projects with the common logic and one (or more) pltafrom specific library projects wiht the particulars of each platform.

    Dependency injection will make it easier but it's not necessary.

  6. #6
    Registered User
    Join Date
    Jun 2013
    Posts
    52

    Re: Use of BingMapsTask on WP8 and WP7 gives different result

    The 'best' solution in my case was to revert to BingMapsDirectionTask instead of BingMapsTask! With BingMapsDirectionTask it's still possible to use the coördinates, BUT you need to set the Current thread to US: Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); before the .Show() method.

    @SB Dev: using reflection would also seem a good possibility, but I haven't tested that...

Similar Threads

  1. Routing result box
    By bayyanmc in forum [Archived] Maps API for Javascript
    Replies: 4
    Last Post: 2013-07-22, 11:13
  2. GeoCode without any Result
    By 1A Parco-Service GmbH in forum [Archived] Maps API for Javascript
    Replies: 7
    Last Post: 2012-12-02, 05:42
  3. About the result of sending SMS
    By tuzai in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2003-07-14, 04:07
  4. drawImage(img, -10, -10, 0); with different result ?!
    By ph0x in forum Mobile Java General
    Replies: 1
    Last Post: 2003-02-12, 12:57

Posting Permissions

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