angularjs-google-maps icon indicating copy to clipboard operation
angularjs-google-maps copied to clipboard

InfoWindow pixel-offset doesn't work

Open ericjames opened this issue 8 years ago • 7 comments

You don't have a pixel-offset attribute option, they all default to infowindow position.

However the workaround is to manually set the options of the infoWindow of map after you initialize getMap():

NgMap.getMap({id: 'map'}).then(function(map) { 
    map.infoWindows.infoWindow;
    infoWindow = infoWindow.setOptions({pixelOffset: { height: -40, width: 0}});
});

Ideally we would have something like: <info-window pixel-offset="{width:-20px,height:-100px}" position="37,-98"></info-window>

ericjames avatar Apr 11 '16 17:04 ericjames

Thanks for this. Have you tried pixel-offset="{width:-20,height:-100}" without px? I will consider it as a new feature.

allenhwkim avatar May 23 '16 15:05 allenhwkim

@ericjames how to set infowindow option?

your code doe not work for me thx!

gino8080 avatar Oct 03 '16 15:10 gino8080

It's either pixel-offset="Size(width:-20,height:-100)"

or this part must accept pixel-offset, so that it can be converted to pixel.

@ericjames. I think your code should be

infoWindow.setOptions({pixelOffset:new google.maps.Size(-20, -100)})

Instead of providing hash, I think

allenhwkim avatar Dec 12 '16 14:12 allenhwkim

Thx a lot) just found your reply to another guy in your repo in the morning) already made my custom info window) thx for your job! Have a nice day!

Send from iphone

12 дек. 2016 г., в 16:56, Allen Kim [email protected] написал(а):

It's either pixel-offset="Size(width:-20,height:-100)"

or this part must accept pixel-offset, so that it can be converted to pixel. @ericjames. I think your code should be

infoWindow.setOptions({pixelOffset:new google.maps.Size(-20, -100)}) Instead of providing hash, I think

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Maks-Yaremenko avatar Dec 12 '16 15:12 Maks-Yaremenko

can somebody help me, what is pixels that shows x: somenumbers, y: othernumbers

isaacSolano avatar Apr 18 '18 00:04 isaacSolano

was anybody able to make this work ? Thanks.

wholeinsoul avatar Feb 22 '19 05:02 wholeinsoul

Can you please tell the solutions for the same

ruchirai90 avatar Aug 20 '19 13:08 ruchirai90