سؤال

I have a google map.

And there's an information window.

Now the size is standard and there r loads of texts inside.

So, my boss asked me to increase it.

We are useing ektron CMS and thus I need to go into ektron workarea and edit map.js

Even if it is ektron, it is still using google map.

I managed to find out which part is displaying as info window.

This is the part of code where info window pops up and display information inside.

marker = new GMarker(point, icon);
var infoWindow = map.getInfoWindow();
GEvent.addListener(marker, "mouseover", function () {
                    if (EMap.SearchData != 'content') {
                        if (qlink && qlink.length > 0) {
                            _userTB = '<span>' + title + '</span>';
                        }
                        else {
                            _userTB = title;
                        }
                        var theHtml1 = '<div id="IW_' + markerid + '" style="overflow:auto;width:240px;height:100px;">' + markerid + '. ' + _userTB + _summarytxt + '<br/>' + EGlobal.Format(EMap.Geolocation, new Array('javascript:EMap.SetAddress(\'' + EGlobal.Replace(address, '#', ' ') + '\',\'to\');', 'javascript:EMap.SetAddress(\'' + EGlobal.Replace(address, '#', ' ') + '\',\'from\');')) + '</div>';
                        map.openInfoWindowHtml(theHtml1);
                    }
                    else {
                        var theHtml2 = '<div id="IW_' + markerid + '" style="overflow:auto;width:240px;height:100px;">' + markerid + '. <span><b>' + title + '</b></span><br/>' + _summarytxt + '<br/>' + EGlobal.Format(EMap.Geolocation, new Array('javascript:EMap.SetAddress(\'' + EGlobal.Replace(address, '#', ' ') + '\',\'to\');', 'javascript:EMap.SetAddress(\'' + EGlobal.Replace(address, '#', ' ') + '\',\'from\');')) + '</div>';
                        marker.openInfoWindowHtml(theHtml2);
                    }
                });

I try to search on google and found out that this is how a guy tried to change the info window size.

var infoWindow = map.getInfoWindow();
var point = new GLatLng(0,0);
var marker = new GMarker(point);
GEvent.bind(marker,”click”,marker,function() {
    map.openInfoWindowHtml(this.getPoint(),this.address,{onOpenFn:function(){
        infoWindow.reset(this.getPoint(),infoWindow.getTabs(),new GSize(200,200),null,null);
    }});
});

The full article is on this site.

But I cannot merge them into 1.

especially that guy is using map.openInfoWindowHtml() with 3 parameters and ektron is using marker.openInfoWindowHtml() with only one parameter.

Any idea how to get this done? Tkz a lot.

And.. I am very new to google map. So, forgive me if my question is wasting your time.

هل كانت مفيدة؟

المحلول

Maybe this answer is too simple but did you allready tried to edit this line in the openInfoWindowHTML() call?

style="overflow:auto;width:240px;height:100px;">
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top