ember-google-map
ember-google-map copied to clipboard
Cannot read property 'lat' of undefined
Hi! I found an issue similar to mine that was closed, reporting the same error: Uncaught TypeError: Cannot read property 'lat' of undefined
on helpers.js:197
: return helpers.makeObj(latKey || 'lat', val.lat(), lngKey || 'lng', val.lng());
. But I confirmed I was doing all the appropriate things and it still doesn't seem to work.
I'm running Ember v1.13.4
and Ember Data v1.13.5
.
Template:
{{google-map markers=model markerController='map/service-marker'}}
Note: I also tried model.content
and the error isn't thrown but no pins are placed.
Route:
...
model: function() {
return Ember.A([
{name: "Home", latitude: 14.766127, longitude: 102.810987, body: "Here is B&H's home"},
{name: "Shop", latitude: 14.762963, longitude: 102.812285, body: "Here is B&H's shop", isInfoWindowVisible: true},
{name: "Hay's", latitude: 14.762900, longitude: 102.812018, body: "Here is Hay's shop"}
]);
}
...
controllers/map/service-marker.js
...
lat: Ember.computed.alias('latitude'),
lng: Ember.computed.alias('longitude')
...
I also tried setting the aliases directly on the models to no avail. I have to use this for a project due in a day, if anyone can assist I'd really appreciate it.