Hi All,
I want to bind the shapefile. But data would be coming from database as it is dynamic instead of DBF file. Is it possible to bind shape file and dynamic data from database. If so can you post the sample?
Thanks in Advance,
Pavan
Hi, Pavan
If your data comes from a database the way to go is to provide custom data source containing both your geographic coordinates and data related to shapes/points. To do that follow this instructions in this help topic: Configuring Geographic Shapes Series: Configuring Custom Shape Data Source.
If your geographic data is in a shapefile and your data is in a database I strongly suggest you to migrate the geographic data into the database which can be achieved with a variety of tools.
Cheers, Lazar
Hi,
After Reading the shape file is it possible to filter the shapes based on some filter like id/Name and display only those shapes from the shape file?
For Example If I am click on Texas shape Can i Display Only counties belonging to Texas from whole counties shape file. If so Can you please post the code?
Pavan.
Hi Lazar,
My requirement is not to make the clicked shape disappear, but make few shapes which are from the shapefile to dissapear.
For Example if I click on State 'AK' then I will load all counties shapfile. Here I need to show only counties belonging to 'AK'. So I need to make all other counties shapes besides AK to be invisible.
_areaID ='AK';
shape contains a field 'BoundaryID' which can be used to filter 'AK'
function (shape) {
var pop = shape.fields.item("BoundaryID");
if (_areaID != pop) {
shape.visibility($.ig.Visibility.prototype.collapsed);
}
else
shape.visibility($.ig.Visibility.prototype.visible);
But here it is giving error saying shape has no method 'visibility'.
Can you please look into this.
Regards,
It was just easier for me to use the context of the sample and that is why the example provided by me makes the selected shape disappear.
Your code is not working because you are using the first argument of the callback and not the second one. The callback function is passed two arguments. The first one provides the data associated to the particular shape being processed by the control. The second argument gives access to the shape series and some other state information and auxiliary methods related to the shape. One of the auxiliary methods is visibility() which allows you to configure the particular shape to be visible or not.
You need to change your code like this:
Thanks a Ton Lazar !!! One more small doubt. I am able to make the shapes invisible. But when I am hovering through the invisible shapes I am able to see the tooltip of those shapes. Can you tell me how to make tool tip also disabled for them.
I am very new to JavaScript/JQuery. I am working on igMap(JavaScript/Html 5) and I want to display only USA but not world map. Please someone suggest me to achieve the same.
If you set the backgroundContent to null it should hide the world map.