You wouldn't be able to help me with converting that php into asp.net
would you? This is the part here:
1. <?php
2. require("phpsqlsearch_dbinfo.php");
3.
4. // Get parameters from URL
5. $center_lat = $_GET["lat"];
6. $center_lng = $_GET["lng"];
7. $radius = $_GET["radius"];
8.
9. // Start XML file, create parent node
10. $dom = new DOMDocument("1.0");
11. $node = $dom->createElement("markers");
12. $parnode = $dom->appendChild($node);
13.
14. // Opens a connection to a mySQL server
15. $connection=mysql_connect (localhost, $username, $password);
16. if (!$connection) {
17. die("Not connected : " . mysql_error());
18. }
19.
20. // Set the active mySQL database
21. $db_selected = mysql_select_db($database, $connection);
22. if (!$db_selected) {
23. die ("Can\'t use db : " . mysql_error());
24. }
25.
26. // Search the rows in the markers table
27. $query = sprintf("SELECT address, name, lat, lng, ( 3959 * acos
( cos( radians('%s') ) * cos( radians( lat ) ) * cos( radians( lng ) -
radians('%s') ) + sin( radians('%s') ) * sin( radians( lat ) ) ) ) AS
distance FROM markers HAVING distance < '%s' ORDER BY distance LIMIT
0 , 20",
28. mysql_real_escape_string($center_lat),
29. mysql_real_escape_string($center_lng),
30. mysql_real_escape_string($center_lat),
31. mysql_real_escape_string($radius));
32. $result = mysql_query($query);
33.
34. $result = mysql_query($query);
35. if (!$result) {
36. die("Invalid query: " . mysql_error());
37. }
38.
39. header("Content-type: text/xml");
40.
41. // Iterate through the rows, adding XML nodes for each
42. while ($row = @mysql_fetch_assoc($result)){
43. $node = $dom->createElement("marker");
44. $newnode = $parnode->appendChild($node);
45. $newnode->setAttribute("name", $row['name']);
46. $newnode->setAttribute("address", $row['address']);
47. $newnode->setAttribute("lat", $row['lat']);
48. $newnode->setAttribute("lng", $row['lng']);
49. $newnode->setAttribute("distance", $row['distance']);
50. }
51.
52. echo $dom->saveXML();
53. ?>
On Nov 11, 9:07 am, Schwimms <[email protected]> wrote:
> Wow!
>
> That is exactly what I need.. Now all I just need is to convert that
> to asp.net. :(
>
> On Nov 9, 10:59 am, "[email protected]" <[email protected]>
> wrote:
>
> > On Nov 9, 8:00 am,Schwimms<[email protected]> wrote:
>
> > > Hi,
>
> > > I have a database with multiple map coordinates and I also have my
> > > google map and a search box but not all the code is set up. I am using
> > > asp.net and visual basic. This is what I want the program to do:
>
> > > - You type an address in that search box.
> > > - After you hit submit the map shows you map points around that
> > > address by looking at my database. I would only like to show 5 miles
> > > of radius from the address that is searched. I also would only like to
> > > allow 40 map points to be populated at a time.
> > > - You can hit a next button to see more map points.
> > > - You can also drag the map around and it reloads the map points based
> > > on where you drag your map around to.
>
> > > I think this is more complicated then I think it is. Could you help me
> > > with code?
>
> > Sounds like the classic store locator:
>
> >http://groups.google.com/group/google-maps-api/browse_frm/thread/486d...
>
> >http://googlemapsapi.blogspot.com/2008/01/article-creating-store-loca...
>
> >http://code.google.com/support/bin/answer.py?answer=87134&topic=11364
>
> > -- Larry- Hide quoted text -
>
> > - Show quoted text -
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-api?hl=.