Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

google is not defined #101

Open
MichalNemec opened this issue Feb 27, 2018 · 3 comments
Open

google is not defined #101

MichalNemec opened this issue Feb 27, 2018 · 3 comments

Comments

@MichalNemec
Copy link

Hello, via composer installed this package.

When i copy paste "service" below in readme i get Uncaught ReferenceError: google is not defined.

Even when i have in view on top this:
use dosamigos\google\maps\MapAsset;
MapAsset::register($this);

@tonydspaniard
Copy link
Member

google is not defined on the javascript console? If that is the case, make is an issue with the registration of the assets not the extension library itself.

How do you render the file? Where is actually located the registration of the assets? At the top of what? The Layout? The partial view? The more info0rmation your provide the better. Thanks.

@paskuale75
Copy link

In the case of renderAjax, only the first call the console says that google is not defined, from the second call on instead it works...

@paskuale75
Copy link

I think solved it, adding your asset to the main asset as a dependency.

class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'css/site.css',
        'css/custom.css',
        'https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css',
        'https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback'

    ];
    public $js = [
        'js/jquery.mask.js',
    ];
    public $depends = [
        'dosamigos\google\maps\MapAsset'
    ];
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants