Comments (6)
ok i found a way to debug this
console.log("check");
console.log(typeof this);
console.log(typeof this.data);
console.log(typeof this.data.atts);
console.log(typeof this.data.atts.rendered);
if (typeof this.data.atts.rendered === 'function') {
console.log("call rendered");
this.data.atts.rendered(this.data.map);
} else {
console.log("rendered is undef");
}
this outputs
check
object
object
object
undefined
rendered is undef
ok i guess that was the wrong place to lock at?
from meteor-autoform-map.
Ah, now i am getting a feel of it whats happening. Your code gets never to the point (if clause) to call my callback function and pass the map as an argument. BUT somehow my callback is invoked anyway! I can choose any arbitrary property name for my callback function but its called anyway.
location: {
type: String,
autoform: {
type: 'map',
afFieldInput: {
<left out>,
absdfXXX: function (gmap) {
console.log("set current gmap");
console.log(gmap) ;
Session.set("currentGoogleMap", gmap);
}
}
}
},
So obviously i am doing something wrong but the fact that the functions is called anyway made me believe it was right in the first place.
EDIT:
if i log the this.data.atts its showing me, that whatever function name i set its undefined. But that function is called (but maybe erased after?)
EDIT2:
Ok now i am pretty much stuck. After all i would guess your code is right, in a sense that if it ever worked before.I would guess the error is in Autoform itself cuz i can never find a place in your code where the rendered (or whatever i named the function) is not undefined. I could only guess where the toplevel entrypoint of the values passed by Autoform is (either in Template.afMap.created or Template.afMap.rendered i would vote for the last cuz you starting to handle the data here) but all places i found rendered with a function undefined. Im starting to believe, that Autoform is messing this up and for whatever reason calling any function present and destroying it by setting it undefined.
EDIT3:
I havn't looked through the code of Autoform but i believe this is happening. If you set a property as function the function is invoked by Autoform and the returnvalue is saved into the property and passed by. Thats why every arbitrary named property with a function is called but undefined is left over – cuz my function did not return any value. If i do something like this:
location: {
type: String,
autoform: {
type: 'map',
afFieldInput: {
<left out>,
rendered: function () {
return function(gmap) {
console.log("set current gmap");
console.log(gmap) ;
Session.set("currentGoogleMap", gmap);
}
}
}
}
},
it seems to work but i'll get this error message
Exception from Tracker recompute function:
RangeError: Maximum call stack size exceeded
from meteor-autoform-map.
Hmmm... really strange but I guess it's autoform messing up. It seems to work only when you put the rendered callback in afFieldInput
and it will return the callback function, e.g.
location: {
type: String,
autoform: {
type: 'map',
afFieldInput: {
rendered: function () {
return function (map) {
console.log(map);
};
}
}
}
}
from meteor-autoform-map.
Yes, as i mentioned in my last edit in my third post: if i do that i'll get an exception
Exception from Tracker recompute function:
RangeError: Maximum call stack size exceeded
obviously Autoform is trying to evaluate this recursively, no matter what, until the jsVM stack get overflown.
from meteor-autoform-map.
It may be caused by other property. For me it worked. At least on Chrome. I've came across this error on Firefox several times.
from meteor-autoform-map.
I tried it again and surprisingly the exception did not happen but the "outter" function is called 15 times. Regardless of this, you should consider to update your docs or investigating whats causing that quirk (API change of Autoform?) after this i would consider this issue closed.
from meteor-autoform-map.
Related Issues (20)
- autocomplete without map HOT 1
- Any plans to support mongo geo query style fields? HOT 2
- Google Maps package
- [enhancement ] Are you planning to add google autocomplete input field ? HOT 2
- map not render HOT 3
- [enhancement] address field HOT 5
- Options on afQuickField
- Bro Leaflet please! HOT 1
- Fill address HOT 1
- SearchBox undefined HOT 2
- Is it supported with Meteor 1.2.1 ?Also can you put up a demo link
- Get current location doesn't work. HOT 6
- Difference between declaration and real state HOT 1
- google map does not render un error in console
- Google Maps API error: MissingKeyMapError HOT 1
- Is there a way to reactively listen for changes on the marker position?
- Not compatible with AutoForm v6.0 HOT 3
- Touch events do not work from mobile
- Update to Autoform 6.2.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-autoform-map.