Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Cascading dropdowns and Google maps

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.

Eddie Willcox
Posts: 0
Joined: Thu Nov 14, 2013 6:55 am

Cascading dropdowns and Google maps

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:

Image

Eddie Willcox
Posts: 0
Joined: Thu Nov 14, 2013 6:55 am

Cascading dropdowns and Google maps

Here is a screenshot of the query service test where I have copied the request from my app preview test into the where test:

Image

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:

Image

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:

Image

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Cascading dropdowns and Google maps

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

Eddie Willcox
Posts: 0
Joined: Thu Nov 14, 2013 6:55 am

Cascading dropdowns and Google maps

Hi Sergiy,

I have tried this, but the map keeps coming up empty. Unles I misunderstand what you are trying to say?

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

Cascading dropdowns and Google maps

Hi, Eddie.

Please, check tab network in the browser. Do you receive response for this request?

Eddie Willcox
Posts: 0
Joined: Thu Nov 14, 2013 6:55 am

Cascading dropdowns and Google maps

Hi Nikita. Here are some screenshots of the responses and their corresponding requests.

Request with localStorage.getItem:
Image

Response:
Image

Static Request (where my JS in the query is return '{"City": "Pretoria0", "Province": "Gauteng"}';

Image

Response:

Image

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

Cascading dropdowns and Google maps

Hi Eddie.
And how have you dynamically created these parameters? Could you send the mapping, so we can reproduce it.

Eddie Willcox
Posts: 0
Joined: Thu Nov 14, 2013 6:55 am

Cascading dropdowns and Google maps

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).

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Cascading dropdowns and Google maps

Hello!

In your code there are invisible symbols which broke where line (see the screenshot). Delete this line and write in editor again
Image

Return to “Issues”