Tabnine Logo For Javascript
GeoPoint
Code IndexAdd Tabnine to your IDE (free)

How to use
GeoPoint
function
in
parse

Best JavaScript code snippets using parse.GeoPoint(Showing top 7 results out of 315)

origin: parse-community/parse-server

it('matches $nearSphere queries', function() {
  let q = new Parse.Query('Checkin');
  q.near('location', new Parse.GeoPoint(20, 20));
  // With no max distance, any GeoPoint is 'near'
  const pt = {
   id: new Id('Checkin', 'C1'),
   location: new Parse.GeoPoint(40, 40),
  };
  const ptUndefined = {
   id: new Id('Checkin', 'C1'),
  };
  const ptNull = {
   id: new Id('Checkin', 'C1'),
   location: null,
  };
  expect(matchesQuery(pt, q)).toBe(true);
  expect(matchesQuery(ptUndefined, q)).toBe(false);
  expect(matchesQuery(ptNull, q)).toBe(false);

  q = new Parse.Query('Checkin');
  pt.location = new Parse.GeoPoint(40, 40);
  q.withinRadians('location', new Parse.GeoPoint(30, 30), 0.3);
  expect(matchesQuery(pt, q)).toBe(true);

  q.withinRadians('location', new Parse.GeoPoint(30, 30), 0.2);
  expect(matchesQuery(pt, q)).toBe(false);
 });
origin: parse-community/parse-server

const obj1 = new GeoObject({ value: 1, location: new Parse.GeoPoint(1, 1), date: new Date(1) });
const obj2 = new GeoObject({ value: 2, location: new Parse.GeoPoint(2, 1), date: new Date(2) });
const obj3 = new GeoObject({ value: 3, location: new Parse.GeoPoint(3, 1), date: new Date(3) });
await Parse.Object.saveAll([obj1, obj2, obj3]);
origin: parse-community/parse-server

it('does not change inner objects if the key has the same name as a geopoint field on the class, and the value is an array of length 2, or if the key has the same name as a file field on the class, and the value is a string', done => {
  const file = new Parse.File('myfile.txt', { base64: 'eAo=' });
  file
   .save()
   .then(f => {
    const obj = new Parse.Object('O');
    obj.set('fileField', f);
    obj.set('geoField', new Parse.GeoPoint(0, 0));
    obj.set('innerObj', {
     fileField: 'data',
     geoField: [1, 2],
    });
    return obj.save();
   })
   .then(object => object.fetch())
   .then(object => {
    expect(object.get('innerObj')).toEqual({
     fileField: 'data',
     geoField: [1, 2],
    });
    done();
   })
   .catch(e => {
    jfail(e);
    done();
   });
 });
origin: parse-community/parse-server

it('withJSON supports geoWithin.centerSphere', (done) => {
  const inbound = new Parse.GeoPoint(1.5, 1.5);
  const onbound = new Parse.GeoPoint(10, 10);
  const outbound = new Parse.GeoPoint(20, 20);
  const obj1 = new Parse.Object('TestObject', { location: inbound });
  const obj2 = new Parse.Object('TestObject', { location: onbound });
  const obj3 = new Parse.Object('TestObject', { location: outbound });
  const center = new Parse.GeoPoint(0, 0);
  const distanceInKilometers = 1569 + 1; // 1569km is the approximate distance between {0, 0} and {10, 10}.
  Parse.Object.saveAll([obj1, obj2, obj3])
origin: parse-community/parse-server

it('matches $within queries', function() {
  const caltrainStation = {
   id: new Id('Checkin', 'C1'),
   location: new Parse.GeoPoint(37.776346, -122.394218),
   name: 'Caltrain',
  };
   location: new Parse.GeoPoint(37.325635, -121.945753),
   name: 'Santa Clara',
  };
   new Parse.GeoPoint(37.708813, -122.526398),
   new Parse.GeoPoint(37.822802, -122.373962)
  );
   new Parse.GeoPoint(37.822802, -122.373962),
   new Parse.GeoPoint(37.708813, -122.526398)
  );
   new Parse.GeoPoint(37.708813, -122.373962),
   new Parse.GeoPoint(37.822802, -122.526398)
  );
origin: parse-community/parse-server

const obj1 = new GeoObject({ value: 1, location: new Parse.GeoPoint(1, 1), date: new Date(1) });
const obj2 = new GeoObject({ value: 2, location: new Parse.GeoPoint(2, 1), date: new Date(2) });
const obj3 = new GeoObject({ value: 3, location: new Parse.GeoPoint(3, 1), date: new Date(3) });
await Parse.Object.saveAll([obj1, obj2, obj3]);
origin: parse-community/parse-server

const obj1 = new GeoObject({ value: 1, location: new Parse.GeoPoint(1, 1), date: new Date(1) });
const obj2 = new GeoObject({ value: 2, location: new Parse.GeoPoint(2, 1), date: new Date(2) });
const obj3 = new GeoObject({ value: 3, location: new Parse.GeoPoint(3, 1), date: new Date(3) });
await Parse.Object.saveAll([obj1, obj2, obj3]);
parse(npm)GeoPoint

Most used parse functions

  • Cloud
  • Config
  • User
  • ACL
  • ACL.ACL
  • ACL.setPublicReadAccess,
  • ACL.setPublicWriteAccess,
  • ACL.setReadAccess,
  • ACL.setRoleReadAccess,
  • ACL.setRoleWriteAccess,
  • ACL.setWriteAccess,
  • Analytics,
  • Error,
  • FacebookUtils,
  • File,
  • File.File,
  • File._name,
  • File._url,
  • File.addMetadata

Popular in JavaScript

  • minimist
    parse argument options
  • moment
    Parse, validate, manipulate, and display dates
  • express
    Fast, unopinionated, minimalist web framework
  • request
    Simplified HTTP request client.
  • async
    Higher-order functions and common patterns for asynchronous code
  • commander
    the complete solution for node.js command-line programs
  • winston
    A logger for just about everything.
  • colors
    get colors in your node.js console
  • js-yaml
    YAML 1.2 parser and serializer
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now