Ox.Map elements need new too
This commit is contained in:
parent
cb7a7b0f5d
commit
523764c632
4 changed files with 11 additions and 11 deletions
|
@ -393,7 +393,7 @@ Ox.Map = function(options, self) {
|
|||
northeast = new google.maps.LatLngBounds(
|
||||
center, bounds.getNorthEast()
|
||||
).getCenter(),
|
||||
place = Ox.MapPlace({
|
||||
place = new Ox.MapPlace({
|
||||
alternativeNames: [],
|
||||
countryCode: '',
|
||||
editable: true,
|
||||
|
@ -609,12 +609,12 @@ Ox.Map = function(options, self) {
|
|||
i == length - 1 ||
|
||||
canContain(bounds, result.geometry.bounds || result.geometry.viewport)
|
||||
) {
|
||||
callback(Ox.MapPlace(parseGeodata(results[i])));
|
||||
callback(new Ox.MapPlace(parseGeodata(results[i])));
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback(Ox.MapPlace(parseGeodata(results[0])));
|
||||
callback(new Ox.MapPlace(parseGeodata(results[0])));
|
||||
}
|
||||
}
|
||||
if (
|
||||
|
@ -637,7 +637,7 @@ Ox.Map = function(options, self) {
|
|||
address: name
|
||||
}, function(results, status) {
|
||||
if (status == google.maps.GeocoderStatus.OK) {
|
||||
callback(Ox.MapPlace(parseGeodata(results[0])));
|
||||
callback(new Ox.MapPlace(parseGeodata(results[0])));
|
||||
}
|
||||
if (
|
||||
status == google.maps.GeocoderStatus.OK ||
|
||||
|
@ -719,7 +719,7 @@ Ox.Map = function(options, self) {
|
|||
self.places = [];
|
||||
if (!self.isAsync) {
|
||||
self.options.places.forEach(function(place, i) {
|
||||
self.places[i] = Ox.MapPlace(Ox.extend({
|
||||
self.places[i] = new Ox.MapPlace(Ox.extend({
|
||||
map: that
|
||||
}, place));
|
||||
});
|
||||
|
@ -806,7 +806,7 @@ Ox.Map = function(options, self) {
|
|||
var place = getPlaceById(item.id);
|
||||
if (!place) {
|
||||
self.places.push(
|
||||
Ox.MapPlace(Ox.extend({
|
||||
new Ox.MapPlace(Ox.extend({
|
||||
map: that
|
||||
}, item)).add()
|
||||
);
|
||||
|
@ -1023,7 +1023,7 @@ Ox.Map = function(options, self) {
|
|||
]
|
||||
}
|
||||
}, function(results) {
|
||||
place = Ox.MapPlace(Ox.extend({
|
||||
place = new Ox.MapPlace(Ox.extend({
|
||||
map: that
|
||||
}, results.data.items[0])).add();
|
||||
self.places.push(place);
|
||||
|
|
|
@ -63,7 +63,7 @@ Ox.MapMarker = function(options) {
|
|||
bounds = bounds.union(that.place.bounds);
|
||||
southWest = bounds.getSouthWest();
|
||||
northEast = bounds.getNorthEast();
|
||||
that.map.newPlace(Ox.MapPlace({
|
||||
that.map.newPlace(new Ox.MapPlace({
|
||||
// fixme: duplicated, see Ox.Map.js
|
||||
alternativeNames: [],
|
||||
countryCode: '',
|
||||
|
|
|
@ -72,13 +72,13 @@ Ox.MapPlace = function(options) {
|
|||
{lat: that.north, lng: that.east}
|
||||
);
|
||||
if (!that.marker) {
|
||||
that.marker = Ox.MapMarker({
|
||||
that.marker = new Ox.MapMarker({
|
||||
color: that.markerColor,
|
||||
map: that.map,
|
||||
place: that,
|
||||
size: that.markerSize
|
||||
});
|
||||
that.rectangle = Ox.MapRectangle({
|
||||
that.rectangle = new Ox.MapRectangle({
|
||||
map: that.map,
|
||||
place: that
|
||||
});
|
||||
|
|
|
@ -34,7 +34,7 @@ Ox.MapRectangle = function(options, self) {
|
|||
markers <a> array of markers
|
||||
@*/
|
||||
that.markers = Ox.map(that.place.points, function(point, position) {
|
||||
return Ox.MapRectangleMarker({
|
||||
return new Ox.MapRectangleMarker({
|
||||
map: that.map,
|
||||
place: that.place,
|
||||
position: position
|
||||
|
|
Loading…
Reference in a new issue