-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
need person's location add using google maps #48
base: dev
Are you sure you want to change the base?
Conversation
flood_2017-05-29.sql
Outdated
-- Table structure for table `donations` | ||
-- | ||
|
||
CREATE TABLE `donations` ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add a migration use artisan
cli tool , otherwise its going to be diffcult to manage the DB upgrades / changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the migrations are added we should be good to go with this PR
app/Need.php
Outdated
@@ -12,6 +12,6 @@ class Need extends Model | |||
* @var array | |||
*/ | |||
protected $fillable = [ | |||
'name', 'telephone', 'address', 'city', 'needs', 'heads' | |||
'name', 'telephone', 'address','latlon', 'city', 'needs', 'heads' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO latlon
is a bit unreadable at first sight. Maybe something like geolocation
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay i will change
</div> | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many blank lines.
<button type="button" onclick="getLocation()" class="btn btn-primary">සිතියමට ඇතුල් කරන්න</button> | ||
<p id="demo"> </p> | ||
<div id="mapholder" style="width:55%;height:300px"> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the Maps API to get the general area from the address input above?
https://developers.google.com/maps/documentation/geocoding/intro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we can. but if some one enter a wrong address, it will be a problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It could be more work at the moment, but can something like the following be done?
- User enters an address
- An attempt is made to obtain the geolocation using that address.
- If the locations are received, the map is refreshed to show that location.
- If the location is wrong on the map, the user adjusts it.
Maybe this can be an improvement after these current changes are merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will be fine. i will work on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is an issue to add MAP API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please investigate the possibility of getting the geocode from the address itself.
updated to getting geocode from address. please review it and notify me |
function showError(error) { | ||
switch(error) { | ||
case "ZERO_RESULTS": | ||
x.innerHTML = "ඔබගේ ලිපිනය සොයාගත නොහැක . රතු පැහැති සලකුණ ඇදගෙන යාමෙන් ඔබ සිටින ස්ථානය ලකුණු කල හැක " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would these have to be i18nized? Not sure if that PR was merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are the defined errors of the geocode. i checked those errors and printed customized errors messages for these defined errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chamilad Do we have i18n support at the moment? Does resources/lang contain them?
Edit : Seems https://github.com/reliefsupports/reliefsupports.org/pull/122 gives i18n support.
@dulajsan Please include a screenshot of the UI if possible. Thanks for implementing this! I think this will also make a good starting point for a broader map feature. |
@dulajsan appreciate if you can fix conflict and test once with latest code in your local. |
@thinkholic is this already in production? |
} | ||
} | ||
|
||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dulajsan please get an update from dev and add the translations for these
app/Providers/AppServiceProvider.php
Outdated
@@ -13,7 +14,8 @@ class AppServiceProvider extends ServiceProvider | |||
*/ | |||
public function boot() | |||
{ | |||
// | |||
Schema::defaultStringLength(191); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for now, this is due to the multi-byte utf support that's needed. But we need to find a mechanism to go around the default string length problem and move this concert someplace that makes sense.
Geolocation integration forked from PR #48
@@ -137,19 +138,19 @@ function showPosition(position) { | |||
function showError(error) { | |||
switch(error) { | |||
case "ZERO_RESULTS": | |||
x.innerHTML = "ඔබගේ ලිපිනය සොයාගත නොහැක . රතු පැහැති සලකුණ ඇදගෙන යාමෙන් ඔබ සිටින ස්ථානය ලකුණු කල හැක " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added i18n support. Now we can expose requester location.
@dulajsan I have tested in staging and its not convenient as we search in Google maps. |
@danishka yes we can type in address field. Then the map will focused to relevant address. ex: If we type nugegoda, the map will focused to nugegoda |
Add GPS location when someone submit their needs. It is optional.