tag:blogger.com,1999:blog-6162085167223928155.post7158590828762898787..comments2017-08-20T13:42:48.497+02:00Comments on ErieStuff: Google Maps: Point In PolygonUnknownnoreply@blogger.comBlogger8125tag:blogger.com,1999:blog-6162085167223928155.post-793820651218930812009-09-02T17:02:32.869+02:002009-09-02T17:02:32.869+02:00Jason,
I would check out the link from Matt Willi...Jason, <br />I would check out the link from Matt Williamson comment: http://dawsdesign.com/drupal/google_maps_point_in_polygon<br /><br />This code extends the google maps api with a point-in-polygon algorithm. Pull the polygon coords from the database, plot them on your map, plot the customer coord on the map (I asume you know how to do this, it is not within the scope of this blogpost. If not, search the Google Api help pages for plotting polygons on a map). Use the point-in-polygon function like so:<br /><br />var boolIsInside = polygon.containsLatLng(point);<br />(where polygon is of the GMap polygon class and point is of the GMap point class).<br /><br />The point-in-polygon algorithm is performed client-side. If your polygon is to complex for clientside computation, or you need the result of the test in php, you could use de php-version that I provide in this blogpost to do the point-in-polygon test server-side.<br /><br />The php algorithm is not really ready-to-use, you will need to rewrite it to fit your own needs.Eriehttps://www.blogger.com/profile/04527619262477956478noreply@blogger.comtag:blogger.com,1999:blog-6162085167223928155.post-18000485232362152972009-09-02T16:04:57.301+02:002009-09-02T16:04:57.301+02:00Erie,
Im looking for a solution in php. Here is ...Erie,<br /><br />Im looking for a solution in php. Here is my problem. Im using php and mysql. I need to be able to pull polygon coordinates from a mysql db and have them plotted on a map. I also need to pull a customer location(long/lat) from the db and plot it on the same map and then have the api return true or fales if the point is within the polygon. Any suggestions? Can your code be modified in order to achieve this?Unknownhttps://www.blogger.com/profile/06992299388489337812noreply@blogger.comtag:blogger.com,1999:blog-6162085167223928155.post-28998918386183223722009-08-31T09:49:33.647+02:002009-08-31T09:49:33.647+02:00Jason, I don't understand your question, can y...Jason, I don't understand your question, can you elaborate?Eriehttps://www.blogger.com/profile/04527619262477956478noreply@blogger.comtag:blogger.com,1999:blog-6162085167223928155.post-77994457951984687762009-08-31T00:47:01.293+02:002009-08-31T00:47:01.293+02:00I am wanting to pull the polygon points from a db ...I am wanting to pull the polygon points from a db and all pull the single point from a db and have it return on the map. Any suggestions? php mysqlUnknownhttps://www.blogger.com/profile/06992299388489337812noreply@blogger.comtag:blogger.com,1999:blog-6162085167223928155.post-62443682825461998232009-02-12T20:32:00.000+01:002009-02-12T20:32:00.000+01:00I've implemented a JS google maps extension to tes...I've implemented a JS google maps extension to test if a point is in a polygon. It can be found at http://dawsdesign.com/drupal/google_maps_point_in_polygonMatt Williamsonhttps://www.blogger.com/profile/17935063827932240235noreply@blogger.comtag:blogger.com,1999:blog-6162085167223928155.post-76505876073842305642008-03-26T00:24:00.000+01:002008-03-26T00:24:00.000+01:00Very cool!I had someone ask me if this could be do...Very cool!<BR/><BR/>I had someone ask me if this could be done and I didn't have an answer for them at the time. If we use it, I'll let you know.<BR/><BR/>Regards,<BR/>BenBhttps://www.blogger.com/profile/14313067100038584279noreply@blogger.comtag:blogger.com,1999:blog-6162085167223928155.post-10671103613338598852008-03-17T22:13:00.000+01:002008-03-17T22:13:00.000+01:00UPDATE: 2008-03-17- restructured PHP,HTML and CSS-...UPDATE: 2008-03-17<BR/>- restructured PHP,HTML and CSS<BR/>- KML handling now through class<BR/>- Upload of KML file from harddriveEriehttps://www.blogger.com/profile/04527619262477956478noreply@blogger.comtag:blogger.com,1999:blog-6162085167223928155.post-73466879846929977532008-03-04T10:07:00.000+01:002008-03-04T10:07:00.000+01:00Update:Minor editorial changes to the text.Update:<BR/>Minor editorial changes to the text.Eriehttps://www.blogger.com/profile/04527619262477956478noreply@blogger.com