开发者

display google map in cfwindow

I would like to display a google map in a cfwindow. I created a cfwindow and set the source to the url which contains my google map. The html form beneath my map displays, but the actual map doesn't display. Why is this happening and what can I do to correct it?

see code:

<!DOCTYPE html> 
 <html> 
 <head> 
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 

<script type="text/javascript"   
 src="http://maps.google.com/maps/api/js?sensor=false"> 

</head>
<body>
   <cfwindow name="w1" title="Location" initShow=true x开发者_StackOverflow=10 y=10 width="700" height="450" source="url to map">
    </cfwindow>
</body>


In order for the google map to render, it needs to fire off some javascript. When opening content in a cfwindow, embedded javascript won't always run.

Verify that your initialization javascript is running on the URL to the map, and if not, use AjaxOnLoad (CF8+) to ensure the initialization script runs. You also need to make sure that any script assets are included from the parent page.

This is absolutely possible (click Directions on this example).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜