JavaFX with Google Maps and JavaScript callback

Hi all

I wanted to create an application in javafx where use can click on the google maps map and the application will save the x - y coordinates. I found this

Article on the experience of java fx cards in JavaFX 2.0 / / JavaFX News, demos and Insight / / FX experience and that worked very well. But this example

does JavaFX to javascript.

Now, I added this method to their java script:

 google.maps.event.addListener(document.map, "click", function(event) {
    var lat = event.latLng.lat();
    var lng = event.latLng.lng();
    // populate yor box/field with lat, lng
    alert("Lat=" + lat + "; Lng=" + lng);
});

and it works if I call the page html by itself. But if I click on the card inside my javafx application, no popup will appear. That, probably something with the webengine

but I don't need the popup, I need information lat and LNG in my java fx application.

Anyone have an idea how to realize that?

Thank you

Hauke

See this section of the tutorial.

Also, since you mentioned that the alert box has not been indicated, if you don't want this feature at some point, you can register a handler with the WebEngine onAlert.

Tags: Java

Similar Questions

  • Slate 7 voicetab: problem with Google Maps.

    Friends, long since I've updated my tab to Kitkat of JellyBean, I have a problem with Google maps. Whenever I use Google maps, it freezes the tab at some point and then I have to restart the tab. I updated the app several times and restored too. A tab reset but still having the same problem. What should I do to prevent it? At the moment I use 'maps', but I need to use Google maps. Please give notice to fix the problem.

    Hi there @Mono45

    Welcome to the Forums of HP Support! It's a good place to find the help you need, so many other users, the HP experts and other members of the support staff. I understand that your 7 Slate freezes on you when you try to run Google Maps. I'm happy to help you with this.

    I would recommend that you go well following linked page from above and in the section on the use of "find the solution that fits...." ' article 'an apps constantly reply on your HP Tablet.

    HP tablets - tablets hangs or freezes (Android KitKat, Jelly Bean)

    If it works for you, please mark this message as a solution.

  • How can I disable the zoom MagicMouse with Google Maps?

    I use OS 10.11.3 (just improved) and an iMac 27 inches and MagicMouse, and suddenly the zoom with Google maps feature is now out of control.  I barely touch the MagicMouse and the zoom goes berserk, zoom-and-out and back-and-forth like crazy!  I can't click-and - drag any card with the function of zoo goes ballistic.

    I had already been able to disable this annoying zoom feature but now I can't find anything in system preferences (mouse, accessibility, trackpad, etc.).  Please help me.  Thank you!

    Hi FRANTIC,

    I don't know if you press any other keys while you scroll/zoom around your screen or if this only happens with Google maps, but I don't know which would be difficult.

    Looks like you check in the appropriate locations to change the behavior.

    Zoom in the accessibility preferences - Mac Help options

    Set the options for the selected style (full-screen or picture-in-picture) by clicking More Options in the Zoom of the accessibility preferences pane.

    To open this pane, choose the Apple menu > System Preferences, click Accessibility, click Zoom, and then click More Options.

    Zoom full screen

      

    Maximum and minimum Zoom Zoom

      

    Set the range of magnification to use when you zoom in and out quickly.

    Enlarge the image on the screen using your trackpad - Mac Help

    You can use your trackpad to zoom in on part of your screen.

    1. Choose the Apple menu > System Preferences, click Accessibility, and then click Zoom.

    2. Select 'Gesture to scroll using the modifier keys to zoom' to activate the zoom, and then select control, Option, or command from the context menu.

    It works for you?

  • In google maps, after seeing satellite or view, links on the map does not work, I have to charge google maps and start all over again

    When I open google maps, the links displayed on the maps can be used. However, if I change to a view street or satellite view and then return to the display of the base map, links displayed on the map is no longer working. I have to leave google maps and reload to get the links to work again.

    Hello peterronald, many site problems can be caused by corrupted cookies or cache. To try to solve these problems, the first step is to clear cookies and cache.
    Note: This will be you temporarily disconnect all sites, you're connected to.
    To clear the cache and cookies to do the following:

    1. Go to Firefox > history > clear recent history or (if no Firefox button is displayed) go to tools > clear recent history.
    2. Under "Time range to clear", select "all".
    3. Now, click the arrow next to details to toggle the active details list.
    4. In the list of details, see the Cache and Cookies and uncheck everything.
    5. Now click the clear now button.

    More information can be found in article to clear your cache, history, and other personal information in Firefox .

    This solve your problems? Please report to us!

    Thank you.

  • Issue of domain Google Maps and service

    Hello!

    I have a question about Google Maps and service areas.

    If I'm traveling and I'm going in and out of phone service, my google maps will continue to navigate?

    Thanks for all the answers!

    You're right Jay, but there is a setting in the cards that you may want to check. Open the cards and press on Menu > more > Cache settings > Prefetch on mobile. I think this make sure that once you have set up a route that she will prefetch all necessary tiles and store them on the phone so that if you lose a data connection that you will not lose the card too.

    Maps are directly related to your data connection. Even if the phone has a GPS signal, it will be able only to view or obtain cards if she has a data connection. If the phone Prérécupère all the tiles in a particular card that the data connection is not necessary and you won't have to worry about entering into the poor reception or no service areas. I hope this helps.

  • Google maps and Director

    Hey guys... Director works with Google Maps?

    any help or sampler would be nice...

    Thank you.

    Gino

    I see that WebXtra works in full in Windows... is that correct?

    Yes.

  • Google Maps and Mapviewer with SRID 8307 like the SRID display.

    LJ recently published the very concise example (thanks!) of the google maps display in mapviewer on his blog.

    Questions to which I am soliciting answers to form the forum is:

    (1) for the use of Google map tiles, is the assumption that made the SRID for the card will, or should be SRID 3785?
    (2) the ability to google does support the tiles from google to be crushed on a map of mapviewer with SRID 8307 upward? (I ask because we tried and we have the offset of the scale - perhaps zoom levels must be set to 20?)

    Thank you

    Stone

    Not that I know of. Used 3785 and 11.1.0.6, 11.1.0.7 without problems.

    Send me msg of error MapBuilder.
    And entry of user_sdo_geom_metadata for the table, the column that contains the data in 3785.

  • Google Maps and KMZ files

    Does anyone know how to get Coldfusion to display a KMZ layer on a google map? I have a google map which has several layers and it works very well but we would like the plan to display a KMZ file as a layer. The KMZ file is located in the root of the web directory.

    ! - Start of map->
    < script src =http://maps.google.com/maps?file=api & amp; v = 2 & amp; key = mykey
    Type = "text/javascript" > < / script >
    "< script src ="http://earthcode.com/downloads/gzoom.js"type =" text/javascript"> < / script >"
    "< script src ="http://gmaps-utility-library.googlecode.com/svn/trunk/markermanager/1.1/src/markermanager. js "> < / script>.
    < script type = "text/javascript" >
    function initialize() {}

    If (GBrowserIsCompatible()) {}

    <! - 1 card - >
    map1 var = new GMap2 (document.getElementById ("map_canvas1"));
    Map1.setCenter (new GLatLng(31.970804,-86.682129), 4);
    Map1.setMapType (G_HYBRID_MAP);
    Map1.setUIToDefault ();

    Create an icon of basis for all of our benchmarks that specifies the
    Shadow, icon size, etc..
    var baseIcon = new also (G_DEFAULT_ICON);
    baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
    baseIcon.iconSize = new GSize (20, 34);
    baseIcon.shadowSize = new GSize (37, 34);
    baseIcon.iconAnchor = new GPoint (9, 34);
    baseIcon.infoWindowAnchor = new GPoint (9, 2);

    Creates a marker which the Info window displays the corresponding letter
    to the index given.
    function createMarker (point, title, contact, ICAO, iwwc, letter) {}
    Create an icon that symbolized to this point using our icon class
    var letteredIcon = new also (baseIcon);
    letteredIcon.image = "http://www.google.com/mapfiles/marker" + letter + "'.png"; "

    Set up our GMarkerOptions object
    markerOptions = {letteredIcon: icon, title: title};
    var marker = new GMarker (point, markerOptions);

    GEvent.addListener (marker, "click", function() {}
    marker.openInfoWindowHtml ("< u > < b >" + title + "< /b > < / u > < br / > < b > phone: & nbsp < /b >" + contact + "< br / > < b > ICAO: & nbsp < /b >" + ICAO + "& nbsp & nbsp & nbsp & nbsp & nbsp < B > IWWC: & nbsp < /b >" + iwwc);
    });
    return marker;
    }
    <!-/ * OVERLAYS card 1 * /-->

    Map1.addOverlay (createMarker (new GLatLng(41.939,-72.688), "Bradley International Airport", "DSN 220-2312", "KBDL", "CT3", "A"));

    ColdFusion will have nothing to do with KMZ and Google Maps.  Google Maps is a client technology that use JavaScript.  Have your CFML deliver the appropriate JavaScript Google Maps API expects inside some relevant HTML and browsers that can display your desired map.

    ColdFusion do not even know it happened, he left for another application.

  • MBPr crashing (especially on Safari) with Google Maps

    Hey people,

    Recently (last month or Yes, but not sure about the exact time), my Mac crashed when I used Google maps satellite mode. It is almost always a problem with Safari. Today I tested it and it wouldn't crash on Google Chrome, but are permanently with Safari. (I know before, at least once that plant on Chrome too).

    Someone has had a similar experience? What should I try?

    Thank you!

    Pete

    Please launch the Console application in one of the following ways:

    ☞ Enter the first letters of his name in a Spotlight search. Select from the results (it should be at the top).

    ☞ In the Finder, select go utilities ▹ of menu bar or press the combination of keys shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad and start typing the name.

    Step 1

    For this step, the title of the Console window should be all Messages. If it isn't, select

    SYSTEM LOG QUERIES ▹ all Messages

    in the list of logs on the left. If you don't see this list, select

    List of newspapers seen ▹ display

    in the menu at the top of the screen bar.

    In the upper right corner of the Console window, there is a search box to filter. Enter the name of the application crashed or process. For example, if Safari has crashed, you would enter "Safari" (without the quotes).

    Each message in the journal begins with the date and time when it was entered. Select the messages since the time of the last fall, as appropriate. Copy to the Clipboard by pressing Control-C key combination. Paste into a reply to this message by pressing command + V.

    The journal contains a large amount of information, almost everything that is not relevant to solve a particular problem. When you post a journal excerpt, be selective. A few dozen lines are almost always more than enough.

    Please don't dump blindly thousands of lines in the journal in this discussion.

    Please do not post screenshots of log messages - text poster.

    Some private information, such as your name, may appear in the log. Anonymize before posting.

    Step 2

    In the Console window, clear the search box, and then select

    DIAGNOSIS AND diagnostic USE information reports ▹ user

    (not diagnose them and use Messages) in the list of logs on the left. There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points downwards. You will see a list of reports of incidents. The name of each report begins with the name of the process and ends with ".crash". Select the most recent report on the process in question. The content of the report is displayed at right. Allows you to copy and paste to validate all of the content, text, not a screenshot.

    I know that the report is long, perhaps several hundred lines. Please report all this anyway. If the report is only a few lines, make sure that you have disabled the search box.

    If you don't see any report, but you know, he had an accident, you have chosen diagnostic and using the list of Log Messages. INFORMATION on the USE of DIAGNOSTIC AND choose instead.

    In the interest of privacy, I suggest that, before posting, you change the UUID ' anonymous, ' a long string of letters, numbers and dashes in the header of the report, if it is present (it cannot be). "

    Please do not post other types of diagnostic report - they are very long and rarely useful.

    When you post the journal excerpt or the accident report, you might see an error message on the web page: "you have included content in your post that is not allowed", or "the message contains invalid characters." It's a bug in the forum software. Thanks for posting the text on Pastebin, then post here a link to the page you created.

    If you have an account on Pastebin, please do not select private in exposure menu to paste on the page, because no one else that you will be able to see it.

  • Porting Android app - problem with Google Maps

    I have an Android app I want to put at the disposal of users of BlackBerry 10 by porting to the Android Runtime of BB. The only stumbling block is that my Android application uses Google Maps API (com.google.android.maps) that does not support the run time. The map screen is only a small feature of the app, and I'm happy to turn it off for BlackBerry users, but is it possible? I don't want to maintain two copies of the request, somehow can code an application so that the conversion to the BAR works, but cards are always available on Android?  I made sure that the reference to the API maps in the Android manifest has the required tag = 'false' and check in my code, if cards are available on the device, but this doesn't seem to be enough.  The Compatibility Checker lists each line in each file of the source code where I make reference to a map object.

    Any help appreciated,

    Jonathan

    No, it's not going to work. Save you time trying to find a solution and just copy your project to a new and necessary modifications for blackberry. If you use source control, then you can try to turn to this probject.

    By the way. If you want to Google maps in your application, it can be done using a webview and Google API javascript.

  • Help with Google Maps blackBerry Smartphones please.

    Hello

    I have the 9530 and spin the device OS 4.7.0.75.

    I loaded Google maps successfully, the two 2.3.2 version and 2.2.2.

    I can't get rid of the portrait keyboard, so I end up with one half of the screen.

    Everyone else ran into this and can you let me know if this can be corrected?

    Thanks in advance for your suggestions,

    Bifocals

    Looks like you got Google Maps put in "compatibility" Mode As a result, half of the screen keyboard all the time.

    Find and click the 'Options '. Then click on 'Advanced Options', then click 'Applications', 'Google Maps' discovery and highlight do not click it. Then press the BB menu button and select "Disable the Compatibility Mode". Then back out and try again 'Google Maps'.

    I hope that this is the problem.

    If I helped, please remember to give me CONGRATULATIONS!

    If your problem has been resolved, please solve this thread by marking the position that solved for you!

  • Problem with Google Maps blackBerry Smartphones?

    Hi, I'm having a lot of problems with the Google Maps download.

    I just got my blackberry a couple of weeks, and google maps is a feature that I really need.

    I have download it without problems, and then when I opened the application I can search for a place with no trouble.

    However, I can't find any more places. If I enter another address, I get the 'getting directions' screen and he's looking for hours and hours. Finally, I just delete the program and reinstall it if I want to search for another location.

    Why should I do this? Is there something wrong with my phone?

    Upgrade to the latest OS:

    See the link below for download and simple installation instructions.

    http://www.BlackBerryForums.com/General-8500-series-discussion-Gemini/235791-latest-OS-8520-5-0-0-13...

    Make a backup of your device first, using Desktop Manager > backup. Close the office at the end Manager.

    1. download the OS files to the PC then install on the PC by running (double click) the downloaded file.
    2. go in c:\program files Research in motion\apploader and delete the file named "vendor.xml."
    3. plug in the BB and double-click on "Loader.exe." It is located in the same place as the above vendor.xml file.

  • GOOgle maps and the problems of flash cs4

    Hello, I have a problem.

    I did a site in Flash cs4 with several pages that you enter by clicking on the button.

    Then in one of the pages I wanted to insert google map so I did the installation of the google maps.

    Then, I entered a keyframe and insert the ActionScript for the google map:


    import com.google.maps.LatLng;
    import com.google.maps.Map;
    import com.google.maps.MapEvent;
    import com.google.maps.MapType;
    import com.google.maps.InfoWindowOptions;
    import com.google.maps.LatLngBounds;
    import com.google.maps.MapMoveEvent;
    import com.google.maps.overlays.Marker;
    import com.google.maps.overlays.MarkerOptions;
    import com.google.maps.interfaces.IPolyline;
    com.google.maps.services import. *;

    var dir:Directions;
    var polyline:IPolyline;
    var map: map

    function setupMap() {}

    map = new Map();
    Map.Key = "ABQIAAAA38eqZ79rYEIJwNYsDl4kqO9UF00lgandsoandso... » ;
    map.setSize (new Point (800,500));
    Map.x = 150;
    Map.y = 150;
    map.addEventListener (MapEvent.MAP_READY, onMapReady);
    this.addChild (map);

    }
    setupMap();

    function onMapReady(event:Event):void {}

    dir = new Directions();
    dir.addEventListener (DirectionsEvent.DIRECTIONS_SUCCESS, onDirectionsLoaded);
    dir. Load ("Belgrade");

    }
    function onDirectionsLoaded(event:DirectionsEvent):void {}

    }

    GOOGLE MAP WORK NICE BUT,

    I have a problem when I go to another page google map stays on this page too...

    with a page from the last keyframe apearing on other pages, I always solved with the entry BLANK KEY FRAMES BETWEEN THEM IN A TIMELINE.

    THIS IS ACTIONSCRIPT...

    I do not know how to stop google map when I go to the other page, his trips, he...

    pls help I have more solutions.

    Thank you

    I fairly well supplied all the necessary details in what I have described.  Create a new movieclip with nothing in it symbol.  Place it in a frame where you want the card to appear in the timeline and assign it an instance name ("emptyMC" works).  In the code that show you, change...

    this.addChild (map);

    TO

    emptyMC.addChild (map);

    This should work unless there is something on Google maps that I know not (which is very likely since I haven't used their is still Flash)

  • Google maps and maps does not not on iOS10/iPhone 7

    Since I have the iPhone 7 and by doing so updated to iOS10 my Google Maps constantly I am at home. I've deleted and reinstalled and it worked brielfy before stopping in a random place, and then finally get back to me at home. The possible reasons for this!

    It is also haopening for me. So frustrating. It is slightly different because he doesn't think I'm home but in random places and his /voice not even always on. It is not up-to-date or for example, if it says, turn left into 4.4 mikes he doesn't know that I have reached the turn. No warning without voice. Nothing.

  • Frequent crashes repeatedly on google maps and eBay and even on this page

    I am writing from Internet Explorer because this page is snding firefox head first in an accident. I'm one of the first fans of firefox, but lately, it's crashing frequently on some sites. eBay item pages that have demos 3d and google maps are 2 examples. Even this page crashed whenever I started to be reported in firefox. This is the last story of crashes:

    bp-68825b1c-d0d4-47cb-b438-0fff12150703	03-07-2015 09:35
    bp-49d7b151-bebb-4df2-87c9-fb4432150703	03-07-2015 09:34
    bp-0a372c48-edd9-4f05-a8b2-b0f182150703	03-07-2015 09:31
    bp-2bfe9d6f-43f7-403d-af69-b58662150703	03-07-2015 09:31
    bp-fe1c5913-252f-4f7f-a9d3-3e5392150703	03-07-2015 09:31
    bp-d1792566-6708-41dd-99cd-f269f2150703	03-07-2015 09:31
    bp-a555d8ef-6905-496b-aba6-4e0882150703	03-07-2015 09:22
    bp-ff91fefd-db6c-4b5b-be02-9820e2150703	03-07-2015 09:13
    bp-f34ac69d-a628-4769-b663-72ae12150702	03-07-2015 00:44
    bp-0ba8a0a0-d397-4723-b613-5eb542150702	03-07-2015 00:37
    bp-9a044f47-306d-419f-a895-a159b2150702	03-07-2015 00:37
    bp-3d622a29-ffa7-498c-8da5-a05b92150702	03-07-2015 00:36
    bp-a0879c67-4b66-4a6e-8e43-e88282150702	02-07-2015 10:11
    bp-c8c568fc-1c02-462a-be08-d12832150702	02-07-2015 06:01
    bp-0742da0e-5764-48a4-96a7-e17912150702	02-07-2015 05:46
    bp-7884e06f-0ba7-4b47-b063-01e3e2150702	02-07-2015 05:46
    bp-6fb32f5a-74f7-4c56-9799-f017c2150702	02-07-2015 05:45
    bp-6ce2862c-902f-4da7-8970-365bc2150701	01-07-2015 06:05
    bp-365d9d26-8a75-4b54-88b3-576882150701	01-07-2015 06:01
    bp-7a3f33b8-cf6e-411b-b7d1-d3c3c2150701	01-07-2015 06:01
    bp-e9795bb3-4bf8-4eb0-a8aa-ddff42150701	01-07-2015 06:01
    bp-04fe1a45-85c4-4b7f-9c27-b58182150630	30-06-2015 18:55
    bp-e6316832-c197-4a68-ac4c-cd2c52150630	30-06-2015 18:55
    bp-8bba090a-76bc-4b7c-b863-c14862150625	25-06-2015 20:13
    bp-565b3b95-f4b6-4268-bd09-8e00a2150625	25-06-2015 20:13
    bp-42b1c660-73ec-42e5-b193-2677c2150625	25-06-2015 20:13
    bp-6333e81e-48d5-465b-a28f-daa062150625	25-06-2015 20:13
    bp-7fb0a93f-85da-4cba-ab80-4ff0f2150624	25-06-2015 01:16
    bp-8e3f4772-0a03-486b-aeda-b95e52150624	25-06-2015 00:48
    bp-3917e3dd-0bfe-4570-8492-beb732150624	25-06-2015 00:46
    bp-0d790193-9cfe-4784-a93b-aceb12150624	25-06-2015 00:45
    bp-5de403cc-a31a-40a8-9785-1f1052150624	25-06-2015 00:45
    bp-86e6b24d-12ae-4f94-b76f-0b64e2150624	24-06-2015 06:09
    bp-bafca96a-136a-4ae9-9995-44ffe2150622

    Hi rupysk, please try to install a newer version of displaylink drivers for your system of http://www.displaylink.com/downloads/downloads.php and then upgrade to firefox 39. I hope that this should address these accidents.

    Update to the latest version of Firefox

Maybe you are looking for