Page 1 of 1

Building Google Map App with Geolocation

Posted: Sat Sep 15, 2012 7:47 am
by John4930205

I followed this tutorial to setup google map geolocation:
http://help.gotiggr.com/getting-start...

But when I click on the marker, info window (popup) doesn't come up. I tried adding the Google API 3 InfoWindow function to the geolocation component, but the infowindow doesn't come up. Plz help!


Building Google Map App with Geolocation

Posted: Sat Sep 15, 2012 3:53 pm
by maxkatz

Did you check this option?

Image


Building Google Map App with Geolocation

Posted: Sun Sep 16, 2012 8:28 am
by John4930205

That option is for the standard marker that you set via marker properties, no? Geolocation service component displays another marker that doesn't allow me to click and display the info window.

Again, my geolocation setup is based on this tutorial: http://help.gotiggr.com/getting-start...


Building Google Map App with Geolocation

Posted: Sun Sep 16, 2012 4:16 pm
by maxkatz

Can you share the code that you used to add the info window?


Building Google Map App with Geolocation

Posted: Mon Sep 17, 2012 2:53 am
by John4930205

This is the code that I have on the geolocation component - Event (Success) - Run Custom Javascript, but not working...

Do I need to change "markerX" to something else?

--------------------------

var map = Tiggr('googlemap1');
map.options['address']='';
map.refresh();

var infowindow = new google.maps.InfoWindow();
//clicklistener
google.maps.event.addListener(markerX, 'click', function() {
infowindow.setContent('Marker #X');
infowindow.open(Tiggr("googlemap1").gmap, markerX);
});


Building Google Map App with Geolocation

Posted: Mon Sep 17, 2012 3:09 am
by maxkatz

Instead of using Tiggzi(...) function to get the map, try to get the map div directly, like this:
var map = document.getElementById("map_div"),


Building Google Map App with Geolocation

Posted: Mon Sep 17, 2012 6:47 am
by John4930205

Thx Max, but I just can't get this work...

So I decided to go another route...

I would like to customize the marker for the geolocation. I used this code on the geolocation component - Event (Success) - Run Custom Javascript, but not working...

Do you have any advice on this? Thx.

--------------------------

var map = Tiggr('googlemap1');
map.options['address']='';
map.refresh();

var marker = new google.maps.Marker({
icon: 'http://www.example.com/images/custom-...',
title: "Testmarker"
});

Tiggr("googlemap1").options.mapElement.gmap('addMarker', marker);


Building Google Map App with Geolocation

Posted: Tue Sep 18, 2012 1:13 am
by maxkatz

You should add InfoWindow to the marker: https://developers.google.com/maps/do...


Building Google Map App with Geolocation

Posted: Mon Sep 15, 2014 3:58 am
by Tooba Atif

I am using the below code on geolocation success. but its not working.

var map = Appery('GMaps');
map.setProperty('address','');
map.refresh();

var marker = new google.maps.Marker({
animation: google.maps.Animation.DROP,
title: "Location Found"
});

marker.setMap(map);

google.maps.event.addListener(marker, 'click', function() {
confirm('Do you want to add details for this house?');
});

I have disabled the 'Show marker' on the GMap but nothing is shown on the screen.
If I enable it then i was unable to click on marker using the above code.


Building Google Map App with Geolocation

Posted: Mon Sep 15, 2014 12:46 pm
by Kateryna Grynko

Hi John,

Did you get it working?