I have a huge problem with my ionic app.
When the user clicks on a point of interest, for example train stations and clicks on "open in Google Maps" The App opens the link fullscreen in the app and you have to kill the app, since there is no close button. The Softkeys don't work.
See here:
I guess I have to use the inappbrowser, but how can I enable it inside the map? Deactivating the POI's isn't an option.
Any help much appreciated!
In my case i had in controller.js:
'<a onclick="goto('+obj1[j].places.items[0][0]+','+obj1[j].places.items[0][1]+')">Open in google maps!</a>'
and then in function goto:
window.goto = function(lat,lon){
window.open("https://www.google.com/maps/dir//"+lat+","+lon+"/#",'_system', 'location=yes');
}
Edit:
(....your code....)
var popupContent1 = '<div id="locationContent1">' +
'<div> ' + item.storeName + '</div>' +
'<div> ' + item.address + '</div>' +
'<div> ' + item.city + '</div>' +
'<div>' +'<a onclick="goto('+item.latitude+','+item.longitude+')">Open in google maps!</a>'+ '</div>' +
'</div>';
createInfoWindow(marker, popupContent1);
//marker.bindTo('map',cat.data('goo'),'map');
var infoWindow = new google.maps.InfoWindow();
function createInfoWindow(marker, popupContent1) {
google.maps.event.addListener(marker,'click',function(){ infowindow.setContent(popupContent1);
infowindow.open(map,this);
})
}
Related
Hi everyone! What I want:
I have a background video (duration 2 sec) on the homepage. Video should be played from the middle forward when the mouse cursor moves to the right and backward when the mouse cursor moves to the left. And is it possible to implement the same only on Android/iPhone? To play the video when the Android/iPhone is tilted. Maybe someone knows the examples. Please attach links to the examples.
You want to look at deviceOrientation - https://caniuse.com/#search=deviceorientation
Based on that you can use code similar to below to track the movement (in this case I think it would be the beta, though per CanIUse you should note Safari and Chrome use different coordinate systems) to determine where in the video you want to scroll to
<body>
<div id="status">Loading...</div>
<div id="alpha"></div>
<div id="beta"></div>
<div id="gamma"></div>
<script>
if (window.DeviceOrientationEvent) {
window.addEventListener('deviceorientation', deviceOrientationHandler, false);
document.getElementById("status").innerText = "Supported!";
} else {
alert("Sorry, your browser doesn't support Device Orientation");
}
function deviceOrientationHandler(event) {
var time = new Date();
showTime = ("0" + time.getHours()).slice(-2) + ":" + ("0" + time.getMinutes()).slice(-2) + ":" + ("0" + time.getSeconds()).slice(-2);
document.getElementById("status").innerText = "triggered: " + showTime
document.getElementById("alpha").innerText = "Alpha: " + Math.round(event.alpha)
document.getElementById("beta").innerText = "Beta: " + Math.round(event.beta)
document.getElementById("gamma").innerText = "Gamma: " + Math.round(event.gamma)
}
</script>
</body>
i'm making an app for my school that collects specific data from firebase real-time database, I am currently following a tutorial (i am really new into google apps script). I tried this code:
function getAllData() {
var ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1g1AELHBONzjEvfMekn3U86xVs9bDdX68bp5i3U2qnjsc)
var firebaseUrl = "https://example.firebaseio.com/";
var base = FirebaseApp.getDatabaseByUrl(firebaseUrl);
var data = base.getData();
for(var i in data) {
Logger.log(data[i].logbookId + ' ' + data[i].logbookfullName + ' ' + data[i].logbookEmail + ' ' + data[i].logbookSubject + ' ' + data[i].logbookDate + ' ' + data[i].logbookTime);
}
}
but it seems It doesn't work. Can someone give me a solution?
There is no native FirebaseApp within Google Script. I believe you are trying to use this Firebase Libray by RomainVialard. First you should follow the Install Guide to install the library into your script.
Add the library key MYeP8ZEEt1ylVDxS7uyg9plDOcoke7-2l into Resources menu > Libraries.
You should then be able to use the FirebaseApp object and functions.
I'm developing a game with Unity3D for Android. I'm using Facebook App for sharing game score in Facebook. But I receive a error message ;
My codes are here ;
//facebook share start
public static void share(string link, string pictureLink, string name,string caption, string description, string redirectUri){
Application.OpenURL(ShareUrl +
"?app_id=" + AppId +
"&link=" + WWW.EscapeURL( link )+
"&picture=" + WWW.EscapeURL(pictureLink) +
"&name=" + WWW.EscapeURL(name) +
"&caption=" + WWW.EscapeURL(caption) +
"&description=" + WWW.EscapeURL(description) +
"&redirect_uri=" + WWW.EscapeURL(redirectUri));
}//facebook share end
if(GUI.Button(new Rect(Screen.width/2,(Screen.height/2-30),80,20), "Share")){
print("Share");
share("http://www.halilcosgun.com","https://24.media.tumblr.com/avatar_ce3a5b939737_64.png","Facebook skor paylaşma denemesi " + score,"Skor da mı paylaşmıyah?","oyun çok yakında!","http://facebook.com");
}
I tried to write many adresses (many many configurations) intead of "http://facebook.com", but I can't find the true one.
If you know the solution, can you halp me please?
I would like to thank you for your interest.
there must me an invalid parameter that you have provided . try to find it out and make the change it will solve your issue
try the share with first s in caps example
Share("http://www.halilcosgun.com","https://24.media.tumblr.com/avatar_ce3a5b939737_64.png","Facebook skor paylaşma denemesi " + score,"Skor da mı paylaşmıyah?","oyun çok yakında!","http://facebook.com");
}
I am using PhoneGap to develop an Android App. I am using ZXing plugin in order to scan a QR-Code.
In index.html, I put a button in order to scan a QR-Code:
<a href="#" onclick="scanCode();">
Here is the code of scanCode in the java-script file:
var scanCode = function() {
window.plugins.barcodeScanner.scan(
function(result) {
alert("Scanned Code: " + result.text
+ ". Format: " + result.format
+ ". Cancelled: " + result.cancelled);
}, function(error) {
alert("Scan failed: " + error);
});
}
I want to retrieve datas from "result", especially "result.text" in order to use them in another html file.
How can I please do it?
Thanks.
result.text is already the scanned text.
Try this:
var thetext = result.text;
https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner talks about adding src.com.phonegap.plugins.barcodescanner.BarcodeScanner.java.
Good day!
I just want to ask if an InfoBubble can have a listener. I tried to insert the text of the InfoBubble in a div and insert an onclick command there, but nothing happens.
Thanks in advance. By the way I am currently developing an android application, and using webview to display the map.
ok, jetpro,
here's what I do in a similar scenario using javascript:
/* json data object requires:
data.Id,
data.Lat,
data.Lng,
data.Name,
data.Address,
data.Date
*/
function DisplayMapEvent(data, targetDiv) {
var latlng, options, map, contentString, infowindow, marker;
// setup our variables
latlng = new window.google.maps.LatLng(data.Lat, data.Lng);
options =
{
zoom: 15,
center: latlng,
mapTypeId: window.google.maps.MapTypeId.ROADMAP
};
// create the map inside our map <div> and apply the options
map = new window.google.maps.Map(document.getElementById(targetDiv), options);
map.setOptions(options);
// info to display in the infowindow popup
contentString =
'<div>' +
'<b style="color: #DC6852;">' + data.Name + '</b><br />' +
'Where: ' + data.Address + '<br />' +
'When: ' + data.Date + '<br />' +
'</div>';
// info/marker and popup objects setup
infowindow = new window.google.maps.InfoWindow({
content: contentString
});
marker = new window.google.maps.Marker({
position: latlng,
map: map
});
// add the usual suspect event handlers
window.google.maps.event.trigger(map, 'resize');
// to allow us to repoen a map marker infowindow if closed
window.google.maps.event.addListener(marker, 'click', function () {
infowindow.open(map, marker);
});
// open infowindow on map once rendered
infowindow.open(map, marker);
// sit back and wonder at the glory of google maps mow :-)
}
In my case, I'm passing a json object into the DisplayMapEvent function, but you could rejig this to your own requirement. This function is called anytime I wish to add a new marker onto my map, so you may be able to lift this wholesale and refactor as required.
Hope this helps.
Add listener like this
google.maps.event.addDomListener(infoBubble2.bubble_, 'click', function(){..});
Have fun!