How to change text and set address on map ( Add-listing )
This topic contains 23 replies, has 4 voices, and was last updated by Ding Hua 8 years, 6 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
December 19, 2016 at 10:40 am #326974
Hi Stiofan,
When I use it , I got error zero result .
Refer attached files for my setting and results.Rgds,
YCDecember 19, 2016 at 6:12 pm #327197Are you trying to use the region field and city field for something else?
I don’t think that will ever work. You must use what Google Maps API returns for those fields.
I’ll let Stiofan add more comments to that.
Thanks
December 20, 2016 at 5:11 am #327456Hi Paolo,
It just work.
Look at my my-setting.png.
There are two setting I ticked.Disable set address on map from changing address fields
Disable move map pin from changing address fieldsThis two setting make sure it won’t break my custom location by the values of region and city from api return.Because locations are not known by the Google API and this prevent breaking my custom location.
It works perfectly as it suggest and meet what users need.
The only problem now is api query. It seems like api query is not using postal code that user enter.
api query only use address and some of the address in Singapore are not know by google map api.That is why I requesting option to configure api to use only postal code and country to query like below(postal,country) which return accurate map location in Singapore from google map.
http://maps.googleapis.com/maps/api/geocode/json?address=732895,Singapore
Rgds,
YCDecember 21, 2016 at 5:52 pm #328427Seems to work find for me? The zip is sent.
Stiofan
December 22, 2016 at 4:02 am #328704Hi Stiofan,
Pls try this address
Block 515 Woodlands Drive 14 Singapore 730515
refer attached file geo-directory-not-able-to-get-map-location.png , Geo Directory unable to get correct map location and Zero_result error come out for the address “Block 515 Woodlands Drive 14 Singapore 730515.And the map location,log/lat is not showing in correct place.
For the same address I tried below three methods , all works and google map able to return map location accurately .
1) key in address “Block 515 Woodlands Drive 14 Singapore 730515” in google map , found working.refer attached file same-address-postal-code-country-on-google-map-ok.png
2) api query using the whole address “Block 515 Woodlands Drive 14 Singapore 730515”, found working , refer api-query-for-the-same-address-postal-code-country-ok.png
3) api query using only country and postal code , found working , refer to api-query-with-postal-code-and-country-only.pngSo not sure why Geo directory is not able to locate the correct map location for the same address and having Zero_Result error message.
Rgds,
YCDecember 22, 2016 at 5:34 pm #329293try this code snippet: (not tested)
add_action('geodir_add_listing_codeaddress_before_geocode','_my_set_address_street_zip'); function _my_set_address_street_zip(){ ?> address = jQuery('#post_address').val(); address = address + ',' + country + ',' + zip; <?php }
Stiofan
December 23, 2016 at 6:06 am #329565Hi Stiofan,
The code is not working. It even bream my entire website and could’t log in anymore.
I need to delete the code snippet plugin folder to solve it.
And I cannot install again same code snippet plugin, all my other code snippet currently using are gone.
I got to use another variant code snippet plugin for others.Pls give me the correct one.
Rgds,
YCDecember 23, 2016 at 10:49 am #329659if your server does not have php shorttags enabled that could throw an error.
This code is tested:
add_filter('geodir_codeaddress','_my_set_address_street_zip',10,1); function _my_set_address_street_zip($codeAddress){ $codeAddress = $codeAddress ." address = jQuery('#post_address').val(); address = address + ',' + country + ',' + zip; "; return $codeAddress; }
Thanks,
Stiofan
December 23, 2016 at 11:24 am #329664Hi Stiofan,
This new code is working fine.
Thanks.Rgds,
YC -
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket