Will it be possible to do something like the one here:
http://code.google.com/support/bin/answer.py?answer=87134&topic=11364#findnearsql
That is the final file: phpsqlsearch_map.html
Will the Geocoder work?? Something like that example would be ideal.
May be get all the district names from a table and have it displayed
in a listbox. And then use the lat/long values of those districts
from that table and extract neighboring villages from the village
table based on a specific distance.
On Nov 19, 3:01 pm, Ricky <[EMAIL PROTECTED]> wrote:
> sorry about the localhost url..
>
> Just wanted to ask if the syntax of the URL was correct with respect
> to mentioning the lat/long/radius in the url.
>
> Thanks for that code snippet. Will try to implement the same in my
> code.
>
> On Nov 19, 2:39 pm, mapperzUK <[EMAIL PROTECTED]> wrote:
>
> > In the end I used centre lat/lng then use the spatial search in the
> > postgres server
>
> > send a request (a click on map) 51.2, 0.1, 5 (lat,lng,distance)
>
> > // Example loading dll
> > if (!extension_loaded('pgsql')) {
> > dl('php_pgsql.dll');}
>
> > $db = pg_connect('host=localhost dbname=gmap user=xxx
> > password=xxxxxx'); //use separate php script on webserver
>
> > $lat = $_GET["lat"];
> > $long = $_GET["long"];
>
> > $radius = $_GET["radius"];
>
> > $sql = "SELECT x(the_geom) as x, y(the_geom) as field1,
> > field2, field2, field2, field2 FROM gmap1";
> > $sql = $sql . " where (the_geom && SetSRID('BOX3D(" . ($long
> > - $radius) . " " . ($lat - $radius) . ", " . ($long + $radius) . " " .
> > ($lat + $radius) . ")'::box3d,4269))";
> > $sql = $sql . " AND distance( the_geom, GeomFromText( 'POINT
> > (" . $long . " " . $lat . ")', 4269)) < " . $radius;
>
> > //echo $sql;
>
> > $result = pg_query($sql);
> > if (!$result) {
> > echo "Problem with query " . $sql . "<br/>";
> > echo pg_last_error();
> > exit();
> > }
>
> > //$array = pg_fetch_array($result);
> > //echo json_encode($array)
>
> > Just found it faster
>
> > please don't post locahost url's [we can't see them online]
>
> > Mapperzhttp://mapperz.blogspot.com/
>
> > On Nov 19, 7:14 am, Ricky <[EMAIL PROTECTED]> wrote:
>
> > > Am stuck with this error message.. :(
>
> > > Warning: pg_query() [function.pg-query]: Query failed: ERROR: LIMIT
> > > #,# syntax is not supported HINT: Use separate LIMIT and OFFSET
> > > clauses.in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
> > > \map2.php on line 30
>
> > > *************
> > > $query = sprintf("SELECT place_id, place_name, lat, lng, ( 6371 * acos
> > > ( cos( radians('%s') ) *
>
> > > cos( radians( lat ) ) * cos( radians( lng ) - radians('%s') ) + sin
> > > ( radians('%s') ) * sin(
>
> > > radians( lat ) ) ) ) AS distance FROM places HAVING distance < '%s'
> > > ORDER BY distance LIMIT 0 ,
>
> > > 20",
> > > pg_escape_string($center_lat),
> > > pg_escape_string($center_lng),
> > > pg_escape_string($center_lat),
> > > pg_escape_string($radius));
> > > *************
> > > Line 30 is: $result = pg_query($link,$query);
>
> > > How do I alter syntax of select statement?!
>
> > > Thanks.
>
> > > On Nov 18, 6:06 pm, Ricky <[EMAIL PROTECTED]> wrote:
>
> > > > Isn't this is how my URL should look?!
>
> > > >http://localhost:8080/map2.php?lat=17&long=80&radius=25
>
> > > > On Nov 18, 5:49 pm, Ricky <[EMAIL PROTECTED]> wrote:
>
> > > > > Hey Thanks for that link.. Am working on it, trying to get it to work
> > > > > with PostGreSQL..
> > > > > _real_escape_string part is showing an error? replaced mysql with
> > > > > pg.. guess there is more to it.
> > > > > Will try to figure out whats wrong..
>
> > > > > Ricky
>
> > > > > On Nov 17, 1:58 pm, mapperzUK <[EMAIL PROTECTED]> wrote:
>
> > > > > > You need to use a location and do a spatial search on your 1200
> > > > > > markers but restricting the search by a distance
>
> > > > > > seehttp://code.google.com/support/bin/answer.py?answer=87134&topic=11364...
>
> > > > > > quote:
> > > > > > "Here's the SQL statement that will find the closest 20 locations
> > > > > > that
> > > > > > are within a radius of 25 miles to the 37, -122 coordinate. It
> > > > > > calculates the distance based on the latitude/longitude of that row
> > > > > > and the target latitude/longitude, and then asks for only rows where
> > > > > > the distance value is less than 25, orders the whole query by
> > > > > > distance, and limits it to 20 results. To search by kilometers
> > > > > > instead
> > > > > > of miles, replace 3959 with 6371. "
>
> > > > > > This will make your map faster.
>
> > > > > > Mapperzhttp://mapperz.blogspot.com/
>
> > > > > > On Nov 17, 3:46 am, Ricky <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Was going through this
> > > > > > > link:http://code.google.com/apis/maps/documentation/overlays.html
>
> > > > > > > But how can I alter this code to incorporate the markers at
> > > > > > > different
> > > > > > > zoom levels?
> > > > > > > Do i have a new field which can have integer values. Assigning
> > > > > > > the
> > > > > > > same integer value to all which needs to be shown at a particular
> > > > > > > zoom
> > > > > > > level. Will that be the way to go about?!! Then use an If-else to
> > > > > > > load based on the integer value?
>
> > > > > > > **********************************
>
> > > > > > > function createMarker(point,html,icon) {
> > > > > > > var marker = new GMarker(point,icon);
> > > > > > > GEvent.addListener(marker, "click", function() {
> > > > > > > marker.openInfoWindowHtml(html);});
>
> > > > > > > return marker;
>
> > > > > > > };
>
> > > > > > > <?php
>
> > > > > > > $link = pg_connect("host=localhost port=5432 dbname=place user=abc
> > > > > > > password=xyz") or die("Could not connect: " . pg_error());
>
> > > > > > > $result = pg_query($link,"SELECT * FROM places");
> > > > > > > if (!$result)
> > > > > > > {
> > > > > > > echo "no results ";
>
> > > > > > > }
>
> > > > > > > while($row = pg_fetch_array($result))
> > > > > > > {
> > > > > > > echo "var point = new GLatLng(" . $row['lat'] . "," .
> > > > > > > $row['long'] .
> > > > > > > ");\n";
> > > > > > > echo "var marker = createMarker(point, '" . addslashes($row
> > > > > > > ['place_name']) . "',pin);\n";
> > > > > > > echo "map.addOverlay(marker);\n";
> > > > > > > echo "\n";
>
> > > > > > > }
>
> > > > > > > *************************
> > > > > > > What changes to be made here?! Also right now all the 1200+
> > > > > > > markers
> > > > > > > are loading at the same time. So its taking time to load them.
> > > > > > > Will
> > > > > > > need to scale this to 32000+ markers. So it has to be zoom levels
> > > > > > > which I should be working on I guess.
>
> > > > > > > Thanks in advance
> > > > > > > Ricky
>
> > > > > > > On Nov 13, 8:46 pm, Ricky <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > Thanks everyone.. Looked at the error log and finally
> > > > > > > > understood it
> > > > > > > > was cos the php_pgsql.dll was not present.. Downloaded it.. Made
> > > > > > > > changes on the php.ini file and yipee..!! It now works..
>
> > > > > > > > Also deleted this line--- pg_selectdb("places",$link) or die
> > > > > > > > ("Can\'t
> > > > > > > > use dbmapserver : " .pg_error());
>
> > > > > > > > Can go sleep in peace.. :)
>
> > > > > > > > On Nov 13, 5:59 pm, tunerGeek <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > You won't ever see PHP code (<?php) in your view source, only
> > > > > > > > > the HTML
> > > > > > > > > that PHP generates. That's one reason for require'ing /
> > > > > > > > > include'ing
> > > > > > > > > your db connection info... if PHP fails on your server, it
> > > > > > > > > cannot
> > > > > > > > > expand the connect info and thus not ever release that info
> > > > > > > > > to the
> > > > > > > > > public.
>
> > > > > > > > > For PHP errors, take a peek at your apache error log.
>
> > > > > > > > > On Nov 13, 5:07 am, Ricky <[EMAIL PROTECTED]> wrote:
> > > > > > > > > <snip>
>
> > > > > > > > > > So the code starting from "<?php " is not to be seen.
>
> > > > > > > > > > Some error there..!!
>
> > > > > > > > > > On Nov 13, 3:58 pm, Rossko <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > > > You might get a clue by doing a simple 'view source' on
> > > > > > > > > > > your blank
> > > > > > > > > > > page - what's really in there?
>
> > > > > > > > > > > cheers, Ross K
--~--~---------~--~----~------------~-------~--~----~
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=en
-~----------~----~----~----~------~----~------~--~---