Google Maps Javascript API-如何删除成人相关的搜索结果 [英] Google Maps Javascript API - How to remove adult-related search results

查看:105
本文介绍了Google Maps Javascript API-如何删除成人相关的搜索结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几个月前,我使用google maps javascript API开发了一个maps应用程序,到目前为止,它运行良好,没有客户的抱怨.

I developed a maps application several months ago using the google maps javascript api and so far it's worked great with no complaints from our clients.

但是,最近我们有一个抱怨,说我们的地图显示的是成人相关地点的内容.我想完全删除这些结果.我们的应用程序已部署到数百个客户端,因此仅根据其ID删除位置标记对我们来说是行不通的.

However, recently we got one complaint that our maps were bringing up adult-related places content. I'd like to completely remove these results. Our application is deployed to hundreds of clients so just removing the place marker based on it's id is not going to work for us.

理想情况下,我想设置一个不搜索的某些关键字列表-(例如,性",脱衣舞俱乐部"等-酒吧就可以了.)

Ideally I'd like to set a list of certain keywords to NOT search for - (i.e., 'sex', 'strip club', etc. - bars are fine.)

现在,我们在使用关键字列表,例如...画廊,保龄球馆,赌场,体育馆,电影租赁,电影院,博物馆,夜总会,公园,水疗中心,体育馆,动物园...娱乐部分.一些与成人相关的地方正出现在这些地方. (可能是在电影租借或夜总会中)

Right now we're using a keyword list such as ... Art Galleries, Bowling Allies, Casinos, Gyms, Movie Rentals, Movie Theaters, Museums, Night Clubs, Parks, Spas, Stadiums, Zoos ... for our entertainment section. Some adult-related places are popping up in these somewhere. (probably in movie rentals or night clubs)

请记住,我们的应用程序在此处使用 javascript api地方信息库: https://developers.google.com/maps/documentation/javascript/places

Keep in mind that our app is using the javascript api places library here: https://developers.google.com/maps/documentation/javascript/places

我考虑过做这样的事情的想法...

I've considered the idea of doing something like this...

如果(结果[i] .name.search(/sex/i)== -1){如果(结果[i] .name.search(/strip/i)== -1){ }}

if (results[i].name.search(/sex/i) == -1){if (results[i].name.search(/strip club/i) == -1){do something}}

但这不是一个非常全面的选择,因为很多东西仍然可以通过.

But that isn't a very comprehensive option as alot of stuff would still get through.

有人对我如何解决这个问题有任何见解吗?我不认为有任何本机javascript maps api选项.我们不使用JSON,所以我认为我们不能使用常规"搜索查询.

Does anyone have any insight on how I might get around this? I don't think there is any native javascript maps api option for this. We're not using JSON so I don't think we can use a 'normal' search query.

推荐答案

好的,我不认为有任何本地方法可以做到这一点,但我会分享我作为变通方法所做的工作,以防万一其他人偶然发现了这个问题...

okay, I don't think there is any native way to do this but I'll share what I did as a work-around just in case anyone else stumbles upon this question...

<cfif entertainmentFilter EQ 0>
    <cfset Entertainment_sub = 'Art Galleries,Bowling Allies,Casinos,Gyms,Movie Rentals,Movie Theaters,Museums,Night Clubs,Parks,Spas,Stadiums,Zoos'>
<cfelse>
    <cfset Entertainment_sub = 'Art Galleries,Bowling Allies,Gyms,Movie Theaters,Museums,Parks,Spas,Stadiums,Zoos'>
</cfif>

我在这里使用ColdFusion进行设置,但这是一个简单的条件语句,可以使用任何语言进行设置.基本上只有一个过滤器"变量,当该变量设置为1时,它会删除所有更可能找到成人内容的搜索词.

I'm using coldfusion to set it here but it's a simple conditional statement that can be setup with any language. Basically just have a 'filter' variable which when set to 1 removes any search terms that are more likely to find adult content.

这篇关于Google Maps Javascript API-如何删除成人相关的搜索结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆