lukemadera / meteor-autoform-googleplace Goto Github PK
View Code? Open in Web Editor NEWGoogle Places Autocomplete input (without map). Returns an object with formatted address components
Google Places Autocomplete input (without map). Returns an object with formatted address components
@lukemadera It would be great if the location could be saved in a GeoJSON format, as against the current lat and lng. Example is below. Reference( http://geojson.org/ , http://docs.mongodb.org/v2.6/reference/operator/query/near/#query-on-geojson-data)
{
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1] // [ lng, lat ]
},
}
That would enable geospatial queries on mongo.
It would be interesting
The autocomplete should accept an international address.
Easy to implement.
with the user still having an option to change? Like passing the input a suggested or forecasted location (most likely from their profile, or past form).
You can do this normally with a helper and a 'value=thisHelperValue' inside the autoform field brackets but it doesn't seem to work in fields with type=googleplaces
Is it possible to retrieve the name of the selected place as well, if available?
I keep getting a "city is required" whenever I select an NYC address. It seems to not compute jamaica and far rockaway etc.
First, I would like to thank you so much for providing this awesome packages, it saves me a lot of time.
However I noticed maybe a small bug for the class.
I am using template bootstrap3-horizontal for my autoform.
When I add {{> afQuickField name="address" type="googleplace" opts=optsGoogleplace template="bootstrap3-horizontal" label-class="col-sm-2" input-col-class="col-sm-8"}} to my html file, it's redered as without the class "form-control".
This is causing inconsistent layout with the rest of autoform fields.
Can I just filter the dropdown so that it just displays cities ?
Perhaps this is because the input field is nested in another div.
The input should should support standard keyboard events for autocomplete inputs
psuedocode:
document.onkeydown = checkKey;
function checkKey(e) {
e = e || window.event;
if (e.keyCode == '38') {
// up arrow
} else if (e.keyCode == '40') {
// down arrow
} else if (e.keyCode == '37') {
// left arrow
} else if (e.keyCode == '39') {
// right arrow
} else if (e.keyCode == '13') {
// enter (select current)
} else if (e.keyCode == '27') {
// esc (closer)
}
}
I mean having something like:
LocationSchema = new SimpleSchema({
type: {
type: String,
allowedValues: ['Point'],
defaultValue: 'Point'
},
coordinates: {
type: [Number],
decimal: true
}
});
Could it be possible to trigger an event at the end of a selection ?
Template.myformtemplate.events({
"newadress #myfield": function(evt,tpl) {
var adressdata = AutoForm.getInputValue(...);
// update the UI with the data
}
})
Thanks
Hi there,
I just had this error after following the install steps:
TypeError: Cannot read property 'type' of null
at Template.afGooglePlace.rendered (lukemadera_autoform-googleplace.js:308)
at runTemplateHooks (template-extension.js:375)
at templateExtensionMasterHook (template-extension.js:324)
at template.js:116
at Function.Template._withTemplateInstanceFunc (template.js:437)
at fireCallbacks (template.js:112)
at null.<anonymous> (template.js:205)
at view.js:104
at Object.Blaze._withCurrentView (view.js:523)
at view.js:103
Any idea what the problem is?
Thanks!
Looks like we need to add ejson to the dependencies now.
http://lukemadera-packages.meteor.com/af-googleplace-basic does not seem to exist anymore.
Your package uses ejson, but doesn't mention it in the package dependencies. So when using this package inside a package we just get a ejson not found error.
I'm having some dep conflicts and this package https://github.com/dburles/meteor-google-maps helps manage dep conflicts
This scripts is perfect, but it lacks the google logo... Making it unusable as is. We need to make it include the "powered by Google" on the displayed list. Could be toggled with an option...
Looks like it is on this line -
this.autocompleteservice =new google.maps.places.AutocompleteService();
I'm not sure if I'm just not loading google places properly (have it in my head tag of the navbar), or if I'm doing something else wrong.
Thanks a lot!!
Hi,
I discovered this plugin and while you say in README that it is currently not working in iOS-Apps, there are no more issues around. So my simple question. What is the status on this or is there a workaround to fix this problem (fastclick?)
Thanks
I created the field input like in your docu - works fine.
When I use this in my "edit" autoForm I am not able to "delete" the value. Every time I delete the prefilled input value and submit the form the value will be still there.
Hay,
why don't you simply add the AddressSchema to this package and export it? So we wouldn't need to copy paste it if we want to use this plugin ;)
Regards,
Lukas
edit: okay perhaps it isn't that easy because your state regex, only allows some specific states, but would always fail in European country
I have the schema for my addresses field:
citiesToWork: {
type: [Object],
label: 'Cities',
blackbox: true,
optional: true
},
And in template:
{{> afQuickField name='citiesToWork' type='googleplace' opts=optsGoogleplaceCity}}
But it only show 1 field to type address, not autoform block for adding values to array.
Is there any way to create an element for adding several addresses?
I've setup my schema like this (coffeescript):
address:
type: new SimpleSchema App.Schemas.Address
autoform:
afQuickFields:
type: 'googleplace'
also tried this way:
address:
type: new SimpleSchema App.Schemas.Address
quickForm:
type: 'googleplace'
even tried a simple field like this:
address:
type: String
autoform:
afQuickField:
type: 'googleplace'
and still nothing.
No errors, but also no autocomplete.
Can't figure out what I'm doing wrong...
Thanks!
Hi,
I'd like to use the search to display the name of the place (if available) in the input field instead of the address.
Is there a way to do this through events/hooks with your package?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.