Hi Alex,

When i uncomment that line of alert it alerts the passed value from flex
both in simulator and ipad. But the issue is when i run from ipad the
polygon wont get showed in the map and the strange is its working in
simulator.

On Tue, Nov 10, 2015 at 9:20 PM, Alex Harui [via Apache Flex Users] <
ml-node+s2333346n11455...@n4.nabble.com> wrote:

> I saw you commented out an alert of the “str” passed in.  What does it
> look like when it works and when it doesn’t work?
>
> On 11/10/15, 3:06 AM, "Manohar Jeyaraj" <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=11455&i=0>> wrote:
>
> >Hi,
> >
> >Thanks Alex and Jude for the prompt reply. I tried with stagewebview
> >wrapper it is working fine in simulator but not in ipad.
> >Let me explain briefly.
> >
> >What I am trying to achieve is showing a polygon as a border for a
> >particular state in a country based on geojson data file.
> >
> https://google-developers.appspot.com/maps/documentation/javascript/exampl
> >es/layer-data-dragndrop
> >
> >In the link above, if we drag and drop a geojson file of any geography,
> >that particular region gets highlighted with a polygon.
> >
> >I am trying to achieve same thing by passing the geography\state code
> from
> >flex to html google map's javascript function.
> >
> >I am using tabbed view mobile flex application where i have a list(of
> >various states of a particular country) and displaying Google Map (which
> >is
> >Google Map javascript api HTML page).
> >On change of list i am calling the stagewebview wrapper as Jude suggested
> >(webview.callJavaScript('myfunction',null,str)) and the selected
> >value(which is the selected state's code) is being passed to html page
> and
> >it is working fine in the simulator as in the screenshot below link:
> >
> >http://pasteboard.co/21UN0O5N.png
> >
> >But when i deploy the code and run the ipa file in ipad the geography
> wont
> >be marked like in the screenshot above and it will display only the empty
> >map as in the screenshot below link:
> >
> >http://pasteboard.co/21Vf22LR.png
> >
> >This is the html page(code) that I am using within stagewebview:
> >
> >http://codepen.io/anon/pen/zvMBaz
> >
> >On selecting the list, i am calling following javascript function from
> >flex:
> >function myfunction(str)
> >{
> >    //alert(str);
> >    loadJSON("./"+str+".geojson", function(response) {});   // this loads
> >the geojson file which has lat\long points that needs to be shown on the
> >map
> >}
> >
> >Kindly let me know if i am missing anything or anything is wrong?.
> >
> >
> >
> >On Tue, Nov 10, 2015 at 4:09 AM, jude [via Apache Flex Users] <
> >[hidden email] <http:///user/SendEmail.jtp?type=node&node=11455&i=1>>
> wrote:
> >
> >> Manohar,
> >>
> >> Try this stagewebview wrapper,
> >>
> >>
> >>
> https://github.com/monkeypunch3/flexcapacitor/blob/master/MainMobileLibra
> >>ry/src/com/flexcapacitor/controls/WebView.as.
> >>
> >> You would pass objects as stringified JSON as Alex mentioned. FYI In
> the
> >> latest Android a user reported you must add a fake protocol to get the
> >> event to fire, https://github.com/monkeypunch3/flexcapacitor/issues/1.
> >>
> >> On Mon, Nov 9, 2015 at 8:38 AM, Alex Harui <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=11451&i=0>> wrote:
> >>
> >> > Is your JS function being called, but just not with the right value?
> >> >
> >> > If so, I would just JSON to stringify the object.
> >> >
> >> > -Alex
> >> >
> >> > On 11/9/15, 3:42 AM, "Manohar Jeyaraj" <[hidden email]
> >> <http:///user/SendEmail.jtp?type=node&node=11451&i=1>> wrote:
> >> >
> >> > >ExternalInterface is not available as I am using this in mobile
> >> > >application. Hence I am using stagewebview.
> >> > >
> >> > >I am using stagewebview(to display HTML Google map)  to call a
> >> javascript
> >> > >function in flex mobile application.
> >> > >I am passing a selected item value(from flex) to a javascript
> >>function
> >> > >like
> >> > >below:
> >> > >
> >> > >webView.loadURL(“javascript:myfunction(‘” + lst.selectedItem[‘name’]
> >>+
> >> > >“‘)”);
> >> > >
> >> > >and in my html file  when i add an alert i am getting the value too.
> >> > >
> >> > >But the problem is that the required function is working only when i
> >> add
> >> > >it
> >> > >under onload in body as below:
> >> > >
> >> > ><body onload="myfunction('value')">
> >> > >
> >> > >but when i remove the onload method from the body of html and call
> it
> >> from
> >> > >flex the required action is not happening inside the JS function.
> >> > >
> >> > >Kindly help me out on what is causing the issue?
> >> >
> >> >
> >>
> >>
> >> ------------------------------
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> >>
> http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-pass-Object-fr
> >>om-stagewebview-to-javascript-function-tp11376p11451.html
> >> To start a new topic under Apache Flex Users, email
> >> [hidden email] <http:///user/SendEmail.jtp?type=node&node=11455&i=2>
> >> To unsubscribe from Apache Flex Users, click here
> >>
> >><http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?
>
> >>macro=unsubscribe_by_code&node=1&code=bWFudW1lOThAZ21haWwuY29tfDF8LTEyNjk
>
> >>1NDc3NTE=>
> >> .
> >> NAML
> >>
> >><http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?
>
> >>macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml
>
> >>.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabbl
>
> >>e.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble
>
> >>%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21n
>
> >>abble%3Aemail.naml>
> >>
> >
> >
> >
> >--
> >~M@nU~
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-pass-Object-from-stagewebview-to-javascript-function-tp11376p11455.html
> To start a new topic under Apache Flex Users, email
> ml-node+s2333346n...@n4.nabble.com
> To unsubscribe from Apache Flex Users, click here
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=bWFudW1lOThAZ21haWwuY29tfDF8LTEyNjk1NDc3NTE=>
> .
> NAML
> <http://apache-flex-users.2333346.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



-- 
~M@nU~




--
View this message in context: 
http://apache-flex-users.2333346.n4.nabble.com/Not-able-to-pass-Object-from-stagewebview-to-javascript-function-tp11376p11456.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Reply via email to