matt-jensen / ember-cli-g-maps Goto Github PK
View Code? Open in Web Editor NEWDeprecated Google Maps Addon
Home Page: http://matt-jensen.github.io/ember-cli-g-maps
License: MIT License
Deprecated Google Maps Addon
Home Page: http://matt-jensen.github.io/ember-cli-g-maps
License: MIT License
The addon is working fine but it seems to be wrecking my acceptance tests.
not ok 43 PhantomJS 1.9 - TestLoader Failures: myproject/tests/acceptance/booking/edit/account-test: could not be loaded
---
actual: >
null
message: >
Died on test #1 at http://localhost:7357/assets/test-support.js:2934
at http://localhost:7357/assets/test-support.js:6640
at http://localhost:7357/assets/test-loader.js:31
at http://localhost:7357/assets/test-loader.js:21
at http://localhost:7357/assets/test-loader.js:40
at http://localhost:7357/assets/test-support.js:6647: Could not find module `ember-cli-app-version/initializer-factory` imported from `myproject/initializers/app-version`
Log: |
If I remove "ember-cli-g-maps": "0.3.2"
from my code the tests start working again.
routes
property on the componentHow to reproduce:
Observe in console:
Uncaught TypeError: Cannot read property 'location' of undefined
at r.<anonymous> (https://matt-jensen.github.io/ember-cli-g-maps/assets/vendor-8ace701c1f2eb849adbb40f30eb4afd8.js:19:1382)
...
The problem is in the setup()
function in g-autocomplete.js:
setup(input) {
const autocomplete = new google.maps.places.Autocomplete(input);
const handler = Ember.run.bind(this, function() {
const place = autocomplete.getPlace();
this.sendAction('on-select', {
lat: place.geometry.location.lat(),
lng: place.geometry.location.lng(),
place
});
});
This function is assuming that autocomplete.getPlace()
always returns a place that has a geometry. However, if the user doesn't select a place from the dropdown, the return value of getPlace()
contains only the "name" key with the content of the <input>
element.
I'm not 100% sure what is the right thing to do here.
One possibility is to not fire the on-select event unless a place has actually been chosen from the dropdown. Another would be to resubmit the content of the input field into the maps AutocompleteService
and use the first matching result, which is probably what the user intended.
create wrapper method for:
http://stackoverflow.com/questions/12173508/google-maps-v3-how-to-force-reloading-of-tiles
Consider for map instance only:
google.maps.event.trigger(map, 'resize');
In the controller, we have
zoom: Ember.computed('model.radius', {
get(key) {
let radius = this.get('model.radius');
return Math.round(14-Math.log(radius)/Math.LN2);
},
set(key, value) {
}
}),
We should follow the DDAU pattern.
Hi,
Is a search box possible in this addon?
https://developers.google.com/maps/documentation/javascript/examples/places-searchbox
If not, how would I implement this myself (maybe even in the addon)?
Ensure that new gMap service method enhancements are shipped with this release.
Is there way way to put a marker at a specific address? If not can support for this be added?
The gMap service, as it stands, is complication of concerns that creates unneeded overhead which was originally designed for the use case of responding to a google map loaded
event.
This use case is easily satisfied within the Ember convention of data down, action up by providing a loaded action on the component which will send the respective action with:
new Promise(function(resolve) {
google.maps.event.addListenerOnce(googleMapInstance, 'idle', resolve);
});
This removes the unnecessary overhead and provides user with a means to respond once the Google Map has finished loading.
No one wants an Addon that requires bower dependencies and GMaps manages map children, which just isn't disco. Goals are to remove gmaps-for-apps.js
and manage Google Map children as regular components.
bower.json
gMap service to wrap GMaps travelRoute
method: https://hpneo.github.io/gmaps/documentation.html#GMaps-travelRoute
Should support accepting:
A) two [lat,lng] coordinates
b) and/or two geocodes
Hi,
I am not sure if this module supports Ember 2.7.0 but it seems that Ember.String.singularize was removed in this version.
I get an error _ember.default.String.singularize is not a function
when I include g-maps.
Check for gMaps support.
If not supported, implement on g-maps component.
Add Documentation.
Add Example on g-maps component property page.
Hi,
Is it possible to add multiple dynamically generated markers to a Google Map.
Like this (in ember-g-map addon):
{{#each markers as |marker|}}
{{g-map-marker context lat=hotspot.lat lng=hotspot.lng }}
{{/each}}
The problem with the ember-g-map addon is that the markers aren't draggable.
One event with a map child object and a second event with a jQuery event. Commit should ensure selections events are not prone to bug as well.
gMap service should provide an addListenerOnce method to listen for map load/registered event by map name.
For Example:
this.get('gMap').addListenerOnce('my-map-loaded', function() {
console.log('yay');
});
this.get('gMap').addListenerOnce('my-map-registered', function() {
console.log('boo boo boo');
});
This functionality should prevent the need for wrapping map event promises in callbacks of afterRender
.
I defined an action for the event "zoom_changed", in that action, I get a "gMapEvent" back, but how do I get the new zoom level from the gMapEvent?
I don't want to fetch google maps before it is needed. I can see in the source code that there is lazyLoad configuration options but the code is commented out. What's the status of lazy load functionality? Is this already working or if not then how can I help you in progressing with that?
g-maps.js:85 Uncaught TypeError: Cannot read property 'length' of undefined
events
is undefined
The "Place Autocomplete" demo says:
place is a MarkerPlace
I believe this should be:
place is a PlaceResult
Source line may be here
i want to pop up a modal (by toggle boolean property on controller) when double click marker, how to access controller's action by double clicking marker?
config/environment.js
heatmapMakers
Hey I started getting this error recently and can't figure out why it is happening.
app.js:13 Error while processing route: index Cannot read property 'geocode' of undefined TypeError: Cannot read property 'geocode' of undefined
at GMaps.geocode (http://localhost:4200/assets/vendor.js:74185:16)
at http://localhost:4200/assets/vendor.js:135874:25
at Object.initializePromise (http://localhost:4200/assets/vendor.js:67799:7)
at new Promise (http://localhost:4200/assets/vendor.js:69651:21)
at Class.geocode (http://localhost:4200/assets/vendor.js:135859:14)
at Class._geocode (http://localhost:4200/assets/app.js:7340:35)
at Class._lookup (http://localhost:4200/assets/app.js:7331:19)
at Class._lookupCoords (http://localhost:4200/assets/app.js:7325:19)
at tryCatch (http://localhost:4200/assets/vendor.js:67749:14)
at invokeCallback (http://localhost:4200/assets/vendor.js:67764:15)
Has anyone seen anything like this?
Hello, I'm trying to insert my map inside a modal but it doesn't appear.
I tried setting a var after x seconds when Modal is generated in view but it doesn't appear.
what i need to do?
thanks :)
Hi Matt,
Why not contribute on single project https://github.com/asennikov/ember-g-map, since ember-g-map is supporting ember fastboot and other industry people (yahoo developer: https://github.com/asennikov/ember-g-map/commits/master?author=mike-north) are contributing to the same code base ?
Thanks.
I'm trying to force the map to use English as interface language, but this option is not inserted in the script tag.
ENV.googleMap = {
version: '3', // not recommended
protocol: '//', // default
lazyLoad: false, // default
language: 'en', // optional
region: 'JA' // optional
}
Language and region settings doesn't seem to affect the script tag in any way
/autocomplete/index
Place Autocomplete Example:
https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete
Uncomment actions and ensure that each action unit test receives a separate mixin instance.
I have a problem how can I auto-center the markers on the map?
Hi,
I just installed g-maps and used it in my hbs file:
{{g-maps lat=50 lng=5 zoom=12}}
This gives me some errors:
Uncaught TypeError: _.ef is not a function stats.js:5
Uncaught TypeError: _.oa is not a function util.js:32
Uncaught TypeError: _.oa is not a function common.js:208
Uncaught TypeError: this.S.removeAt is not a function stats.js:7
Uncaught TypeError: Cannot read property 'j' of undefined util.js:20
Uncaught TypeError: Cannot read property 'type' of undefined common.js:34
I have set the contentSecurityPolicy, I have set the API key and the css height.
https://developers.google.com/maps/documentation/javascript/geocoding?hl=en
Allow support for placeID if possible.
gmaps.geocode already supports reverse geocoding
gMap service should provide a method that accept a list of map children, of any type, and return a suggested latLng
and zoom
for readjusting the map.
For Example:
this.get('gMap').suggestMapFrame({
markers: [],
polygons: [],
// ect..
});
Maybe able to leverage:
https://hpneo.github.io/gmaps/documentation.html#GMaps-fitLatLngBounds
config/environment.js
Identify the people + projects that made this possible:
ember-google-map
gmaps
countless others who shared their frustrations and solutions regarding google maps.
https://developers.google.com/maps/documentation/javascript/geocoding?hl=en
Allow support for placeID if possible.
gmaps.geocode already supports reverse geocoding
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.