Maps API v3 Symbol cut on tile edge

http://stackoverflow.com/questions/24853312

by upsidown

HTML

<script src="https://maps.googleapis.com/maps/api/js?&amp;sensor=false"></script>
<div id="map-canvas"></div>

CSS

html, body, #map-canvas {
     height: 100%;
     width: 100%;
     margin: 0px;
     padding: 0px;
 }

JavaScript

function initialize() {
    var mapOptions = {
        zoom: 6,
        center: new google.maps.LatLng(20.291, 153.027),
        mapTypeId: google.maps.MapTypeId.TERRAIN
    };

    var map = new google.maps.Map(document.getElementById('map-canvas'),
    mapOptions);

    // Define a symbol using a predefined path (an arrow)
    // supplied by the Google Maps JavaScript API.
    var lineSymbol = {
        path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW
    };

    // Create the polyline and add the symbol via the 'icons' property.

    var lineCoordinates = [
    new google.maps.LatLng(22, 150),
    new google.maps.LatLng(20, 145.7)];

    var line = new google.maps.Polyline({
        path: lineCoordinates,
        icons: [{
            icon: lineSymbol,
            offset: '100%'
        }],
        strokeColor: 'red',
        strokeWeight: 8,
        draggable: true,
        map: map
    });
}

initialize();