Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP6 + MapPoint ActiveX Use Question

Status
Not open for further replies.

JRB-Bldr

Programmer
May 17, 2001
3,281
US
I have been trying to find out how to get the following MapPoint ActiveX properites to work with VFP6

I can get MapPoint to open and I can get the appropriate data set working with it, but I need to set up the map object to appear in the user's desired manner.

So far, I have:
oMap=CREATEOBJECT('mappoint.application')
oMap.application.ActiveMap.DataSets.ImportData(<my data>)
oMap.Visible= .T.
and it all works fine to this point.

However I still need to figure out how/where to get the following properties set:
DataMapType = 1 && Shaded Area Map
DataRangeType = 3 && Equal Distinct Ranges
DataRanges.Count = 8 && 8 Value Ranges
ColorScheme = 15 && Full Spectrum Color Set

My attempts to date have all ended up with an error message.

I either am attempting to assign the property and its value to an in-correct &quot;parent&quot; object or, in some other manner, am not doing it right.

If you have any suggestions, they would be most appreciated.

Thanks,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
jrbbldr

I cannot shed too much light on this subject (since I do not have MapPoint installed anywhere on my systems), but one thing I noticed is the Properties you are refering to (ie:DataMapType,DataRangeType,DataRanges.Count,ColorScheme) are part of the Datasets object not the oMap object, in other word, I think if you need to access these properties you need to have an instance of the datasets: (this is untested but the sample of the VB code I saw seem to suggest this approach)


oMap=CREATEOBJECT('mappoint.application')
Mydatasets=oMap.application.ActiveMap.DataSets.ImportData(<my data>)
myDatasets.DataMapType=1
oMap.Visible= .T.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
DataMapType is a property of the dataset and is Read-Only

DataRangeType is a property of the dataranges collection and is Read-Only

DataRanges.Count is Read-Only and returns the number of datarange objects in the collection

ColorScheme is a property of the DataRanges collection and is Read-Only

The entire object model is in the helpfile that comes with Mappoint under Programming Information, you obviously can't set Read-Only properties...However, there are a number of ways that you can change these values...wanna change the DataMapType then you need to create the type of map you are looking for...pushpin, shaded area, etc. Wanna change the DataRanges.Count...then you need to create more data ranges.

Slighthaze = NULL
 
Mike & SlightHaze -- Thanks for your input.

Being new to MapPoint I still have questions on how to:
&quot;wanna change the DataMapType then you need to create the type of map you are looking for...pushpin, shaded area, etc. Wanna change the DataRanges.Count...then you need to create more data ranges.&quot;

Yes, I can manually create a Data Map with the user's data and with the specific visual format properties which the user needs.

But how to do it other than manually?

SlightHaze -- When you say &quot;there are a number of ways that you can change these values&quot;
Here is where I am at a loss as to how to make it happen.

Any additional advice would be greatly appreciated.

Thanks,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Well there is a lot of stuff that I would need to know in order to give you coding examples specific to your needs. I could give you for-instances for all kinds of stuff, but I think it would be more productive if you could give me a little more of an idea about what you are trying to do. Such as, where is the data coming from (I'm assuming VFP tables at this point), what are you trying to display to the user from that data, what are you attempting to let the user control, and any other specifics you can think of that might narrow it down a bit. Maybe a quick statement about what the application is designed to accomplish for the user would bridge a lot of the gaps for me. If you have code that is working up to a point, but are stuck on a particular portion you might try posting part of it and then I could help you build from there. Once I have some sense of what we're about here I can give you some code snippets to help you along and tell you if any of it is impossible given the current Mappoint object model limitations. Speaking of which, what version of Mappoint are you developing this for?

Slighthaze = NULL
 
SlightHaze - thanks for the reply.

I have a VFP6 application which is gathering Total Sales per State data from another application's data files.
I am currently using or, more accurately, evaluating the use of MapPoint 2002

The application currently:
* gathers the data fine
* outputs it to a MapPoint compatible Data file
* then successfully executes
oMap=CREATEOBJECT('mappoint.application')
oMap.application.ActiveMap.DataSets.ImportData(<my data>)
oMap.Visible= .T.

However when I look at the current map, it does not appear as needed. Instead it has the Default display of:
* the Road and Data format
* it does not have Equal Distinct Data Ranges
* even when I manually set it to Equal Distinct Data Ranges it only has 3 when I want the maximum of 8
* it does not represent the data per state as Shaded values.

Esentially it does not display the DataSet properites that I have discussed:
DataMapType = 1 && Shaded Area Map
DataRangeType = 3 && Equal Distinct Ranges
DataRanges.Count = 8 && 8 Value Ranges
ColorScheme = 15 && Full Spectrum Color Set

This does not seem like it should be a difficult task to accomplish.

I have done similar things before with older (now obsolete) data mapping tools and now I want to do it with one of &quot;today's&quot; tools. It just seems like getting the map to display as desired shouldn't be this difficult to make happen.

Depending on how many other people are getting value from this discussion on what is primarily a MapPoint utilization issue (albeit via VFP6), we can continue this discussion via email or continue to do it here.

Your continued support and advice is much appreciated.

Thanks,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top