【问题标题】:GEO-Location with mobile phone and google maps apiGEO-Location with mobile phone and google maps api
【发布时间】:2014-04-01 04:05:52
【问题描述】:

我一直在尝试创建一个移动应用程序,该应用程序将搜索我自己的MySQL database,其中存储了有关企业的信息(lat、lng、企业名称)。

这是我希望它如何工作的分步指南。

1). The user will manually input a postcode
2). PHP (laravel) will process the request
3). The Google Maps API will use the Lat, 
Lngs I have stored in my database and display the location closest to the postcode which has been entered.
4). Display the results on the page

我正在使用 PhoneGap 来创建移动应用程序,而我正在使用 Laravel 来创建 PHP 框架。

【问题讨论】:

  • 是的,当然。现在你的问题在哪里?

标签: google-maps-api-3 cordova geolocation laravel-4


【解决方案1】:

我的方法是将邮政编码和 lat,lng 缓存到表格中。这样您的请求会更快。

您需要做的是从用户那里获取邮政编码并将其发送到 google api 以获取经纬度。然后使用这些值来搜索数据库。

Google 上的本教程可能有助于从数据库中获得最接近的企业。 https://developers.google.com/maps/articles/phpsqlajax_v3

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-09
    • 1970-01-01
    • 2011-12-13
    • 2014-11-05
    • 2020-01-29
    • 2020-06-02
    • 1970-01-01
    • 2017-01-23
    相关资源
    最近更新 更多