Click here to Skip to main content
15,917,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI friends

My problem is Zoom Level Set

I called this function initialize()in page load
it works fine
google.maps.event.addDomListener(window, 'load', initialize);

C#
function initialize() {

            var mapProp = {
                center: new google.maps.LatLng(22.268764039074, 15.29296875),
                zoom: 2,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };

            map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
        }



After That is create one poly line with existing map live

C#
var PolylineCoordList = [];
                        for (var i = 0; i < data.d.length; i++) {
                            var PolyineCoords = new google.maps.LatLng(data.d[i].POLYLAT, data.d[i].POLYLNG);
                            PolylineCoordList.push(PolyineCoords);
                        }
                        var flightPath = new google.maps.Polyline({
                            path: PolylineCoordList,
                            strokeColor: '#FF0000',
                            strokeOpacity: 1.0,
                            strokeWeight: 2
                        });
                        flightPath.setMap(map);
                        ClearPolyLine.push(flightPath);




After creating of poly line on map
My map is not automatically zoom to the draw ed poly line place


I want my map to automatically zoom to the given poly line place


Can any one please help to me

........................................................................
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900