{"action":"created","issue":{"url":"https://api.github.com/repos/paulbartrum/jurassic/issues/13","repository_url":"https://api.github.com/repos/paulbartrum/jurassic","labels_url":"https://api.github.com/repos/paulbartrum/jurassic/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/paulbartrum/jurassic/issues/13/comments","events_url":"https://api.github.com/repos/paulbartrum/jurassic/issues/13/events","html_url":"https://github.com/paulbartrum/jurassic/issues/13","id":144801145,"number":13,"title":"Calling a function in a javascript library","user":{"login":"thipages","id":130309,"avatar_url":"https://avatars.githubusercontent.com/u/130309?v=3","gravatar_id":"","url":"https://api.github.com/users/thipages","html_url":"https://github.com/thipages","followers_url":"https://api.github.com/users/thipages/followers","following_url":"https://api.github.com/users/thipages/following{/other_user}","gists_url":"https://api.github.com/users/thipages/gists{/gist_id}","starred_url":"https://api.github.com/users/thipages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thipages/subscriptions","organizations_url":"https://api.github.com/users/thipages/orgs","repos_url":"https://api.github.com/users/thipages/repos","events_url":"https://api.github.com/users/thipages/events{/privacy}","received_events_url":"https://api.github.com/users/thipages/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paulbartrum/jurassic/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-31T06:16:46Z","updated_at":"2016-03-31T12:37:27Z","closed_at":null,"body":"Hi,\r\nI want to call a function in an existing js library.\r\nI did not find the way to do it\r\n\r\nhere is the library : http://turfjs.org/\r\nAs an example, I would like to call turf.distance from C#\r\n\r\nThank you"},"comment":{"url":"https://api.github.com/repos/paulbartrum/jurassic/issues/comments/203912250","html_url":"https://github.com/paulbartrum/jurassic/issues/13#issuecomment-203912250","issue_url":"https://api.github.com/repos/paulbartrum/jurassic/issues/13","id":203912250,"user":{"login":"paulbartrum","id":1572571,"avatar_url":"https://avatars.githubusercontent.com/u/1572571?v=3","gravatar_id":"","url":"https://api.github.com/users/paulbartrum","html_url":"https://github.com/paulbartrum","followers_url":"https://api.github.com/users/paulbartrum/followers","following_url":"https://api.github.com/users/paulbartrum/following{/other_user}","gists_url":"https://api.github.com/users/paulbartrum/gists{/gist_id}","starred_url":"https://api.github.com/users/paulbartrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulbartrum/subscriptions","organizations_url":"https://api.github.com/users/paulbartrum/orgs","repos_url":"https://api.github.com/users/paulbartrum/repos","events_url":"https://api.github.com/users/paulbartrum/events{/privacy}","received_events_url":"https://api.github.com/users/paulbartrum/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T12:37:27Z","updated_at":"2016-03-31T12:37:27Z","body":"Hmm, that does make it harder.  You need something like this (untested):\r\n\r\n```c#\r\nvar param = engine.Object.Construct();\r\nparam[\"type\"] = engine.Object.Construct();\r\nvar geometry = engine.Object.Construct();\r\ngeometry[\"type\"] = \"Point\";\r\ngeometry[\"coordinates\"] = engine.Array.New(new object[] { -75.343, 39.984 });\r\nparam[\"geometry\"] = geometry;\r\n((ObjectInstance)engine.Global[\"turf\"]).CallMemberFunction(\"distance\", param);\r\n```\r\n\r\nAnd yes, half a meg of javascript is going to be slow (everything gets compiled up front).  Sorry!"}}