Can each layer in a Bing map have its own datasource? - asp.net

If so, is it possible to bind that datasource to the layer so that it produces the appropriate number of pushpins based on values in the datasource?

If you just want to split the layer to manage your pushpins in an easier way, you can add some entities to your map like following:
pinLayer = new Microsoft.Maps.EntityCollection({ zIndex: 13 });
map.entities.push(pinLayer);
Follow this Link to get more explanation about layers on Bing Maps

Related

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

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);

Using HeatmapLayer with data from FusionTablesLayer (Google Maps API)

How can I display a heatmap with the Google Maps API with data from a Fusion Table (Layer)?
With a FusionTablesLayer I can select and display the data (as markers).
layer = new google.maps.FusionTablesLayer({
query: {
select: '\'Geocodable address\'',
where: 'City=\''+city+'\' AND Category = \'companies\'',
from: 'sdfgfdgfsdfewrrtre34534543egffg'
},
heatmap: {
enabled: true
},
templateId: 0,
styleId: 1
});
However, I can't display the data as heatmap. I tried adding 'maxIntensity' and 'radius' as parameters but this did not work. I get a map like this one in this post.
Now, I'm looking to the HeatmapLayer but don't know how to retrieve the data as with the FusionTablesLayer. Somehow the 'query' parameter does not work in HeatmapLayer.
Therefore my question: How can I display a heatmap with the Google Maps API with data from a Fusion Table?
Sorry, there is nothing you can do.
Heatmaps created via a FusionTablesLayer did not have any configurable options.
To be able to use a HeatMapLayer with the data from a FusionTable you must download these data, and the data must include a location(a LatLng, not an address ).
When you didn't store these LatLng's on your own in a column you're not able to get them, the LatLng's created internally via geocoding are not accessible via download.

Google's Fusion Tables Layer: IN query - what about multiple columns?

I want a google map where I can query different columns from my fusion table to display on the map when a user selects a checkbox. Google's Fusion Tables Layer Example: IN query is great if the data you want to display is in one column, but mine is in multiple columns, and I am not a programmer and cannot figure this out.
Is it possible to query different columns to display on your map using checkboxes?
Lets use the IN query example from above.
Here is the map and code: https://developers.google.com/fusiontables/docs/samples/in
Here is the fusion table: https://www.google.com/fusiontables/DataSource?docid=15UY2pgiz8sRkq37p2TaJd64U7M_2HDVqHT3Quw
Lets say there are additional columns to the fusion table: A, B, and C with a "yes" or "no" value like the delivery column.
I want the map to load with all stores displayed, and
I want checkboxes for:
delivery
A
B
C
So the user can select/deselect these using the checkbox and then those with "yes" will display on the map.
Is this even possible? If so, could someone please provide the code? I have looked everywhere and cannot find an example like this that pulls from different columns.
Thank you!
Consider using Derek Eder's Searchable Map Template, which lets you build a filtered map such as you are describing.

Getting marker data from a google map v3

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);}

Resources