MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / toPoint

Function toPoint

libs/leaflet/leaflet-src.js:962–976  ·  view source on GitHub ↗
(x, y, round)

Source from the content-addressed store, hash-verified

960 // @factory L.point(coords: Object)
961 // Expects a plain object of the form `{x: Number, y: Number}` instead.
962 function toPoint(x, y, round) {
963 if (x instanceof Point) {
964 return x;
965 }
966 if (isArray(x)) {
967 return new Point(x[0], x[1]);
968 }
969 if (x === undefined || x === null) {
970 return x;
971 }
972 if (typeof x === 'object' && 'x' in x && 'y' in x) {
973 return new Point(x.x, x.y);
974 }
975 return new Point(x, y, round);
976 }
977
978 /*
979 * @class Bounds

Callers 3

leaflet-src.jsFile · 0.85
polygonCenterFunction · 0.85
polylineCenterFunction · 0.85

Calls 1

isArrayFunction · 0.50

Tested by

no test coverage detected