PageSourceSearch

https://texasriverschool.org/wp-content/plugins/texasriverschool/js/maps.js?ver=2013-10-16-01

js texasriverschool.org collected 2026-10-04 17:40:05 UTC 6,272 bytes, 208 lines download raw bytes

1var map;
2var geocoder;
3var address;
4var themarker;
5var zoom = 4;
6var lastzoom = '';
7var points = Array();
8// var lat;
9// var lon;
10// lat = 25.311000; lon = -80.280589;
11var listing_style;
12var center;
13var marker;
14marker = new google.maps.Marker();
15
16// jQuery(window).load( findLocation );
17if( lat != '' && lon != '' ) {
18	center = new google.maps.LatLng(lat,lon);
19} else {
20	center = new google.maps.LatLng(clat,clon);
21}
22jQuery(window).load( init_geo_map );
23
24
25function init_geo_map() {
26	var type;
27	var draggable;
28	type = jQuery('input:radio[name=venue_geocode_type]:checked').val();
29	geocoder = new google.maps.Geocoder();
30	if (document.getElementById("map_canvas")) {
31		var myOptions = {
32			zoom: 16,
33			center: center,
34			mapTypeId: google.maps.MapTypeId.HYBRID,
35			disableDefaultUI: false,
36			panControl: false,
37			rotateControl: false,
38			scaleControl: false,
39			streetViewControl: false,
40			mapTypeControl: false,
41			scrollwheel: false
42		}
43		map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
44
45		if( lat != '' && lon != '' ) {
46			position = new google.maps.LatLng(lat, lon);
47			var point = new google.maps.LatLng(lat,lon);
48
49			if( type != 'lookup' ) {
50				draggable = true;
51			} else {
52				draggable = false;
53			}
54			var markerOptions = {
55				position: position,
56				draggable: draggable,
57				animation: google.maps.Animation.DROP,
58				map: map
59			}
60			// marker = new google.maps.Marker(markerOptions);
61			marker.setOptions(markerOptions);
62
63			google.maps.event.addListener(
64				marker,
65				'drag',
66				function() {
67					document.getElementById("coordinates").innerHTML = 'Coordinates: ' + roundNumber( marker.position.lat(), 4 ) + ', ' + roundNumber( marker.position.lng(), 4 );
68					document.getElementById("venue_geocode").value = roundNumber( marker.position.lat(), 4 ) + ', ' + roundNumber( marker.position.lng(), 4 );
69				}
70			);
71		} else {
72			position = new google.maps.LatLng(clat, clon);
73			var point = new google.maps.LatLng(clat, clon);
74		}
75	}
76}
77
78	function manual_pin() {
79		jQuery( 'body.post-type-venue #map_canvas').css('display','block');
80		marker.setMap(null);
81		// position = new google.maps.LatLng(clat, clon);
82		var markerOptions = {
83			position: map.getCenter(),
84			draggable: true,
85			animation: google.maps.Animation.DROP,
86			map: map
87		}
88
89		marker.setOptions(markerOptions);
90
91		document.getElementById("coordinates").innerHTML = 'Coordinates: ' + roundNumber( marker.position.lat(), 4 ) + ', ' + roundNumber( marker.position.lng(), 4 );
92		document.getElementById("venue_geocode").value = roundNumber( marker.position.lat(), 4 ) + ', ' + roundNumber( marker.position.lng(), 4 );
93
94		google.maps.event.addListener(
95			marker,
96			'drag',
97			function() {
98				document.getElementById("coordinates").innerHTML = 'Coordinates: ' + roundNumber( marker.position.lat(), 4 ) + ', ' + roundNumber( marker.position.lng(), 4 );
99				document.getElementById("venue_geocode").value = roundNumber( marker.position.lat(), 4 ) + ', ' + roundNumber( marker.position.lng(), 4 );
100			}
101		);
102	}
103
104	function set_auto_lookup() {
105		jQuery('#venue_geocode_type_lookup').prop('checked',true);
106		geo_lookup();
107	}
108
109	function set_manual_lookup() {
110		jQuery('#venue_geocode_type_manual').prop('checked',true);
111		manual_pin();
112	}
113
114	function set_nomap_lookup() {
115		jQuery('#venue_geocode_type_remove').prop('checked',true);
116		remove_pin();
117	}
118
119	function remove_pin() {
120		jQuery( 'body.post-type-venue #map_canvas').css('display','none');
121		document.getElementById("coordinates").innerHTML = 'Coordinates: not set';
122		document.getElementById("venue_geocode").value = '';
123		marker.setMap(null);
124	}
125
126	function code_address(address) {
127		jQuery( 'body.post-type-venue #map_canvas').css('display','block');
128		// address = '2835 Shoal Crest Avenue, Austin, TX 78705';
129		geocoder.geocode( { 'address': address}, function(results, status) {
130		if (status == google.maps.GeocoderStatus.OK) {
131			map.setCenter(results[0].geometry.location);
132
133			var markerOptions = {
134				position: results[0].geometry.location,
135				draggable: false,
136				animation: google.maps.Animation.DROP,
137				map: map
138			}
139
140			marker.setOptions(markerOptions);
141
142			document.getElementById("coordinates").innerHTML = 'Coordinates: ' + roundNumber( marker.position.lat(), 4 ) + ', ' + roundNumber( marker.position.lng(), 4 );
143			document.getElementById("venue_geocode").value = roundNumber( marker.position.lat(), 4 ) + ', ' + roundNumber( marker.position.lng(), 4 );
144
145			google.maps.event.addListener(
146				marker,
147				'drag',
148				function() {
149					document.getElementById("coordinates").innerHTML = 'Coordinates: ' + roundNumber( marker.position.lat(), 4 ) + ', ' + roundNumber( marker.position.lng(), 4 );
150					document.getElementById("venue_geocode").value = roundNumber( marker.position.lat(), 4 ) + ', ' + roundNumber( marker.position.lng(), 4 );
151				}
152			);
153
154
155
156		} else {
157			alert("Geocode was not successful for the following reason: " + status);
158		}
159	});
160}
161
162function roundNumber(number, digits) {
163	var multiple = Math.pow(10, digits);
164	var rndedNum = Math.round(number * multiple) / multiple;
165	return rndedNum;
166}
167function findLocation() {
168	lat = 30.2649;
169	lon = -97.7568;
170	center = new google.maps.LatLng(lat,lon);
171	// document.getElementById("coordinates").innerHTML = lat + ', ' + lon;
172}
173function foundLocation(position) {
174lat = position.coords.latitude;
175lon = position.coords.longitude;
176center = new google.maps.LatLng(lat,lon);
177document.getElementById("coordinates").innerHTML = lat + ', ' + lon;
178}
179function noLocation() {
180// alert('Could not find location');
181lat = 30.267;
182lon = -97.7613;
183center = new google.maps.LatLng(lat,lon);
184}
185
186
187	function onblur_lookup() {
188		if( jQuery('#venue_address').val() == '' || jQuery('#venue_city').val() == '' || jQuery('#venue_state_picker').val() == '' ) { 
189			// alert( 'hello' );
190			return false;
191		}
192		geo_lookup();
193	}
194
195	function geo_lookup() {
196		// alert( 'hello' );
197		var address;
198		var type;
199		type = jQuery('input:radio[name=venue_geocode_type]:checked').val();
200		if( type == 'lookup' ) { 
201			address = jQuery('#venue_address').val() + ',' + jQuery('#venue_city').val() + ',' + jQuery('#venue_state_picker').val() + ',' + jQuery('#venue_country').val() + ',' + jQuery('#venue_zip').val();
202			// alert( address );
203			code_address(address);
204		}
205	}
206
207
208

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.