Skip to content

Commit e4ac54f

Browse files
author
deveshpankaj
committed
Added: location api example app
1 parent af9d161 commit e4ac54f

File tree

843 files changed

+133065
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

843 files changed

+133065
-0
lines changed

location-api-example/.gitignore

Whitespace-only changes.

location-api-example/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
## Build
3+
```bash
4+
$ androidjs b
5+
```
6+

location-api-example/assets/androidjs.js

+306
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

location-api-example/assets/bootstrap.min.css

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

location-api-example/assets/bootstrap.min.js

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Loading
9.27 KB
Loading
25.7 KB
Loading

location-api-example/assets/jquery-3.3.1.slim.min.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

location-api-example/assets/popper.min.js

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

location-api-example/assets/script.js

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
new Vue({
2+
el: '#app',
3+
data: {
4+
latitude: null,
5+
longitude: null
6+
},
7+
created() {
8+
let api_response = app.location.get();
9+
this.latitude = api_response.latitude;
10+
this.longitude = api_response.longitude;
11+
try{
12+
google.maps.event.addDomListener(window, 'load', ()=>initialize(api_response.latitude, api_response.longitude));
13+
}catch(e){
14+
alert(JSON.stringify(e));
15+
}
16+
},
17+
methods: {
18+
remove(el){
19+
for( var i = 0; i < this.users.length; i++) {
20+
if ( this.users[i] === el) {
21+
this.users.splice(i, 1);
22+
i--;
23+
}
24+
}
25+
}
26+
}
27+
});
28+
29+
function initialize(a, b) {
30+
var latlng = new google.maps.LatLng(a, b);
31+
var map = new google.maps.Map(document.getElementById('map'), {
32+
center: latlng,
33+
zoom: 13
34+
});
35+
var marker = new google.maps.Marker({
36+
map: map,
37+
position: latlng,
38+
draggable: false,
39+
anchorPoint: new google.maps.Point(0, -29)
40+
});
41+
var infowindow = new google.maps.InfoWindow();
42+
google.maps.event.addListener(marker, 'click', function() {
43+
var iwContent = '<div id="iw_container">' +
44+
'<div class="iw_title"><b>Location</b> : Noida</div></div>';
45+
// including content to the infowindow
46+
infowindow.setContent(iwContent);
47+
// opening the infowindow in the current map and at the current marker location
48+
infowindow.open(map, marker);
49+
});
50+
}
51+

location-api-example/main.js

Whitespace-only changes.

location-api-example/node_modules/Buffer/README.md

+24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

location-api-example/node_modules/Buffer/index.js

+98
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

location-api-example/node_modules/Buffer/package.json

+49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)