简体   繁体   English

在Google Map上使用KML叠加层进行用户输入搜索

[英]User Input Search using KML overlay on Google Map

I've created "zones" laid out in a KML file that effectively overlays on the Google Map within my page. 我已经在KML文件中创建了“区域”,该区域有效地覆盖了我页面中的Google Map。 What I am looking to do is provide the ability for users to search by inputting their address in an html form and having the code recognize that their address is either in "zone a", "b", etc. or not in one at all by creating a placemarker at the location the searched for and including the appropriate information in the description. 我正在寻找的功能是为用户提供搜索功能,方法是以html形式输入其地址,并使代码识别出其地址位于“区域a”,“ b”等中,或者根本不在一个区域中。通过在要搜索的位置创建一个地标并将描述中包含适当的信息。

I've tried using javascript to transform their search query to lat and long and using the geocoder function, create a placemarker that way, but have been unsuccessful. 我尝试使用javascript将其搜索查询转换为经纬度,然后使用geocoder功能,以这种方式创建地标,但未成功。 I thought maybe there was a problem because the KML layer would have already been loaded possible requiring a refresh of the data...? 我认为可能存在问题,因为KML层可能已经被加载,可能需要刷新数据...? So I tried using php to POST to the same page causing essentially a refresh of it with their query included and having the geocoder create a placemarker at user's lat and long THEN load the KML layer. 所以我试图用phpPOST基本上导致它与他们的查询刷新同一页面包括在内,具有地理编码器在创建用户的LAT放置地标和长期然后加载KML层。

After too long of spinning wheels, it seems I need to consider an option other than KML, but I'm not sure how I would implement fusion tables or throw the KML information into a mysql database. 经过漫长的旋转之后,似乎我需要考虑除KML之外的其他选项,但是我不确定如何实现融合表或将KML信息放入mysql数据库。

Any help is greatly appreciated! 任何帮助是极大的赞赏!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM