谷歌地图v2获取Android方向(Google Map v2 Get Direction Android)
在我的Android应用程序中使用Google Maps v2可以获得2点之间的方向吗?
我找到了Polyline,但我不想在两点之间划一条线。
我找到了一个使用Intent的解决方案。 它可以解决这个问题,但它没有用,因为这个解决方案正在启动另一个地图应用程序,我想在我的应用程序中显示方向。 我可以这样做吗?
Can i get direction between 2 points with using Google Maps v2 in my Android application ?
I found Polyline but i don't want to draw a line between 2 points.
I found a solution which is using Intent. It can solve this problem but it is not useful because this solution is starting another map application and I want to show direction in my application. Can i do this ?
原文:https://stackoverflow.com/questions/17732416
最满意答案
您的列名称错误,此行为
"UserMember.PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%"
"UserMember.PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%"
"UserMember.PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%"
应为"PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%"
"PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%"
从你在fields
看到的东西的"PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%"
。您可能还需要指定要包含的模型,如下所示: -
$this->UserList->find( 'all', array( 'contain' => array( 'UserMember' => array('PhoneNumber') ), 'conditions' => array( 'UserList.type' => 1, 'UserList.owner_id' => $this->UserAuth->getUserId(), 'PhoneNumber.phoneNumber LIKE' => '%' . '514' . '%' ), 'fields'=>array( 'UserMember.first_name', 'UserMember.last_name', 'PhoneNumber.phoneNumber' ) ) );
Your column name is wrong, this line
"UserMember.PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%"
should be"PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%"
from the looks of things like you have in yourfields
.You might also need to specify which models you want to contain like this:-
$this->UserList->find( 'all', array( 'contain' => array( 'UserMember' => array('PhoneNumber') ), 'conditions' => array( 'UserList.type' => 1, 'UserList.owner_id' => $this->UserAuth->getUserId(), 'PhoneNumber.phoneNumber LIKE' => '%' . '514' . '%' ), 'fields'=>array( 'UserMember.first_name', 'UserMember.last_name', 'PhoneNumber.phoneNumber' ) ) );
相关问答
更多-
快速回答是你的关联错了。 长篇文章如下: 首先,没有名为hasAndBelongsTo关联。 关联名称为hasAndBelongsToMany 。 此外,您在Message Model中组合的关联是完全错误的,或者如果我可以这样说 - 您可能没有正确理解它们。 因此,快速修复将删除hasMany到MessageUser , belongsTo User和错误的hasAndBelongsTo Message ,并向用户添加hasAndBelongsToMany关联。 如果你想让Message hasAndBe ...
-
CakePHP 2.x Acl(CakePHP 2.x Acl)[2022-03-23]
好, 最后我让ACL工作了。 我发现它很容易,我只需要知道shellscrpting 。 我一直都知道它在CakePHP实现得很好,我只需要让它在我的项目中运行。 首先,我们必须从shell/command prompt executable PHP和CakePHP executable 。 我在Windows(7)做过,稍后会尝试Linux和MAC 。 首先,如果您的命令提示符中没有PHP可执行文件,请转到“ My Computer->Properties->Environment Variables(f ... -
您正尝试允许$this->Acl->allow($group, 'controllers/TravelRequests/step($stepNumber');其中step($stepNumber不是现有操作)。 您应该使用$this->Acl->allow($group, 'controllers/TravelRequests/step') 。 You are trying to allow $this->Acl->allow($group, 'controllers/TravelRequests/step ...
-
CakePHP 2.x HABTM查找按条件关系的数据(CakePHP 2.x HABTM find data which have relationship by condition)[2022-08-11]
好吧,如果有人对以下内容感兴趣,这是一个“丑陋”的解决方案: $userId = $this->Auth->user('id'); $joins = array( array('table'=>'sdirectories_users', 'alias' => 'SdirectoriesUser', 'type'=>'inner', 'conditions'= ... -
CakePHP FormHelper将输入和相应的标签包装在div中。 因此,您不会获得内联元素。 如果要使用Formhelper创建输入,则必须通过'div' => false禁用div作为输入选项并手动包装取消/提交输入。 如果您只是想重置表单并保留在页面上,可以使用'type' => 'reset'作为输入。 如果要返回索引页面Form->input('Reset', array( ...我终于发现:我的index.php文件不正确。 我使用了服务器的真正的根,homz.800 /,而不仅仅是/,它工作。 为了使css正常工作,我将webroot的内容放在app中的app文件夹中。 I finally found out : my index.php files weren't correct. I used the real root of the server, homz.800/, instead of just /, and it worked. To have css workin ...您的列名称错误,此行为"UserMember.PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%" "UserMember.PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%" "UserMember.PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%"应为"PhoneNumber.phoneNumber LIKE" => "%" . "514" . "%" "Ph ...在CakePHP中,javascript文件存储在app / webroot / js /中。 然后,您可以通过调用将它们包含在布局中 echo $html->script('jquery-1.7.2.min.js'); 然后,您可以在视图或其他外部js文件中编写javascript代码。 In CakePHP javascript files are stored in app/webroot/js/. You then can include them in the layout by calli ...
CakePHP 2.x验证表格(CakePHP 2.x validating form)[2022-06-25]
接近的方法在这里是错误的.. 验证失败后,您将在else块validates获得验证错误。 但你在验证块本身访问它是不正确的。 它应该是这样的。 if ($this->Device->validates()) { // successful validation } else { // you'll get the validation errors here } 现在结果代码应该是 if ($this->Device->validates()) { if ($this->Devi ...你真的需要Guzzle吗? 我同意旧的Cake2 HTTP套接字是老式的,但是有一些它不能做的事情需要你添加另一个库? 使用特性,只要你没有坚持使用古老的php版本,这是一个干净的解决方案。 这里有一些伪代码会给你高层次的想法: trait HttpSocket { protected $_httpSocket = null; protected $_httpSocketConfig = [ // Default config goes here ]; pub ...相关文章
更多- hadoop杂记-为什么会有Map-reduce v2 (Yarn)
- nagios微信报警(版本V2)
- android googlemap问题,求帮助...
- Hadoop对Map执行框架的实现(TaskTracker端)
- 疯狂Android讲义
- Hadoop对Map执行框架的实现(客户端)
- Obama says economy moving in right direction
- android---TextView赋值问题
- android 集成所有分享平台
- Hadoop中map/reduce编程中关于mapper和reducer的Format问题
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)