javascript - Load Database Values to Google Map -
i want similar this demo want load latitude , longitude values database.i able load marker on map not move.i using codeigniter framework , google map js api v3. using mysql database. here codes:
//inside setinterval function of above demo interval = window.setinterval(function() { <?php $this->load->model('maps/maps_model'); $data['result11'] = $this->maps_model->getlastpagination(); ?> var pos = new google.maps.latlng(<?php echo $result11->lat; ?>,<?php echo $result11->lon; ?>); marker.setposition(pos); }, 10); //inside model function getlastpagination(){ $query = $this->db->query("select lat,lon map order id desc limit 1"); if ($query->num_rows() > 0){ $row = $query->row(); homecoming $row; } }
javascript mysql codeigniter google-maps google-maps-markers
No comments:
Post a Comment