aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/MapBox/MapBox.tsx
diff options
context:
space:
mode:
authorEric <ericmabr@gmail.com>2023-07-31 14:02:02 -0400
committerEric <ericmabr@gmail.com>2023-07-31 14:02:02 -0400
commit94f122332d15b5844a2c46fc78f9a3a3125e7b06 (patch)
tree6a2a2e5012e85893ee35b8d1af4e474614b0efa1 /src/client/views/nodes/MapBox/MapBox.tsx
parentcaa2e09edb9c1db0af571013d006179bdc84f755 (diff)
Pushpin onclick centers on pushpin
Diffstat (limited to 'src/client/views/nodes/MapBox/MapBox.tsx')
-rw-r--r--src/client/views/nodes/MapBox/MapBox.tsx30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/client/views/nodes/MapBox/MapBox.tsx b/src/client/views/nodes/MapBox/MapBox.tsx
index ad534f5f2..8e460c090 100644
--- a/src/client/views/nodes/MapBox/MapBox.tsx
+++ b/src/client/views/nodes/MapBox/MapBox.tsx
@@ -634,6 +634,14 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
pushpinClicked = (pin:Doc) => {
pin.infoWindowOpen = !pin.infoWindowOpen;
+ // TODO:
+ // if (sidebarannos is not open) open sidebarannos
+
+ // pan to pushpin location
+ this.dataDoc.latitude = pin.lat;
+ this.dataDoc.longitude = pin.lng;
+
+
// @action
// onPointerDown = (e: React.PointerEvent) => {
// if (e.button === 2 || e.ctrlKey) {
@@ -685,6 +693,9 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
this.dataDoc.latitude = this._bingMap.current.getCenter().latitude;
this.dataDoc.longitude = this._bingMap.current.getCenter().longitude;
this.dataDoc.zoom = this._bingMap.current.getZoom();
+ // if(this.dataDoc.mapType == 'x'){
+ // this.dataDoc.locationToLookAt
+ // }
// this.dataDoc.mapType = new this.MicrosoftMaps.MapTypeId();
};
/*
@@ -713,7 +724,7 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
// this.bingSearchBarContents=location.name;
// Centers on the searched location
- this._bingMap.current.panTo(new this.MicrosoftMaps.Location(this.dataDoc.latitude, this.dataDoc.longitude));
+ // this._bingMap.current.panTo(new this.MicrosoftMaps.Location(this.dataDoc.latitude, this.dataDoc.longitude));
// this._bingMap.current.setView({
// center: new this.MicrosoftMaps.Location(this.dataDoc.latitude, this.dataDoc.longitude),
@@ -727,7 +738,7 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
color: 'blue',
});
if (temp != this.searched_pin || this.searched_pin == null) {
- this._bingMap.current.entities.push(this.searched_pin);
+ this._bingMap.current.entities.push(temp);
this.searched_pin = temp;
}
@@ -754,6 +765,7 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
presLong: NumCast(this.dataDoc.longitude),
presZoom: NumCast(this.dataDoc.zoom),
presMapType: this.dataDoc.mapType,
+ // preslocationToLookAt:this.dataDoc.locationToLookAt,
// presType:
unrendered: true,
annotationOn: this.rootDoc,
@@ -773,7 +785,9 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
*/
@action
addPushpin = (pin: Doc) => {
- const pushPin = pin.infoWindowOpen ? new this.MicrosoftMaps.Pushpin(new this.MicrosoftMaps.Location(pin.lat, pin.lng), {}): new this.MicrosoftMaps.Pushpin(new this.MicrosoftMaps.Location(pin.lat, pin.lng), {icon: 'http://icons.iconarchive.com/icons/icons-land/vista-map-markers/24/Map-Marker-Marker-Outside-Chartreuse-icon.png'});
+ const pushPin = pin.infoWindowOpen ? new this.MicrosoftMaps.Pushpin(new this.MicrosoftMaps.Location(pin.lat, pin.lng), {}): new this.MicrosoftMaps.Pushpin(new this.MicrosoftMaps.Location(pin.lat, pin.lng),
+ // {icon: 'http://icons.iconarchive.com/icons/icons-land/vista-map-markers/24/Map-Marker-Marker-Outside-Chartreuse-icon.png'}
+ );
this._bingMap.current.entities.push(pushPin);
@@ -806,9 +820,17 @@ export class MapBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps
* Map options
*/
bingMapOptions = {
- navigationBarMode: 'square',
+ navigationBarMode: 'compact',
backgroundColor: '#f1f3f4',
enableInertia: true,
+ supportedMapTypes:['grayscale', 'canvasLight'],
+ // showScalebar:true
+ // disableRoadView:true,
+ // disableBirdseye:true
+ streetsideOptions:{
+ showProblemReporting:false,
+ showCurrentAddress:false,
+ },
};
/**