Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infowindows not opening #59

Closed
fran-worley opened this issue Apr 30, 2019 · 2 comments
Closed

infowindows not opening #59

fran-worley opened this issue Apr 30, 2019 · 2 comments

Comments

@fran-worley
Copy link

Describe the bug

Firstly, thank you so much for building such a lovely api wrapper for google maps, the move from ember-cli-g-maps has removed so much code!!

Apologies if I'm missing something basic but I can't seem to get my infowindows to open. I know that the open attribute is being set correctly but for some reason the windows themselves aren't showing.

To Reproduce

// controller.js
actions: {
  onMapLoad(publicApi) {
    set(this, 'gmapApi', publicApi);
    // this is then used to manually set the bounds of the map once the site 
    // markers are loaded which is why I don't set a lat and lng for the map initially
  }
}
// template.hbs
  {{#g-map 
    disableDefaultUI=true 
    zoomControl=true
    onLoad=(action "onMapLoaded") 
  as |g|}}    
    {{#each sites as |site|}}
      {{#g.marker 
        lat=site.address.latitude
        lng=site.address.longitude
        onClick=(action (toggle "mapInfoWindowOpen" site))
      as |marker|}}
        {{marker.infoWindow isOpen=site.mapInfoWindowOpen content="test"}}
      {{/g.marker}}
    {{/each}}
  {{/g-map}}

Attempted solutions

I've tried following you instructions here for creating one infowindow and changing the target but I get the same result.


Addon configuration and device details

  • ember version: 3.9.0

Addon configuration:

  • Addon version: 2.1.1

  • Addon config from environment.js (do not post your API key):

  ENV['ember-google-maps'] = {
    key: process.env.GOOGLE_MAPS_API_KEY, // Using .env files in this example
    language: 'en',
    region: 'GB',
    protocol: 'https',
    version: '3.35',
    libraries: ['drawing'], // Optional libraries
    // client: undefined,
    // channel: undefined,
    // baseUrl: '//maps.googleapis.com/maps/api/js'
  };
  • Addon config from ember-cli-build.js:
    'ember-google-maps': {
      only: ['marker', 'info-window']
    }
  • Google Maps version: 3.35

Desktop:

  • OS: osx 10.14.3

  • Browser: chrome

  • Version: 73.0.3683.86

@sandydoo
Copy link
Owner

sandydoo commented Apr 30, 2019

Hey, @fran-worley.
It's probably the component whitelist only: ['marker', 'info-window']. This feature broke at some point (#49) , never had tests, and can be quite fiddly to configure.
I'll cut that bit out from the docs until it's fixed. Sorry for the trouble! I realize how frustrating these issues can be 😞

@fran-worley
Copy link
Author

@sandydoo as simple as that!! removed the build config and my info windows started to work!

@sandydoo sandydoo mentioned this issue May 13, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants