LocationRect Class Method fromEdges(north:number, west:number, south:number, east:number) RRS feed

  • General discussion

  • I tried to implement the fromEdges method in two different ways and neither worked.

    var mb = new Microsoft.Maps.LocationRect.fromEdges(mapBounds[0], mapBounds[1], mapBounds[2], mapBounds[3]);

    mapBounds contains 4 strings of latitude and longitude values and the method threw an error of Invalid Latitude.  The string values are valid.

    Next I tried using the bracketed method:

    var mb = new Microsoft.Maps.LocationRect.fromEdges({north:mapBounds[0], west:mapBounds[1], south:mapBounds[2], east:mapBounds[3]});

    Threw the same error.

    Final solution was to use a different constructor and it worked:

    var mb = new Microsoft.Maps.LocationRect.fromLocations(new Microsoft.Maps.Location(mapBounds[0], mapBounds[1]), new Microsoft.Maps.Location(mapBounds[2], mapBounds[3]));
    I don't think fromEdges is working and fromLocations is.

    I am using the V8 Web Control API.
    • Edited by developer68 Thursday, June 20, 2019 6:29 PM
    Thursday, June 20, 2019 6:28 PM

All replies