How to get coordinates from Google Map

I wonder how to get coordinates from Google Map to JavaFX application when click has occured. Here is an example of code:
public class JavaFXApplication extends Application {
public void showCoordinates(String coords)
        System.out.println("Coordinates: " + coords);
    @Override public void start(Stage stage)
        final WebView webView = new WebView();
        final WebEngine webEngine = webView.getEngine();
        webEngine.load(getClass().getResource("googlemap.html").toString());
        webEngine.getLoadWorker().stateProperty().addListener(
                new ChangeListener<State>() {
                    @Override
                    public void changed(ObservableValue<? extends State> ov, State oldState, State newState) {
                        if (newState == State.SUCCEEDED) {
                            JSObject window = (JSObject) webEngine.executeScript("window");
                            window.setMember("java", new JavaFXApplication());
        BorderPane root = new BorderPane();
        root.setCenter(webView);
        stage.setTitle("Google maps");
        Scene scene = new Scene(root,1000,700, Color.web("#666970"));
        stage.setScene(scene);
        stage.show();
   public static void main(String[] args){
        Application.launch(args);
// googlemap.html file
<!DOCTYPE html>
<html>
    <head>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        <style type="text/css">
            html { height: 100% }
            body { height: 100%; margin: 0px; padding: 0px }
            #map_canvas { height: 100%; background-color: #666970; }
        </style>       
        <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">
        </script>
        <script type="text/javascript">           
            function initialize() {
                var latlng = new google.maps.LatLng(40.75089, -73.93804);
                var myOptions = {
                    zoom: 10,
                    center: latlng,
                    mapTypeId: google.maps.MapTypeId.ROADMAP,
                    mapTypeControl: false,
                    panControl: true,
                    navigationControl: true,
                    streetViewControl: false,
                    backgroundColor: "#666970"
                var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);    
                document.map = map;
        google.maps.event.addListener(map, 'click', function(event) {
            //java.showCoordinates(event.latLng); ???
        map.setCenter(location);
        </script>
    </head>
    <body onload="initialize()">
        <div id="map_canvas" style="width:100%; height:100%"></div>
    </body>
</html>Edited by: krbltik on 03.10.2012 22:59

Hi, welcome!
You may also have a look at GPS Info Qt, available for free at Ovi Store: http://store.ovi.com/content/165671
GPS Info Qt is a nice Qt app. I have it on my C6-01 and I like it.
Regards.

Similar Messages

  • How to migrate mails from Google Apps to MS Exchange Online IMAP (Getting error)

    Any tips on How to migrate mails from Google Apps to MSOL? What is required? When I am trying to migrate using IMAP but getting fpollowing error
    =======================
    Summary: 1 item(s). 0 succeeded, 1 failed.
    Elapsed time: 00:00:11
    [email protected]
    Failed
    Error:
    Failed to log on successfully for the following reason:
    Server rejected Basic login with following message : * CAPABILITY IMAP4rev1 UNSELECT LITERAL+ IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE.
    Exchange Management Shell command attempted:
    'Microsoft.Exchange.Transporter.Provider.PopImap.InternetMailboxMeta' | Move-XsIMAPMailboxToExchangeOnline -AllowUnsecureConnection $false -TargetCredential 'System.Management.Automation.PSCredential' -MaxThreadCount '10' -Quiet
    Elapsed Time: 00:00:11
    ======================
    Any help will be much appreciated.
    Regards
    Sunil DK

    I just finished migrating a client from Google Apps to Microsoft Exchange Online using the IMAP option in the Microsoft Online Services Migration Tool.  
    I added the mailboxes by creating a CSV file [i.e. GoogleApps(Gmail)_Mailboxes.csv] in the following format:
    SourceIdentity,SourceServer,SourceLoginID,SourcePassword,TargetIdentity
    [email protected],imap.gmail.com,[email protected],P@ssword1,[email protected]
    [email protected],imap.gmail.com,[email protected],P@ssword2,[email protected]
    [email protected],imap.gmail.com,[email protected],P@ssword3,[email protected]
    Then I created a custom folder map XML file [i.e. GoogleApps(Gmail)_FolderMap.xml] to map the Google Apps (Gmail) labels to the appropriate Exchange (Outlook) mailbox folders and create those that didn't exist (i.e. Important, Starred, Follow up,
    Misc, Priority) as sub-folders under the Inbox:
    <?xml version="1.0" encoding="utf-8"?>
    <FolderMappings xmlns="http://tempuri.org/FolderMap.xsd">
    <!-- This xml contains the mapping of foldername in source server to folders in target server -->
    <!--
    "path" is the name of the folder in source server
    "Name" is the name of the folder to be mapped into target server
    "SpecialFolder" is the name of the special folder to be mapped into
    target server (Name will be ignored) valid values are :
    Inbox
    Calendar
    Tasks
    Sent Items
    Deleted Items
    Drafts
    Junk E-mail
    Contacts
    Outbox
    Journal
    Notes
    "Description" Description of the folder
    "ExcludeFolder" indicates folders to exclude. Valid values are:
    true (case sensitive)
    false (case sensitive)
    0
    1
    -->
    <!-- Default Mapping Section -->
    <Folder path = "INBOX">
    <Property SpecialFolder = "Inbox"/>
    </Folder>
    <Folder path = "New Mail">
    <Property SpecialFolder = "Inbox"/>
    </Folder>
    <Folder path = "[Root]">
    <Property SpecialFolder = "Inbox"/>
    </Folder>
    <Folder path = "">
    <Property SpecialFolder = "Inbox"/>
    </Folder>
    <Folder path = "Calendar">
    <Property SpecialFolder = "Calendar"/>
    </Folder>
    <Folder path = "Tasks">
    <Property Name = "Migration items/Tasks"/>
    </Folder>
    <Folder path = "Sent Items">
    <Property SpecialFolder = "Sent Items"/>
    </Folder>
    <Folder path = "Sent Mail">
    <Property SpecialFolder = "Sent Items"/>
    </Folder>
    <Folder path = "Sent">
    <Property SpecialFolder = "Sent Items"/>
    </Folder>
    <Folder path = "Deleted Items">
    <Property SpecialFolder = "Deleted Items"/>
    </Folder>
    <Folder path = "Trash">
    <Property SpecialFolder = "Deleted Items"/>
    </Folder>
    <Folder path = "Drafts">
    <Property SpecialFolder = "Drafts"/>
    </Folder>
    <Folder path = "Draft">
    <Property SpecialFolder = "Drafts"/>
    </Folder>
    <Folder path = "Junk E-mail">
    <Property SpecialFolder = "Junk E-mail"/>
    </Folder>
    <Folder path = "Spam">
    <Property SpecialFolder = "Junk E-mail"/>
    </Folder>
    <Folder path = "Contacts">
    <Property Name = "Migration Items/Contacts"/>
    </Folder>
    <Folder path = "Outbox">
    <Property SpecialFolder = "Outbox"/>
    </Folder>
    <Folder path = "Journal">
    <Property SpecialFolder = "Journal"/>
    </Folder>
    <Folder path = "Notes">
    <Property SpecialFolder = "Notes"/>
    </Folder>
    <Folder path = "Public Folders">
    <Property ExcludeFolder = "true"/>
    </Folder>
    <!-- Google Apps (Gmail) Specific Mapping Section -->
    <Folder path = "[Gmail]/All Mail">
    <Property ExcludeFolder = "true"/>
    </Folder>
    <Folder path = "All Mail">
    <Property ExcludeFolder = "true"/>
    </Folder>
    <Folder path = "[Gmail]/Drafts">
    <Property SpecialFolder = "Drafts"/>
    </Folder>
    <Folder path = "[Gmail]/Important">
    <Property Name = "Inbox/Important"/>
    </Folder>
    <Folder path = "[Gmail]/Sent Mail">
    <Property SpecialFolder = "Sent Items"/>
    </Folder>
    <Folder path = "[Gmail]/Spam">
    <Property SpecialFolder = "Junk E-mail"/>
    </Folder>
    <Folder path = "[Gmail]/Starred">
    <Property Name = "Inbox/Starred"/>
    </Folder>
    <Folder path = "[Gmail]/Trash">
    <Property SpecialFolder = "Deleted Items"/>
    </Folder>
    <!-- Custom Mapping Section -->
    <Folder path = "Follow up">
    <Property Name = "Inbox/Follow up"/>
    </Folder>
    <Folder path = "Misc">
    <Property Name = "Inbox/Misc"/>
    </Folder>
    <Folder path = "Priority">
    <Property Name = "Inbox/Priority"/>
    </Folder>
    </FolderMappings>
    Additionally, I had to tell the Internet E-mail Mailbox Migration Wizard to use the "Individual Account Credentials" option since I was able to specify each account password in the CSV file when adding the mailboxes to Microsoft Online Services Migration
    Tools console.
    Just to note, the users had to manually export their contacts to a CSV file and calendars to iCal (ICS) files in order to import those items into Outlook.
    I hope this will benefit others since Microsoft doesn't seem to have a custom, specifically defined migration strategy for this scenario.  With Google Apps being in direct competition with BPOS/Office365, I assumed that Microsoft would have a simple
    strategy using something like ActiveSync to facilitate the migration of email, contacts, calendar entries, etc.  Hopefully we'll see something along those lines become available in a future release of the migration tools.
    --Jon Payne

  • How do i get photos from google to my iphoto?

    How do I get photos from google to my iphoto?

    Download them to disk and then import to iPhoto
    LN

  • When I assign an address from google map to my contact, my contact pictures changes to a map. How do I prevent that from happening??? thanks

    When I assign an address from google map to my contact, my contact pictures changes to a map. How do I prevent that from happening??? thanks

    It isn't. Forward it to [email protected] and then delete it.
    (109195)

  • Hi, I downloaded get tube from google on my i mac and now want to delete the app completely, how can I do so?

    Hi, I downloaded get tube from google on my i mac and now want to delete the app completely, how can I do so?

    Get AppZapper, a free program that removes apps.  Make sure everything has been removed by checking with Spotlight once the app has been zapped.

  • HT4489 how to get Contacts from my google account?

    how to get Contacts from my google account?

    If you mean you want to get them in iCloud, export the contacts from Google as a vCard (see https://support.google.com/mail/answer/24911?hl=en), then import this to iCloud (see http://support.apple.com/kb/PH3605).

  • ** Any one know How to Implement POI of Google map ***

    **Hi Friends,
    if any one knows about implementation.just share with me.
    [email protected]

    HI Friends,
    How to implement Point Of Interest from google map.
    Is it possible, i checked in google static map api ..it provides markers and path and also some features
    other than POI.
    May i know how to implement POI,
    what api i have to use..i checked google ajax api. im not able to get that one.
    So,give me ur suggestions.
    what i have to do .
    [email protected]

  • How to get Position from EmployeeInfo in DIAPI

    I am using DIAPI(JCO) for SAP B1. According to one or my reuirement i am in need of Position from the EmployeesInfo. But there  seems no option or method for getting position from that. Can anyone guide me how to get that from EmployeesInfo ? Any help is appreciated..

    Looking at the DI API properties vs. DB fields mapping documentation in the SAP Business One developer area (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c5f5dbcc-0a01-0010-5d82-f25f2bee715e)
    it seems that this field is not exposed (yet).
    I.e. you could only run a SQL statement to get this information.
    Sorry,
    Frank

  • How to get resultset from oracle procedure use ejb3

    how to get resultset from oracle procedure use ejb3
    i know oracle procedure should like this
    Create or replace PROCEDURE resultset_test(
    aaa IN NUMBER,
    bbb OUT sys_refcursor) ....
    but what s the ejb3 scripts looks like? please give me an example or link~
    ths

    - there are no EJB3 scripts, only compiled application code
    - the part of the EJB spec that deals with databases is called the Java Persistence API, but likely you are just looking for the JDBC API.
    Now you should know what to Google to get your "example script": "java jdbc oracle procedure"

  • How to get acknowlgmnt from EFT (debt card swap) machine from swing app.

    Hi,
    Please some 1 let me know how to get acknowlegdement from EFT ( debit card Swap) machine once it is connected to the computer.
    I have a code which seems to have no errors ut it I am not sure whether the EFT machine will be able to send or recieve the data once the car is swaped. because i dont know what is the response of the EFT machine when connected to the computer though a java swing class.
    I know it will be quite tidious job for you to go through my program but this is all i can do...or atleast give me a link where i can refer to such case.......I am using eclipe Ide....and have searched alot on google too......

    Vish_1x1 wrote:
    Hi,
    Please some 1 let me know how to get acknowlegdement from EFT ( debit card Swap) machine once it is connected to the computer.What do you mean by "acknowledgement"? You realise it needs some sort of authorising host in order to authorise, right?
    I have a code which seems to have no errors ut it I am not sure whether the EFT machine will be able to send or recieve the data once the car is swaped. because i dont know what is the response of the EFT machine when connected to the computer though a java swing class.Mumbo-jumbo
    I know it will be quite tidious job for you to go through my program but this is all i can do...or atleast give me a link where i can refer to such case.......I am using eclipe Ide....and have searched alot on google too......Where did you get this "EFT machine" (whatever that is)? Do you mean a card reader? An EMV terminal? A PDQ? What? Where did it come from? Start there. If you need to get this thing working, you must be part of an enterprise, which has access to resources such as hardware vendor support, merchant banking services and EFT software vendors. If you're not, then you might as well abandon all hope of using this machine to take cards on your own, because you can't. End of story
    And, no, nothing to do with Java

  • Get result from google by java

    after greeting
    i want to know how to make search and get result from google through jsp and display it in jsp
    if anyone has answer
    please send me it as soon as possible
    thanks

    Check what API's google provides and make use of it.
    Start here: [http://code.google.com].

  • How to get hostname from targetlist in custom deployment procedure?

    When I make a simple procedure with a phase that will loop through a procedure hostname list
    and a hostcmd or directive inside that will use the hostname ex change a configuration file. How to get hostname from the hostname targetlist?
    I would rather not use $(hostname) or similar function if I can get the hostname from the target list.
    Edited by: user476601 on 2012-09-06 05:59

    I have tried that and cannot get it to work.
    I have tried to make a procedure with:
    parameter
    - parallel fase
    - step directive with hostname parm based on simple sh script (echo $hostname)
    - map hostname setvalue %TargetName%
    In a hostcmd step you cannot access %TargetName% directly
    it doesn't work. Please come with an example if you have tried it.
    /René

  • Getting values from a Map

    Hi,
    I would like to get values from a Map. This is my Map
    courrierId659 = [Ljava.lang.String;@7e6f03,
    nomModele = [Ljava.lang.String;@aa594b,
    navigation = [Ljava.lang.String;@1cc67fd,
    dateImpression = [Ljava.lang.String;@bf2fa9,
    nomGestionnaire = [Ljava.lang.String;@1d2279c,
    courrierId650 = [Ljava.lang.String;@64635b,
    selection = [Ljava.lang.String;@1a93ff1
    I want to get all the values whose keys start with courrierId, is possible to get these values in a effective way? or I have to iterate through the Map?
    Thank you in advance

    elsymenab wrote:
    I want to get all the values whose keys start with courrierId, is possible to get these values in a effective way?Yes. Loop through the keys, and where the key meets your criteria, get the value.
    or I have to iterate through the Map?That sounds pretty effective to me.
    ~

  • How to get photos from mac to iPhone 6? when i try it just comes up iCloud instead of my photos

    how to get photos from mac to iPhone 6? when i try it just comes up iCloud instead of my photos

    Make sure Settings > iCloud > Photos > iCloud Photo Library (Beta) = "Off"
    Then sync your iPhone using iTunes and make sure your sync settings for photos are set correctly in iTunes.

  • I got a new computer and don't know how to get music from ipod touch to itunes library

    I recently got a new computer and don't know how to get music from my ipod touch to show on my itunes library. 

    You need to transfer the iTunes folder from the old computer to the new one.
    iTunes: How to move your music to a new computer (Mac or Windows):
      http://support.apple.com/kb/HT4527

Maybe you are looking for