<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js"></script>
<style>
#map {
width: 100%;
height: 400px;
}
</style>
</head>
<body>
<div id="dvResult" style="width: 100%; height: 20px"></div>
<div id="map"></div>
<script>
mapkit.init({
authorizationCallback: done => {
done('your token');
},
language: "es"
});
var mGeocoder = new mapkit.Geocoder({ language: "en-GB",
getsUserLocation: true });
mGeocoder.lookup("1000 Coit Rd, Plano TX 75050", (err, data) => {
if(err)
alert(err);
else
{
console.log(data);
var lat = data.results[0].coordinate.latitude;
var lng = data.results[0].coordinate.longitude;
var dvResult = document.getElementById('dvResult');
dvResult.innerHTML = "Lat: " + lat + " / Lng: " + lng;
}
});
</script>
</body>
</html>