Third party map viewer center on map
I'm trying to write a workflow to let a user center the map on a point and then open street view at that location. I've got the centering working fine with the PanToPoint command, and I can open street view with the ShowExternalComponentView command. However, I can't get street view to center on the location I just zoomed the map too. Instead, it centers on the center of the map before it panned to the point.
I tried using the BroadcastCurrentViewpoint command using "googleMaps" as the parameter, but that doesn't appear to do anything. Any ideas on how to tell street view to center on my point in the map?
-
Try use SetMapExtent and ZoomToScale instead of using PanToPoint. I found out that sometimes the workflow works faster than the map causing some very strange behaviors. I think your workflow send the PanToPoint-command and immediately thereafter sends the ShowExternal.... making google open at the initial location.
0 -
I'm using PanToPoint because I don't want to adjust the scale. I added an External Delay before opening the third party map viewer, and that works for the first time street view opens. However subsequent times just reopen street view at the same location as the first time. So it seems like it's not unloading when I close the map viewer window. I tried using RemoveExternalComponentById to remove it, but that doesn't reset the extent to center on the point I pan to either.
0 -
Hi all,
Oh. I see I'm not the only one with those issues.
John, we reacted the same way. I added an External Delay the first time. But this wasn't the best when right-clicking on the opposite of the screen. I added instead a listenForExternalEvent (event: "MapPanEndedEvent") to make sure it doesnt open street view before the PanToPoint ended.
In spite of that, it still have occasionnaly a position shifting (always up) of the viewpoint when the externalComponentView opens. I notice it happens when the viewpoint is almost already center. This is a very strange behavior because my workflow forces the SHowExternalComponentView command to wait before opening anything. Do you have experiments that same kind of behavior?0 -
Hi Philippe,
It sounds like that shift may be occuring due to the street view container opening, which pans the map while opening the container, re-centering it to the point before ShowExternalComponentView was executed.
I've opened a JIRA ticket (GVH-15558) to take a look into the shifting position. For now, it might be worth trying to wait for a second "MapPanEndedEvent", then using the "BroadcastCurrentViewpoint" command to recenter.
Thanks,
Cody0 -
Hi Cody,
Thanks for your answer,What you propose correspond to the workflow alvailable in the code gallery (Open Street View for a Location Using the Map Context Menu). Ive already tested this solution but the shift occurs as well. However, Ive realized it happens most of the time when you right-click for the first time after opening the viewer.
I'll follow the ticket
Regards,
Philippe0 -
Hi Cody,
Just following up with you about the the ticket GVH-15558. I see it's not in the HTML5 Viewer 2.8 Known Issues list yet but maybe, you haven't time to take a look on it. Keep me posted because it will be great to know if there is any workaround or it's a official bug before our next deployment. Thanks!0 -
Any updates on this? We are running GE 4.8.2 and GVH 2.9.2 and experiencing this same issue. 0 -
Hi Lisa,
I see GVH-15558 still being open and with no target version. This means it will not be in 2.11, due to be released later this month.
Regards,
Wayne Richard
Latitude Geographics Group Ltd.
Head Office: 300 – 1117 Wharf Street Victoria, BC Canada V8W 1T7
Tel: (250) 381-8130 | Fax: (250) 381-8132 | wrichard@latitudegeo.com
Developers of Geocortex web-based mapping software | www.geocortex.com
An Esri Platinum Business Partner0 -
Hi, Is there an update to this? I am implementing the street view functionality for our GVH implementation (right-click context menu), and the position shifts on initial launch of the street view is a problem. Our users use this functionality frequently and some assistance with this would be really appreciated. Thanks. 0 -
Also looking for an update on this, thanks. 0 -
I managed to solve this by putting in a 1000ms delay before the 'BroadcastCurrentViewpoint' commmand. Seems it just gets ahead of itself. So my button calls 'ShowExternalComponentView' then a 1000ms delay, then 'BroadcastCurrentViewpoint'. 0 -
This was using Workflow 5 btw. 0 -
I was noticing this issue in my production env yet not in my dev env. I resolved this by increasing the wait timeout of the externalcomponentinitialize event. I think this was timing out and moving onto the broadcastcurrentviewpoint command too soon before the externalcomponent was fully initialized. By increasing the wait time from 1000ms to 2000ms, the broadcastcurrentviewpoint fired with better timing, positioning the streetview in the right spot. 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
13 Kommentare