{"action":"created","issue":{"url":"https://api.github.com/repos/yogiben/meteor-autoform-map/issues/31","labels_url":"https://api.github.com/repos/yogiben/meteor-autoform-map/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/yogiben/meteor-autoform-map/issues/31/comments","events_url":"https://api.github.com/repos/yogiben/meteor-autoform-map/issues/31/events","html_url":"https://github.com/yogiben/meteor-autoform-map/issues/31","id":93614045,"number":31,"title":"rendered function has no gmap parameter","user":{"login":"pythoneer","id":1102097,"avatar_url":"https://avatars.githubusercontent.com/u/1102097?v=3","gravatar_id":"","url":"https://api.github.com/users/pythoneer","html_url":"https://github.com/pythoneer","followers_url":"https://api.github.com/users/pythoneer/followers","following_url":"https://api.github.com/users/pythoneer/following{/other_user}","gists_url":"https://api.github.com/users/pythoneer/gists{/gist_id}","starred_url":"https://api.github.com/users/pythoneer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pythoneer/subscriptions","organizations_url":"https://api.github.com/users/pythoneer/orgs","repos_url":"https://api.github.com/users/pythoneer/repos","events_url":"https://api.github.com/users/pythoneer/events{/privacy}","received_events_url":"https://api.github.com/users/pythoneer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-07T19:52:55Z","updated_at":"2015-07-09T17:00:42Z","closed_at":null,"body":"If i set a function for the rendered option this function is like called 15 times and every time the map object is undefined. \r\n```\r\nlocation: {\r\n        type: String,\r\n        autoform: {\r\n            type: 'map',\r\n            afFieldInput: {\r\n                defaultLat: \"52.520645\",\r\n                defaultLng: \"13.409779\",\r\n                geolocation: true,\r\n                searchBox: true,\r\n                autolocate: false,\r\n                zoom:15,\r\n                height: \"400px\",\r\n                rendered: function (gmap) {\r\n                    console.log(\"set current gmap\");\r\n                    console.log(gmap) ;\r\n                    Session.set(\"currentGoogleMap\", gmap);\r\n                }\r\n            }\r\n        }\r\n    },\r\n```\r\n\r\ni looked through your code and can't find an obvious error. \r\n\r\n```\r\nif typeof @data.atts.rendered == 'function'\r\n\t\t@data.atts.rendered @data.map\r\n```\r\n\r\nlooks fine to me, but the map is undefined :/\r\n\r\nOT: i would love to debug this myself, but i can't find the place to alter the code of your installed package."},"comment":{"url":"https://api.github.com/repos/yogiben/meteor-autoform-map/issues/comments/120070264","html_url":"https://github.com/yogiben/meteor-autoform-map/issues/31#issuecomment-120070264","issue_url":"https://api.github.com/repos/yogiben/meteor-autoform-map/issues/31","id":120070264,"user":{"login":"mpowaga","id":180248,"avatar_url":"https://avatars.githubusercontent.com/u/180248?v=3","gravatar_id":"","url":"https://api.github.com/users/mpowaga","html_url":"https://github.com/mpowaga","followers_url":"https://api.github.com/users/mpowaga/followers","following_url":"https://api.github.com/users/mpowaga/following{/other_user}","gists_url":"https://api.github.com/users/mpowaga/gists{/gist_id}","starred_url":"https://api.github.com/users/mpowaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpowaga/subscriptions","organizations_url":"https://api.github.com/users/mpowaga/orgs","repos_url":"https://api.github.com/users/mpowaga/repos","events_url":"https://api.github.com/users/mpowaga/events{/privacy}","received_events_url":"https://api.github.com/users/mpowaga/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T17:00:42Z","updated_at":"2015-07-09T17:00:42Z","body":"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.\r\n\r\n```javascript\r\nlocation: {\r\n  type: String,\r\n  autoform: {\r\n    type: 'map',\r\n    afFieldInput: {\r\n      rendered: function () {\r\n        return function (map) {\r\n          console.log(map);\r\n        };\r\n      }\r\n    }\r\n  }\r\n}\r\n```"}}