revBrowserCallScript

Graham Pearson gspearson at gmail.com
Tue Jun 11 14:24:07 EDT 2013


I am not sure if you got this working but in working with an application
that is based on google maps I have the Rev stuff working but I am at a
loss with the markers of google maps.

Here is my line in Rev Script

get revBrowserCallScript(sBrowserId, "AddSchoolMarker",
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L][@attributes]["ID"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["SchoolName"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["Address"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["City"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["State"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["ZipCode"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["ZipPlus4"], tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["SchoolLatitude"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["SchoolLongitude"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["TotalStudents"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["DistanceFromBTATower"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["CountyName"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["PhoneNumber"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["HasVOLEquipment"],
tSchoolsInMarketDataArray[RecordSet][SchoolsWithinMarket][L]["HasEBSLicenseModem"])


All of these variables are being pulled from a MySQL Database through a
Web Service powered by Coldfusion and returned to Livecode as an XML
Packet. Which when I do window.alert I am getting each one of these
parameters to display properly.

Below is my javascript code which the marker section is not working.

<script type="text/javascript">
var map;
function
AddSchoolMarker(NESCID,Name,Address,City,State,Zip,Zip4,Latitude,Longitude,TotalStudents,DistanceFromTower,CountyName,PhoneNumber,HasVOLEquipment,HasEBSModem)
{
	// window.alert("NESCID " + NESCID);
	// window.alert("School Name " + Name);
	// window.alert("School Address " + Address);
	// window.alert("School City " + City);
	// window.alert("School State " + State);
	// window.alert("School Zip " + Zip);
	// window.alert("School Zip4 " + Zip4);
	// window.alert("School Latitude " + Latitude);
	// window.alert("School Longitude " + Longitude);
	// window.alert("Total Students " + TotalStudents);
	// window.alert("Distance from Tower " + DistanceFromTower);
	// window.alert("County Name " + CountyName);
	// window.alert("Phone Number " + PhoneNumber);
	// window.alert("Has VOL Equipment " + HasVOLEquipment);
	// window.alert("Has EBS Modme " + HasEBSModem);
	var marker = new google.maps.Marker({
		position: new google.maps.LatLng(Latitude, Longitude),
		map: map
	});
			
	var infowindow = new google.maps.InfoWindow({
		content: 'Building Name: ' + Name
	});
	
	google.maps.event.addListener(marker, 'click', function() {
		infowindow.open(map, marker);
	});
}

function initialize() {
	var mapOptions = {
		center: new google.maps.LatLng(#Variables.CLat#, #Variables.CLon#),
		zoom: 8,
		panControl: false,
		zoomControl: true,
		zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL },
		scaleControl: true,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	 };
	var map = new google.maps.Map(document.getElementById("map-canvas"),
mapOptions);

	// Marker of Tower Location
	var marker = new google.maps.Marker({
		position: new google.maps.LatLng(#Variables.CLat#, #Variables.CLon#),
		title: "#Variables.MarkerTitle#"
	});
	marker.setMap(map);

	// 35 Mile Radius from Tower Location
	var marketDisplayRadius;
	var BTARadius = {
		strokeColor: '##000000',
		strokeOpacity: 0.8,
		strokeWeight: 1,
		fillColor: '##F5F5F5',
		fillOpacity: 0.35,
		map: map,
		center: new google.maps.LatLng(#Variables.CLat#, #Variables.CLon#),
		radius: 56327
	};
	marketDisplayRadius = new google.maps.Circle(BTARadius);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>


With the revBrowserCallScript it does call the function on the webpage,
I just can not get the marker to show up within the browser object.



On 3/22/2013 5:00 AM, Jacques Hausser wrote:
> Call to experts:
> 
> I have newbie's  problems with revBrowserCallScript. I'm using a browser and an html file built according to various examples to display google maps; it's OK and revBrowserCallScript works as expected for functions without parameters… but issues an error when I try to use parameters. I didn't find anything very enlighting in doc, former messages and forums… Thanks for any hint !
> 
> Jacques
> 
> My function call:
> 
>                 get revBrowserCallScript(LBrowserID,MoveAndZoom,tLat,tLong,tZoom)
> 
> the function called (one of several different versions):
> 
>                 function MoveAndZoom(pLat,pLng,pZoom)
>                 {
>                 var tCenter = new google.maps.LatLng(pLat,pLng);
>                 var sortie = "OK";
>                 map.setZoom(pZoom);
>                 map.panto(tCenter);
>                 return sortie;
>                 }
> 
> I also tried with map.setCenter(tCenter), as well as with and without 'get' and 'return sortie;'. 
> 
> the error is (External handler: exception) near "error in script"
> 
> 
> 
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 





More information about the use-livecode mailing list