Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Application updated database. Pin
Ibrahim.elh28-Jan-16 2:29
Ibrahim.elh28-Jan-16 2:29 
GeneralRe: C# Application updated database. Pin
Richard Deeming28-Jan-16 2:34
mveRichard Deeming28-Jan-16 2:34 
GeneralRe: C# Application updated database. Pin
Ibrahim.elh28-Jan-16 3:19
Ibrahim.elh28-Jan-16 3:19 
GeneralRe: C# Application updated database. Pin
Ibrahim.elh28-Jan-16 4:15
Ibrahim.elh28-Jan-16 4:15 
GeneralRe: C# Application updated database. Pin
Richard Deeming28-Jan-16 4:21
mveRichard Deeming28-Jan-16 4:21 
GeneralRe: C# Application updated database. Pin
Ibrahim.elh28-Jan-16 4:34
Ibrahim.elh28-Jan-16 4:34 
GeneralRe: C# Application updated database. Pin
Ibrahim.elh28-Jan-16 5:41
Ibrahim.elh28-Jan-16 5:41 
Questionsetting multiple Locations in a bing Map Pin
yemen_mansour27-Jan-16 21:34
yemen_mansour27-Jan-16 21:34 
Hi,

I am having a problem in putting a marker for every location in my bing map, this is my code:

C#
private async void geolocator_PositionChanged(Geolocator sender, PositionChangedEventArgs args)
{
    await
    // Need to get back onto UI thread before updating location information
    this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(
    async () =>
    {
        UriString4 = "my URL";
        var http = new HttpClient();
        http.MaxResponseContentBufferSize = Int32.MaxValue;
        var response = await http.GetStringAsync(UriString4);
        var rootObject = JsonConvert.DeserializeObject<NvBarberry.Models.RootObject>(response);
        Location[] location = new Location[int.Parse(rootObject.total)];
        for (int i = 0; i < int.Parse(rootObject.total); i++)
        {
            //Get the current location

            location[i] = new Location(rootObject.locals[i].local_latit,rootObject.locals[i].local_longi);

            //Update the position of the GPS pushpin
            MapLayer.SetPosition(GpsIcon, location[i]);

            //Set the radius of the Accuracy Circle
            GpsIcon.SetRadius(args.Position.Coordinate.Accuracy);

            //Make GPS pushpin visible
            GpsIcon.Visibility = Windows.UI.Xaml.Visibility.Visible;

            //Update the map view to the current GPS location
            MyMap.SetView(location[i], 17);

        }
    }));}


This is the JSON data from where I want to get the local_longi and local_latit of every Location:

{
    success : 1,
    total : 2,
    locals : [{
            id_local : "59",
            local_longi : "20",
            local_latit : "25894"
        }, {
            id_local : "60",
            local_longi : "10.33699",
            local_latit : "25.997745"
        }
    ]
}

The problem is that I get only one marker on the map,

from the Debugger,I get all results in "location" variable,I don't know why I get only one marker in the Map

Please How can I correct my code to have multiple Locations set in the Map

thanks for help
QuestionWindows 10 Mobile MDM - Device Provisioning Pin
gomes127-Jan-16 19:50
gomes127-Jan-16 19:50 
QuestionAdd WeakEvent to ObservableCollection using reflection Pin
Kenneth Haugland27-Jan-16 6:52
mvaKenneth Haugland27-Jan-16 6:52 
AnswerRe: Add WeakEvent to ObservableCollection using reflection Pin
Richard Deeming27-Jan-16 7:17
mveRichard Deeming27-Jan-16 7:17 
GeneralRe: Add WeakEvent to ObservableCollection using reflection Pin
Kenneth Haugland27-Jan-16 7:21
mvaKenneth Haugland27-Jan-16 7:21 
GeneralRe: Add WeakEvent to ObservableCollection using reflection Pin
Mycroft Holmes27-Jan-16 12:05
professionalMycroft Holmes27-Jan-16 12:05 
GeneralRe: Add WeakEvent to ObservableCollection using reflection Pin
Kenneth Haugland27-Jan-16 22:09
mvaKenneth Haugland27-Jan-16 22:09 
AnswerRe: Add WeakEvent to ObservableCollection using reflection Pin
BillWoodruff27-Jan-16 14:52
professionalBillWoodruff27-Jan-16 14:52 
GeneralRe: Add WeakEvent to ObservableCollection using reflection Pin
Kenneth Haugland27-Jan-16 22:13
mvaKenneth Haugland27-Jan-16 22:13 
QuestionProgrammatically Attach Debugger Pin
Kevin Marois26-Jan-16 7:49
professionalKevin Marois26-Jan-16 7:49 
AnswerRe: Programmatically Attach Debugger Pin
OriginalGriff26-Jan-16 8:26
mveOriginalGriff26-Jan-16 8:26 
GeneralRe: Programmatically Attach Debugger Pin
Kevin Marois26-Jan-16 8:32
professionalKevin Marois26-Jan-16 8:32 
GeneralRe: Programmatically Attach Debugger Pin
OriginalGriff26-Jan-16 8:41
mveOriginalGriff26-Jan-16 8:41 
GeneralRe: Programmatically Attach Debugger Pin
Kevin Marois26-Jan-16 8:38
professionalKevin Marois26-Jan-16 8:38 
GeneralRe: Programmatically Attach Debugger Pin
OriginalGriff26-Jan-16 8:41
mveOriginalGriff26-Jan-16 8:41 
GeneralRe: Programmatically Attach Debugger Pin
Kevin Marois26-Jan-16 8:45
professionalKevin Marois26-Jan-16 8:45 
GeneralRe: Programmatically Attach Debugger Pin
OriginalGriff26-Jan-16 8:57
mveOriginalGriff26-Jan-16 8:57 
GeneralRe: Programmatically Attach Debugger Pin
Kevin Marois26-Jan-16 9:01
professionalKevin Marois26-Jan-16 9:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.