Giter Site home page Giter Site logo

google-maps-addon's People

Contributors

ember-tomster avatar erkie avatar samvelraja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

google-maps-addon's Issues

Include google maps SDK from addon

Currently the user has to inject the google maps SDK manually before using this addon. It would be great if it could be handled by the addon. In my project I'm using the following helper that I borrowed from some other ember google maps addon:

import Ember from 'ember';

const API_KEY = 'xxxxxxxxtheapikeyxxxxxx';
const LIBRARIES = ['drawing'];

var promise;

/**
 * Loads the google map SDK
 *
 * @return {Ember.RSVP.Promise}
 */
export function loadGoogleMaps(resolveWith) {
  if (window.google && window.google.maps) {
    return Ember.RSVP.resolve(resolveWith);
  }

  if (promise) {
    return promise;
  }

  var src = `https://maps.googleapis.com/maps/api/js?key=${API_KEY}&libraries=${LIBRARIES.join(",")}`;

  return promise = new Ember.RSVP.Promise(function (resolve, reject) {
    window.__emberGoogleMapLoaded__ = Ember.run.bind(function () {
      promise = null;
      window.__emberGoogleMapLoaded__ = null;
      resolve(resolveWith);
    });

    Ember.$.getScript(src + '&callback=__emberGoogleMapLoaded__').fail(function (jqXhr) {
      promise = null;
      window.__emberGoogleMapLoaded__ = null;
      reject(jqXhr);
    });
  });
}

export default Ember.Helper.helper(loadGoogleMaps);

Become owner

Hi,

I would love to help out with this repo and addon. What do you think about making me an owner/contributor as well so we can iterate quickly?

Polygon support

Adding polygons the same way we add circles, rectangles and infowindows seems like a no brainer. If I get some time today I might make a PR for it.

Adding `mapOptions` has observable creates problem in callback hooks

Since the mapOptions is an observable property, when we use the addon in an component, this forces us to create the mapOptions object has mutable object to handle the CB function, therefore, any changes happened in the component property itself creates the mapOptions to update.

say,
converting the mapMessage from mousemove to

mouseout triggers back the the component to re-render

DEMO

Must find a fix ASAP.

One thought is to move-out the CB properties out of mapOptions and providing them as seperate options.

Goal, should not revert back the observer since it is a good enhancement.

@erkie your thoughts are welcome.

Addon improvement and glitches

  • zoom must be handled, padding string in zoom throwing error
  • Toggler for Zoom contol and scale control in map
  • Default map view

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.