Page 3 of 5

Create new infoWindow for multiple markers generated from REST.

Posted: Mon Jul 07, 2014 2:52 am
by Yurii Orishchuk

Hi Andrea,

Thanks for your update.

I gave you this code to replace your map object with our one.

So if you got it worked with suggested code - it's fact that your GMAP component not initialized at this time.

You can use given code in this case as you need.

Regards.


Create new infoWindow for multiple markers generated from REST.

Posted: Thu Aug 14, 2014 2:19 am
by adith visnu

Hi,
i hope this discussion is still alive.
i have a questions for my infowindows.

why is it happened, guys?

Image

here is my code

var CreateMarker = function(ubahJsonLokasi, i){
marker = new google.maps.Marker({
position: new google.maps.LatLng(ubahJsonLokasi.Latitude, ubahJsonLokasi.Longtitude),
animation: google.maps.Animation.BOUNCE,
map: Appery("maps").gmap,
title: ubahJsonLokasi.PIN,
icon: "https://cdn4.iconfinder.com/data/icon..."
});

Code: Select all

 arrayMarker.push(marker); 

 var infowindow = new google.maps.InfoWindow({content:ubahJsonLokasi[i].PIN});  
 google.maps.event.addListener(marker, 'click', function() {  
     infowindow.open(Appery("maps").gmap,marker);  
 }); 

};

for (var i = 0, j = ubahJsonLokasi.length; i < j; i++)
CreateMarker(ubahJsonLokasi,i);

Thanks


Create new infoWindow for multiple markers generated from REST.

Posted: Thu Aug 14, 2014 2:40 am
by Yurii Orishchuk

Hi Adith,

You need to get mapObject in some other way.

pre

Appery("maps")&#46;options&#46;mapElement&#46;gmap('get', 'map');

/pre

Here is updated code for you:

pre

var mapObject = Appery("maps")&#46;options&#46;mapElement&#46;gmap('get', 'map');

var CreateMarker = function(ubahJsonLokasi, i) {
marker = new google&#46;maps&#46;Marker({
position: new google&#46;maps&#46;LatLng(ubahJsonLokasi&#46;Latitude, ubahJsonLokasi&#46;Longtitude),
animation: google&#46;maps&#46;Animation&#46;BOUNCE,
map: mapObject,
title: ubahJsonLokasi&#46;PIN,
icon: "https:&#47;&#47;cdn4&#46;iconfinder&#46;com/data/icon&#46;&#46;&#46;"
});

Code: Select all

 arrayMarker&#46;push(marker); 

 var infowindow = new google&#46;maps&#46;InfoWindow({ 
     content: ubahJsonLokasi[i]&#46;PIN 
 }); 
 google&#46;maps&#46;event&#46;addListener(marker, 'click', function() { 
     infowindow&#46;open(mapObject&#46;gmap, marker); 
 }); 

};

for (var i = 0, j = ubahJsonLokasi&#46;length; i < j; i++)
CreateMarker(ubahJsonLokasi, i);

/pre

Regards


Create new infoWindow for multiple markers generated from REST.

Posted: Thu Aug 14, 2014 2:51 am
by adith visnu

Hi Yurii
Thanks for the answer,
but your code makes all infowindows won't show.


Create new infoWindow for multiple markers generated from REST.

Posted: Thu Aug 14, 2014 3:21 am
by Yurii Orishchuk

Adith,

Please provide us your app public link and describe steps to reproduce your problem.

Thanks.


Create new infoWindow for multiple markers generated from REST.

Posted: Thu Aug 14, 2014 3:25 am
by adith visnu

Hi Yurii,
update : infowindows show but only in one markers, not all, and still same with the picture that i post before

sure Yurii, here is the link
http://appery.io/app/mobile-frame?src...


Create new infoWindow for multiple markers generated from REST.

Posted: Thu Aug 14, 2014 4:03 am
by Yurii Orishchuk

Adith,

We, also, need steps to reproduce your problem.

Regards.


Create new infoWindow for multiple markers generated from REST.

Posted: Thu Aug 14, 2014 4:19 am
by adith visnu

Hi Yurii,
here the steps,
first you should click generate on first screen. And then click "Tambah Data" on top navbar

next add this value to form :

  • "P369PH" on ID Device

  • anything on Sebutan
    and click "tambahkan dia"

    And then, click list on top navbar, is there any data or no.
    if there is a data, then close panel and click DimanaDia on bottom navbar

    zoom out the maps

    click the marker

    then, u can see my problem.
    thanks Yurii
    Regards.


Create new infoWindow for multiple markers generated from REST.

Posted: Thu Aug 14, 2014 11:20 pm
by Yurii Orishchuk

Hi Adith,

Unfortunatly we can not reproduce this issue.

I have items in list but when click on "tambahkan dia" i don't see any markers.

Please revert code to your original code.

And make some screen shots what we need to see.

Regards.


Create new infoWindow for multiple markers generated from REST.

Posted: Wed Aug 27, 2014 7:23 am
by adith visnu

Hi yurii.

please see on my new project here
http://appery.io/app/mobile-frame?src...

click the marker button on header and click the marker on map.
why info windows is on wrong positions.?