Geolocation in Drupal

  • 6,157 views
Uploaded on

Maps and geolocation are becoming more and more important to the sites we build as the scope of our smallest projects become regional, national and global. Does your next project need to list store …

Maps and geolocation are becoming more and more important to the sites we build as the scope of our smallest projects become regional, national and global. Does your next project need to list store locations that sell a product world wide? Do you need to limit content for certain country descriptions? While these thoughts might be scary at first I promise it isn't voodoo and at the end of the talk you will know how to do all of these things.

In this session I will walk you through Drupal common ways to:

- Add maps to your site
- Create locations on your maps (with and without views)
- Locate your users in realtime
- Search for locations within a distance
- Use mobile devices for geolocation

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
6,157
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
58
Comments
0
Likes
4

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Geolocation in Drupal (nodes & users) By Andrew M. Riley Mediacurrent Consultant @andrewmriley
  • 2. Goal
    • Introduce users to basic mapping concepts, OpenLayers configuration in Drupal and Geocoding users based off of IP address or device location.
    • Disclaimer: Getting fancy may require some type of programming knowledge.
  • 3. Mapping in General  
  • 4.  
    • GIS
    • A geographic information system, geographical information science, or geospatial information studies is a system designed to capture, store, manipulate, analyze, manage, and present all types of geographically referenced data. In the simplest terms, GIS is the merging of cartography, statistical analysis, and database technology.
    • Source: http://en.wikipedia.org/wiki/GIS
  • 5.  
    • Geolocation
    • Geolocation is the identification of the real-world geographic location of an object, such as a cell phone or an Internet-connected computer terminal. Geolocation may refer to the practice of assessing the location, or to the actual assessed location.
    • Source: http://en.wikipedia.org/wiki/Geolocation
  • 6.  
    • Geocoding
    • Geocoding is the process of finding associated geographic coordinates (often expressed as latitude and longitude) from other geographic data, such as street addresses, or zip codes (postal codes). With geographic coordinates the features can be mapped and entered into Geographic Information Systems
    • Source: http://en.wikipedia.org/wiki/Geocoding
  • 7. Recap
    • GIS  - System for mapping points and interacting with points.
    • Geolocation  - Real world location of an object represented as coordinates. Could be the action of looking up or the stored values.
    • Geocoding - The action of looking up coordinates to map real world objects.
  • 8. Creating a map  
  • 9. The GMap Way
    • Location Module + GMap
  • 10. The OpenLayers Way
    • OpenLayers
    • +
    • Geocode
    • +
    • Geofield
  • 11. OpenLayers (map display)
      • Manages information about the maps (not points)
      • Displays Maps
      • Integrates with views
  • 12. Geofield (storage)
      • Creates a new field type
      • Flexible Output
      • Ties in with Geocode module
      • Can display a map for users to select a location
  • 13. Geocode (lookup)
      • Converts addresses into lat/long
      • Uses the Geofield field type for storage
      • Pulls information from other fields
      • Can use different geocoding engines
      • Good user experience
      • Geocoding can be wonky outside of the U.S.
  • 14. OpenLayers Proximity
      • ***There is currently no D7 version***
      • Lets users search by distance
      • Uses view as its interface
  • 15. Locating your users  
  • 16. Why?
      • Hide/Change options depending on which country the user is in
      • Redirect the user to a different version of the site
      • Better user identification
      • Better user experience
  • 17. How?
      • Find out the users IP Address
      • Lookup the IP Address somehow and find out the location data.
      • ???
      • Profit
  • 18. Three Questions
      • Will I be using this on mobile?
      • How much money do I want to spend?
      • Can I process the data at a later date? (and how much data)
  • 19. Google Loader
    • Pros:
      • Free
      • Returns more than just Lat & Long
      • Unlimited Queries
      • 2-4-1 Loading of JQuery
    • Cons:
      • Not always reliable
      • Requires an external source
      • Mobile & International results unreliable
  • 20. HTML5 Geolocation
    • Pros:
      • Works great on mobile
      • Uses GPS if possible
      • Free
    • Cons:
      • Browser support is unreliable*
      • Asks the user if you can use their location
      • Only returns Lat & Long
  • 21. Pay Databases & Services
    • Pros:
      • Can be internal or external
      • Doesn't ask the user to use their location
    • Cons:
      • Can cost a lot of money
      • Could have limited number of queries
      • Might have the wrong location for mobile
      • International data varies on levels below country
  • 22. Which one to use?
    • The right tool for the job + a backup method
    • or
    • Use the Smart IP module w/ Device Geolocation
    • ($_SESSION['smart_ip']['location'])
  • 23. Modules
    • OpenLayers
    • http://drupal.org/project/openlayers
    • Geocode
    • https://github.com/fillerwriter/geocode
    • Geofield
    • http://drupal.org/project/geofield
    • Smart IP
    • http://drupal.org/project/smart_ip
    • Device Geolocation
    • http://drupal.org/project/device_geolocation
  • 24. Pay IP Services
    • MaxMind
    • http://www.maxmind.com
    • IP2Location
    • http://www.ip2location.com
    • IPInfoDB
    • http://ipinfodb.com/register.php
  • 25. More Info
    • OpenLayers (D6) Presentation by Patrick Hayes
    • (Far more technical than my talk)
    • http://yadadrop.com/drupal-video/gis-mapping-drupal-openlayers-geo
    • OpenLayers (D7) Docs
    • http://drupal.org/node/595872
    • OpenLayers (JS Library)
    • http://openlayers.org/
  • 26. Geolocation in Drupal (nodes & users) By Andrew M. Riley Mediacurrent Consultant @andrewmriley http://j.mp/rrpq2R