HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpbiancoarte/wp-content/plugins/hiroshi-core/inc/maps/assets/js/custom-marker.js
(function ($) {
    "use strict";

    function CustomMarker ( options ) {
        this.latlng = new google.maps.LatLng({lat: options.position.lat, lng: options.position.lng});
        this.setMap(options.map);
        this.templateData = options.templateData;
        this.markerData = {
            pin : options.markerPin
        };
    }

    if (typeof google === 'object') {
        CustomMarker.prototype = new google.maps.OverlayView();
    }

    CustomMarker.prototype.draw = function() {
        var self = this;
        var div = this.div;

        if (!div) {
            div = this.div = document.createElement('div');
            var id = this.templateData.itemId;
            div.className = 'qodef-map-marker-holder';
            div.setAttribute("id", id);
            div.setAttribute("data-latlng", this.latlng);

            var markerInfoTemplate = _.template( $('.qodef-info-window-template').html() );
            markerInfoTemplate = markerInfoTemplate( self.templateData );

            var markerTemplate = _.template( $('.qodef-marker-template').html() );
            markerTemplate = markerTemplate( self.markerData );

            $(div).append(markerInfoTemplate);
            $(div).append(markerTemplate);

            div.style.position = 'absolute';
            div.style.cursor = 'pointer';

            var panes = this.getPanes();
            panes.overlayImage.appendChild(div);
        }

        var point = this.getProjection().fromLatLngToDivPixel(this.latlng);

        if (point) {
            div.style.left = (point.x) + 'px';
            div.style.top = (point.y) + 'px';
        }
    };

    CustomMarker.prototype.remove = function() {
        if (this.div) {
            this.div.parentNode.removeChild(this.div);
            this.div = null;
        }
    };

    CustomMarker.prototype.getPosition = function() {
        return this.latlng;
    };
    
    window.qodefCustomMarker = CustomMarker;

})(jQuery);