Getting marker data from a google map v3 - google-maps-api-3

I have a google map v3 with a number of markers, which have a "category" attribute. I also have a left side menu bar, from which a user can select the desired category. When he/she clicks on the selected category, all the markers are cleared from the map, and only markers with the selected category are loaded.
Now, I need some sort of function which can search through the map and get the loaded markers and their data. The data will then be dynamically loaded in the right side menu bar. You can see the page I am talking about at this LINK
Please, any help will be highly appreciated...

I know this isn't the answer you are hoping for, but there is no good way to query the map and ask for all of the markers. As you load the map and create the markers, you want to keep an array of all of your markers or keep an array by category and track your markers in multiple arrays. Keeping an array for each marker type will make it much easier to turn them on/off; that's what I do. Hope this helps -

One solution:
1) Create an array of markers. Every time you create a marker, add it to the array. Also assign a property to the marker of 'category' or something.
marker.category='foo';
2) When user clicks on the button, look through your markers array and test if each marker matches the category. If it does not, set the map to null.
if (markers[iterator].category!='foo'){
markers[iterator].setMap(null);
} else {markers[iterator].setMap(map);}

Related

Report Builder MAP Parameters

Good Afternoon,
So I have built a State Map in Report builder that is separated into Counties. I have been pretty successful, however there is one thing I cannot figure out. When I click on the county, is it possible to pass the county name that I clicked to a chart on the same report. I can pass it to another report via go to report, but I would like to have it on the same document.I also kept getting a Subreport not found when I attempted that method. Any help is greatly appreciated.
Thanks!
A basic rule of SSRS is that with very few exceptions, you cannot change the content of a report unless you refresh the report.
Bearing this in mind, you have a couple of options..
Call the same report again as a subreport.
Assuming you only want your map and a single dynamic chart.
Add a parameter to the report that defaults to specific value such as 'none'. Then you can decide what do show in your chart when the parameter = 'none' or you could choose the hide the chart if the parameter is 'none'.
In your map go to the map's polygon properties and assign an action.
Set the action to be Go to Report
Choose your report (so we get the report to call itself)
Add a parameter, choose the parameter you added a few steps earlier as the name and select the field that contains the state name or ID etc as the value.
Your Chart's dataset can then be updated to use the new parameter in the dataset query.
Create a chart for every State
The other option is to create a chart for every state, you can do this using a table or list control and a subreport containing your chart, so you design will not have to have lots of charts individually placed.
Each Chart can have a bookmark set (most objects have a bookmark property) that is the name or ID of the state it represents.
Then in your map, set the action properties in the polygon properties to 'Go to bookmark' and then use the state name or ID as the bookmark expression to go to.

HERE - Cluster view all items in clusterprovider

after adding all items into a clustered data provider i would like to set the bounds of the map to make sure all items are displayed.
in case of a marker group this is easy by using the bounding box of the marker group but i cant figure out what to use with a clustered data provider
H.clustering.ICluster contains method getBoundingBox() that could help to set the bounds of the map.
Reference can be taken from here :
https://developer.here.com/documentation/maps/3.1.17.0/api_reference/H.clustering.ICluster.html

Is it possible to add values to table widget programmatically in Google Appmakers

I am able to show the data source data in google app maker table widget, but I don not know how to show static values (array of object) to table widgets programmatically.
I am new to app maker,I don not know is it possible to add values to table widget programmatically or not.
If any one knows please help me...
Thank you in advance :)
To call your own create children method you would want to set up a panel similar to the picture provided and set a datasource for that panel for which items you want to appear in that panel.
Then go to events for that panel and in the onDataLoad event enter the following code as it pertains to your own data. In my example I used a datasource called employees, and I created a label with the employee name for each item in the datasource.
widget.datasource.items.forEach(function(item) {
var node = document.createElement('div');
node.className = 'app-Label';
node.style.margin = '8px';
node.textContent = item.EmployeeName;
widget.getElement().appendChild(node);
});
That is about the simplest example I have. In the case of a table you would want to create your own base container, a header, and then a container that holds all your table rows. Then in your table body you would set up a similar script that attaches row panels and in the row panels you would create your labels. This would also be possible to declare your own array of objects and loop over each object this way.

How can I add layers to Here Maps?

I am starting with here-api,I follow the examples and I add some markers in the map, but i nedd and a layer switcher, to select multiple layers with differents markers, and shown it in the map but i cant do it. The markers are, static and the map not reload the firt markers.
I try to put more than one maps, in tabs, but not work. Some idea about it?
Sorry for my english.
Regards.
As much as I know, Here JS API does not support this kind of layers out of the box, but you can implement is quite simply.
You can use something called a Group.
From the documentation:
Groups are logical containers which can hold a collection of child objects (markers or spatials, but
also sub-groups). Groups make it easy to add, remove, show or hide whole sets of map objects in
an atomic operation, without the need to manipulate each object individually. In addition, a group
allows you to calculate a bounding box enclosing all the objects it contains and to listen for events
dispatched by the group's child objects.
It means that you can add some objects (markers, polylines, polygons) into one group and some into another group. Then you can use addObject and removeObject methods on the map accordingly to add or remove this group (group extends Object class).
group = new H.map.Group();
group.addObject(marker1);
group.addObject(marker2);
// add to map
map.addObject(group);
// remove from map
map.removeObject(group);

Trying to eliminate duplicate markers in GMaps V3 sidebar

I'm using google maps v3 API to display markers from an XML document, and I'm utilizing marker manager to specify the number of markers to show per zoom level.
Here's the link: http://www.wrh.noaa.gov/mfr/rec/v2/index_sidebar_zoom.php
And here's the problem. It seems that upon loading, the script loads all the markers for each zoom level together, so even though I only have ~200 markers, my marker array, named "batch", contains 507 markers. When I display "batch" on the sidebar, it thus displays some duplicate markers.
So to troubleshoot this, I tried to eliminate duplicates using a jquery script I found. However, when I alert the length of the "batch" array and then alert the length of the new array (supposed to be free of duplicates), it shows 507 as well.
So, any suggestions on how to eliminate the duplicate markers, and sort them alphabetically to display on the sidebar?
Lastly, I seem to have lost my functionality of displaying more markers as I zoom in while I've been working on the sidebar. Any ideas on what happened to that functionality?
Thanks for any help,
S
The MarkerManager is diplaying the first 48 markers 4 times, the first 98 markers 3 times, the first 150 markers twice. Is that what you want?
mgr.addMarkers(createMarker(48), 6);
mgr.addMarkers(createMarker(98), 7);
mgr.addMarkers(createMarker(150), 8);
mgr.addMarkers(createMarker(211), 9);
I think what you want is this:
mgr.addMarkers(createMarker(0,48), 6);
mgr.addMarkers(createMarker(48,98), 7);
mgr.addMarkers(createMarker(98,150), 8);
mgr.addMarkers(createMarker(150,211), 9);
And change your createMarker function to take a start and end number.
Like this

Resources