Search code examples
vue.jshere-api

HereMaps Vue: trying to add behavior but H.mapevents is undefined


I am trying just a basic map with zoom behavior. The Map itself works but I cannot add a behavior:

In my mounted for the map I am doing this:

let map = new H.Map(
        this.$refs.map,
        this.platform.createDefaultLayers().normal.map,
        {
          zoom: 10,
          center: {
            lng: pos.coords.longitude,
            lat: pos.coords.latitude
          }
        }
      );

      var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map));

      this.map = map;

At var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map));

I get an Uncaught TypeError: Cannot read property 'Behavior' of undefined When I Debug it the H Object does not have the mapevents object in it. Am I missing something?


Solution

  • Have you included/imported 'here-js-api/scripts/mapsjs-mapevents' ?
    Or how do you include/import here-js?