How to display duplicate maker in cluster here map - here-api

I am using here map and I use clustering. But I have problem for displaying maker whose cordinates are same /dublicate . When I zoom in clustering , unfortunately the makers are not visible but cluster is still visible. How to display these makers when cluster is zoomed ?
My clustering options is as following
var clusteredDataProvider = new H.clustering.Provider(dataPoints, {
clusteringOptions : {
eps : 16,
minWeight : 2
},
theme : new PusulaClusterTheme()
});

We had the same issue. If you absolutely need the markers to show the exact very same spot up to the inch so to speak, then I don't know what you could do. But we wanted to show markers for each house on a street and sometimes we had multiple families in a house so we could not get the multiple ones to properly show.
We opened a ticket with HERE and this was their reply:
"...when you are placing multiple markers at the same geo-point, it is
just that they are stacked one on top of the other. Since they are all
at the same coordinate only the top most one will be displayed. So
to enable multiple marker to be shown at the same coordinate, you will
need to have some logic to avoid overlapping of markers. There is no
method straight off the shelf in JS API that can do this for you, but maybe
you can use the method map.getObjectsat(X,Y) to check if there are
already any markers at the point. If there is an existing one, then use
some logic to slightly change the coordinate value of the new marker
to be added at the point.
We ended up copying a solution we found here on Stackoverflow see this link that was written for Google Maps, but is just as relevant here with HERE. It uses a function to randomly change the last digit or 2 of the coordinates if they are multiple, and that way all your multiple coordinates will be a little bit unique and spaced out.

Related

Pathfinding in isometric game with autotiles: How to modify NavigationMesh

Im generating a map proceduraly with isometric autotiles. Each tile has its navigation poligon defined in the Tilemap editor. The Navigationmesh is working fine. The thing is that the map I generate is bigger than the actually playable area. I dont want the human player to see the borders of the map, the "black background". So I'm limiting the camera view movement. Therefore, the navigationmesh goes outside of the playable area, like in this image:
I'm using pathfinding to move the player character. Since the map is generated proceduraly, sometimes it generates a map where the path to a point goes outside the playable area an then comes back in order to reach its destination. Like this:
A player in O would go outside the playable are to reach X. In X could be a point of interest, so if this kind of map is generated, I would simply regenerate it until i get a feasible one.
I'm using GODOT 3.51.
I have think about:
Carving a hole in the navigation mesh on the borders of the playable area using clip_polygons(). BUT since im using autotile navigation, it is very hard to get the navigationpoligoninstance. I have tried this but failed miserably.
-Adding NavigationObstacles on the borders: Hadn't tried this, but as far as i understand from my research, this will not avoid the agent to generate the path to the destination.
My idea is to achieve that no path goes out of the playable area and then check is the map is feasible by checking if all points of interest (randomly spawned) are reacheable. This is done by cheking the last point of every path to interest points from the starting point an seeing if it is equal to the point of interest position.
I hope this is understandable. Sometimes I dont understand myself.
What comes to mind is to use two versions of the tiles. One that is not passable which will be used to generate the areas that the players should not be able to reach. And the regular one used for the playable area.

Tableau reacts poorly to latitude and longitude for one particular location

I have been troubleshooting this issue where I click on datapoint in geographic map and NOTHING appears. However, all other datepoints work as expected
Troubleshooting steps
I deleted and re-created the tableau map
I removed the offending datapoint, and all other datapoints worked
I renamed the address of the datapoint, same problem
But then, I changed the latitude and longitude of the data-point and it worked.
Now when I revert to the correct latitude and longitude of the data-point it doesn't work.
Why on Earth doesn't it work?
Is there a certain way I should format longitude and latitude? This is how I formatted it:
Please please please help. I've been working on this all day.
This is screenshot of it working, when I select location from drop-down
This is screenshot when I select data-point from map and it DOESN'T WORK.
Notice how data at the bottom is BLANK, as if nothing is selected.
But if I select any other data-point on map it works
Update
Proof of concept is here,
Notice when you click on Eat at Joes on map, the data display is blank, but if you select Eat at Joes from dropdown, then it works
Another update
If I go to dashboard, do rectangular select, this is what I get
If I go to original map and do rectangular select, I get this. It says 64 marks, 1 row by 1 column
And if I use quick filter, select Eat at Joes, it displays the data, including the name Eat at Joes
But if I hover over or select 'Eat at Joeson the map (not the drop-down), the name in the dashboard saysNoneinstead ofEat at Joes`.
And this happens to all data points that I hover over.
I uploaded latest workbook here
Update after calculated field
I dragged Cal_Loc to Details and it is aggregate (I am unable to change to Dimension) and not appearing in drop-down of dashboard panel.
However on lower left corner of Maps screen, it says 5 marks even though I see 4, which is still quite unsettling ...
There are two problems.
The first is that you're using ATTR(). Instead of putting the fields of interest into Tooltip as attributes, put them into Detail as dimensions. Filtering on an attribute is tricky (that *'ll get you into all sorts of trouble). For filtering, dimensions are usually the way to go.
The second is that you have lat/lng in the map as dimensions. Try changing them to a measure. If your dimensions (Location, Type) can uniquely identify every point on the map (and now that you've made them dimensions and not attributes, they can), then you can have the lat/lng averaged.
Your title problem is a known issue with Tableau. They've acknowledged the problem for about two and a half years now, but there's no fix in sight. Behavior with putting dimensions in titles is very inconsistent (a quick search through the Tableau forums reveals a pretty shocking number of people with your exact issue). I couldn't find a solution to your problem, but here's a hacked together one specific to your situation.
Make a calculated field:
IIF(COUNTD([Location]) > 1, 'Multiple Locations', ATTR([Location]))
Then replace [Location] in your title with that field. It just checks to see how many locations are present in the partition. If there's just one, it uses ATTR([Location]), which we can safely assume will return the name of a single location and not a "*". Otherwise, it returns "Multiple Locations", which you can obviously adjust to fit your needs.

Google Maps API V3 -> Utilize MarkerCluster but have the clusters themselves be specific to a drawn polygon/region?

Ok, let me preface this question with the fact that I have created a lot of google maps, but they have been strictly markers and polylines denoting routes and a couple with some handler interaction.
Now I am looking to show basically a map of the world, mostly North America and I want to split this continent into my predefined regions with some lats/lngs that I have. Using these regions I want to draw something like a polygon with a light opacity and different color per region.
I then want to use marker clustering but I want the clusters to be specific to these regions. I have looked around but I haven't found an example like this. I have seen pages that say you can do this but not how you would go about doing this. Again, I am definitely a noob when it comes to drawing polygons and using the marker cluster. I know this question is fairly vague but just looking for an example/idea to start off of, and more so I don't want to write a bunch of code against this specific api and then find out that it is not possible.
Any ideas or suggestions are greatly appreciated....Thanks.
It can be done, but will require a rewrite of the MarkerClusterer (probably will simplify it).
You will need to determine how you are going to represent and load the cluster boundary polygons (KML, GeoJSON, native Google Maps API v3 polygons) and probably use the google.maps.geometry.poly.containsLocation(point:LatLng, polygon:Polygon) instead of LatLngBounds.contains to determine which cluster "owns" a marker.

Create directions on a map based on custom data

So what I'm trying to do is the following:
Have a map (such as Google Maps or questMaps). It doesn't matter at all which API I need to use.
On that map have an overlay on the streets. So say (for example) the street has bad lightning at night, it will be colored red. If it has good lightning it will have a green overlay.
Based on the overlay the map creates a custom route (for example the user only wants to walk on the green/well lit streets).
I have no idea how to accomplish this (especially step 3).
First, you'll have to decide what data you need. How do you categorize certain streets as lit or unlit? What if some parts of a street are well lit and some have no lights? Do you need to know the location of every streetlight in your area? What if lights burn out?
After figuring out what data you need, you need to build your dataset. I'd be VERY surprised if this data already exists, so you will probably need to gather it yourself. Either go around town and take notes, or crowdsource the project, or figure out some other way.
Once you have gathered your data, learn the drawing API of whatever mapping tool you wish to use. They all should have functions in their API for drawing colored lines (for streets) or points (for streetlights) on top of an existing map.
Finally, learn the navigational API of the mapping tool you chose. You're right, this is a hard step. I know Google Maps lets you specify certain waypoints when requesting directions; maybe your app can calculate well-lit waypoints and feed them to Google Maps' Directions service to influence the route it generates.
Good luck!
For custom routing, you need to read up on "Graph Theory". This ignores the geography of the street map, and considers it as a set of junctions (nodes or vertices in the graph theory jargon) connected by edges. You can assign weights to edges - these could be lengths, travel times, ones and zeroes etc. Anything. They can have no relation to the position on the map.
So for your application, you'd assign a large weight to unlit streets, and a small weight to lit streets, then use a standard minimum-weight algorithm to get a route from one node to another.

Highlighting borders of state and cities of US in Google Map API 3

I have a scenario where I have to highlight borders and shade a state or city after geocoding it (when I got the lang and lat).
How can I do this, do I need to have a complete information of a city to surround it with polylines? Or is there a way that map API can do this for me.
True. Google does not provide this feature. So what we can do... we can have the lat/long of the borders of the state. And we have to draw polygons ourselves.
I used this JS object. And changed it to Google map object (google.maps.LatLng).
For example:
var statesobj = {"AK": [new google.maps.LatLng(70.0187, -141.0205),
new google.maps.LatLng(70.1292, -141.7291),
new google.maps.LatLng(70.4515, -144.8163)]}
So, it's easy now. Loop on these lat/longs. And you can draw the polygons on every state of US.
So this is the solution I came up. If you guys know some better idea to do it. Please share.
You can also try Google Geo Charts:
http://code.google.com/apis/chart/interactive/docs/gallery/geochart.html
Google Maps API doesn't allow you to retrieve city borders. There are a couple other places from which you can get the coordinates, though:
Flickr API
There is a Flickr API based on photos that people tag, but it's only as accurate as the people who tag photos: so it's good enough for bootstrapping but probably not for production: http://karya-blog.blogspot.com/2012/12/fetching-city-polygons-with-flickr-api.html
Natural Earth Data
An accurate alternative is www.naturalearthdata.com. To get that data from there you just need to make two requests: one with the city name and one with their ID to get the parameters:
unlock.edina.ac.uk/ws/search?name=berlin&gazetteer=naturalearth&format=json
and then
unlock.edina.ac.uk/ws/footprintLookup?format=json&identifier=14126951
and you're set :)
Mapzen
If it's possible for you to pre-fetch the data, go for Mapzen, they have a full and pretty accurate database: https://mapzen.com/data/borders/
I'm afraid google maps API doesn't provide any means to access region (country, state, city, ...) shapes.
If you want to highlight regions you have to create custom overlays based on data acquired elsewhere.
Now the basic map example includes a "mashup" of data. When identifying data is fed to the web service, the resulting output can pinpoint locations on the map.
It shows how a geographic Map Marker is placed on the map to identify a specific location. Map Markers can use the default icon (shown) or a custom image, gauge, or even a chart. Optionally, the map can be configured to display a Map Marker Info window, containing additional location-specific data, when the marker is clicked.
It includes data-driven, colored regions (in this case, representing postal codes) overlaid a map of eg Washington, DC. Logi Info can work with GIS boundary data to produce region overlays for states, counties, cities, school districts, and other areas. Like the Map Marker, regions can be clicked to display a pop-up information window with detail data.

Resources