angularjs-google-maps
angularjs-google-maps copied to clipboard
InfoWindow pixel-offset doesn't work
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>
Thanks for this.
Have you tried pixel-offset="{width:-20,height:-100}"
without px
?
I will consider it as a new feature.
@ericjames how to set infowindow option?
your code doe not work for me thx!
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
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.
can somebody help me, what is pixels that shows x: somenumbers, y: othernumbers
was anybody able to make this work ? Thanks.
Can you please tell the solutions for the same