Click here to Skip to main content
15,897,371 members
Articles / Web Development / ASP.NET

Image and Location Search(aroo)

Rate me:
Please Sign up or sign in to vote.
4.96/5 (28 votes)
11 Jun 2008CPOL12 min read 203.8K   2.5K   76  
Index your website (including images and geographic data), search and display results in Google Earth.
<%@ Page Language="c#" 
Buffer="true"
autoeventwireup="true" 
Inherits="Searcharoo.WebApplication.SearchPageBase" 
ContentType="application/vnd.google-earth.kml+xml" 
%><script runat="server">
      protected override SortedList GetSearchResults(Searcharoo.Engine.Search se)
      {
          return se.GetResults(this.SearchQuery, _Catalog, true); // ONLY Geocoded results
      }
      protected override int MaxResultsPerPage
      {
          get
          {
              return 200; 
          }
      }</script><%@ Register TagPrefix="roo" TagName="SearchPanel" Src="SearchControl.ascx" %><?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
   <Document><asp:Panel runat="server" visible="false">
		<roo:SearchPanel id="ucSearchPanelHeader" runat="server"  visible="false" IsSearchResultsPage="false" />
		<asp:Panel id="lblNoSearchResults" visible="false" runat="server"></asp:Panel>
		</asp:Panel>
		<name>Searcharoo Results for: <%=SearchQuery %></name>
		<description>The query took <%=_DisplayTime%> and produced <%=_Geocoded%> geocoded results.</description>
		<asp:Repeater id="SearchResults" runat="server">
	    <ItemTemplate>
        <Placemark>   
            <name><![CDATA[<%# DataBinder.Eval(Container.DataItem, "TitleText") %> ]]></name>
            <description><![CDATA[
                <%# DataBinder.Eval(Container.DataItem, "DescriptionText") %>
                <br />
                <a href="<%# DataBinder.Eval(Container.DataItem, "Url") %>"><img src="<%# DataBinder.Eval(Container.DataItem, "Url") %>" width="120" /></a>
                <br />
                Tags: <%# DataBinder.Eval(Container.DataItem, "KeywordString") %>
                <br />
                Size: <%# DataBinder.Eval(Container.DataItem, "Size") %>
                <br />
                Crawled Date: <%# DataBinder.Eval(Container.DataItem, "CrawledDate") %>
                <br />
                Rank: (<%# DataBinder.Eval(Container.DataItem, "Rank") %>)
            ]]></description>
            <Style><IconStyle><Icon><href><%# DataBinder.Eval(Container.DataItem, "Url") %></href></Icon></IconStyle></Style>
            <Point>      
                <extrude>1</extrude>
		        <altitudeMode>relativeToGround</altitudeMode>
                <coordinates><%# DataBinder.Eval(Container.DataItem, "GpsLocationText")%>,0</coordinates>    
            </Point>
        </Placemark>
	    </ItemTemplate>
		</asp:Repeater><asp:Panel runat="server" visible="false"><roo:SearchPanel id="ucSearchPanelFooter" runat="server" visible="false" IsSearchResultsPage="true" IsFooter="true"/></asp:Panel>
   </Document>
</kml>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Australia Australia
-- ooo ---
www.conceptdevelopment.net
conceptdev.blogspot.com
www.searcharoo.net
www.recipenow.net
www.racereplay.net
www.silverlightearth.com

Comments and Discussions