Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript
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);
 
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
 
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 30-Apr-13 21:14pm

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

  Print Answers RSS
0 OriginalGriff 562
1 Sergey Alexandrovich Kryukov 484
2 Maciej Los 325
3 DamithSL 233
4 Mathew Soji 195
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 1 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100