How to add google maps js without breaking jquery? So, I'm trying to implement a custom map using the Google Maps API in addition to a Google Map view. I'm working with an up-to-date D7 install. The reason for this is that I need to have multiple layers of content types, which isn't possible with the default views user interface. The view needs to show multiple entity types as individual layers, which I hope to implement as GeoJSON data layers from GeoJSON views through a custom map implementation.

The problem is my current approach is breaking my existing GMAP views and is interfering with jquery functionality. 

I get a series of 'jquery is undefined' errors, as well as broken UI functionality, leading me to believe something is making variables collide. 

I am approaching this by creating a block in a custom module and adding the markup and JS necessary through the module like so. 

add js files $path = drupal_get_path('module', 'gmap_json');  
drupal_add_js($path. '/gmap_json.js', 'file');

function gmap_json_block_info() {
    $blocks = array();  
    $blocks['hello_world'] = array(
      'info' =&gt; t('Hello world'),
    );  
    return $blocks;
  }  

  function gmap_json_block_view($delta = '') {
    $block = array();  
    if ($delta == 'hello_world') {
      $block['subject'] = t('Hello world');
      $block['content'] = t('This is the block content.');
      $block['content'] .= '&lt;div id="json-map"&gt;&lt;/div&gt;';
    }  
    return $block;
  }


And my map js is here

function initMap() {
    map = new google.maps.Map(document.getElementById('json-map'), {
      zoom: 4,
      center: {lat: -28, lng: 137}
    });


    map.data.loadGeoJson(
        'https://storage.googleapis.com/mapsdevsite/json/google.json');
  }


The problem seem to be with how I'm adding my scripts, since leaving the drupal_add_js statement out of the module is what triggers the error.

So, how am I messing up in adding the js to the page? What's the right way to do this?
So, in this case the answer comes from one of the comments. I wasn't properly using the drupal_add_js call, which shouldn't be called globally. So I moved it into the function in my little module to side step this, but the better way to approach this is using the render arrays and the #attached property of the block's content array. This approach let's you more granularly choose which js is placed and called.