javascript - google can't maps api rotate marker -


im having problem rotating marker @ google maps api. im doing:

<script> function initialize() {     var mapprop = {         center: new google.maps.latlng(51.508742, -0.120850),         zoom: 4,         minzoom: 2,         maptypeid: google.maps.maptypeid.roadmap     };     var map = new google.maps.map(document.getelementbyid("map"), mapprop);     var mylatlng = new google.maps.latlng(-51.508742, -0.120850);      var image = 'http://wcdn1.dataknet.com/static/resources/icons/set73/f3eef3d2.png';     var marker = new google.maps.marker({         position: mylatlng,         icon: {             path: google.maps.symbolpath.backward_open_arrow,             scale: 10         },         rotation: 50,         map: map     }); } google.maps.event.adddomlistener(window, 'load', initialize); </script> 

but dosn't work sadly, know heading , 50 degrees can see in "rotate". how can this?

you need change marker structure bit rotation:

        function initialize() {  	            var mapprop = {  	                center: new google.maps.latlng(51.508742, -0.120850),  	                zoom: 4,  	                minzoom: 2,  	                maptypeid: google.maps.maptypeid.roadmap  	            };  	            var map = new google.maps.map(document.getelementbyid("map"), mapprop);  	            var mylatlng = new google.maps.latlng(-51.508742, -0.120850);    	            var image = 'http://wcdn1.dataknet.com/static/resources/icons/set73/f3eef3d2.png';  	            var marker = new google.maps.marker({  	                position: mylatlng,  	                icon: {  	                    path: google.maps.symbolpath.backward_open_arrow,  	                    scale: 10,  	                    rotation: 50  	                },  	                  	                map: map  	            });  	        }  	        google.maps.event.adddomlistener(window, 'load', initialize);
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>  <script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>    <div id="map" style="width:500px;height:500px;"></div>;


Comments