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',
        ),
        // ...
    );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误