房途网地图提供地图定位嵌入接口。通过在贵网页上合适位置插入如例子所示的javascript代码,在网页上就会根据所设参数出现房途网地图并定位显示。
请联系房途服务热线 400-600-6969
一、请将javascript脚本插入到网页<head>标签与</head>标签内。在网页元素加载完成后创建地图设置参数。
<script src="http://res.fangtuwang.com/js/ft2Map.js" type="text/javascript"></script>
<script type="text/javascript">function mapLoad(){ftMap2("容器ID", { city: "城市参数", name: "定位名称" });}</script>
二、参数说明
三、代码示例 提示:您可以先修改部分代码再运行,复制代码和保存代码功能在Firefox下无效。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>房途网定位</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="http://res.fangtuwang.com/js/ft2Map.js" type="text/javascript"></script> <script type="text/javascript"> document.charset = "utf-8"; //仅运行测试使用 function mapLoad() { //创建一个地图 //构造函数:在给定的 HTML container(通常是 DIV 元素)中创建新的地图(地图大小默认为容器高宽)。还可以传递类型为的可选参数 opts。 ftMap2("map", { city: "hangzhou", name: "天苑大厦", type: 1, eye: 0 }); } </script> </head> <body onload="mapLoad();"> <div id="map" style="width:500px;height:380px;"></div> </body> </html>