Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Javascript/Google Map - Pan/Zoom functionality

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Javascript/Google Map - Pan/Zoom functionality
 Login/Join
 
Silver Member
posted
Hi,


I am trying to modify the ability to Pan/Zoom in a Google Map depending on if it is a desktop/mobile browser. I have a Google map component through the HTML Composer. However, I think that I'm not getting the map object correctly or using it wrongly and appreciate any suggestions. The code I have so far is:


<SCRIPT type=text/javascript src="http://maps.google.com/maps?file=api&v=2"></SCRIPT>

<SCRIPT id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {
  var isMobile = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/) != null; 
  if (isMobile == false) {
    var mapObj = document.getElementById('googlemapcontrol1');
    mapObj.enableDoubleClickZoom();
    mapObj.enableScrollWheelZoom();
    mapObj.enableContinuousZoom();
    mapObj.draggingEnabled();
  }
}
//End function window_onload
</SCRIPT>



Thanks!
JL

This message has been edited. Last edited by: <Kathryn Henning>,


Year(s) of experience in WebFOCUS: 5+. Using WebFOCUS 7.7.03 on Windows platform with Oracle/SQL Server.
 
Posts: 41 | Registered: September 08, 2008Report This Post
<Kathryn Henning>
posted
Hi JL,

Since this looks like it's going to require some research, I'd like to recommend opening a case on InfoResponse Online.

Regards,

Kathryn
 
Report This Post
Silver Member
posted Hide Post
FYI, as I suspected, I was not getting the map object correctly and got it to work using:


  • For the Google map properties, the Zooms and Dragging are enabled.

  • Code to disable the zoom/dragging properties:
      var isMobile = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/) != null; 
      var mapObj = getMapObject('googlemapcontrol1').map;
    
        var isMobile = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/) != null; 
        var mapObj = getMapObject('googlemapcontrol1').map;
        if (isMobile == true) {
          mapObj.disableDoubleClickZoom();
          mapObj.disableScrollWheelZoom();
          mapObj.disableContinuousZoom();
          mapObj.disablePinchToZoom();
          mapObj.disableDragging();
        }
    

This message has been edited. Last edited by: JL,


Year(s) of experience in WebFOCUS: 5+. Using WebFOCUS 7.7.03 on Windows platform with Oracle/SQL Server.
 
Posts: 41 | Registered: September 08, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Javascript/Google Map - Pan/Zoom functionality

Copyright © 1996-2020 Information Builders