1(function ($) { 2 "use strict"; 3 4 $( document ).on( 5 'qodefGoogleMapsCallbackEvent', 6 function () { 7 function CustomMarker( options ) { 8 this.latlng = new google.maps.LatLng( {lat: options.position.lat, lng: options.position.lng} ); 9 this.setMap( options.map ); 10 this.templateData = options.templateData; 11 this.markerData = { 12 pin : options.markerPin 13 }; 14 } 15 16 CustomMarker.prototype = new google.maps.OverlayView(); 17 18 CustomMarker.prototype.draw = function () { 19 var self = this; 20 var div = this.div; 21 22 if ( ! div) { 23 div = this.div = document.createElement( 'div' ); 24 var id = this.templateData.itemId; 25 div.className = 'qodef-map-marker-holder'; 26 div.setAttribute( "id", id ); 27 div.setAttribute( "data-latlng", this.latlng ); 28 29 var markerInfoTemplate = _.template( $( '.qodef-info-window-template' ).html() ); 30 markerInfoTemplate = markerInfoTemplate( self.templateData ); 31 32 var markerTemplate = _.template( $( '.qodef-marker-template' ).html() ); 33 markerTemplate = markerTemplate( self.markerData ); 34 35 $( div ).append( markerInfoTemplate ); 36 $( div ).append( markerTemplate ); 37 38 div.style.position = 'absolute'; 39 div.style.cursor = 'pointer'; 40 41 var panes = this.getPanes(); 42 panes.overlayImage.appendChild( div ); 43 } 44 45 var point = this.getProjection().fromLatLngToDivPixel( this.latlng ); 46 47 if (point) { 48 div.style.left = (point.x) + 'px'; 49 div.style.top = (point.y) + 'px'; 50 } 51 }; 52 53 CustomMarker.prototype.remove = function () { 54 if (this.div) { 55 this.div.parentNode.removeChild( this.div ); 56 this.div = null; 57 } 58 }; 59 60 CustomMarker.prototype.getPosition = function () { 61 return this.latlng; 62 }; 63 64 window.qodefCustomMarker = CustomMarker; 65 } 66 ); 67 68})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.