Oriented Images

//Handler after imajnet was activated
ImajnetPlugin.onImajnetActivated = function() {
	//Set coordinates
	var lon = 19.047818870703463;
	var lat = 47.51576979427608; 	

	//Get closest image to this coordinates
	ImajnetPlugin.getOrientedImages(lon, lat);
	//Zoom map to view images

//Function that will get the oriented images at those coordinates
ImajnetPlugin.getOrientedImages = function(lon, lat) {
	//Set imajnet mode to closest image;
	Imajnet.activateImajnetControl(null, 'clickMode');

	//Pass the coordinates to the imajnet library
	    lon: lon,
	    lat: lat

//Register events on the map to get oriented images on click
ImajnetPlugin.registerMapEvents = function() {
	map.on('click', onMapClick);

function onMapClick(event) {
	//all coordinates passed to the imajnet sdk must be in wgs84
	var coordinate = ol.proj.transform(event.coordinate, webMercator, wgs84);
	ImajnetPlugin.getOrientedImages(coordinate[0], coordinate[1]);