GeoPoint

Geolocation coordinates field, works by pasting a Google Maps URL

Copy
      "location" : {
  "type" : "GeoPoint",
  "fieldset" : "Shop location"
}
    

Reference

type

string

GeoPoint

fieldset

string

user-friendly field label

Proximity search:

Copy
      var latitude = 48.8768767,
    longitude = 2.3338802,
    distance = 10 //km;

api.query([
  prismic.Predicates.at("document.type", "store"),
  prismic.Predicates.near("my.store.location", latitude, longitude, distance)
], { pageSize : 10 }).then(function(documents) {
  res.render('index', {
    prismicdocs: documents.results
  })
});
    
Copy
      $latitude = 48.8768767;
$longitude = 2.3338802;
$distance = 10; // km
$response = $api
    ->query(
        Predicates::at("document.type", "store"),
        Predicates::near("my.store.location", latitude, longitude, distance))
    ->submit();
    
Copy
      Double latitude = 48.8768767;
Double longitude = 2.3338802;
Integer distance = 10; // km
Response response = api
    ->query(Predicates.near("my.store.location", latitude, longitude, distance))
    ->submit();
    

GeoPoint fields cannot be used as ordering, but results to a Predicate.near query will be ordered by proximity.

Copy
      p My location: 
          != prismicdoc.getGeoPoint("store.location").latitude + ', ' + prismicdoc.getGeoPoint("store.location").longitude
    
Copy
      <?php $location = $prismicdoc->getGeoPoint("store.location") ?>
<p>
  My location:
  <?= $location.getLatitude() ?>, <?= $location.getLongitude() ?>
</p>
    
Copy
      <c:set var="location" value="${prismicdoc.getGeoPoint("store.location")}"/>
<p>
  My location:
  ${location.getLatitude()}, ${location.getLongitude()}
</p>