Search
LatLongRect.fromCenter Method
See Also
 






Creates a LatLongRect instance from center coordinate and size.

Namespace: MindFusion.Mapping
File: LatLongRect.js

 Syntax

JavaScript  Copy Code

function fromCenter (location, size)

 Parameters

location

LatLong. The center coordinate.

size

MindFusion.Drawing.Size. The size in meters.

 Return Value

LatLongRect. A LatLongRect instance.

 Remarks

The following code sets the mapBounds property of a mapView instance to a rectangle:

 Example

JavaScript  Copy Code

var m = MindFusion.Mapping;
var d = MindFusion.Drawing;

// create a new instance of the mapView
var view = new m.MapView(document.getElementById("mapView"));
view.theme = "light";
view.mapBounds = m.LatLongRect.fromCenter(new m.LatLong(51.507351, -0.127758), new d.Size(50, 100));
view.zoomPivot = m.ZoomPivot.Cursor;

 See Also