Angular-google-maps: Can't seem to map systemjs to point to core.umd.js

Created on 3 Sep 2016  路  14Comments  路  Source: SebastianM/angular-google-maps

Using angular2 and jspm I can't seem to point to the new google maps main file: core.umd.js (systemjs keep on trying to load core.js instead of core.umd.js)

if I manually copy core.umd.js > core.js all is well... (but that's not a solution of course).

my setup is:

map: {
        "angular2-google-maps": "npm:[email protected]/core",


packages: {
        "StudioDashboard": {
            "main": "StudioDashboard.js"
        },
        "angular2-google-maps": {
            "defaultExtension": "js"
        },

for the complete config see: https://github.com/born2net/studioDashboard/blob/master/jspm.config.js

any suggestions are appreciated,

regards

Sean

discussion / question

Most helpful comment

@born2net i used import {SebmGoogleMap} from 'angular2-google-maps/core/directives';
or import {AgmCoreModule} from 'angular2-google-maps/core/core-module';

Mapping:
'angular2-google-maps': 'node_modules/[email protected]',

All 14 comments

@born2net What's missing is the main setting:

https://github.com/SebastianM/angular2-google-maps/blob/master/CHANGELOG.md#0110-red-motherboard-2016-06-12

Try to add "main": "index.js":

"angular2-google-maps": {
  "defaultExtension": "js",
  "main": "index.js"
}

and remove the /core in your map setting.

thanks, yes that was the first thing I tried but getting still:

 packages: {
        "StudioDashboard": {
            "main": "StudioDashboard.js"
        },
        "angular2-google-maps": {
            "defaultExtension": "js",
            "main": "index.js"
        },

and still

GET http://localhost:9089/jspm_packages/npm/[email protected]/core/core.js 404 (Not Found)

so I tried also removing the /core in map settings and error becomes

GET http://localhost:9089/jspm_packages/npm/[email protected]/core.js 404 (Not Found)

nothing I am doing seems to be able to bring it to point to core/core.umd :/

regards

sorry, try this:

"angular2-google-maps/core": {
  "defaultExtension": "js",
  "main": "index.js"
}

same :(
tried:

"angular2-google-maps/core": {
  "defaultExtension": "js",
  "main": "index.js"
}

and both:

  map: {
        "@angular/platform-browser": "npm:@angular/[email protected]",
        "@angular/platform-browser-dynamic": "npm:@angular/[email protected]",
        "@angular/forms": "npm:@angular/[email protected]",
        "angular2-google-maps": "npm:[email protected]",

as well as

  map: {
        "@angular/platform-browser": "npm:@angular/[email protected]",
        "@angular/platform-browser-dynamic": "npm:@angular/[email protected]",
        "@angular/forms": "npm:@angular/[email protected]",
        "angular2-google-maps": "npm:[email protected]/core",

GET http://localhost:9089/jspm_packages/npm/[email protected]/core.js 404 (Not Found)

it seems to not be picking up the packages { options...

@born2net updated the plunker: http://plnkr.co/edit/YX7W20?p=preview

I close this issue now, as there is no bug. Feel free to reopen.

I ended up fixing by doing:

    map: {
        "core-js": "npm:[email protected]",
        "gulp-util": "npm:[email protected]",
        "twbs/bootstrap": "github:twbs/[email protected]",
        "@angular/http": "npm:@angular/[email protected]/bundles/http.umd",
        "@angular/router": "npm:@angular/[email protected]",
        "angular-router": "npm:@angular/[email protected]",
        "angular2-google-maps": "npm:[email protected]"
    }

and

import {SebmGoogleMap} from "angular2-google-maps/core/core.umd.js";

Angular 2 Kitchen sink: http://ng2.javascriptninja.io
and source@ https://github.com/born2net/ng2Boilerplate
Regards,

Sean

It may be a good idea to add this to the getting started guide for people who don't want to use the Angular CLI.

agreed!

@born2net i used import {SebmGoogleMap} from 'angular2-google-maps/core/directives';
or import {AgmCoreModule} from 'angular2-google-maps/core/core-module';

Mapping:
'angular2-google-maps': 'node_modules/[email protected]',

Thanks guys, it works.

For me (also not using ng-cli) it ended up working with
// in my map.module.ts
import { AgmCoreModule } from 'angular2-google-maps/core/core-module';

// in sytemjs.config.js

 map: {      
      app: 'app',        
      'rxjs':                      'npm:rxjs',
      'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
      'angular2-google-maps': 'npm:angular2-google-maps'    
    },    
    packages: {
      app: {
        main: './main.js',
        defaultExtension: 'js'
      },
      rxjs: {
        defaultExtension: 'js'
      },
      "angular2-google-maps/core": {    
        "defaultExtension": "js",
        "main": "index.js"
      }
    }

Thank you @codeconcept for writing down what you did :)

How would be the new import on 1.0 beta?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexweber picture alexweber  路  4Comments

ostapch picture ostapch  路  4Comments

marcelinobadin picture marcelinobadin  路  3Comments

dineshkumar20 picture dineshkumar20  路  3Comments

DeveloperAdd007 picture DeveloperAdd007  路  3Comments