2013-10-26 139 views
-1

我一樣有一個justdial.com應用程序,其中每當地址輸入到地址輸入到數據庫,從那裏同一地址用於創建谷歌地圖的形式。動態地添加谷歌地圖在我的應用程序

整個代碼是在轉發標籤即每一個新的地址輸入谷歌地圖API的時間獲取它,並顯​​示在我的應用程序映射寫入。

正如justdial.com完成。

該項目使用n層C#.NET框架完成。

<asp:Repeater ID="Repeater1" OnItemDataBound="Repeater1_ItemDataBound" runat="server" onitemcommand="Repeater1_ItemCommand"> 
    <ItemTemplate> 
    <h2>Map</h2> 
            <div style="width:100%; min-height:250px;"> 
            <iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=<%#Eval("comp_adrs") %>+India&amp;aq=0&amp;oq=<%#Eval("comp_adrs") %>&amp;sll=23.192951,72.6299&amp;sspn=0.024023,0.042014&amp;ie=UTF8&amp;hq=&amp;hnear=<%#Eval("comp_adrs") %>,+Odisha,+India&amp;t=m&amp;z=14&amp;ll=20.344743,85.803818&amp;output=embed"></iframe><br /><small><a href="https://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=<%#Eval("comp_adrs") %>,+Odisha,+India&amp;aq=0&amp;oq=<%#Eval("comp_adrs") %>&amp;sll=23.192951,72.6299&amp;sspn=0.024023,0.042014&amp;ie=UTF8&amp;hq=&amp;hnear=<%#Eval("comp_adrs") %>,+Odisha,+India&amp;t=m&amp;z=14&amp;ll=20.344743,85.803818" style="color:#0000FF;text-align:left">View Larger Map</a></small> 
            </div> 

</ItemTemplate> 
    </asp:Repeater> 

回答

0

在我的應用程序添加一個動態的谷歌地圖,我只是刪除從API代碼所在位置的經緯度,併爲進入地址的所有的地方加了我的變量和它去正確的。

<iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" 
              marginwidth="0" src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=<%#Eval("business_name") %>+<%#Eval("comp_adrs") %>+India&amp;aq=0&amp;oq=<%#Eval("business_name") %>+<%#Eval("comp_adrs") %>&amp;ie=UTF8&amp;hq=&amp;hnear=<%#Eval("business_name") %>+<%#Eval("comp_adrs") %>,+Odisha,+India&amp;t=m&amp;z=14&amp;output=embed"> 
</iframe> 
相關問題