I would like to create a map display application using javascript API like below with .Net Core MVC + angular, how can I do it?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<title>TEST</title>
<style type="text/css">
#sample_map {
width: 660px;
height: 280px;
}
</style>
<script type='text/javascript' src='http://xxxxx/js/map/xxjsapi'></script>
<script type='text/javascript'>
window.onload = function() {
Xxapi.mapHost = 'api-map-pre.com';
Xxapi.auth('xxxxxxxxxx', task_func);
}
function task_func(authStatus) {
if (authStatus != 'success') {
return;
}
var options = {
centerPosition: new Xxapi.Util.LonLat(139.70030321482975, 35.68955994193983),
mapScale: 16
};
Xxapi.mapCreate('sample_map', options);
}
</script>
</head>
<body>
<div id='sample_map'></div>
</body>
</html>
This is a external javascript API and no source and no configfiles. And it seems to be using callback. I looking at: Load external js script dynamically in Angular 2 and tried, but isn't work. Plaese help me.