Page 1 of 1

Can I add push pins to a map?

Posted: Tue Oct 01, 2013 10:28 am
by jyotsna s

Can I add push pins to a map in appery.io? Also when I click on the push pin, I should be able to navigate to another screen. Is that possible?


Can I add push pins to a map?

Posted: Tue Oct 01, 2013 11:03 am
by Kateryna Grynko

Hi Jyotsna,

Please take a look at here:
http://docs.appery.io/tutorials/addin...


Can I add push pins to a map?

Posted: Tue Oct 01, 2013 11:29 am
by jyotsna s

hi katya... I have tried using the above link. Here, when we put markers in map, we cannot click on the marker and navigate to any other page. So is there any way to click on the marker and navigate to another screen?


Can I add push pins to a map?

Posted: Tue Oct 01, 2013 1:00 pm
by Kateryna Grynko

Hi Jyotsna,

Here is the sample code to navigate to URL:
codevar marker = new google.maps.Marker({
url: 'http://www.google.com/',
map: map
});

google.maps.event.addListener(marker, 'click', function() {
window.location.href = marker.url;
});/code

Here is how to navigate between Appery.io pages: http://docs.appery.io/javascript-api/...


Can I add push pins to a map?

Posted: Thu Oct 03, 2013 4:32 am
by jyotsna s

Thanks Katya. But I have tried all of these but couldn't get the required output. The issue is, when I click on the marker, the map is getting zoomed in instead of navigating to another page.


Can I add push pins to a map?

Posted: Thu Oct 03, 2013 7:13 am
by Kateryna Grynko

Hi Jyotsna,

You probably missed something in a marker. Try the following code please:
codevar myOptions = {
zoom :8,
center: new google.maps.LatLng(37.63, -122.424),
mapTypeId: google.maps.MapTypeId.ROADMAP
};

var map = new google.maps.Map($('div[dsid="googlemap1"]').get(0), myOptions);

//San Francisco, with custom marker
var sfLatlng = new google.maps.LatLng(37.775, -122.4183333);
var marker = new google.maps.Marker({
position: sfLatlng,
map: map,
title: "San Francisco",
url : "http://google.com",
});
google.maps.event.addListener(marker, 'click', function() {
window.location.href = this.url;
});/code


Can I add push pins to a map?

Posted: Mon Oct 07, 2013 9:25 am
by jyotsna s

Thanks a lot Katya. This worked.