douping6871 2014-01-27 01:56
浏览 41
已采纳

ZF2谷歌地图模块 - Zend \ ServiceManager \ ServiceManager :: get无法为GMaps \ Service \ GoogleMap获取或创建实例

I'm trying to use this module, https://github.com/gowsram/zf2-google-maps- , but I'm running into a problem.

Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for GMaps\Service\GoogleMap

I have followed the instruction in the github readme, and have cloned the project into my vendors directory.

From what I understand, the line which calls the ServiceLocator,

$map = $this->getServiceLocator()->get('GMaps\Service\GoogleMap');

isn't pointing to the right place. Unfortunately my knowledge of how the service locator works isn't deep enough to figure out how to fix the problem, despite attempts to remedy this by diving into the docs. It's all a little over my head.

Thanks for any input you may be able to provide!

  • 写回答

1条回答 默认 最新

  • douxiong1994 2014-01-27 02:09
    关注

    Have you edited your application.config.php file so that the modules array contains GMaps? From the look of the error, the module isn't running since the service is not registered with the ServiceManager.

    That step appeared to be skipped over in the installation instructions but you should add it to your application config so it runs the module's Module.php code.

    application.config.php

    return array(
        'modules' => array(
            'Application',
            'GMaps',
        ),
        /...
    );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证