JavaFX creating interactive map - javafx

I have got a problem to set up the interactive map. I want to make the visual feedback as the mouse is moved over the map to indicate to users what areas they can click on (e.g. the mouse cursor might change when over a clickable
area/town or the area might be highlighted/glow).
How can I achieve this?

Your question is a little bit difficult to answer because you do not tell us how your map is drawn and what you already know about the geometry shown on the map. If you only have a raster image of your map, e.g. scanned from a paper map, then things are getting complicated.
For a similar task I first wrote a program to geo-reference the map and determine the outlines of the interesting areas in the form of polygons.
Then I used the polygons to draw the outlines on the map display. I added listeners to each polygon so that I am notified when the mouse enters or exits an area.

Related

How to make mystery box like in mario games in Tiled map Editor?

I'am making simple platformer (C++, Tiled). But dont't understand how to implement mystery box. It must be an object or tile? If it better to be tile, then how animate tiles in tmx map.
Assuming you want to predetermine what will come out of the mystery box, it will be easier to use an object (can be a tile object) and not a plain tile on a tile layer. This is because you can associate a custom property with a tile object, to tell your game which item should come out.
Alternatively, you can use different tiles for each mystery box, but render them all the same in your game. This would allow you to quickly see where you put which item in the editor.
Using an object in your game rather than a plain tile should make it easier to animate it. But, you can always wait with creating such an object until the point where it is necessary.

How to get info from a window and the modify it using AutoIT?

I am trying to automate the process of turning display layers on and off in a modeling program using AutoIt. I am currently using code that simply simulates a mouse-click at a particular pixel position and as that of course needs to be set up differently depending on the screen being used at the time, I would like to replace the mouse-click simulation with getting the information from the window, looking for a certain text, then checking or unchecking the "Map" and "Legend" check boxes.
My problem is that I don't know how to do that. If someone has a good way to include or point to screen shots let me know but until then I will try to describe everything the best that I can.
The window:
The window I am referring to is titled "Map Layers". The area that I am specifically interested is looks like a large list box (it takes up the vast majority of the window space) and it has 4 columns: Layer Name, Map, Legend, and Sample. Name has the name of the layer, Map has a check box to control which layers are displayed, Legend has a check box that controls which layers appear in the legend window, and Sample for some layers has the symbol that will appear in the legend. for my purpose the Sample column is irrelevant.
AutoIt v3 Window Info:
When I use the finder tool I can't get it to highlight the "list box" area, only the surrounding boarder that it and some buttons are in. The window info says that this surrounding boarder area (which seems similar to a panel) has a class of Button.
So my fundamental question is what code to use to drill into that "Button", find out what the list view looking thing is, and get the info from it, then interact with the map and legend check boxes without referring to pixel location (or at least grammatically get the pixel position).
If I have left out any important information or was unclear anywhere please let me know.
Edit: Forgot to mention and don't know if it helps but the info given using the finder tool for the column headers is Control: Class: SysHeader32
Try RanorexSpy and see if it can give you more details.

Text Layer google-maps-api-3

I have been working with the Google Maps API V3 on a project for some time. I am using the polygon shapes to represent buildings on the map of my campus and now I'm looking for a solution to the issue of the shapes being underneath the text for the map. This includes building games in specific for my campus. I was wondering if there was a way to move the order in which they are displayed so that polygons go under the built in text layer for google maps, and if so, how I would achieve that.
Thanks in advanced,
Mike
I don't think this is possible. Unless the map names are turned off via map options they appear to be a part of the tile image.
Edit: You could possibly do something like turn off the labels and use a library like infobox to make your own.

Changing nodes icon and clickable area in Google Maps Drawing Library (polygon)

As you know, Google Maps Drawing Library is easy to implement, but it gives very little control to the developer.
(Here is a sample of the library at use http://gmaps-samples-v3.googlecode.com/svn/trunk/drawing/drawing-tools.html )
I would like to change the default settings of drawing polygons in two ways:
first, I'd like to use another icon for the nodes connecting lines instead of the small square icon
second, I like to increase the clickable area around the initial node.
Do you know if it's possible to do these changes to the drawing library?
I appreciate your help.
It is not possible with the existing drawing manager functionality. Please go through the following issue in Google maps api issues
http://code.google.com/p/gmaps-api-issues/issues/detail?can=2&start=0&num=100&q=drawing%20library&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Stars%20ApiType%20Internal&groupby=&sort=&id=3760

Creating an interactive map with CSS

Based on the design below, is it possible to create the map just using CSS? If so, how?
So as you can see, when you hover over a state the name will appear and change the color of the state. On clicking it will info below the map per state.
UPDATE 1:
Can it be done using absolute positioning, z-index and hover states on a button?
UPDATE 2:
With a slight tweak to the design, would it be possible to have a flat image for the map and plotting dot's on it for each state that would include a hover (using the same tab style as the image example)? Each dot being an image. Am I right in saying that the complication of the design is to highlight the right area when hovered? Therefore, just having a dot would solve it right?
I was interested in this too and found this example (USA) MAP if you look into the source code there is area for each state that look like <area onmouseover="show(this)" onmouseout="hide()" onclick="fform.tg.checked=false;togl()" shape="poly" coords="179,33,174,66,230,67,225,35,179,33,179,33" href="us-nd.html">. You can read more about and tags in W3C link. I think its the only way how to do this without flash or something... But it cant be done without a little JS. To get the coords, I would asume you just open your image in some editor that shows coords(gimp or something) and manually find them out...
No. If it had rectangular shapes yes but with a lot of work.
You really need javascript on this one.
You might want to try a Javascript mapping library - www.openlayers.org is the market leader (and free and open source).
You get your US state map in the right format (GML for example) then you can pretty much cut n paste from one of the openlayers examples. Hovering and clicking are handled by event functions. They can then do things like updating your info box below the map.
Note that if you want Alaska and Hawaii as in the picture and all you can find is a geographic state map, you might have to use a GIS to shift the features around. Quantum GIS is a free and open-source GIS that can do this for you. Help for that can be found on gis.stackexchange.com!
If you're willing to use javascript, jQuery more specifically, here is a nice plug-in/tutorial on how to do what it seems like you'd like to. http://playground.mobily.pl/jquery/mobily-map.html. It won't do the states exactly, but it will allow you to drop pins and such.
Update: This seems to be exactly what you're looking for: http://playground.mobily.pl/tutorials/building-an-interactive-map-with-raphael.html. It includes a rather indepth tutorial as well.
Here is another interactive US map I found myself: http://www.fla-shop.com/products/html5/united-states/us/ It is purely javascript with customizable popups.

Resources