Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions OddJobb/www/js/controllers/post_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ myApp.onPageInit('post', function (page) {
2. Generate post data!
*/


myApp.params.swipePanel = false;
map = new GMaps({
div: '#map',
lat: -12.043333,
lng: -77.028333
});

const testPost = {
season: 'img/green.jpg',
title: 'Grass Mowing Required',
date: 'January 21, 2015',
text: 'Guys please help my grass is growing too large'
text: 'Guys please help my grass is growing too large',
postalCode: 'L1G6N4'
}

const posts = [];
Expand All @@ -25,7 +32,8 @@ myApp.onPageInit('post', function (page) {
posts.push(testPost);
}


address(testPost.postalCode);

const myList = myApp.virtualList('.list-block.virtual-list.cardslist', {
items: posts,
template:
Expand All @@ -44,4 +52,21 @@ myApp.onPageInit('post', function (page) {
' </div>' +
'</div >'
});
})
})

function address(adr){
GMaps.geocode({

address: adr,
callback: function(results, status) {
if (status == 'OK') {
var latlng = results[0].geometry.location;
map.setCenter(latlng.lat(), latlng.lng());
map.addMarker({
lat: latlng.lat(),
lng: latlng.lng()
});
}
}
});
}
3 changes: 2 additions & 1 deletion OddJobb/www/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<div data-page="post" class="page">
<div class="page-content">
<div class="content-block-title">Posting Details</div>

<div id="map">
</div>
<div class="list-block virtual-list cardslist">
<!-- keep it empty -->
</div>
Expand Down