Git Product home page Git Product logo

Comments (9)

sebholstein avatar sebholstein commented on May 16, 2024

@sphaso you are missing two things (when looking at your code):

  1. In the providers, you include ANGULAR2_GOOGLE_MAPS_DIRECTIVES but it must be ANGULAR2_GOOGLE_MAPS_PROVIDERS.
  2. You have to include the directives ANGULAR2_GOOGLE_MAPS_DIRECTIVES in a directives array
@Page({
  templateUrl: 'build/pages/mappa/mappa.html',
  style: '.sebm-google-map-container {         height: 300px;       }',
  directives: [ANGULAR2_GOOGLE_MAPS_DIRECTIVES],
  providers: [
    ANGULAR2_GOOGLE_MAPS_PROVIDERS
  ]
})

from angular-google-maps.

sphaso avatar sphaso commented on May 16, 2024

Thank you!
Now I get an error when loading the page: "No Directive annotation found on SebmGoogleMap". Any idea?

from angular-google-maps.

sebholstein avatar sebholstein commented on May 16, 2024

Try to update the versions for the following packages in your package.json file:

"dependencies": {
    "angular2": "^2.0.0-beta.2",
    "angular2-google-maps": "^0.6.1"
}

Then run npm install in the terminal and restart your app.

from angular-google-maps.

sphaso avatar sphaso commented on May 16, 2024

I was already using those versions. Anything else I can do to help?

from angular-google-maps.

sebholstein avatar sebholstein commented on May 16, 2024

@sphaso played with Ionic and angular2-google-maps a few days ago. Uploaded my working app here, so you can diff with your code: https://github.com/SebastianM/MyIonic2Project

For running this project:
npm install
ionic serve

from angular-google-maps.

sebholstein avatar sebholstein commented on May 16, 2024

The angular2-google-maps related code is here: https://github.com/SebastianM/MyIonic2Project/blob/master/app/pages/hello-ionic/hello-ionic.ts

Closing this for now, feel free to reopen if you find any bugs/issues working with ionic.

from angular-google-maps.

mildful avatar mildful commented on May 16, 2024

Hi.

I've reopened this issue because I have the exact same problem. I'm working with Ionic 2 (2.0.0-beta.6) and Angular 2 (2.0.0-beta.15).

I have the latest version of angular2-google-maps.

I'm using this package as specified in the documentation & comments.

Here is my code :

import {Page} from 'ionic-angular';
import {ANGULAR2_GOOGLE_MAPS_DIRECTIVES, SebmGoogleMap} from 'angular2-google-maps/core';

@Page({
    directives: [ANGULAR2_GOOGLE_MAPS_DIRECTIVES, SebmGoogleMap],
    template: `
        <sebm-google-map [latitude]="lat" [longitude]="lng"></sebm-google-map>
    `,
    styles: [`
        .sebm-google-map-container {
          height: 300px;
        }
    `]
})
export class MapPage {
    lat: number = -34;
    lng: number = 138;

    constructor() {}
}

And the error:
Uncaught (in promise): No Directive annotation found on SebmGoogleMap

I'm currently investigating, I'll update this comment if I found anything.

from angular-google-maps.

sebholstein avatar sebholstein commented on May 16, 2024

Hi @mildful,

the latest angular2-google-maps version (0.10.0) supports angular2-rc.1 only - the current docs/getting started guide is out of date (sorry, update of the docs coming soon).

from angular-google-maps.

meskatjahan avatar meskatjahan commented on May 16, 2024
import {ANGULAR2_GOOGLE_MAPS_DIRECTIVES} from 'angular2-google-maps/core';

is now

{GOOGLE_MAPS_PROVIDERS} from 'angular2-google-maps/core';

from angular-google-maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.