google code and github are normally not meant for hosting js files for the direct usage

so these (and possibly other lines) should be in the modules' js directory (because google code and github also have sometimes problems with the uptime, not often but they have them too):

define('IP_GEOLOC_GEO_JS', 'https://geo-location-javascript.googlecode.com/svn/trunk/js/geo.js');
define('IP_GEOLOC_JQUERY_BLOCK_UI', 'http://malsup.github.com/jquery.blockUI.js');

these lines are in the file ip_geoloc_api.inc

Comments

rdeboer’s picture

I would agree, but neither of these are used anymore in 7.x-1.23 ...

dancor’s picture

uh, are you sure?

function ip_geoloc_output_map_current_location($div_id = 'ip-geoloc-map-current-location',
    $map_options = NULL, $map_style = NULL, $latitude = NULL, $longitude = NULL) {
  $js_options = array('group' => JS_LIBRARY);
  drupal_add_js(IP_GEOLOC_GEO_JS, $js_options);
  drupal_add_js(IP_GEOLOC_GOOGLE_MAPS_GPS, $js_options);
rdeboer’s picture

Hmm... ok, maybe the first one is... I haven't used the Google interface for a while.... need to double-check....
Thanks for pointing it out.
Rik

cmonnow’s picture

UPDATE: I found the answer. There was a comment elsewhere that the necessity of geo.js is on its way out and slows things down.

Hi Rik,

Out of interest, I was wondering if geo.js was intentionally eliminated from loading in ip_geoloc_current_location.js. Firstly, the geo.js doesn't appear to be loaded by default on every page load so the lines:

        if (typeof(geo_position_js) != 'object') {
          data['error'] = Drupal.t('IPGV&M: device does not support W3C API and the unified geo_position_js device API is not loaded.');

will always be true should navigator.geolocation not be supported by the device.

Secondly, even if geo.js was manually loaded, the lines:

   if (geo_position_js.init()) {
      data['error'] = Drupal.t('IPGV&M cannot accurately determine visitor location. Browser does not support getCurrentPosition(): @browser', { '@browser': navigator.userAgent });

would also always be true (should everything load normally).

I was wondering if any of this was intentional and if so, was it due to bugs or unnecessary overhead for outdated devices etc.

Cheers

rdeboer’s picture

Assigned: Unassigned » rdeboer
Issue summary: View changes
Status: Active » Closed (fixed)

All references to geo_position_js and includes for geo.js have been intentionally removed in 7.x-1.x-dev, soon to become 7.x-1.25