MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / toLatLng

Function toLatLng

src/leaflet/core/Base.js:173–196  ·  view source on GitHub ↗
(a, b, c)

Source from the content-addressed store, hash-verified

171}
172
173function toLatLng(a, b, c) {
174 if (a instanceof L.latLng) {
175 return a;
176 }
177 if (Array.isArray(a) && typeof a[0] !== 'object') {
178 if (a.length === 3) {
179 return new L.latLng(a[0], a[1], a[2]);
180 }
181 if (a.length === 2) {
182 return new L.latLng(a[0], a[1]);
183 }
184 return null;
185 }
186 if (a === undefined || a === null) {
187 return a;
188 }
189 if (typeof a === 'object' && 'lat' in a) {
190 return new L.latLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);
191 }
192 if (b === undefined) {
193 return null;
194 }
195 return new L.latLng(a, b, c);
196}

Callers 1

Base.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected