WHERE ITS AT WHERE ITS AT Martin Anderson-Clutz Digital Echidna - - PowerPoint PPT Presentation

where it s at where it s at
SMART_READER_LITE
LIVE PREVIEW

WHERE ITS AT WHERE ITS AT Martin Anderson-Clutz Digital Echidna - - PowerPoint PPT Presentation

Location and Mapping in Drupal: WHERE ITS AT WHERE ITS AT Martin Anderson-Clutz Digital Echidna What This Presentation IS A primer on mapping and location for websites A comparative look at Drupal solutions An outgrowth of my


slide-1
SLIDE 1

WHERE IT’S AT WHERE IT’S AT

Location and Mapping in Drupal:

Martin Anderson-Clutz Digital Echidna

slide-2
SLIDE 2

What This Presentation IS

  • A primer on mapping and location for websites
  • A comparative look at Drupal solutions
  • An outgrowth of my personal experience in in

building a location and mapping site

– YMMV

  • A work in progress

– Feedback is welcome!

slide-3
SLIDE 3

What it IS NOT

  • Detailed, step-by-step instructions
  • An exhaustive look at every option

available

– Chime in if you have a favourite that isn’t mentioned!

slide-4
SLIDE 4

CONTEXT CONTEXT

slide-5
SLIDE 5

Use Cases

  • Static Map – “Our Locations”
  • Dynamic Map – “Users Logged In”
  • Relative Locations – “Retailers < 10km”
slide-6
SLIDE 6

Core Concepts

  • Mapping

– Visualizing location data, often with known landmarks for reference

  • Geocoding

– Enriching the description of a location with geographic coordinates

  • Description: “103 King St., London, ON”
  • Coordinates: 42.981860, -81.251414
slide-7
SLIDE 7

OPTIONS OPTIONS

Let’s look at some

slide-8
SLIDE 8

Mapping Options

  • Google, OpenStreetMaps, Leaflet, Bing,

Yahoo, MapQuest, etc.

  • Considerations:

– Customizability – License restrictions

  • Limits
  • Use in paid and/or private sites
  • Offline use
slide-9
SLIDE 9

Geocoding Options

  • Google, OpenStreetMaps, Bing, Yahoo,

MapQuest, etc.

  • Considerations:

– Limits – Speed – Uptime – Able to store results

slide-10
SLIDE 10

API Limits

slide-11
SLIDE 11

Drupal Options

  • Raw embed
  • Simple Google Maps
  • Location Map
  • Location
  • Geolocation Field
  • Get Locations
  • GeoField
slide-12
SLIDE 12

Raw Embed

  • Put location into Google Maps (or other

map site with embed function)

  • Copy and paste embed code into

Drupal (body text, block, bean, etc.)

  • Ensure text format applied allows

necessary tags

slide-13
SLIDE 13

Raw Embed

  • PRO

– Simple setup – No API key required

  • CON

– Update requires redo on external site – Allowing editor update may require allowing broader access on rest of site – Doesn’t scale

slide-14
SLIDE 14

Simple Google Maps

  • 100% reliant on Google
  • No geocoding, output is effectively a

single-result Google Maps search

  • Update the input text to update the

address

slide-15
SLIDE 15

Simple Google Maps

  • PRO

– Simple to implement – Simple to update – No API key required

  • CON

– No option to manually tweak location or map – Potential for bad (even erroneous) input – Only show one location

slide-16
SLIDE 16

Location Map

  • Similar to Simple Google Maps – relies
  • n Google, map for one node
  • Allows for fine tuning of location
slide-17
SLIDE 17

Location Map

  • PRO

– Simple to implement – Simple to update – No API key required – Option to manually tweak location or map

  • CON

– Only show one location

slide-18
SLIDE 18

Location, GMap

  • Location provides an API, storage, and

geocoding

– Submodules provide additional data points and integrations

  • Gmap module provides maps

– May be possible to use Get Locations Map instead

slide-19
SLIDE 19

Location, GMap

  • PRO

– Proximity search is baked in – Views integration

  • CON

– Limited options for geocoding and mapping – Was late to game with D7, no releases yet for D8 – Fatal error in Location geocoding config. Raised two years ago, no resolution – Non-standard way of managing attachment to content types

slide-20
SLIDE 20

Geolocation Field

  • Provides a field designed to be a simple

method for storing coordinates and related data

  • Options for geocoding, proximity, HTML5

input and maps by Google

  • Stable D8 release already available, as a

complete rewrite

slide-21
SLIDE 21

Geolocation Field

  • PRO

– Powerful – Simple setup – Use with all fieldable entities – Sweet HTML5/Google Places input – D8 ready-ish

  • CON

– Current integrations tied to Google – Map input doesn’t allow for storage and display of address

slide-22
SLIDE 22

Example Interface

slide-23
SLIDE 23

Example Config

slide-24
SLIDE 24

Get Locations

  • By default builds a map per node and per content type
  • Options to use different libraries to cluster, different markers,

etc.

  • Google Maps API v3, Leaflet, others for mapping, geocoding

via Google or OpenStreetMaps

  • Can be used in conjunction with Views, Geofield, Addressfield,

Geolocation, Location, Getdirections, Smart IP, Openlayers, Colourbox, more

  • Get Locations Fields does a Google Places search on place

name and will populate address

  • Current D8 stance is leaving the work of porting to others
slide-25
SLIDE 25

Get Locations

  • PRO

– Views support – Very active development – Loads of options for input, display – Populates address information

  • CON

– No D8 releases yet – Works best with locations already in Google

slide-26
SLIDE 26

Budweiser Gardens

slide-27
SLIDE 27

Bud Gardens Interface

slide-28
SLIDE 28

Budweiser Gardens

slide-29
SLIDE 29

GetLocations Config

slide-30
SLIDE 30

GetLocations Config

slide-31
SLIDE 31

GetLocations Config

slide-32
SLIDE 32

GetLocations Config

slide-33
SLIDE 33

GeoField

  • Perhaps the most talked about D8 location

solution

  • By itself is a container for coordinate data

– Addressfield and Geocoder to interpret from natural language

  • Multiple mapping solutions

– Openlayers is an amazing but complex toolkit

  • Proximity search including Solr
slide-34
SLIDE 34

GeoField

  • PRO

– Ability to customize virtually any part of the location handling and mapping – Seems to be the solution with the most momentum

  • CON

– You’re about to find out how deep the rabbit hole goes – Some challenges in using different pieces to assemble a solution – No documentation yet for recommended version of OpenLayers (7.x-3.0-beta3)

slide-35
SLIDE 35

Lehigh University

slide-36
SLIDE 36

Lehigh University

slide-37
SLIDE 37

Lehigh University

slide-38
SLIDE 38

Lehigh University

slide-39
SLIDE 39

Lehigh University

  • https://memories.lehigh.edu/locations/

159

slide-40
SLIDE 40

Example Interface

slide-41
SLIDE 41

Example Interface

slide-42
SLIDE 42

Addressfield Config

slide-43
SLIDE 43

GeoField, OpenLayers

slide-44
SLIDE 44

OpenLayers: Map Settings

slide-45
SLIDE 45

OpenLayers: Map Settings

slide-46
SLIDE 46

OpenLayers: Layers, Sources

slide-47
SLIDE 47

OpenLayers: Controls

slide-48
SLIDE 48

OpenLayers: Interactions

slide-49
SLIDE 49

OpenLayers: Components

slide-50
SLIDE 50

Drupal 8

  • Geolocation – stable
  • GetLocations – asked for assistance
  • Geofield – alpha
  • Addressfield – replaced by Address (beta)
  • Geocoder – beta
  • Leaflet – beta
  • OpenLayers – to start after 7.x-3.x branch stable
slide-51
SLIDE 51

PIECING THEM PIECING THEM TOGETHER TOGETHER

slide-52
SLIDE 52

Location Tools

Simple Google Map Simple Google Map Location Map Location Map Geolocation Geolocation Field Field Location Location Get Locations Get Locations GeoField GeoField D7 7.x-1.2 7.x-2.3 7.x-1.6 7.x-3.7 7.x-1.17 7.x-2.3 Released 2014-Jan-03 2014-May-24 2014-Nov-03 2015-Aug-04 2015-Oct-08 2014-Sep-21 D7 Users 26,954 13,355 12,394 47,755 9,099 39328 D8 8.x-1.x-dev 8.x-2.x-dev 8.x-1.4 n/a n/a 8.x-1.0-alpha1 Released 2015-Oct-11 2013-Sep-30 2014-Oct-12 2014-Oct-28 D8 Users 20 36 14 Dependencies Modules GMap Module (for map) Libraries Addressfield Libraries Services Google Google Google Views integration N Y Y Y Y Proximity N N Y Y Y Y Documentatio n N N N Y Y Y Submodules

Location, User Locations, Phone and Location Fax, Location Search, Location CCK, Location Generate, Location Add Another, Location Entity, Search API Location Taxonomy, Location Email Getlocations Search, Getlocations Block, Getlocations Location Taxonomize, Getlocations Map, Getlocations Leaflet, Getlocations Tools, Getlocations GPS Compatible Modules: Addressfield, OpenLayers, Static Map, Leafle, Leaflet Widget, Geocoder, Geocoder AutoComplete, Address Field, Sync PostGIS, Openlayers Apachesolr, Openlayers CCK Migrate, RSS Field Formatters, Views GeoJSON, Search API Location, Spatial Tools, Geofield PostGIS, Geofield Proximity Plugin

slide-53
SLIDE 53

Mapping Tools

Simple Google Simple Google Map Map Location Map Location MapGeolocation Geolocation Field Field GMap GMap Get Locations Get Locations Leaflet Leaflet OpenLayers OpenLayers D7 7.x-1.2 7.x-2.3 7.x-1.6 7.x-2.10 7.x-1.17 7.x-1.3 7.x-3.0-beta3 Released 2014-Jan-03 2014-May-24 2014-Nov-03 2015-Sep-08 2015-Oct-08 2015-Oct-09 2015-Jun-25 D7 Users 26,006 13,477 12027 41,299 9,099 9.839 13,383 D8 n/a 8.x-2.x-dev 8.x-1.4 (2015- Oct-14) n/a n/a 8.x-1.x-dev n/a Released 2013-Sep-30 D8 Users 4 Dependencies Modules Libraries Geofield, Libraries, cTools and Entity Libraries Leaflet Services Google Google Google Views integration Y Y Proximity Y Y Documentatio n N Y Submodules

GMap Location, GMap Taxonomy, GMap Macro Builde Getlocations Search, Getlocations Block, Getlocations Location Taxonomize, Getlocations Map, Getlocations Leaflet, Getlocations Tools, Getlocations GPS OpenLayers UI, OpenLayers Views, OpenLayers Geofield, OpenLayers Examples, OpenLayers Bloc, OpenLayers Contextual Links, OpenLayers Services

slide-54
SLIDE 54

ROCK IT ROCK IT

Time to

slide-55
SLIDE 55

Resources

  • http://socialcompare.com/en/comparison/sites-internet-de-cartographie
  • http://www.programmableweb.com/news/top-10-mapping-apis-google-maps-microsoft-bing-maps-and-

mapquest/analysis/2015/02/23

  • http://www.programmableweb.com/news/7-free-geocoding-apis-google-bing-yahoo-and-mapquest/

2012/06/21

  • http://stackoverflow.com/questions/2958714/storable-geocoding-reverse-geocoding-services?rq=1
  • http://geocoder-php.org/
  • http://gis.harvard.edu/services/blog/geocoding-best-practices
  • http://www.gisgraphy.com/compare/
  • https://geoservices.tamu.edu/Services/Geocode/OtherGeocoders/
  • https://www.drupal.org/node/1704948
  • https://events.drupal.org/losangeles2015/sessions/location-location-location-mapping-drupal
slide-56
SLIDE 56

QUESTIONS? QUESTIONS?

Martin Anderson-Clutz @mandclu martin@echidna.ca