You are here

function _openlayers_cck_generate_pair in Openlayers 6

Same name and namespace in other branches
  1. 6.2 modules/openlayers_cck/includes/openlayers_cck.generate.inc \_openlayers_cck_generate_pair()

Generate Random Lat and Lon

Return value

A space separated longitude and latitiude

1 call to _openlayers_cck_generate_pair()
openlayers_cck_content_generate in modules/openlayers_cck/openlayers_cck.module
Implementation of hook_content_generate().

File

modules/openlayers_cck/openlayers_cck.module, line 834
This file holds the main Drupal hook functions and private functions for the openlayers_cck module.

Code

function _openlayers_cck_generate_pair() {
  $lat = (double) ((mt_rand(0, 120000) - 60000) / 1000);
  $lon = (double) ((mt_rand(0, 360000) - 180000) / 1000);
  return (string) $lon . ' ' . (string) $lat;
}