Hi,
I had the local search bar working in V2 to search the map. i have
been trying to convert to V3 api but can't seem to bind the search to
the map. it was easily done with V2 api
I would post a link to the page, but unfortunately, the page is on the
intranet here. i don't really want to create new page in Red Dot on
the public site as it is a national governmental web site, and some
people might stumble on it while doing a search...
It's currently loading markers from an access database

here is my code:

<%...@language="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../../../../Connections/conn_pos.asp" -->
<%
Dim current_province
Session("selTown")=request.Form("tTown")
current_town = Session("selTown")
Session("selProvince")=request.Form("tProv")
current_province = Session("selProvince")

Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows

Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_conn_pos_STRING

If Session("selProvince") = "" Then
Recordset1_cmd.CommandText = "SELECT * FROM NetworkPartners WHERE
Partner='CFDC'"
Else
Recordset1_cmd.CommandText = "SELECT * FROM NetworkPartners WHERE
Partner='CFDC' AND nsProvince = '" & current_province & "'"
End if

Recordset1_cmd.Prepared = true

Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!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>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?
sensor=false&region=CA"></script>
<script src="http://www.google.com/jsapi?key=ABQIAAAAOAr0d9H-
nLeOHZk8C65eexSb5Mn_ZddlBQGAOm8wNVsxiyhejhTLnci2n1wR6ztr0WHXJC5i3Sk89Q"
type="text/javascript"></script>
<script src="http://www.google.com/uds/solutions/mapsearch/
gsmapsearch.js"
    type="text/javascript"></script>



<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Community Futures Development Corporations</title>




<script type="text/javascript">


google.load("search", "1");

(function () {

        window.onload = function(){

                 var latlng = new google.maps.LatLng(53.100002,-111.776962); //
centered on Viking, AB

          // Creating an object literal containing the properties we
want to pass to the map
                  var options = {
                          zoom: 5,
                          center: latlng,
                          mapTypeId: google.maps.MapTypeId.ROADMAP,
                          disableDefaultUI: false,
                          mapTypeControl: true,
                          mapTypeControlOptions: { style:
google.maps.MapTypeControlStyle.DROPDOWN_MENU },
                          scaleControl: false,
                          navigationControl: true,
                          navigationControlOptions: { style:
google.maps.NavigationControlStyle.SMALL },
                          keyboardShortcuts: false,

                 };
                // Calling the constructor, and initializing the map
                var map = new google.maps.Map(document.getElementById('map'),
options);

                <% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>

                var marker<%=Recordset1.Fields.Item("NS_ID").Value%> = new
google.maps.Marker({
                        map: map,
                        clickable: true,
                        position: new 
google.maps.LatLng(<%=Recordset1.Fields.Item
("GoogleMap_ll").Value%>),
                        title: 
'<%=Recordset1.Fields.Item("NetworkSite").Value%>',
                        icon: 'images/cfdc-pin-<%=Recordset1.Fields.Item
("nsProvince").Value %>.png'
                        });

                        // Create InfowWindow
          var infowindow<%=Recordset1.Fields.Item("NS_ID").Value%> =
new google.maps.InfoWindow({
            content: '<%=Recordset1.Fields.Item("NetworkSite").Value
%><br /> <%=Replace(Recordset1.Fields.Item("nsTown").Value, "'",
"&rsquo;") %>, <%=Replace(Recordset1.Fields.Item("nsProvince").Value,
"'", "&rsquo;") %><br /><%=Recordset1.Fields.Item
("StreetAddress").Value%>,<br /> <%=Recordset1.Fields.Item
("PostalCode").Value%>,<br />Phone: <%=Recordset1.Fields.Item
("Phone").Value%>&nbsp;&nbsp;Fax:<%=Recordset1.Fields.Item("Fax").Value
%><br /><a href="<%=Recordset1.Fields.Item("InternetSiteURL").Value
%>"><%=Recordset1.Fields.Item("InternetSiteURL").Value%></a> <div
id="directions"><a href="http://maps.google.com/maps?saddr={Enter your
address}&daddr={<%=Recordset1.Fields.Item("StreetAddress").Value%>,<
%=Replace(Recordset1.Fields.Item("nsTown").Value, "'", "&rsquo;") %>,<
%=Recordset1.Fields.Item("nsProvince").Value %>}">Directions</a></
div>'
          });

          // Adding a click event to the marker
          google.maps.event.addListener(marker<%=Recordset1.Fields.Item
("NS_ID").Value%>, 'click', function() {
            // Opening the InfoWindow
                infowindow<%=Recordset1.Fields.Item("NS_ID").Value%>.open
(map, marker<%=Recordset1.Fields.Item("NS_ID").Value%>);
          });



<% Repeat1__index=Repeat1__index+1
                   Repeat1__numRows=Repeat1__numRows-1
                   Recordset1.MoveNext()
                Wend %>


        loadSearch();
          }})();

function loadSearch(){

        var options = {
      zoomControl : GSmapSearchControl.ZOOM_CONTROL_ENABLE_ALL,
      title : "WD",
      url : "http://www.wd-deo.gc.ca";,
      idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM,
      activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM,
      showResultList : document.getElementById("results")
      }

        new GSmapSearchControl(
      document.getElementById("search"),
      "9700 Jasper Avenue, Edmonton,Alberta,Canada",
      options
      );

};




</script>


<style type="text/css">
<!--
.widthFull {width:98.5%;}
.width25 { width: 200px;float:left;}
.width70 { width: 600px;margin-left: 220px;}

-->
</style>



</head>

<body">
<div class="widthFull">
  <div class="width25">
        <form id="pos1" method="post" action="cfdc_cities_v3api_e.asp">
    <label for="province" style="vertical-align:top">Show offices
in :</label>
    <br />
    <select id="tProv" name="tProv" size="5" style="margin-left:
20px;">
        <option value="AB">Alberta</option>
    <option value="BC">British Columbia</option>
    <option value="MB">Manitoba</option>
    <option value="SK">Saskatchewan</option>
    <option value="">All western CFDC's</option>
    </select>
  <p>
  <input type="submit" id="Submit" name="Submit" value="Submit"/>
  </p>
  <p>&nbsp;</p>
  </form>
  </div>
  <div class="width70">
        <h1>Western Canada Business Service Network</h1>
    <% Select Case current_province
        Case "AB"
                Response.write "<h2>CFDC Offices in Alberta</h2>"
        Case "BC"
                Response.write "<h2>CFDC Offices in British Columbia</h2>"
        Case "MB"
                Response.write "<h2>CFDC Offices in Manitoba</h2>"
        Case "SK"
                Response.write "<h2>CFDC Offices in Saskatchewan</h2>"
        Case Else
                Response.write "<h2>CFDC Offices in Western Canada</h2>"
        End Select %>
        <div id="placelist">
      <div id="search">
        <div id="searchform"></div>
      </div>
    </div>

    <div id="map" style="width: 598px; height: 500px; margin:0 auto"></
div>

</div>
</div>
<div id="results">
        <div id="searchwell"></div>
      </div>

<br/>
</body>
</html>

<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

--

You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.


Reply via email to