WebView + GoogleMaps, not sure I understand QML js connection

Hi all

I'm not 100% on how to use function evaluateJavaScript() QML to call external js code in Web view. I am looking to dismantle the mapWebView tutorial of cascades. The problem, in that I'm runniong is that I can't seem to call the function zoomIn() or my QML zoomOut.

Here's what I'm not in the example so far.

   

   

   

The file external JavaScript (mapfunctions.js)

var map;
function initMap() {
var polyOptions = { strokeColor: '#000000', strokeOpacity: 1.0, strokeWeight: 3 };

 var mapOptions = { center: new google.maps.LatLng(43.449766, -80.406096), zoom: 8, disableDefaultUI: true, mapTypeId: google.maps.MapTypeId.ROADMAP };

 map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);

 poly = new google.maps.Polyline(polyOptions); poly.setMap(map);

 //Listeners google.maps.event.addListener(map, 'click', addLatLng);

}
/** * Handles click events on a map, and adds a new point to the Polyline. * @param {google.maps.MouseEvent} event */function addLatLng(event) {
var path = poly.getPath();
// Because path is an MVCArray, we can simply append a new coordinate // and it will automatically appear path.push(event.latLng);
}
function zoomIn() { map.zoomIn(map.getZoom() + 1);}
function zoomOut() { map.zoomOut(map.getZoom() - 1);}

WebView im trying to create in QML (RouteMapView.qml)

import bb.cascades 1.0
Container { id: root property int height property int width

 layout: AbsoluteLayout {}

 function zoomIn() { var script = "zoomIn()" mapView.evaluateJavaScript(script, JavaScriptWorld.Normal); } function zoomOut() { var script = "zoomOut()" mapView.evaluateJavaScript(script, JavaScriptWorld.Normal); }

 WebView { id: mapView

 preferredHeight: height preferredWidth: width url: "local:///assets/routemap.html"

 gestureHandlers: [ PinchHandler { property variant initial onPinchUpdated: { if (! initial) { initial = event.distance; } if ((event.distance - initial) / 50 > 1) { initial = event.distance; root.zoomIn(); } else if ((event.distance - initial) / 50 < -1) { initial = event.distance; root.zoomOut(); } } } ] }}

Thanks in advance for any help

-J

Sorry, I'm not clear. I think you should you the functions in js.

function zoomIn() {}
map.setZoom (map.getZoom () + 1);
}

function zoomOut() {}
map.setZoom (map.getZoom () - 1);
}

replace the old code. Try it.

Tags: BlackBerry Developers

Similar Questions

  • Not sure I understand the FPGA FIFO resources

    Hi all

    I'm having a problem with FPGA FIFOs.  I'm performing a target-to-Host DMA transfer, and I have two different configurations that use the same FIFO, but have radically different resource allocation.  In the first case below, FIFO is a loop which will be called 1 time k each time the loop runs.  In this case, when you map the Slice LUTs used are about 15%

    In the second case, below, the FIFO is called once when the while loop is executed.  In this case, the use of estimated resources regarding the Slice LUTs is 107%. I guess I don't know why this behavior should be expected.  Can someone explain this to me?  Thanks, Matt

    Yet once again, take a look at the link resource use statistics. You do most or all mathematics in 64-bit and use of resources grows with the increase of the bit widths. In particular, logical shift, you use a lot, is a particularly costly and to a 64-bit value requires choice tables more than two times more than the same operation on a 32-bit value. I suspect that the implementation is really a huge table - for every possible way of entry that there is a corresponding output. This allows him to be very fast at the expense of the FPGA fabric. Other mathematical operations (add, subtract, multiply) are more space-efficient.

    The entire block of logic in the lower left corner of your VI is a candidate easy to encapsulate in a single cycle timed loop, which can save you space, even if it will save especially flip flops and not lookup tables.

  • had this message for the 1st time on windows, not sure if its real? performancewreckcontrol.in

    had this message for the 1st time on windows, not sure if its real?

    Hi Netbook,

    This isn't enough information.  What is the exact message and any word to Word with all the codes?  How it was received (a pop-up, aredirect, an e-mail (if so, what he want/say - leaving out personal information about you)?)  What were you doing when it was received?  Do you know what program sent you him?  What operating system?  What browser and version?  What security programs (names and versions of all of them?  The message say?  When it seemed (start-up or during work)?

    Here's help on how to respond to that and other information necessary to understand: http://support.microsoft.com/kb/555375.

    In the meantime, I would do anything he asked and guess that it's a scam, spam, malware and/or until we prove otherwise based on your comments.

    Thank you!

    Kosh

  • Problems connecting to internet - says network cable disconnected, not sure I have the correct driver installed.

    Had a big storm - got the new modem.  but they said that my drivers where missing or damaged.  Downloaded Marvell Yukon of gateway - to the GT5432 model. Always says cable unplugged network. However, Bishop says peripheral device works correctly. Don't save: no update-unable to connect to the internet.  I uninstalled and reinstalled; rebboted, etc. - still nothing. It has a problem with the PCI connection - no driver, but I don't see anywhere to down load or know what to download. Oh and another adapter on - think 1394 - when I turn that on and off the wonder; It shows the signal for the 1394---400 and does not say his unplugged, but still can not connect to internet.
    The "old" computer to try to find information; noticed that said, unplugged network cable but it allowed me to connect to the internet. When I disabled the 'extra' adapter message there went, speed signal only at 100 than at the 'old' calculation is not any other PCI devices connection listed.

    I'm not sure of what continues.

    The 1st computer was working fine - then picked it up to move it to where it belonged to my office and that's when he went out-made no sense to me!

    Because you seem comfortable opening your computer, have you tried re - a corner of the map (with power off, remove the card and reinsert it into the slot, be sure to exercise static precautions if you are in an environment of low-hu7midity).  If there is an empty slot, you can also move the map Marvell to another location.  See the comments below.

    It's a long shot, because even if you did not provide the complete ipconfig output, the data that you have provided appeared to be normal, but...

    Open network connections (start > run > ncpa.cpl > OK)
    Right-click on the icon for your network adapter, and then select Properties
    You should see a screen like this--> http://screenshots.modemhelp.net/screenshots/Windows_XP/Network_Connections/Local_Area_Connection/Properties/General/Index.shtml
    Issues related to the:
    In the upper area, under 'Connect using' said 'Marvell Yukon 88E8039 PCI-E Fast Ethernet Controller?  If this is not the case, what does say?

    In the second box, what are the items are listed under "this connection uses the following items"?

    The only other thing I can think is that the Marvell Ethernet card was damaged in the same storm that got your original modem/router.

    *******************************************

    According to Gateway, the GT5432 has 4 card slots:
    A PCI Express x 16 (GUI)
    A PCI Express x 1
    Two PCI Conventional

    Your motherboard should look like this:

    Orange, top, connector is the PCI Express x 16.  You probably have a video card in this slot.

    The short white connector is the PCI Express x 1 connector.

    Two more long white connectors are the standard PCI slots.

    If I understand your installation, you should have the Marvell Yukon map into the slots of two down and your Agere modem on the other.  As long as you have the SMC1244TX PCI card, why don't just remove you the Agere modem or the card Marvell and insert the card CMS in one of the two PCI slots?  You are not using the modem and the working hypothesis is that the Marvell card does not work, so there is not much to gain by leaving a card in your computer.

    Download the user guide and drivers for the SMC here--> http://www.smc.com/index.cfm?event=viewProduct&localeCode=EN_TUR&cid=9&scid=51&pid=238 map

    Moreover, assuming that your open slot is the short PCI Express x 1 slot, you can buy another Ethernet card that will work in this niche: see--> http://www.newegg.com/Product/ProductList.aspx?Submit=ENE&N=100010064%20600016290&IsNodeId=1&bop=And&Order=PRICE&PageSize=100

    If I were you, I blow up the cheaper models and get the Intel EXPI9301CT $ 36 10 / 100 / 1000 Mbps PCI Express Desktop Adapter Gigabit CT.  Note that this is the same card with a similar name (with close to 400 customers) which sells for $29,94.  The price difference is because the cheaper "BLK" letters in the description, which means that it is "sold in bulk" and has no drivers, user guide CD or anything else in the box.  There are several negative comments from people who do not understand this difference and then had trouble finding the driver for the card on the Internet.

  • Not sure how to set up Windows Fax Scan &

    Original title: "Windows fax and scan"

    I'm not sure how set the computer to my phone... it is already connected to the internet... If I understand correctly... I think so..

    If you use a dial-up connection, then the line is indeed already used with the internet.  You can do this through the internet, and you may not use this same line while it is used for the internet.  You need an analog (non-digital) line separated with a fax modem or (one in your system) be bound separately or you need to switch back if it is a good analog line and you have everything you need to fax. Here's how to set up fax and scan:http://windows.microsoft.com/en-us/windows-vista/Set-up-your-computer-to-send-and-receive-faxes.  Here's a FAQ on Windows Fax and scan, which can also help to answer your questions:http://windows.microsoft.com/en-us/windows-vista/Faxing-frequently-asked-questions.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Inquire... There is a section of code that I'm not sure as to what it reperesents...

    Being new to java-script and learning on the fly at the moment I'm trying to get things straight in my mine... In doing so, I find myself using the code with segments I can't stand no less. Here is an article of the code coming from a dynamic stamp. The words that I've highlighted in RED are what I need to be explain to me regarding; what they wear on the stamp itself; All of the code is at the bottom of the page, if you need to reference it.

    Thanks guys...

    If (event.source.forReal & & (event.source.stampName == "#fF_WBqLLUm0cA33ryprG3A"))

    {

    If ('ok' is app.execDialog (dialog)) < < < < < I understand what it's

    {

    CMSG = var dialog.starValue; < < < < < I understand what it's

    event.value = "\n" + CMSG; < < < < < < < I think I know what it is... nothing typed in "\n" will also appear in the field of text and dialogue starValue

    event.source.source.info MJ in the Group CMSG; < < < < < I don't know what it is and I don't know what 'mj' represents. That suppose to come after ".info. _ »

    CMSG = "\n" + dialog.mjValue; < < < < < I understand what it's

    This. getField ("MJ/m²") .value = CMSG; < < < < < < fact the: getField means the text of the stamp box? and "MJ/m2" the name of the text box in the stamp? ".

    CMSG = "\n" + dialog.accValue; < < < < < I understand what it's

    This. getField ("accreditation") .value = CMSG; < < < < < "MJ/m2"I'm not sure what "accreditation" represents here.

    }

    }

    ALL OF THE CODE

    var = {} dialog box

    starValue:

    mjValue:

    accValue:

    bChk1:false,

    bChk2:false,

    initialize: function (dialog)

    {

    var dlgInit =

    {

    'Chk1': this.bChk1,

    "Chk2": this.bChk2.

    };

    Dialog.Load (dlgInit);

    },

    function: Commit (dialog) {/ / called pressed OK}

    results var = dialog.store ();

    this.starValue = results ["txt1"];

    this.mjValue = results ['txt2"];

    this.accValue = results ['txt3"];

    var oRslt = dialog.store ();

    this.bChk1 = oRslt ["Chk1'];

    this.bChk2 = oRslt ["Chk2"];

    },

    Description:

    {

    name: 'Energy Rating Information', / / title of the dialog box

    elements:

    [

    {

    type: "display."

    elements:

    [

    {

    name: "enter Star Rating: «,»»

    type: 'static_text. "

    },

    {

    item_id: "txt1"

    type: 'edit_text. "

    Multiline: true,

    Width: 300,

    height: 20

    },

    {

    name: "Enter MJ/m²: «,»»

    type: 'static_text. "

    },

    {

    item_id: "txt2."

    type: 'edit_text. "

    Multiline: true,

    Width: 300,

    height: 20

    },

    {

    name: "enter the approval number: «,»»

    type: 'static_text. "

    },

    {

    item_id: "txt3."

    type: 'edit_text. "

    Multiline: true,

    Width: 300,

    height: 20

    },

    {

    type: "display."

    char_height: 10,.

    elements:

    [

    {

    type: 'static_text. "

    item_id: "stat."

    name: "what kind of note is this:?

    char_width: 15,.

    alignment: "align_fill",.

    Police: 'dialogue ',.

    },

    {

    type: "display."

    char_width: 8.

    char_height: 8.

    align_children: "align_top."

    elements:

    [

    {

    type: "display."

    char_width: 8.

    char_height: 8.

    elements:

    [

    {

    type: 'check_box. "

    item_id: "Chk1."

    name: "single Habitation."

    },

    {

    type: 'check_box. "

    item_id: "Chk2."

    name: "the development of multi - unit,"

    },

    ]

    },

    ]

    },

    ]

    },

    {

    type: "ok_cancel."

    ok_name: "Ok."

    cancel_name: "Cancel".

    },

    ]

    },

    ]

    }

    };

    If (event.source.forReal & & (event.source.stampName == "#fF_WBqLLUm0cA33ryprG3A"))

    {

    If ('ok' is app.execDialog (dialog))

    {

    CMSG var = dialog.starValue;

    Event.Value = "\n" + CMSG;

    Event.source.source.info.MJ = CMSG;

    CMSG = "\n" + dialog.mjValue;

    this.getField("MJ/m²").value = CMSG;

    CMSG = "\n" + dialog.accValue;

    this.getField("accreditation").value = CMSG;

    }

    }

    Entry information is is created in the document in which you place the stamp. It is not in the stamp file, it is in the file that you are stamping. To view the information in Acrobat, open the dialog information document (Ctrl-D or Cmd - D), then go to the tab "Custom". You should see your new info "mj", regardless of the string to the value that you assigned to the property of mj in your code.

  • Not sure how to get the result that I need.

    Hi all

    I'm not a very good programmer, but I'm learning so please bear with me.

    My problem is that I need to be able to create a page that we can imput two dates and get all the items in our database which are equal or between imputted dates and be sent to the page.

    The part of sql is not my problem, but I'm not sure on how to create the page with in the date boxes.

    As it is now I have created the page, but it is retreving all elements of my table and comes it a grid of smiple and the output how many entries table for this is manageable.

    So, if someone can help me or point me in the right direction that would be great.

    Thnaks

    Pat

    Basis of a form.

    Basis of a SQL clause

    
      SELECT aField,bField,cField
      FROM aTable
      WHERE aDateField BETWEEN
               AND
              
    
    

    There is much for you to learn and understand to make a function and a business page.  But you should get at least close to return results.

  • I got a message this morning, and I'm not sure I did the right thing. He asked something about airports or restaurants?

    no problem with Mozilla. I just got a message on safety and use in airports and restaurants. I unchecked something. I'm not very savvy computer. I don't want to spoil anything. Sorry I can't be more helpful.

    I am afraid that we cannot help you if you are not sure of what the message was. I suggest that you try to run some scans on your computer to search the software malware, Troubleshooting Firefox problems caused by malicious software

  • Firefox crashes on. Its the latest version, Ive tried everything, I'm really not sure why it crashes?

    Whenever I try to watch videos from facebook, it crashes. I even scanned my computer for viruses, but its own. IM really not sure what is wrong?

    Ive tried everything above. Ive reset firefox, uninstalled and deleted the plugin pokki. Hardware acceleration unchecked Ive also removed the protected mode. Oh and by the way, I did that a single flash, IE 16 and not 15

    always the same, it crashes.

  • I have a mac book pro 2009 model, now when I try to load it, there is no green light on the adapter and the laptop does not charge. Not sure if there is a problem with the card or the battery or the laptop. Kindly help

    I have a Mac book pro 2009 model, when I try to load it it not there no green light on the adapter and he is in charge. Not sure if there is a problem with the adapter or the battery or the laptop. Kindly help... Thank you

    Have you tried:

    Portable Apple computers: Troubleshooting MagSafe adapters - Apple Support

    This is the Office Mac Pro forum. I asked that your post be moved to the MacBook Pro laptop forum.

  • A friend offered to sell me his MacBook.  It was new in 2010 or 2011.  I'm not sure of the size of the hard drive is, but it has 16 MB of ram.  Any suggestions on what would be a reasonable price?

    A friend offered to sell me his MacBook.  It was new in 2010 or 2011.  I'm not sure of the size of the hard drive is, but it has 16 MB of RAM.  Any suggestions on what would be a reasonable price?

    This isn't a topic appropriate for the forums. We only used the material price. Visit eBay to find this information.

  • not sure: the new hard drive installation

    I have a Desktop allows a hard disk which is a failure.  F9 during boot diagnostics say its bad.  I just got the HP recovery disk and I'm not sure that 'when' to instaqll them.  I put the OS on the new hard drive and then first run the recovery or recovery disk?

    If you have the recovery disk set for this PC, run recovery on the new hard drive.  To install everything back like it was new again.  The installation of the OS process is executing the recovery.  Install the new hard drive, and then run the set of recovery disks.

  • Wanting to buy g770 but not sure of the difference

    I want to buy the G770, but I'm not sure what the difference between the $519 and laptops for $719. Could someone please inform me on what exactly is the difference in every laptop or direct me to where I can find.

    very appreciated

    hope this helps:
    http://www.Lenovo.com/PSREF/PDF/3book.PDF

  • Not sure what type (Variant) to wire in Datasocket read to a waveform.

    Hello

    I have an accelerometer attached to a housing NI USB-6008 and I try to send the readings taken with it to the server datasocket, (see attached files).  I'm not sure what information and variables are necessary to be wired data read vi (Variant) type so that it displays the information on a waveform graph.

    The accelerometer is just by the way an analog voltage.

    Any help appreciated.

    Hi Ultramar,

    How Datasocket got out before the dynamic data Type was created, it doesn't have full support for this type of data. There is an easy solution that you can apply, which converts the DDT into a table 1 d of waveforms. Screw seal (in the zip file) will show you how to proceed.

    You will also need to add an element named 'test' for Datasocket Server Manager, I've included a settings file, you can import into the DS Server Manager.

    Finally, you will need to run the DS server and you will get the communication.

    I wish to indicate that the 6008 is not the best map to read the values of acccelerometer, but the above steps will allow you to send the data. You will need to change the physical hardware DAQ channel in the publisher.vi DS because I modified the DAQ assistance to work with my setup of the computer.

    Concerning
    JamesC
    NIUK and Ireland

    It only takes a second to rate an answer

  • The server has not completed the compliance audit of the licenses. If the server is joined to a domain, make sure that the server can connect to a domain controller.

    Hi all

    Can I confirm with expert from Microsoft, it's windows foundation server 2012 may not be the first domain controller (which means that the first AD in the forest)? It must be attached to the root of the forest as a domain controller. If I'm promoting it to be first DC in new forest, he invites you to "the server has not completed the compliance audit of the licenses. If the server is joined to a domain, make sure that the server can connect to a domain controller. If the license compliant check cannot be completed, the server will automatically close in 9 days...

    Thank you & best regards
    Andy

    Hi Andy,.

    Your question of Windows is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the TechNet Windows Server Forums:
    http://social.technet.Microsoft.com/forums/en/category/WindowsServer

    Hope the helps of information.

Maybe you are looking for