forked from 0x2620/oxjs
migrate to maplibre-gl for maps
This commit is contained in:
parent
f3b8025e8e
commit
8cebad9fb4
7 changed files with 605 additions and 234 deletions
|
|
@ -44,21 +44,24 @@ Ox.MapPlace = function(options) {
|
|||
update();
|
||||
|
||||
function update(updateMarker) {
|
||||
if (that.east < 0 && that.west > 0) {
|
||||
that.east += 360;
|
||||
}
|
||||
that.points = {
|
||||
ne: new google.maps.LatLng(that.north, that.east),
|
||||
sw: new google.maps.LatLng(that.south, that.west)
|
||||
ne: new maplibregl.LngLat(that.east, that.north),
|
||||
sw: new maplibregl.LngLat(that.west, that.south)
|
||||
};
|
||||
that.bounds = new google.maps.LatLngBounds(that.points.sw, that.points.ne);
|
||||
that.bounds = new maplibregl.LngLatBounds(that.points.sw, that.points.ne);
|
||||
that.center = that.bounds.getCenter();
|
||||
that.lat = that.center.lat();
|
||||
that.lng = that.center.lng();
|
||||
that.lat = that.center.lat;
|
||||
that.lng = that.center.lng;
|
||||
Ox.extend(that.points, {
|
||||
e: new google.maps.LatLng(that.lat, that.east),
|
||||
s: new google.maps.LatLng(that.south, that.lng),
|
||||
se: new google.maps.LatLng(that.south, that.east),
|
||||
n: new google.maps.LatLng(that.north, that.lng),
|
||||
nw: new google.maps.LatLng(that.north, that.west),
|
||||
w: new google.maps.LatLng(that.lat, that.west)
|
||||
e: new maplibregl.LngLat(that.east, that.lat),
|
||||
s: new maplibregl.LngLat(that.lng, that.south),
|
||||
se: new maplibregl.LngLat(that.east, that.south),
|
||||
n: new maplibregl.LngLat(that.lng, that.north),
|
||||
nw: new maplibregl.LngLat(that.west, that.north),
|
||||
w: new maplibregl.LngLat(that.west, that.lat)
|
||||
});
|
||||
// fixme: use bounds.toSpan()
|
||||
that.sizeNorthSouth = (that.north - that.south)
|
||||
|
|
@ -79,8 +82,9 @@ Ox.MapPlace = function(options) {
|
|||
place: that
|
||||
});
|
||||
} else if (updateMarker) {
|
||||
that.marker.update();
|
||||
that.rectangle.update();
|
||||
console.log("fixme update marker")
|
||||
//that.marker.update();
|
||||
//that.rectangle.update();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue