This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
export default { | |
data() { | |
return { | |
address: "", | |
}; | |
}, | |
methods: { | |
locatorButtonPressed() { | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locatorButtonPressed() { | |
navigator.geolocation.getCurrentPosition( | |
position => { | |
console.log(position.coords.latitude); | |
console.log(position.coords.longitude); | |
}, | |
error => { | |
console.log(error.message); | |
}, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async getStreetAddressFrom(lat, long) { | |
try { | |
var { data } = await axios.get( | |
"https://maps.googleapis.com/maps/api/geocode/json?latlng=" + | |
lat + | |
"," + | |
long + | |
"&key={yourAPIKey}" | |
); | |
if(data.error_message) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locatorButtonPressed() { | |
navigator.geolocation.getCurrentPosition( | |
position => { | |
this.getStreetAddressFrom(position.coords.latitude, position.coords.longitude) | |
}, | |
error => { | |
console.log(error.message); | |
} | |
); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=yourapikey"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mounted() { | |
new google.maps.places.Autocomplete( | |
this.$refs["autocomplete"] | |
); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$par_args = array( | |
'parent' => 0 | |
); | |
$parent_categories = get_categories($par_args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$par_args = array( | |
'parent' => 0 | |
); | |
$parent_categories = get_categories($par_args); | |
foreach($parent_categories as $parent_category) { | |
echo '<h2 class="ui header">' . $parent_category->name . '</h2>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$par_args = array( | |
'parent' => 0 | |
); | |
$parent_categories = get_categories($par_args); | |
foreach($parent_categories as $parent_category) { | |
echo '<h2 class="ui header">' . $parent_category->name . '</h2>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="six wide column"> | |
<form class="ui segment large form"> | |
<div class="ui segment"> | |
<div class="field"> | |
<div class="ui right icon input large"> | |
<input type="text" placeholder="Enter your address" v-model="coordinates" /> | |
<i class="dot circle link icon" @click="locatorButtonPressed"></i> | |
</div> | |
</div> | |
<div class="field"> |