How to show multiple areas by location in google maps using php

后端 未结 4 1487
闹比i
闹比i 2021-01-22 07:59

Here is the Initialise function.....

        function initialize() {

Here the variables $Latitude,$Longitude are array values so how can i stor

4条回答
  •  爱一瞬间的悲伤
    2021-01-22 08:22

    This should work for you assuming lat and lon are javascript arrays with the same length:

    var map = null;
    function initialize() {
    
    var lat='';
    var lon='';
    // initialize map center on first point
    var latlng = new google.maps.LatLng(lat[0],lon[0]);
    var myOptions = {
        zoom: 10,
        center: latlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    var bounds = new google.maps.LatLngBounds();
    
    for (var i=0, i

提交回复
热议问题