Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
map没有显示在serevr上使用codeigniter和Googlemaps库,但在localhost上运行良好_Codeigniter_Google Maps - Fatal编程技术网

map没有显示在serevr上使用codeigniter和Googlemaps库,但在localhost上运行良好

map没有显示在serevr上使用codeigniter和Googlemaps库,但在localhost上运行良好,codeigniter,google-maps,Codeigniter,Google Maps,我使用GoogleMapV3API库来显示Googlemap在本地主机上运行良好,但在服务器上不工作 我的控制器功能 public function index() { $this->load->library('Googlemaps'); $this->googlemaps->initialize(); $data['map'] = $this->googlemaps->create_map();

我使用GoogleMapV3API库来显示Googlemap在本地主机上运行良好,但在服务器上不工作

我的控制器功能

public function index()
    {
        $this->load->library('Googlemaps');
       $this->googlemaps->initialize();
        $data['map'] = $this->googlemaps->create_map();
        $this->load->view('home',$data);

    }
和视图

<html >
<head>
    <?php echo $map['js'];?>
    </head>
<body>
<?php echo $map['html'];?>
</body>
</html>
我在应用程序/库中添加了Googlemaps和Jsmin


这可能对你有帮助。你只需要添加谷歌地图,你就可以使用这个

将此添加到您的查看页面中

<div id="map"></div>
    <script>
      function initMap() {
        var uluru = {lat: -25.363, lng: 131.044};
        var map = new google.maps.Map(document.getElementById('map'), {
          zoom: 4,
          center: uluru
        });
        var marker = new google.maps.Marker({
          position: uluru,
          map: map
        });
      }
    </script>
    <script async defer
    src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
    </script>

在您的样式表中添加thid

检查您的控制台是否有错误,并检查是否有google map Api键控制台日志中没有任何内容,但我在日志中发现错误,即404页面未找到:Js/jquery.min.map。但是,我已经添加了google map v3 Api的Js文件library@tejawee将jquery.min.map文件放入文件夹jsshow your website link谢谢先生,但是,您的代码在我的本地主机上运行得很好,但在服务器上运行得不好,而且我的codeigniter代码在本地主机上运行得很好,但在服务器上运行得不好。您可以发布您的网站链接吗,我仍然对codeigniter google地图库有问题,它只在本地主机上工作抱歉,先生,但我不能共享我的网站链接,因为现在我可以使用您的脚本在我的网站上添加google地图,谢谢。我还没有使用codeigniter google地图库。这可能主要是因为API键。使用codeigniter谷歌地图库是否还有其他优势。
#map{width: 100%; height:350px;}