Page 3 of 4
Cascading dropdowns and Google maps
Posted: Thu Feb 27, 2014 5:57 pm
by Illya Stepanov
Hi Eddie,
In your mapping you are adding JS in parameter 'where'?
Code should look like this:
prereturn '{"City":"​Pretoria0", "Province":"Gauteng"}';/pre
Please try it this way - and if it will not work, please post screenshots of request/response from network tab.
Cascading dropdowns and Google maps
Posted: Fri Feb 28, 2014 12:12 pm
by Eddie Willcox
This the code I use in the query service on the stores page:
return '{"City":"' + localStorage.getItem("city") + '", "Province":"' + localStorage.getItem("province") + '"}';
Here is the screenshot of the request/response from the network tab:
Cascading dropdowns and Google maps
Posted: Fri Feb 28, 2014 12:21 pm
by Eddie Willcox
Here is a screenshot of the query service test where I have copied the request from my app preview test into the where test:
As you can see, it returns a blank array.
This is a screenshot of the query service test where I manually typed the query in the where test:
If I type a manual query in the query service of the stores page (i.e. not using localStorage.GetItem), the map shows my marker, even though the "where" in the request/response is exactly the same:
Cascading dropdowns and Google maps
Posted: Fri Feb 28, 2014 4:21 pm
by Serhii Kulibaba
It looks like problem if copy/past string from getsatisfaction (addition symbol before Pretoria0). Use parameter that you manually typed the query in the where test
Cascading dropdowns and Google maps
Posted: Fri Feb 28, 2014 4:42 pm
by Eddie Willcox
Hi Sergiy,
I have tried this, but the map keeps coming up empty. Unles I misunderstand what you are trying to say?
Cascading dropdowns and Google maps
Posted: Fri Feb 28, 2014 7:48 pm
by Nikita
Hi, Eddie.
Please, check tab network in the browser. Do you receive response for this request?
Cascading dropdowns and Google maps
Posted: Mon Mar 03, 2014 6:04 am
by Eddie Willcox
Hi Nikita. Here are some screenshots of the responses and their corresponding requests.
Request with localStorage.getItem:
Response:
Static Request (where my JS in the query is return '{"City": "Pretoria0", "Province": "Gauteng"}';
Response:
Cascading dropdowns and Google maps
Posted: Mon Mar 03, 2014 10:43 am
by Nikita
Hi Eddie.
And how have you dynamically created these parameters? Could you send the mapping, so we can reproduce it.
Cascading dropdowns and Google maps
Posted: Mon Mar 03, 2014 10:52 am
by Eddie Willcox
On the page called Store_selector, I have 2 select boxes which have the province and city as selections and a button. On button tap, I set local storage variables province and city to selected values (hence the 0 at the end of the city, if I choose the second city in the same province, it adds a 1 at the end of the city name) and then navigate to the stores page (where the map is on).
Cascading dropdowns and Google maps
Posted: Mon Mar 03, 2014 8:23 pm
by Maryna Brodina
Hello!
In your code there are invisible symbols which broke where line (see the screenshot). Delete this line and write in editor again