douhan0562 2014-06-01 19:53
浏览 66
已采纳

在ZF2中启动GMaps的问题

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 downloaded zip file and unzipped it 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.

Do you have other tools that could work? I need to get the Latitude and Longitude when I click on a point in the map. But it would not launch .. .

If I put the following in config/application.config.php file:

<?php
return array(
    // This should be an array of module namespaces used in the application.
    'modules' => array(
        'Auth',
        'Application',
        'User',
        'GMaps',
    ),

I get the following exceptions on the page:

Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (GMaps) could not be initialized.'
  • 写回答

1条回答 默认 最新

  • doupu9251 2014-06-01 20:30
    关注

    You have to load the module first to pair and use in application after cloning into the vendor.

    In your config/application.config.php file of your project, add GMaps module like this:

    <?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关系验证