Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Create new infoWindow for multiple markers generated from REST.

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.

adith visnu
Posts: 0
Joined: Mon Jul 07, 2014 6:32 am

Create new infoWindow for multiple markers generated from REST.

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Create new infoWindow for multiple markers generated from REST.

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

adith visnu
Posts: 0
Joined: Mon Jul 07, 2014 6:32 am

Create new infoWindow for multiple markers generated from REST.

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Create new infoWindow for multiple markers generated from REST.

Adith,

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

Thanks.

adith visnu
Posts: 0
Joined: Mon Jul 07, 2014 6:32 am

Create new infoWindow for multiple markers generated from REST.

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...

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Create new infoWindow for multiple markers generated from REST.

Adith,

We, also, need steps to reproduce your problem.

Regards.

adith visnu
Posts: 0
Joined: Mon Jul 07, 2014 6:32 am

Create new infoWindow for multiple markers generated from REST.

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Create new infoWindow for multiple markers generated from REST.

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.

adith visnu
Posts: 0
Joined: Mon Jul 07, 2014 6:32 am

Create new infoWindow for multiple markers generated from REST.

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.?

Return to “Issues”