How to customize google maps infowindow in rails using ym4r_gm
I integrated google maps in my rails project using ym4r_gm.
I want to customize the infowindow as in trulia.com (http://www.trulia.com/for_sale/New_York … _homes_lt/).
I went through the ym4r_gm code to include 'extinfowindow', but no use :开发者_开发知识库(
I'm really struggling alot to customize the bubble/infowindow.
Can any one explain me, how can we customize the infowindow using ym4r_gm.
Please help me..
Thanks in advance.
You need to add the extinfowindow.js to your HEAD (after you call GMap.head, or you can add it to the plugin's map.rb), and you need to alter the ym4r-gm.js (local) file to call openextinfowindow on click.
function addInfoWindowToMarker(marker,info,options){
GEvent.addListener(marker, 'click', function(){
marker.openExtInfoWindow(
map,
"infoWindowID",
"info box text",
{beakOffset: 3}
);
});
return marker;
}
Thanks for your great help stewart. I already closed this issue by doing same thing what you have explained here. :) I overwrite addInfoWindowToMarker in local ym4r_gm.js file .
精彩评论