1/** 2 * This jQuery plugin displays map and it's components. 3 * @author Flipper Code (hello *at* flippercode *dot* com) 4 * @version 1.0 5 */ 6(function($, window, document, undefined) { 7 8 9 function GoogleMaps(element, map_data) { 10 var options; 11 this.element = element; 12 this.map_data = $.extend({}, {}, map_data); 13 options = this.map_data.map_options; 14 this.settings = $.extend({ 15 "zoom": "5", 16 "map_type_id": "ROADMAP", 17 "scroll_wheel": true, 18 "map_visual_refresh": false, 19 "full_screen_control": false, 20 "full_screen_control_position": "BOTTOM_RIGHT", 21 "zoom_control": true, 22 "zoom_control_style": "SMALL", 23 "zoom_control_position": "TOP_LEFT", 24 "map_type_control": true, 25 "map_type_control_style": "HORIZONTAL_BAR", 26 "map_type_control_position": "RIGHT_TOP", 27 "scale_control": true, 28 "street_view_control": true, 29 "street_view_control_position": "TOP_LEFT", 30 "overview_map_control": true, 31 "center_lat": "40.6153983", 32 "center_lng": "-74.2535216", 33 "draggable": true 34 }, {}, options); 35 this.container = $("div[rel='" + $(this.element).attr("id") + "']"); 36 37 var suppress_markers = false; 38 if (this.map_data.map_tabs && this.map_data.map_tabs.direction_tab) { 39 suppress_markers = this.map_data.map_tabs.direction_tab.suppress_markers; 40 } 41 this.directionsService = new google.maps.DirectionsService(); 42 this.directionsDisplay = new google.maps.DirectionsRenderer({ 43 suppressMarkers: suppress_markers, 44 }); 45 this.drawingmanager = {}; 46 this.geocoder = new google.maps.Geocoder(); 47 this.places = []; 48 this.show_places = []; 49 this.categories = {}; 50 this.tabs = []; 51 this.all_shapes = []; 52 this.wpgmp_polylines = []; 53 this.wpgmp_polygons = []; 54 this.wpgmp_circles = []; 55 this.wpgmp_shape_events = []; 56 this.wpgmp_rectangles = []; 57 this.per_page_value = 0; 58 this.current_amenities = []; 59 this.route_directions = []; 60 this.search_area = ''; 61 this.markerClusterer = null; 62 this.infowindow_marker = new google.maps.InfoWindow(); 63 this.init(); 64 } 65 66 GoogleMaps.prototype = { 67 68 init: function() { 69 var map_obj = this; 70 var center = new google.maps.LatLng(map_obj.settings.center_lat, map_obj.settings.center_lng); 71 map_obj.map = new google.maps.Map(map_obj.element, { 72 zoom: parseInt(map_obj.settings.zoom), 73 center: center, 74 disableDoubleClickZoom: (map_obj.settings.scroll_wheel != 'false'), 75 scrollwheel: map_obj.settings.scroll_wheel, 76 zoomControl: (map_obj.settings.zoom_control === true), 77 fullscreenControl: (map_obj.settings.full_screen_control === true), 78 fullscreenControlOptions: { 79 position: eval("google.maps.ControlPosition." + map_obj.settings.full_screen_control_position) 80 }, 81 zoomControlOptions: { 82 style: eval("google.maps.ZoomControlStyle." + map_obj.settings.zoom_control_style), 83 position: eval("google.maps.ControlPosition." + map_obj.settings.zoom_control_position) 84 }, 85 mapTypeControl: (map_obj.settings.map_type_control == true), 86 mapTypeControlOptions: { 87 style: eval("google.maps.MapTypeControlStyle." + map_obj.settings.map_type_control_style), 88 position: eval("google.maps.ControlPosition." + map_obj.settings.map_type_control_position) 89 }, 90 scaleControl: (map_obj.settings.scale_control == true), 91 streetViewControl: (map_obj.settings.street_view_control == true), 92 streetViewControlOptions: { 93 position: eval("google.maps.ControlPosition." + map_obj.settings.street_view_control_position) 94 }, 95 overviewMapControl: (map_obj.settings.overview_map_control == true), 96 overviewMapControlOptions: { 97 opened: map_obj.settings.overview_map_control 98 }, 99 draggable: map_obj.settings.draggable, 100 mapTypeId: eval("google.maps.MapTypeId." + map_obj.settings.map_type_id
100), 101 styles: eval(map_obj.map_data.styles) 102 }); 103 104 map_obj.map_loaded(); 105 map_obj.responsive_map(); 106 map_obj.create_markers(); 107 map_obj.display_markers(); 108 109 if ( map_obj.map_data.street_view ) { 110 map_obj.set_streetview(center); 111 } 112 113 if ( map_obj.map_data.bicyle_layer) { 114 map_obj.set_bicyle_layer(); 115 } 116 117 if ( map_obj.map_data.traffic_layer) { 118 map_obj.set_traffic_layer(); 119 } 120 121 if (map_obj.map_data.transit_layer) { 122 map_obj.set_transit_layer(); 123 } 124 125 if ( map_obj.map_data.panoramio_layer ) { 126 map_obj.set_panoramic_layer(); 127 } 128 129 if (map_obj.settings.display_45_imagery == '45') { 130 map_obj.set_45_imagery(); 131 } 132 133 if (typeof map_obj.map_data.map_visual_refresh === true) { 134 map_obj.set_visual_refresh(); 135 } 136 137 138 $("body").on("click", ".wpgmp_marker_link", function() { 139 map_obj.open_infowindow($(this).data("marker")); 140 $('html, body').animate({ 141 scrollTop: $(map_obj.container).offset().top - 150 142 }, 500); 143 }); 144 145 $(map_obj.container).on("click", "a[data-marker]", function() { 146 map_obj.open_infowindow($(this).data("marker")); 147 $('html, body').animate({ 148 scrollTop: $(map_obj.container).offset().top - 150 149 }, 500); 150 }); 151 152 $(map_obj.container).on("click", "a[data-marker]", function() { 153 map_obj.open_infowindow($(this).data("marker")); 154 }); 155 156 // REGISTER AUTO SUGGEST 157 map_obj.google_auto_suggest($(".wpgmp_auto_suggest")); 158 159 }, 160 161 createMarker: function(place) { 162 var map_obj = this; 163 var map = map_obj.map; 164 var placeLoc = place.geometry.location; 165 var image = { 166 url: place.icon, 167 size: new google.maps.Size(25, 25), 168 scaledSize: new google.maps.Size(25, 25) 169 }; 170 171 place.marker = new google.maps.Marker({ 172 map: map, 173 position: place.geometry.location, 174 icon: image 175 }); 176 177 google.maps.event.addListener(place.marker, 'click', function() { 178 if (map_obj.settings.map_infowindow_customisations === true) 179 map_obj.amenity_infowindow.setContent('<div class="wpgmp_infowindow"><div class="wpgmp_iw_content">' + place.name + '</div></div>'); 180 else 181 map_obj.amenity_infowindow.setContent(place.name); 182 map_obj.amenity_infowindow.open(map, this); 183 }); 184 map_obj.current_amenities.push(place); 185 }, 186 187 marker_bind: function(marker) { 188 189 map_obj = this; 190 191 google.maps.event.addListener(marker, 'drag', function() { 192 193 var position = marker.getPosition(); 194 195 map_obj.geocoder.geocode({ 196 latLng: position 197 }, function(results, status) { 198 199 if (status == google.maps.GeocoderStatus.OK) { 200 201 $("#googlemap_address").val(results[0].formatted_address); 202 203 $(".google_city").val(map_obj.wpgmp_finddata(results[0], 'administrative_area_level_3') || map_obj.wpgmp_finddata(results[0], 'locality')); 204 $(".google_state").val(map_obj.wpgmp_finddata(results[0], "administrative_area_level_1")); 205 $(".google_country").val(map_obj.wpgmp_finddata(results[0], "country")); 206 207 if (results[0].address_components) { 208 for (var i = 0; i < results[0].address_components.length; i++) { 209 for (var j = 0; j < results[0].address_components[i].types.length; j++) { 210 if (results[0].address_components[i].types[j] == "postal_code") { 211 wpgmp_zip_code = results[0].address_components[i].long_name; 212 $(".google_postal_code").val(wpgmp_zip_code); 213 } 214 } 215 } 216 } 217 } 218 }); 219 220 $(".google_latitude").val(position.lat()); 221 $(".google_longitude").val(position.lng()); 222 }); 223 224 }, 225
226 google_auto_suggest: function(obj) { 227 228 var map_obj = this; 229 230 obj.each(function() { 231 var current_input = this; 232 var autocomplete = new google.maps.places.Autocomplete(this); 233 234 autocomplete.bindTo('bounds', map_obj.map); 235 236 if ($(this).attr("name") == 'location_address') { 237 var infowindow = map_obj.infowindow_marker; 238 var marker = new google.maps.Marker({ 239 map: map_obj.map, 240 draggable: true, 241 anchorPoint: new google.maps.Point(0, -29) 242 }); 243 244 map_obj.marker_bind(marker); 245 246 google.maps.event.addListener(autocomplete, 'place_changed', function() { 247 248 var place = autocomplete.getPlace(); 249 if (!place.geometry) { 250 return; 251 } 252 253 // If the place has a geometry, then present it on a map. 254 if (place.geometry.viewport) { 255 map_obj.map.fitBounds(place.geometry.viewport); 256 } else { 257 map_obj.map.setCenter(place.geometry.location); 258 map_obj.map.setZoom(17); 259 } 260 261 $(".google_latitude").val(place.geometry.location.lat()); 262 $(".google_longitude").val(place.geometry.location.lng()); 263 $(".google_city").val(map_obj.wpgmp_finddata(place, 'administrative_area_level_3') || map_obj.wpgmp_finddata(place, 'locality')); 264 $(".google_state").val(map_obj.wpgmp_finddata(place, "administrative_area_level_1")); 265 $(".google_country").val(map_obj.wpgmp_finddata(place, "country")); 266 if (place.address_components) { 267 for (var i = 0; i < place.address_components.length; i++) { 268 for (var j = 0; j < place.address_components[i].types.length; j++) { 269 if (place.address_components[i].types[j] == "postal_code") { 270 wpgmp_zip_code = place.address_components[i].long_name; 271 $(".google_postal_code").val(wpgmp_zip_code); 272 } 273 } 274 } 275 } 276 277 marker.setPosition(place.geometry.location); 278 marker.setVisible(true); 279 }); 280 } else { 281 282 google.maps.event.addListener(autocomplete, 'place_changed', function() { 283 284 var place = autocomplete.getPlace(); 285 if (!place.geometry) { 286 return; 287 } 288 289 $().val(place.geometry.location.lat()); 290 $(current_input).data('longitude', place.geometry.location.lng()); 291 $(current_input).data('latitude', place.geometry.location.lat()); 292 293 }); 294 } 295 }); 296 }, 297 298 wpgmp_finddata: function(result, type) { 299 var component_name = ""; 300 for (i = 0; i < result.address_components.length; ++i) { 301 var component = result.address_components[i]; 302 $.each(component.types, function(index, value) { 303 if (value == type) { 304 component_name = component.long_name; 305 } 306 }); 307 308 309 } 310 return component_name; 311 }, 312 313 open_infowindow: function(current_place) { 314 var map_obj = this; 315 316 $.each(this.map_data.places, function(key, place) { 317 if (parseInt(place.id) == parseInt(current_place) && place.marker.visible === true) { 318 map_obj.openInfoWindow(place); 319 } 320 }); 321 }, 322 323 place_info: function(place_id) { 324 325 var place_obj; 326 327 $.each(this.places, function(index, place) { 328 329 if (parseInt(place.id) == parseInt(place_id)) { 330 place_obj = place; 331 } 332 }); 333 334 return place_obj; 335 }, 336 337 event_listener: function(obj, type, func) { 338 google.maps.event.addListener(obj, type, func); 339 }, 340 341 set_visual_refresh: function() { 342 343 google.maps.visualRefresh = true; 344 }, 345 346 set_45_imagery: function() { 347 //this.map.setTilt(45); 348 }, 349 350 set_bicyle_layer: function() { 351 352 var bikeLayer = new google.maps.BicyclingLayer(); 353 bikeLayer.setMap(this.map); 354 }, 355 356 set_traffic_layer: function() { 357 358 var traffic_layer = new google.maps.TrafficLayer(); 359 traffic_layer.setMap(this.map); 360 }, 361 362 set_panoramic_layer: function() { 363 364 var panoramic_layer = new google.maps.panoramio.PanoramioLayer(); 365 panoramic_layer.setMap(this.map); 366 }, 367 368 set_transit_layer: function() { 369 370 var transit_layer = new google.maps.TransitLayer(); 371 transit_layer.setMap(this.map); 372 }, 373 374 set_streetview: function(latlng) { 375 376 var panoOptions = { 377 position: latlng, 378 addressControlOptions: { 379 position: google.maps.ControlPosition.BOTTOM_CENTER 380 }, 381 linksControl: this.map_data.street_view.links_control, 382 panControl: this.map_data.street_view.street_view_pan_control, 383 zoomControlOptions: { 384 style: google.maps.ZoomControlStyle.SMALL 385 }, 386 enableCloseButton: this.map_data.street_view.street_view_close_button 387 }; 388 if (this.map_data.street_view.pov_heading && this.map_data.street_view.pov_pitch) { 389 panoOptions['pov'] = { 390 heading: parseInt(this.map_data.street_view.pov_heading), 391 pitch: parseInt(this.map_data.street_view.pov_pitch) 392 }; 393 } 394 var panorama = new google.maps.StreetViewPanorama(this.element, panoOptions); 395 }, 396 397 map_loaded: function() { 398 399 var map_obj = this; 400 401 var gmap = map_obj.map; 402 403 google.maps.event.addListenerOnce(gmap, 'idle', function() { 404 405 var center = gmap.getCenter(); 406 google.maps.event.trigger(gmap, 'resize'); 407 gmap.setCenter(center); 408 409 }); 410 411 if (map_obj.settings.center_by_nearest === true) { 412 map_obj.center_by_nearest(); 413 } 414 if (map_obj.settings.close_infowindow_on_map_click === true) { 415 google.maps.event.addListener(gmap, "click", function(event) { 416 $.each(map_obj.places, function(key, place) { 417 place.infowindow.close(); 418 place.marker.setAnimation(null); 419 }); 420 }); 421 } 422 423 if (map_obj.settings.map_infowindow_customisations === true) { 424 google.maps.event.addListener(map_obj.infowindow_marker, 'domready', function() { 425 426 var wpgmp_iwOuter = $(map_obj.container).find('.gm-style-iw'); 427 428 wpgmp_iwOuter.parent().css({ 429 'width': '0px', 430 'height': '0px' 431 }); 432 var wpgmp_iwCloseBtn = wpgmp_iwOuter.next(); 433 wpgmp_iwCloseBtn.css('display', 'none'); 434
435 var wpgmp_iwBackground = wpgmp_iwOuter.prev(); 436 437 wpgmp_iwBackground.children(':nth-child(2)').css({ 438 'display': 'none' 439 }); 440 441 wpgmp_iwBackground.children(':nth-child(3)').css({ 442 'background-color': '#000;', 443 }); 444 445 wpgmp_iwBackground.children(':nth-child(4)').css({ 446 'display': 'none' 447 }); 448 var height = wpgmp_iwOuter.outerHeight() ; 449 wpgmp_iwBackground.children(':nth-child(3)').css({ 450 'top':(height+18)+'px' 451 }); 452 wpgmp_iwBackground.children(':nth-child(1)').css({ 453 'top':(height+10)+'px' 454 }); 455 wpgmp_iwBackground.children(':nth-child(3)').find('div').children().css({ 456 'box-shadow': map_obj.settings.infowindow_border_color + ' 0px 1px 6px', 457 'border': '1px solid ' + map_obj.settings.infowindow_border_color, 458 'border-top': '', 459 'z-index': '1', 460 'background-color': map_obj.settings.infowindow_bg_color 461 }); 462 wpgmp_iwOuter.find('.wpgmp_infowindow').prepend('<div class="infowindow-close"></div>'); 463 wpgmp_iwOuter.on('click', '.infowindow-close', function(event){ 464 $.each(map_obj.places, function(key, place) { 465 place.infowindow.close(); 466 place.marker.setAnimation(null); 467 }); 468 }); 469 }); 470 } 471 472 }, 473 resize_map: function() { 474 var map_obj = this; 475 var gmap = map_obj.map; 476 var zoom = gmap.getZoom(); 477 var center = gmap.getCenter(); 478 google.maps.event.trigger(this.map, 'resize'); 479 gmap.setZoom(zoom); 480 gmap.setCenter(center); 481 }, 482 responsive_map: function() { 483 484 var map_obj = this; 485 486 var gmap = map_obj.map; 487 488 google.maps.event.addDomListener(window, "resize", function() { 489 490 var zoom = gmap.getZoom(); 491 var center = gmap.getCenter(); 492 493 google.maps.event.trigger(gmap, "resize"); 494 gmap.setZoom(zoom); 495 gmap.setCenter(center); 496 gmap.getBounds(); 497 498 }); 499 500 }, 501 create_markers: function() { 502 503 var map_obj = this; 504 var places = map_obj.map_data.places; 505 var temp_listing_placeholder; 506 var replaceData; 507 var remove_keys = []; 508 509 $.each(places, function(key, place) { 510 511 if (place.location.lat && place.location.lng) { 512 if (typeof place.categories == 'undefined') { 513 place.categories = {}; 514 } 515 place.marker = new google.maps.Marker({ 516 position: new google.maps.LatLng( 517 parseFloat(place.location.lat), 518 parseFloat(place.location.lng) 519 ), 520 icon: place.location.icon, 521 url: place.url, 522 draggable: place.location.draggable, 523 map: map_obj.map, 524 clickable: place.location.infowindow_disable, 525 }); 526 527 if (map_obj.settings.infowindow_drop_animation === true) { 528 place.marker.setAnimation(google.maps.Animation.DROP); 529 } 530 531 if (map_obj.settings.infowindow_filter_only === true) { 532 place.marker.visible = false; 533 place.marker.setVisible(false); 534 } 535 536 537 // bind event to marker 538 if (map_obj.map_data.page == 'edit_location') 539 map_obj.marker_bind(place.marker); 540 var location_categories = []; 541 if (typeof place.categories != 'undefined') { 542 for (var cat in place.categories) { 543 location_categories.push(place.categories[cat].name); 544 } 545 } 546 var content = ''; 547 // replace infowindow content. 548 var marker_image = ''; 549 550 if( place.source == 'post' ) { 551 marker_image = place.location.extra_fields.post_featured_image; 552 } else { 553 marker_image = place.location.marker_image; 554 } 555 556 var temp_listing_placeholder = ''; 557 if( place.source == 'post' ) { 558 temp_listing_placeholder = map_obj.settings.infowindow_geotags_setting; 559 } else { 560 temp_listing_placeholder = map_obj.settings.infowindow_setting; 561 } 562 563 if( typeof temp_listing_placeholder == 'undefined' ) { 564 temp_listing_placeholder = place.content; 565 } 566 567 replaceData = { 568 "{marker_id}": place.id, 569 "{marker_title}": place.title, 570 "{marker_address}": place.address, 571 "{marker_latitude}": place.location.lat, 572 "{marker_longitude}": place.location.lng, 573 "{marker_city}": place.location.city, 574 "{marker_state}": place.location.state, 575 "{marker_country}": place.location.country, 576 "{marker_postal_code}": place.location.postal_code, 577 "{marker_zoom}": place.location.zoom, 578 "{marker_icon}": place.location.icon, 579 "{marker_category}": location_categories.join(','), 580 "{marker_message}": place.content, 581 "{marker_image}": marker_image 582 }; 583 584 //Add extra fields of locations 585 if (typeof place.location.extra_fields != 'undefined') { 586 for (var extra in place.location.extra_fields) { 587 if (!place.location.extra_fields[extra]) { 588 replaceData['{' + extra + '}'] = ''; 589 } else { 590 replaceData['{' + extra + '}'] = place.location.extra_fields[extra]; 591 } 592 } 593 } 594 temp_listing_placeholder = temp_listing_placeholder.replace(/{[^{}]+}/g, function(match) { 595 if (match in replaceData) { 596 return (replaceData[match]); 597 } else { 598 return (""); 599 } 600 }); 601 602 content = temp_listing_placeholder; 603 604 605 if (content === "") { 606 if (map_obj.settings.map_infowindow_customisations === true && map_obj.settings.show_infowindow_header === true) 607 content = '<div class="wpgmp_infowindow"><div class="wpgmp_iw_head"><div class="wpgmp_iw_head_content">' + place.title + '</div></div><div class="wpgmp_iw_content">' + place.content + '</div></div>'; 608 else 609 content = '<div class="wpgmp_infowindow"><div class="wpgmp_iw_content">' + place.content + '</div></div>'; 610 } else { 611 if (map_obj.settings.map_infowindow_customisations === true && map_obj.settings.show_infowindow_header === true) 612 content = '<div class="wpgmp_infowindow"><div class="wpgmp_iw_head"><div class="wpgmp_iw_head_content">' + place.title + '</div></div><div class="wpgmp_iw_content">' + content + '</div></div>'; 613 else 614 content = '<div class="wpgmp_infowindow"><div class="wpgmp_iw_content">' + content + '</div></div>'; 615 616 } 617 place.infowindow_data = content; 618 place.infowindow = map_obj.infowindow_marker; 619 620 if (place.location.infowindow_default_open === true) { 621 map_obj.openInfoWindow(place); 622 } else if (map_obj.settings.default_infowindow_open === true) { 623 map_obj.openInfoWindow(place); 624 } 625 var on_event = map_obj.settings.infowindow_open_event; 626 var bounce_on_event = map_obj.settings.infowindow_bounce_animation; 627 map_obj.event_listener(place.marker, on_event, function() { 628 $.each(map_obj.places, function(key, prev_place) { 629 prev_place.infowindow.close(); 630 prev_place.marker.setAnimation(null); 631 }); 632 map_obj.openInfoWindow(place); 633 if (bounce_on_event == 'click') { 634 map_obj.toggle_bounce(place.marker); 635 } 636 }); 637 if (bounce_on_event == 'mouseover' && on_event != 'mouseover') { 638 map_obj.event_listener(place.marker, 'mouseover', function() { 639 place.marker.setAnimation(google.maps.Animation.BOUNCE); 640 }); 641 642 map_obj.event_listener(place.marker, 'mouseout', function() { 643 place.marker.setAnimation(null); 644 }); 645 } 646 647 if (bounce_on_event != '') { 648 google.maps.event.addListener(place.infowindow, 'closeclick', function() { 649 place.marker.setAnimation(null); 650 }); 651 } 652 653 map_obj.places.push(place); 654 } else { 655 remove_keys.push(key); 656 } 657 }); 658 $.each(remove_keys, function(index, value) { 659 places.splice(value, 1); 660 }); 661 662 }, 663 toggle_bounce: function(marker) { 664 if (marker.getAnimation() !== null) { 665 marker.setAnimation(null); 666 } else { 667 marker.setAnimation(google.maps.Animation.BOUNCE); 668 } 669 }, 670 display_markers: function() { 671 672 var map_obj = this; 673 map_obj.show_places = []; 674 map_obj.categories = []; 675 var categories = {}; 676 for (var i = 0; i < map_obj.places.length; i++) {
677 map_obj.places[i].marker.setMap(map_obj.map); 678 if (map_obj.places[i].marker.visible === true) { 679 map_obj.show_places.push(this.places[i]); 680 } 681 682 if (typeof map_obj.places[i].categories != 'undefined') { 683 $.each(map_obj.places[i].categories, function(index, category) { 684 685 if (typeof categories[category.name] == 'undefined') { 686 categories[category.name] = category; 687 } 688 }); 689 } 690 } 691 692 this.categories = categories; 693 }, 694 get_current_location: function(success_func, error_func) { 695 696 var map = this; 697 698 if (typeof map.user_location == 'undefined') { 699 700 navigator.geolocation.getCurrentPosition(function(position) { 701 map.user_location = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); 702 703 if (success_func) 704 success_func(map.user_location); 705 706 }, function(ErrorPosition) { 707 708 if (error_func) 709 error_func(ErrorPosition); 710 711 }, { 712 enableHighAccuracy: true, 713 timeout: 5000, 714 maximumAge: 0 715 }); 716 } else { 717 if (success_func) 718 success_func(map.user_location); 719 } 720 }, 721 722 openInfoWindow: function(place) { 723 var map_obj = this; 724 place.infowindow = map_obj.infowindow_marker; 725 place.infowindow.setContent(place.infowindow_data); 726 if (place.location.onclick_action == "custom_link") { 727 if (place.location.open_new_tab == 'yes') 728 window.open(place.location.redirect_custom_link, '_blank'); 729 else 730 window.open(place.location.redirect_custom_link, '_self'); 731 } else { 732 place.infowindow.open(this.map, place.marker); 733 if (typeof map_obj.settings.infowindow_click_change_center != 'undefined' && map_obj.settings.infowindow_click_change_center == true) { 734 map_obj.map.setCenter(place.marker.getPosition()); 735 } 736 if (typeof map_obj.settings.infowindow_click_change_zoom != 'undefined' && map_obj.settings.infowindow_click_change_zoom > 0) { 737 map_obj.map.setZoom(map_obj.settings.infowindow_click_change_zoom); 738 } 739 if (this.map_data.map_tabs && this.map_data.map_tabs.direction_tab && this.map_data.map_tabs.direction_tab.dir_tab === true) { 740 $(this.container).find('.start_point').val(place.address); 741 } 742 } 743 744 }, 745 }; 746 747 $.fn.maps = function(options, places) { 748 749 this.each(function() { 750 751 if (!$.data(this, "wpgmp_maps")) { 752 $.data(this, "wpgmp_maps", new GoogleMaps(this, options, places)); 753 } 754 755 }); 756 // chain jQuery functions 757 return this; 758 }; 759 760}(jQuery, window, document));
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.