-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
67 lines (64 loc) · 2.01 KB
/
index.html
File metadata and controls
67 lines (64 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>ncMaps</title>
<script src="ncMaps.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script>
sp=[
[19.2419,-103.7529],
[19.2466,-103.7362]
];
paht=[
[19.2419,-103.7529],
[19.2466,-103.7362],
[19.2216,-103.7463],
[19.2012,-103.7403],
[19.1810,-103.7093],
[19.1605,-103.6973],
[19.1400,-103.7353]
];
path=[];
spRopt=[];
// new ncMaps({idMapa:"mapa",libraries:['places']})
// .ready(function(mapa){
// paht.forEach(p=>{
// latLng=mapa.latLng(p[0],p[1]);
// path.push(latLng);
// });
// paht.forEach(p=>{
// latLng=mapa.latLng(p[0],p[1]);
// spRopt.push(latLng);
// });
// mapa.agregaPolyline({path,autoZoom:true,flechas:true});
// });
$(document).ready(function(){
map=new ncMaps({idMapa:"mapa"});
let origen =map.latLng(19.2431,-103.7223);
let destino =map.latLng(19.2544,-103.7256);
let casa = map.latLng(19.2370,-103.7080);
map.autoZoom({path:[origen,destino,casa],tipo:'latlng'});
map.getIndicaciones({origen,destino,verDistancia:true},function (data){
console.log("I",data);
});
map.getDireccionDePunto(casa,function (data){
console.log(data.direccion);
});
map.getPuntoDeDireccion({direccion:"av niños heroes #1133, colima"},function (data){
map.agregarMarcador({latLng:data.punto});
});
});
</script>
<style>
#mapa{
height: 500px;
width: 100%;
}
</style>
</head>
<body>
<div id="mapa"></div>
</body>
</html>