Our PSL API is a html controller with features that can be easily embedded to your own webpage. Choose one of the following two methods that fits your website needs.
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBIyNR2uZCRGVNchYzh9HLwH2oi9S0EYW8"></script> <link href="https://www.findschool.ca/web/ApiV3/css?appid=apiv3demo&fid=1" type="text/css" rel="stylesheet"/> <script src="https://www.findschool.ca/web/ApiV3/js?appid=apiv3demo&fid=1" type="text/javascript"></script>
<div id="schlocator" ></div>
var myOptions = {
SID: "",
DivMainID: "schlocator"
}
var schLocator = new sysparts.schlocator(myOptions);
schLocator.searchAddress("3412 Marmac Crescent, Mississauga");
//event handler
schLocator.onEvent = function (nEventCode, sMessage) {
if ((nEventCode == 10) || (nEventCode == -1))
alert(nEventCode.toString() + ":" + sMessage);
};
//-1: error. //1: search successful, return schools //2: search successful, not found schools //10: register event.
var myOptions = {
SID: "",
DivMainID: "schlocator",
IsInnerMap: 0 //if you want to create google map object in your script, set it to 0;
}
schLocator = new sysparts.schlocator(myOptions);
//event handler
schLocator.onEvent = function (nEventCode, sMessage) {
if ((nEventCode == 10) || (nEventCode == -1))
alert(nEventCode.toString() + ":" + sMessage);
};
if (myOptions.IsInnerMap == 0) {
//to use the map you created, first you need to know the container div object in school locator.
//then create the map in the container
//the last is calling school locator control to do updates according to the map you pass in.
var mapDiv = schLocator.getMapDiv();
var myMap = createMySiteMap(mapDiv);
//set your own map object
schLocator.setMap(0, myMap);
}
//control is ready, let's search.
schLocator.searchAddress(valadress);
function createMySiteMap(mapDivObj) {
var myLatLng = new google.maps.LatLng(43.644363478452504, -79.3758230805397);
var myOptions = {
maxZoom: 15,
minZoom: 10,
zoom: 13,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var myMap = new google.maps.Map(mapDivObj, myOptions);
return myMap;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js" type="text/javascript"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBIyNR2uZCRGVNchYzh9HLwH2oi9S0EYW8" type="text/javascript"></script> <link rel="stylesheet" href= "https://www.findschool.ca/web/ApiV3/css?appid=apiv3demo&fid=1&style=1" type="text/css"/> <script src="https://www.findschool.ca/web/ApiV3/js?appid=apiv3demo&fid=1&style=1" type="text/javascript"></script>