javascript - IE Issue of Google Maps Marker Animation -
I'm using the Google Maps API v3 I'm trying to run down, all browsers except IE Is working on
Would you please suggest necessary changes to work in IE?
My code is:
var map; Var mapOptions = {center: new google.maps.LatLng (0.0, 0.0), zoom: 2, map typewrite: google.maps.MapTypeId.ROADMAP}; Var marker = []; Function initialize () {map = new google.maps.Map (document.getElementById ("map_canvas"), map options); From1 = new google.maps.LatLng (0,0); To1 = new google.maps.LatLng (30,12); From2 = new google.maps.LatLng (-30,15); To2 = new google.maps.LatLng (10, -100); From3 = new google.maps.LatLng (0, -50); To3 = new google.maps.LatLng (0, 50); AddMarker (to1 to1,); AddMarker (to2 to2,); AddMarker (to3 to3,); } Function addMarker (pos, dest) {var marker = new google.maps.marker ({map: map, position: pos, destination: dest}); GooglekmapskeventkaddListener (marker function (event 'click',) {fromLat = this.position.lat (); fromLng = this.position.lng (); toLat = this.destination.lat (); toLng = this.destination.lng (); // animation frames = [] a LatLng store for each phase, (; percent & lt; 1; var percent = 0 percent + = .01) for {curLat = fromLat + percent * (toLat - fromLat); curLng = fromLng + percent * (toLng - fromLng); frames.push (new google.maps.LatLng (curLat, curLng));} move = function (marker, Latlngs, index, Hang , newDestination) {marker.setPosition (latlngs [index]); (? index = latlngs.length -1) if {// call "frame of the animation SetTimeout" (Fu Nction () {move (marker, Latlngs, index + 1, wait, new Distineshn);}, assign wait);} else {// the new route e marker.position = marker.estination; Marker.destination = newDestination ;}} // Start the animation, after the completion please return the original (marker, frame, 0, 20, marker.);}); Markers.push (marker); } Google.maps.event.addDomListener (window, 'load', start); After some negligible it looks like a typing problem.
You just need to change:
frame = [];
to:
var frame = []; Tested in 8 -10.
Comments
Post a Comment