Markers in google maps are not drawn in chrome in an algorithm within an Onsuccess of a Page Method

1

I am doing a web app with vb.net programming in javascript and doing custom marker in google map api with javascript. In windows explorer, edge draws well the markers, which are taken from a path, from the web server where it is running. In chrome he does not draw them. Transfer part of the code, I hope you can help me. Thanks

 /*clase para hacer dibujo icon que se pueda rotar y poner en un marker 13-   12-2016*/
var RotateIcon = function (options) {
    this.options = options || {};
    this.rImg = options.img || new Image();
    this.rImg.src = this.rImg.src || this.options.url || '';
    this.options.width = this.options.width || this.rImg.width || 52;
    this.options.height = this.options.height || this.rImg.height || 60;
    var canvas = document.createElement("canvas");
    canvas.width = this.options.width;
    canvas.height = this.options.height;
    this.context = canvas.getContext("2d");
    this.canvas = canvas;
};

RotateIcon.makeIcon = function (url) {
    return new RotateIcon({ url: url });
};

RotateIcon.prototype.setRotation = function (options) {
    var canvas = this.context,
        angle = (options.deg ) ? (options.deg) * Math.PI / 180 : options.rad,
        centerX = this.options.width / 2,
        centerY = this.options.height / 2;

    canvas.clearRect(0, 0, this.options.width, this.options.height);
    canvas.save();
    canvas.translate(centerX, centerY);
    canvas.rotate(angle);
    canvas.translate(-centerX, -centerY);
    canvas.drawImage(this.rImg, 0, 0);
    canvas.restore();
    return this;
};

RotateIcon.prototype.getUrl = function () {
    return this.canvas.toDataURL('image/png');
};

var image = {
    url: RotateIcon.makeIcon(localdat.pathdibu)
                   .setRotation({ deg: corregirrotacion(this.rotacion) })
                   .getUrl(),
    scaledSize: new google.maps.Size(52, 60) 
  }

this.pointHito = new google.maps.Marker({
    icon: image,
    optimized: false,
    position: flightPlanCoordinates[0],
    map: map


     // scaled size
    
asked by juan pablo serafini 20.03.2017 в 12:55
source

0 answers