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