Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Google map shown in localhost, in website not shown
#1

(This post was last modified: 04-04-2020, 02:37 AM by jreklund.)

Hello, 
I have columns in a table, for example   :   name, employee_lat, employee_long .
I show them in google maps using library CodeIgniter-Google-Maps-V3-API-Library,, in localhost everything is OK .
One of function i use is this
Code:
        function map_loc()
     {
        $this->load->library('googlemaps');
        $config['center'] = '4.637120, 96.842534';
        $config['zoom'] = "8";
           $this->googlemaps->initialize($config);
        //Mulai Query
        $result = $this->db->query("SELECT * FROM employee_loc");
       
        foreach ($result->result_array() as $data){
        $lat=$data['employee_lat'];
        $lon=$data['employee_long'];
       
        $marker = array();     
        $marker['position'] = ''.$lat.','.$lon.'';
        $this->googlemaps->add_marker($marker);
       }
        $data['map'] = $this->googlemaps->create_map();     
        $this->load->view('dashboard/v_view_maps', $data);  
      
      
     }  

Everythings is OK in localhost. I am able to produce any sql i want and it shown well in google maps.
 But when i put in real website in internet, the website is OK but no google maps is shown there. Error is this 

Severity: Warning
Message: file_get_contents(http://maps.google.com/maps/api/geocode/...nsor=false): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
Filename: libraries/Googlemaps.php

Any ideas why this happens ? Thanks
Reply


Messages In This Thread
[SOLVED] Google map shown in localhost, in website not shown - by kelapamuda - 03-30-2020, 08:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB