Page 1 of 2

googlemaps showing previous input

Posted: Sat Nov 14, 2015 10:32 am
by David wyatt

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


googlemaps showing previous input

Posted: Sat Nov 14, 2015 4:01 pm
by Serhii Kulibaba

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?


googlemaps showing previous input

Posted: Sat Nov 14, 2015 9:28 pm
by David wyatt

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


googlemaps showing previous input

Posted: Mon Nov 16, 2015 8:56 pm
by Serhii Kulibaba

David,

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


googlemaps showing previous input

Posted: Wed Nov 18, 2015 9:21 am
by David wyatt

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


googlemaps showing previous input

Posted: Fri Nov 20, 2015 11:08 am
by Serhii Kulibaba

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.


googlemaps showing previous input

Posted: Sat Nov 21, 2015 10:03 pm
by David wyatt

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


googlemaps showing previous input

Posted: Wed Nov 25, 2015 12:56 pm
by Serhii Kulibaba

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


googlemaps showing previous input

Posted: Wed Nov 25, 2015 8:32 pm
by David wyatt

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


googlemaps showing previous input

Posted: Fri Nov 27, 2015 1:53 pm
by Serhii Kulibaba

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