Giter VIP home page Giter VIP logo

Comments (10)

huafu avatar huafu commented on August 17, 2024

Please be sure to understand ember router and controllers. You are not providing any model for your controller and the properties to be used in your controller are defined in your route. Look at the example on GitHub pages and read ember guides they are very good to understand the routing/controllers/etc hierarchy of emberjs ;-)

from ember-google-map.

shopapps avatar shopapps commented on August 17, 2024

ok thanks, It's true I am very new to ember-cli and have just finished working through the ember-cli-101 guide. But I still couldn't get your module to work, so am building my own component. In the meantime please be aware I am not the only one seeing this issue: http://stackoverflow.com/questions/28024785/ember-google-map-in-ember-cli-markerviewclass-must-be-a-subclass-error

all the best,

Paul.

from ember-google-map.

huafu avatar huafu commented on August 17, 2024

There wasn't undefmeansing in my message, I'll be happy to help if I can but first your route need to return a model then you template needs to use this model correctly with the component. The link you provided might be old I am on my mobile and I might miss the date. There was some error on the first versions.

Now if you still have the sme problem after you fixed your controller route and template, please feel free to comment back here ;-)

The model hook of your route should return whatever you need to use with the map, then in te template you have to use the right properties from your model to link them to the map items you want to render. Also the zoom and other stuff have to be defined on your controller if you want to use tem in the template tather than the default options.

Hope that helps :-)

from ember-google-map.

huafu avatar huafu commented on August 17, 2024

And I hope you get my mobile typing mistakes hehe

from ember-google-map.

shopapps avatar shopapps commented on August 17, 2024

hehe.

the date on that link was about 15 days ago i think, but looking at it it seems you have posted against it so perhaps whoever it is will give you further info in their case.

In my case the controller for that particular pod extends a base controller (in that pod) and the model is actually collected from Ember DS in the parent route.js not the controller.js ( i didn't realise model definition had to be in a controller i thought it could be in either). The reason it is in a parent is that i have different routes to the same data e.g. /site/12345/show /site/12345/edit /site/12345/delete etc and i only wanted the map to show during the /site/12345/edit route..

i thought I was following your README explanation on getting it going but evidently I am just misunderstanding something when trying to implement this in an ember-cli app rather than just an ember.js app

anyway.., it's a bit academic now as I am building my own component to match what i needed, I was just trying to check if there was either a bug or some additional documentation required when using with ember-cli.

Regards,

Paul.

from ember-google-map.

huafu avatar huafu commented on August 17, 2024

So you should have your router like this:

Router.map(function() {
  //...
  this.route('site', {path: ':site_id'}, function() {
    this.route('show');
    this.route('edit');
    this.route('delete');
  })
});

then you do no need to generate any route, thanks to Ember Data, the site route will load the site model with id :site_id and will set it on the controller. If a route does not have a model it'll use the model of its parent route by default. So the site.show, site.edit and site.delete controllers will have the same model as the site controller ;-)

from ember-google-map.

huafu avatar huafu commented on August 17, 2024

Ok there is actually this issue if you are using EmberJS < 1.9, please upgrade to 1.9 using Handlebars 2.0 (see Ember website on how to upgrade).

cf: https://github.com/huafu/ember-google-map#updating

from ember-google-map.

shopapps avatar shopapps commented on August 17, 2024

Hi,

Thanks for the tip, It’s good to know little tricks like that.

Regards,

Paul

From: Huafu Gandon [mailto:[email protected]]
Sent: 04 February 2015 19:26
To: huafu/ember-google-map
Cc: Paul
Subject: Re: [ember-google-map] markerViewClass must be a subclass or an instance of Ember.View (#16)

So you should have your router like this:

Router.map(function() {
//...
this.route('site', {path: ':site_id'}, function() {
this.route('show');
this.route('edit');
this.route('delete');
})
});

then you do no need to generate any route, thanks to Ember Data, the site route will load the site model with id :site_id and will set it on the controller. If a route does not have a model it'll use the model of its parent route by default. So the site.show, site.edit and site.delete controllers will have the same model as the site controller ;-)


Reply to this email directly or view it on GitHub #16 (comment) . https://github.com/notifications/beacon/AIZiEHq0Wy8e3NnbROk4Rvpb0BC9oHa4ks5nomnjgaJpZM4Da6nr.gif

from ember-google-map.

shopapps avatar shopapps commented on August 17, 2024

That would explain a lot.

Ember-cli is currently at ver 0.1.12 which contains:

DEBUG: -------------------------------

DEBUG: Ember : 1.8.1

DEBUG: Ember Data : 1.0.0-beta.12

DEBUG: Handlebars : 1.3.0

DEBUG: jQuery : 1.11.2

DEBUG: -------------------------------

My understanding is that they are working towards a new release that supports the new ember and handlebars. For now though will have to wait for that…

Thanks for the help.

Paul.

Paul Robbins | Director

DDI: +44(0) 0118 384 2197 / 08000 124 406
Mob: +44 (0) 79 30 40 38 40
Skype: skype:appthing?call appthing
Email: [email protected]

ShopApps ltd. Foss Cottage, Soke Road, Silchester, Reading, RG7 2NS.

From: Huafu Gandon [mailto:[email protected]]
Sent: 04 February 2015 22:56
To: huafu/ember-google-map
Cc: Paul
Subject: Re: [ember-google-map] markerViewClass must be a subclass or an instance of Ember.View (#16)

Ok there is actually this issue if you are using EmberJS < 1.9, please upgrade to 1.9 using Handlebars 2.0 (see Ember website on how to upgrade).


Reply to this email directly or view it on GitHub #16 (comment) . https://github.com/notifications/beacon/AIZiEBWLbQ4XTTpLC76mFSQD6HtQT7c2ks5nopr5gaJpZM4Da6nr.gif

from ember-google-map.

huafu avatar huafu commented on August 17, 2024

You don't have to wait for it, just go in the README of my plugin, on the top of the file there are two links, one is about a section with a link to a ember help page where it explain the 2 or 3 commands you have to run to upgrade your version of ember and handlebars, all supported by ember-cli. Those versions you see are just the ones installed by default when you create a new ember app.

Huafu Gandon

On 5 févr. 2015, at 16:12, Paul [email protected] wrote:

That would explain a lot.

Ember-cli is currently at ver 0.1.12 which contains:

DEBUG: -------------------------------

DEBUG: Ember : 1.8.1

DEBUG: Ember Data : 1.0.0-beta.12

DEBUG: Handlebars : 1.3.0

DEBUG: jQuery : 1.11.2

DEBUG: -------------------------------

My understanding is that they are working towards a new release that supports the new ember and handlebars. For now though will have to wait for that…

Thanks for the help.

Paul.

Paul Robbins | Director

DDI: +44(0) 0118 384 2197 / 08000 124 406
Mob: +44 (0) 79 30 40 38 40
Skype: skype:appthing?call appthing
Email: [email protected]

ShopApps ltd. Foss Cottage, Soke Road, Silchester, Reading, RG7 2NS.

From: Huafu Gandon [mailto:[email protected]]
Sent: 04 February 2015 22:56
To: huafu/ember-google-map
Cc: Paul
Subject: Re: [ember-google-map] markerViewClass must be a subclass or an instance of Ember.View (#16)

Ok there is actually this issue if you are using EmberJS < 1.9, please upgrade to 1.9 using Handlebars 2.0 (see Ember website on how to upgrade).


Reply to this email directly or view it on GitHub #16 (comment) . https://github.com/notifications/beacon/AIZiEBWLbQ4XTTpLC76mFSQD6HtQT7c2ks5nopr5gaJpZM4Da6nr.gif


Reply to this email directly or view it on GitHub.

from ember-google-map.

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.