# Monday, July 07, 2008

I had another problem with Mapguide Enterprise 2009 recently pertaining to objects not being selectable.  Unlike my previous post on errors caused by layers, no errors were logged to the Mapguide server logs.  This problem is very likely specific to the enterprise version, as I was using the Autodesk FDO Provider for Oracle.

So a data connection was created pointing to the Oracle 10g schema.  This database contained a number of tables containing Lat/Long point geometry entities.  I created a layer pointing to the table in question.  I created a layer pointing to that data connection.  At this point the entities showed up as expected in the both the DWF and the AJAX viewers.  Once again, I could not select any of the entities.  I checked the server logs, no errors were reported.

In troubleshoot mode, I tried just about everything I could think of but nothing would work.  I simplified the theme, created new layers, removed all other layers from them map.  Eventually I created a new layer from another table.  Luckily, the entities on this layer could be selected.  It must be a problem with the underlying data.  On a hunch, I checked the table definitions - specifically looking at primary keys.  The selectable layer had a primary key defined, the problem layer did not.  (Good thing I cannot take credit for creating this source data =))

So, I created a primary key on the problem table, did a touch on the layer definition (opening the definition in Studio and saving it without any changes) and then left for twenty minutes.  I'm thinking there is some sort of caching going within the server, and I'm not sure how it works.  Immediately reloading the map after adding the primary key did not work - the entities were still not selectable.  When I came back - the items in the viewers were now selectable.

So long story short, if again you cannot select map entities using the Autodesk FDO Provider for Oracle ensure that the source table has a primary key defined.  Hopefully this saves someone some grief =)

Monday, July 07, 2008 2:41:35 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |   |  Trackback
# Wednesday, June 25, 2008

Typically developers are color stupid (myself included).  I've seen some really really ugly maps.  I've created some really really ugly maps.  With Mapguide 6.5 in particular - I gave up on trying to create visually appealing maps.  The 255 colors, in the ranges defined I just could not do it.

With Mapguide Enterprise - I may have found a solution.  Recently I created a themed layer for municipalities.  There were twenty five municipalities in a single spatial table.  Each municipality had a unique code.   In an effort to bang these off quickly I added the twenty five municipalities and the filter condition.   Next I entered the twenty five legend labels.

Here is the developer friendly method I came up with creating a somewhat visually appealing color range.  In the first condition I set first set the transparency to 50%.  The transparency affects the resulting color.  Select the color combo and choose "More Colors".  This should bring up the custom color dialog.  First, select one of the "Custom Color" boxes and set the Hue to 0. Next I created a color I wanted to use as my starting shade.

At this point, I saved the color using the "Add to Custom Colors" button.  Your form should look something like this:

Mapguide Color Dialog

Click OK a couple of times and your first condition should be set.  Next I selected my next condition, and clicked the color combo again choosing "More Colors" once again.  This time, select the saved custom color and it should reset the form with the previously saved shade.  At this point I incremented the Hue by 20 to 20.  Click ok a couple of times and repeat.  I was not re-saving my shade, though I suppose that might have made sense.  Each time you repeat this process increase the hue by 20 until you hit the max of 239.

If needed, and you do hit the max hue start the process over starting with another complimentary base shade with a hue of 0. Using a hue increment of 40 might have resulted in more distinct colorations and may be a good idea.

I think it turned out OK, but then again as I stated earlier - I'm color stupid. 

Resulting Color Range

Wednesday, June 25, 2008 10:30:30 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |   |  Trackback