how to display moving points on a map from a database - javascript

There are logs where it is indicated: board number, time, date, latitude and longitude. information about their movement is constantly updated and new boards appear. how to display their movement on the map?

To display markers on a map, you can perhaps use Leafletjs for Javascript.
It is useful library that allows you to use a large array of mapping basemaps, and plot overlays on it, such as adding markers based on latitude or longitude, or drawing polygons or shapes. You can also overlay multiple maps, and there is a lot of functionality linked to the elements.
See their tutorials to get started or reference the documentation to see how you can manipulate the markers on a map.

Related

Is there a way to make a web map with custom areas that display custom info at addresses?

I am trying to make a map for work with our prices for different areas. Basically I would like to be able to add areas to a map so that if I search an address depending what area it is in will tell me the various prices. Is this possible?
I have tried using google map API tutorials but can only add a coloured area that doesn't really do much
This is very possible. Store your areas as an array containing sets of coordinate pairs. Each area with its pricing. You can use Google My Maps to draw the boundaries using real-world GPS coordinates. You can export the polygon shapes you create to JSON data.
Use Google Maps API to lookup a street address and retrieve the GPS coordinates.
Use Point In Polygon class to check which polygon the GPS coordinate belongs in (if any) and assess the price.

Clustering markers with exceptions (Google maps android API)

Iam looking for a way to cluster all my markers on google maps except of a few markers. These few markers may vary from time to time. Means for example: All markers contain an information like a number for instance. If the user watches the map of Europe all markers shall be clustered except of those 3 markers with the highest number. If the user moves to North America on the map or zooms out to see the whole world, all markers shall again/still be clustered except of the 3 markers containing the highest number. These 3 markers could now of course be different markers.
Any idea where and how to start is warmly appreciated. Is it even possible?
Yes, its possible.
For a marker to be clusterizable you have to explicitly add it to a ClusterManager doing mClusterManager.addItem(myClusterizableItem); (See the documentation).
So, you only need to add all the markers to the ClusterManager and create some markers (the ones you don't want to cluster) the usual way using the mMap.addMarker method.
Another way could be to write a custom ClusterRenderer that clusters your markers based on some conditions and exclude the markers you don't want to cluster.

Leaflet js fictional map

I am new to Leaflet and I would like to find out if how to create a fully interactive fictional map. I have an image that I would like to convert to a leaflet map. This image has a number of connections and points like a graph basically.
I want to first of all convert that image to the map, be able to hover over the points, highlight them and display information about them and also to create animations at some point but not immediately with the connections. There is also a requirement to display permanent labels next to each point.
Is that at all possible in Leaflet?
Is that at all possible in Leaflet?
Yes.
Start by reading the leaflet tutorial for non-geographical maps.

how to highlight a state in google maps on click any area in the state of a country

I am willing to highlight a state in the Google maps when user click on any area in the particular state. Supprose if I click on any area in the Washington sate. Then the Washington should be highlighted. Can you help me if any api or js is available to do like that.
There is no automatic API for this. You are going to have to draw a polygon either dynamically when the user clicks, or pre-draw all the U.S. State polygons in advance and hidden, then dynamically make the proper one visible when the user clicks.
As for making polygons in the shape of at least U.S. states, several persons have posted pre-defined polygon lists. One is here in StackOverflow: Geographical boundaries of states/provinces -> Google Maps Polygon
However, if you are looking at world-wide regions, states, and provinces, I doubt you will find pre-defined lists of them all. You may well have to create your own polygons by manually drawing on a Google Map or Google Earth, then export the polygon's lat/lng waypoints.
recently I am creating some relative, the tests I made was based on OpenStreetMap Nominatim (https://wiki.openstreetmap.org/wiki/Nominatim), is something like:
Click on map get Lat, Lng
Search by reverse Geocode, get state (or city)
Use Nominatim API to get a polygon_text (I use the geo WKT format), parse it
Draw the polygon or polygons (if multiplygon) with Google Maps API
Hope it could make some ideas come.

How to display millions of markers on google map (Using Web GL instead of Google Map Marker) with tool tips info on every marker when clicked?

I'm trying to make a web page which displaying a google map with so many markers (can be up to millions of markers) that looked up from data like json.
I try to make it using "google.maps.Marker" but it went very slowly (can be hang) on map rendering when there are so many markers. Then I found that it can be solved by using WEB GL
to render those markers on map like colored points on map. For now, I can make it until that step.
But there are still some problem I got, like below:
Right now I draw markers on map using Web GL like colored points, you can see like this link http://psousa.net/demos/webgl/ (I learned from it). How to change that point shape into triangle shape or circle shape instead of point/rectangle shape like that?
When every point of markers is clicked, there must be a mouse down event that will show some informations about that point (like name, description, etc.). How to implement that mouse event on every single of marker using Web GL?

Categories