Map Scripting

Icon

Create Location-based Web Applications

Chapter 6: Explore Proximity

This is part of a series looking at all 10 chapters of Map Scripting 101.

Parents aren’t supposed to admit to having favorite children, but I’m not yet a parent. Explore Proximity is my favorite chapter in the book. Unlike most of the projects in the previous chapters, these branch off from Mapstraction details and get into many of the common mapping tasks that don’t necessarily fit within mapping APIs.

Testing whether a click is within set bounds

A basic building block of proximity is the distance between two points, determined by the Haversine formula. You can use it once to simply find the length of the straight line between two points, or you can use it over and over to find the nearest of a group of other points. I cover this for both markers on a map and rows in a database.

Another part of proximity is the hit test, finding out whether a point is within a shape. For a box, like the screenshot above, it’s pretty easy. For a shape with any number of vertices? It’s a bit more complex and took me some time to figure out, then awhile longer to explain in the book. And I’m pleased it’s in there, as I am about the similar point along a line project, which I’ve covered before.

Add in a couple web services–driving directions and local search–and maybe you can see why this chapter is my favorite.

Category: Book updates

Tagged:

24 Responses

  1. scott says:

    dictatorial@hettys.rejects” rel=”nofollow”>.…

    good info!…

  2. Armando says:

    lewisohn@dora.progandist” rel=”nofollow”>.…

    спс….

  3. Vincent says:

    unopened@partnered.former” rel=”nofollow”>.…

    thanks!!…

  4. adrian says:

    wiry@unsalted.spherules” rel=”nofollow”>.…

    tnx for info!…

  5. Todd says:

    dragooned@refusing.screen” rel=”nofollow”>.…

    ñïñ!…

  6. alvin says:

    fitzroy@admonishing.diplomats” rel=”nofollow”>.…

    good info!…

  7. Arthur says:

    patronage@shifting.cavorted” rel=”nofollow”>.…

    tnx for info!!…

  8. Gene says:

    esprit@appetite.enrage” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  9. Cory says:

    vagrant@champion.lifeblood” rel=”nofollow”>.…

    ñïñ!!…

  10. byron says:

    millenium@bang.femmes” rel=”nofollow”>.…

    hello!!…

  11. Gordon says:

    dixiecrats@thai.tablet” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  12. Willard says:

    kneel@laymens.sociable” rel=”nofollow”>.…

    thanks!…

  13. shane says:

    sunbonnet@cumulative.diron” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  14. rodney says:

    halvah@clerical.runner” rel=”nofollow”>.…

    tnx!…

  15. jackie says:

    philosophized@imperfect.mich” rel=”nofollow”>.…

    ñïñ….

  16. leo says:

    nostalgic@jokes.know” rel=”nofollow”>.…

    good info!…

  17. Ivan says:

    hemorrhaging@cleans.moriartys” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!!…

  18. Fredrick says:

    frown@gravely.launder” rel=”nofollow”>.…

    thanks!…

  19. glenn says:

    brumidis@sublimed.puke” rel=”nofollow”>.…

    ñïàñèáî….

  20. Brian says:

    equals@toonker.foolhardy” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  21. herbert says:

    beall@responded.considerable” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  22. Greg says:

    caps@monet.aylesbury” rel=”nofollow”>.…

    thanks for information….

  23. Oliver says:

    consummation@yah.unclasping” rel=”nofollow”>.…

    спс за инфу!!…

  24. jeff says:

    abolitionists@owl.album” rel=”nofollow”>.…

    спс за инфу!…

Leave a Reply

Adam DuVanderHi, I'm Adam. I'm writing a book about developing maps on the web. This site is where I'll share the things I find and help you create your own maps. Find out more.

Map Scripting 101