David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

googlemaps showing previous input

Hi,

Im using a database query to populate multiple markers on a googlemap componet. But for some reason the results are always one input behind e.g

input list 1, no results
input list 2, shows list 1
input list 3, shows list 2

Ive tried re-doing my mapping and linked it to a label array to check the query is returning the right result, which it is.

please help

thanks

Dave

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

googlemaps showing previous input

Hello David,

Unfortunately it is not clear enough. Could you please provide more details, screen shots would help a lot.
Do you show data on the map on the service's sussecc event?

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

googlemaps showing previous input

Hi Sergiy,

Apologies for not being clear.

Im using a database to call an array of store addresses near the store selected. The database is mapped to the googlemaps component on the service success, with the original stores address to the google maps address, and the array of results to the marker. Ive attached a screen shot. The issue is that the array of results shown on the map is always one input behind. The array also populates a list so I know its returning the right results, its the map component that is showing the previous results.

thank you for your help Image Image

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

googlemaps showing previous input

David,

Please remove all markers before each service execution: https://developers.google.com/maps/do...

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

googlemaps showing previous input

Thank you Sergiy,

Im having problems calling the function on my google map. how do you reference the Apperyio googlemap when you call the function?

function deleteMarkers() {
clearMarkers();
markers = [];
}

thank you

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

googlemaps showing previous input

Could you please clarify what exactly doesn't work?
Please check are there any errors in console? [This] (http://devcenter.appery.io/documentat...) should help.

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

googlemaps showing previous input

Hi Sergiy,

Im not sure how to use the function. how do i call it during the database mapping and do i need to reference the apperyio googlemap component?

thank you

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

googlemaps showing previous input

Please use JS as it shown here: https://devcenter.appery.io/tutorials... to show markers on the map.
After that - you will be able to remove them without problems

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

googlemaps showing previous input

Hi Sergiy,

I have completed the tutorial and everything works great except I cant clear the previous markers. I added the function from google

function deleteMarkers() {
clearMarkers();
markers = [];
}

but when i call it before the database request it stops the service from running?

thank you

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

googlemaps showing previous input

You have to push all markers to markers array right after prevar marker = new google.maps.Marker({ .../pre line

These links can be helpful:
https://getsatisfaction.com/apperyio/...
https://getsatisfaction.com/apperyio/...
https://getsatisfaction.com/apperyio/...

Return to “Issues”