View Full Version : Centered Pop up Windows with Google Maps API

11-04-2009, 10:38 PM
i would like have a centered pop up window when a user clicks on the link. im having some trouble here since all it does is open the link in the same page and nothing pops up.

<script language="javascript">
var popupWindow = null;
function centeredPopup(url,winName,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
popupWindow = window.open(url,winName,settings)

this is a snippet off google maps api. clicking on the link works, but the page doesnt display in a pop up window.

var point = new GPoint(-123.001063, 49.31505);
var marker = createMarker(point,"Starbucks","Starbucks<br>US<br>test<br><a href='http://maps.google.com/maps/sv?cbp=12,306.07,,1,0.91&amp;cbll=44.977333,-93.268143&amp;panoid=&amp;v=1&amp;hl=en&amp;gl=' onclick='centeredPopup(this.href,'winName','400','250','yes');return false'>Centered Popup Street View</a>")