PageSourceSearch

https://prostija-ptuj.si/components/com_formmaker/views/formmaker/tmpl/if_gmap.js

js prostija-ptuj.si collected 2026-10-02 23:10:38 UTC 1,949 bytes, 67 lines download raw bytes

1/* Code based on Google Map APIv3 Tutorials */
2
3
4var gmapdata= new Array();
5var gmapmarker = new Array();
6
7function if_gmap_init(id, form_id)
8{
9	map=document.getElementById(id+"_element"+form_id);
10	var def_zoomval = parseInt(map.getAttribute("zoom"));
11	var def_longval = map.getAttribute("center_x");
12	var def_latval  = map.getAttribute("center_y");
13
14    var curpoint = new google.maps.LatLng(def_latval,def_longval);
15
16    gmapdata[id] = new google.maps.Map(document.getElementById(id+"_element"+form_id), {
17                center: curpoint,
18                zoom: def_zoomval,
19                mapTypeId: 'roadmap'
20                });
21        
22    gmapmarker[id] = new Array();
23   
24        return false;
25} // end of if_gmap_init
26
27
28function add_marker_on_map(id, i, w_long, w_lat, w_info, form_id, dragb)
29{
30	var marker_point = new google.maps.LatLng(w_lat, w_long);
31	
32	
33       
34    gmapmarker[id][i] = new google.maps.Marker({
35                                        map: gmapdata[id],
36                                        position: marker_point,
37                                        draggable: dragb
38                                });
39								
40	gmapmarker[id][i].setDraggable(dragb);
41	
42	if(dragb)
43	{
44		google.maps.event.addListener(gmapmarker[id][i], 'drag', function() 
45		{
46				document.getElementById(id+"_lat"+form_id).value = gmapmarker[id][i].getPosition().lat().toFixed(6);
47				document.getElementById(id+"_long"+form_id).value = gmapmarker[id][i].getPosition().lng().toFixed(6);
48		});
49	}
50	
51    infoW = new google.maps.InfoWindow;
52        
53    google.maps.event.addListener(gmapmarker[id][i], 'click', function() 
54	{
55        infoW.setContent('<div style="overflow: hidden;">'+document.getElementById(id+"_element"+form_id).getAttribute('info'+i)+"</div>");
56		var infoWOpt = {
57				maxWidth: "300"
58				};
59		infoW.setOptions(infoWOpt);
60        infoW.open(this.getMap(), this);
61    });
62        
63   return false;
64
65	
66} // end of if_gmap_init
67

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.