title: SCRIPT438: Object doesn't support property or method 'addObject'
body: <p>I have the following piece of code to add locations to map (Here API Maps). But at <code>map.addObject(group);</code>, an error is encountered, <code>SCRIPT438: Object doesn't support property or method 'addObject'</code>. I have searched many other solutions but none of them worked for me. This works perfectly in Mozilla Firefox, but does not work in IE 11. What could be the issue? </p>
  
  <p><code>locations</code> is an array containing the suggested locations from Here Maps Api only.</p>
  
  <p><code>dvList</code> is an array to plot points in the map.</p>
  
  <pre><code>function addLocationsToMap(locations) {
  $vehPoints = '';
  $dvListLength = 0;
  var icon = '';
  if (locations.length &gt; 0) {
      var group = new H.map.Group();
      var position, i;
      var icon = new H.map.Icon('/Images/Icons/destination1.png');
      // Add a marker for each location found
      for (i = 0; i &lt; locations.length; i += 1) {
          position = {
              lat: locations[i].location.displayPosition.latitude,
              lng: locations[i].location.displayPosition.longitude
          };
          marker = new H.map.Marker(position, { icon: icon });
          marker.label = locations[i].location.address.label;
          group.addObject(marker);
      }
      marker.addEventListener('tap', function (evt) {
          openBubble(evt.target.getPosition(), evt.target.label);
      }, false);
  
      if ($dvList == null)
          $dvListLength = 0;
      else
          $dvListLength = $dvList.length;
      // Add the locations group to the map
      for (var c = 0; c &lt; $dvListLength; c++) {
          $lat = $dvList[c].LATITUDE;
          $long = $dvList[c].LONGITUDE;
          if ($lat != "" &amp;&amp; $long != "" &amp;&amp; $lat != undefined &amp;&amp; $long != undefined &amp;&amp; $lat != null &amp;&amp; $long != null) {
              var radlat1 = Math.PI * parseFloat(position.lat) / 180;
              var radlat2 = Math.PI * parseFloat($lat) / 180;
              var radlon1 = Math.PI * parseFloat(position.lng) / 180;
              var radlon2 = Math.PI * parseFloat($long) / 180;
              var theta = parseFloat(position.lng) - parseFloat($long);
              var radtheta = Math.PI * theta / 180;
              distance = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);
              distance = Math.acos(distance);
              distance = distance * 180 / Math.PI;
              distance = distance * 60 * 1.1515;
              distance = parseInt(distance * 1.609344);
  
              if (distance &lt;= 100) {
                  if ($('#radDriver').prop("checked")) {
                      icon = new H.map.Icon($dvList[c].DVICON);
                  }
                  else {
                      icon = new H.map.Icon($dvList[c].VEHICON);
                  }
                  var marker1 = new H.map.Marker({ lat: parseFloat($lat), lng: parseFloat($long) }, { icon: icon });
                  marker1.setData($dvList[c].TOOLTIP);
                  group.addObject(marker1);
                  marker1.addEventListener('tap', function (evt) {
                      openBubble(evt.target.getPosition(), evt.target.getData());
                  }, false);
                  //$vehPoints = $vehPoints + $dvList[c].VEHICLEID + ',';
              }
          }
      }
      //end of for loop
          map.addObject(group);
          map.setViewBounds(group.getBounds());
  }
  else {
      alert('Address not found');
      return false;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Any help would be appreciated :)</p>