PageSourceSearch

https://www.arc-sud-bretagne.fr/wp-content/plugins/novacity-osm-fr…/public/js/novacity-osm-front.js?ver=1.6.2

js arc-sud-bretagne.fr collected 2026-10-02 06:43:17 UTC 3,496 bytes, 124 lines download raw bytes

1/**
2 * Get options providing from WP php
3 * @since    1.4.0
4 */
5if ( typeof mapOptions == 'undefined' ) {
6	var mapOptions = {};
7}
8
9/**
10 * Get markers options providing from WP php
11 * @since    1.4.0
12 */
13if ( typeof mapMarkerOptions == 'undefined' ) {
14	var mapMarkerOptions = {};
15}
16
17( function( $ ) {
18	
19	var $all_osm = [];
20
21	$( '.novacity-map, .google-map' ).each( function ( index, el ) {
22		var options,
23			marker,
24			markers = [],
25			$canvas = $(el),
26			$markers = $canvas.find('.marker');
27
28		// Merge options
29		options = $.extend( {}, mapOptions, $canvas.data() );
30
31		$markers.each( function ( index, el ) {
32
33			// Merge options
34			marker = $.extend( {}, mapMarkerOptions, $( el ).data() );
35
36			// data file compatibility
37			if ( typeof marker.kml != 'undefined' ) {
38				marker.file = marker.kml;
39			}
40			marker.html = $( el ).html().trim();
41			markers.push( marker );
42			$( el ).remove();
43		} );
44
45		// Connecteur pour google-map vers OSM (padding)
46		if ( typeof $canvas.data('offset-breakpoint') != 'undefined' ) {
47			options.paddingBreakpoint = $canvas.data('offset-breakpoint');
48		}
49
50		// Connecteur pour google-map vers OSM (offset)
51		if ( typeof $canvas.data('offset-y') != 'undefined' || typeof $canvas.data('offset-x') != 'undefined' ) {
52			options.padding = [0,0,0,0];
53			if ( typeof $canvas.data('offset-x') != 'undefined' && $canvas.data('offset-x') !== 0 ) {
54				if ( $canvas.data('offset-x') > 0 ) {
55					options.padding[1] = $canvas.data('offset-x') * 2;
56				} else if ( $canvas.data('offset-x') < 0 ) {
57					options.padding[3] = $canvas.data('offset-x') * -2;
58				}
59			}
60			if ( typeof $canvas.data('offset-y') != 'undefined' && $canvas.data('offset-y') !== 0 ) {
61				if ( $canvas.data('offset-y') > 0 ) {
62					options.padding[2] = $canvas.data('offset-y') * 1;
63				} else if ( $canvas.data('offset-y') < 0 ) {
64					options.padding[0] = $canvas.data('offset-y') * -1;
65				}
66			}
67		}
68
69		// Connecteur pour google-map vers OSM (icon)
70		for (var i = 0; i < markers.length; i++) {
71			if ( typeof markers[i].iconMarker != 'undefined' && markers[i].iconMarker != '' ) {
72				markers[i].iconUrl = markers[i].iconMarker
73			}
74		}
75
76		options.markers = markers;
77		var $osm = $(el);
78
79		// Permet de retarder l'activation de la map si dans une modale
80		if ( $osm.parents('.modal').length > 0 ) {
81			$osm.parents('.modal').on('shown.bs.modal', function (e) {
82				if ( typeof $osm.$canvas == 'undefined' ) {
83					$osm = $osm.osm(options);
84				} else {
85					$osm.refresh();
86				}
87			});
88
89		// Permet de retarder l'activation de la map si dans un tab
90		} else if ( $osm.parents('.tab-pane').length > 0 ) {
91			var trigger_id = $osm.parents('.tab-pane').attr('id');
92			if ( $('#' + trigger_id ).hasClass('active') ) {
93				$osm = $osm.osm(options);
94			} else {
95				$('[href="#' + trigger_id + '"], [data-target="#' + trigger_id + '"]').on('shown.bs.tab', function (e) {
96					if ( typeof $osm.$canvas == 'undefined' ) {
97						$osm = $osm.osm(options);
98					} else {
99						$osm.refresh();
100					}
101				});
102			}
103
104		// Permet de retarder l'activation de la map si dans un collapse
105		} else if ( $osm.parents('.collapse').length > 0 ) {
106			if ( $osm.parents('.collapse').hasClass('in') ) {
107				$osm = $osm.osm(options);
108			} else {
109				$osm.parents('.collapse').on('shown.bs.collapse', function (e) {
110					if ( typeof $osm.$canvas == 'undefined' ) {
111						$osm = $osm.osm(options);
112					} else {
113						$osm.refresh();
114					}
115				});
116			}
117			
118		} else {
119			$osm = $osm.osm( options );
120		}
121
122	});
123
124}( 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.