Showing posts with label drupal. Show all posts
Showing posts with label drupal. Show all posts

Monday, March 15, 2010

Tilecaching MXD/ArcGIS Server to file/folder-based only (e.g. google, mapnik)

So it seems like there's no automated way to go from mxd to file/folder based (rather than web service) tile cache. The best I could do was use maptiler/gdal2tiles (maptiler is a very nice gui for gdal2tiles) to cache raster layers. This will fuse multiple raster layers, but doesn't handle vectors. If you want to pass vectors through here you can always convert to raster with some other tool but you'll end up loosing any scale dependencies. Please note, you'll likely have to incorporate a part of their auto-generated code for google maps, since the file naming doesn't completely conform to x/y/z google scheme naming. I've included my modified tile provider class for the gmap_overlays submodule (part of the gmap addons submod collection ... lives in PATH_TO_DRUPAL\sites\all\modules\gmap_addons\gmap_overlays\js), which handles output from maptiler/gdal2tiles.

note: exposing as wms and using tilecache might be a good idea, but this non-automated solution that is OK for me right now

Thursday, March 4, 2010

Drupal SWFTools Error

Was getting the following error: "You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialize correctly." on Chrome and I.E. only. Figured out that by changing the embed method under Embedding settings (Home>Administer>Site configuration>SWF Tools>Embedding settings) back to "Direct embedding - do not use JavaScript replacement" from " SWFObject 2 - JavaScript" I no longer get this error

Tile basemap through Views/GMaps module (Drupal)

To add a tiled basemap to a gmap created with views (and the gmaps) module:

1. First make sure that you have a gmap set up through views. This is a good tutorial: http://groups.drupal.org/node/19614

2. Next download the GMap Addons module, if you haven't already done so

3. Create a map tile structure using something like tilecache, mapcruncher, or ArcGIS (you can generate a map with the google maps scheme, just not sure where to get an xml that would adequately describe the scheme to ArcGIS)

4. Finally add a tile overlay macro within the style (GMap) configuration for this view. Use the following form:

[gmap |overlay=tile:http://host/tilesdirectory/{Z}/{X}/{Y}.png]

... notice you don't need to substitute anything for Z, X, or Y ... these correspond to folder numbering as generated with tilecache (or other tiling program) using the google maps scheme.

If you save the view you should now be able to see your basemap in a page generated by that view.

Thursday, March 12, 2009

Blocks not displaying in their regions?

Blocks not displaying in their regions? Delete the block and then create it again and add again to the appropriate region. This worked for me.

Wednesday, December 10, 2008

distinct Drupal user list with views

having trouble displaying a DISTINCT user list with views? This problem often arises because you need to choose the 'user' type view when you are first creating the new view.

Tuesday, December 9, 2008

Drupal Views Templates and CCK $fields Array

Having difficulty accessing the $fields array under your Drupal Views template? Are you sure you have named your template correctly (for instance, if you have named it with 'field' instead of 'fields' the template will apply to individual fields, for which the $fields array is not exposed)

Thursday, December 4, 2008

How to migrate Drupal to xampp for Development



Occasionally it is important to work on a local development machine. For this task I often use the xampp package, which mirrors a standard lamp stack.

To migrate an existing remote drupal site do the following:
  1. install xampp at c:\xampp
  2. modify c:\xampp\apache\conf\httpd.conf
    1. the line 'Listen 80' to 'Listen 88'
    2. If you had Clean URLs on your remote site (i.e. localhost/drupal/admin instead of localhost/drupal/?q=admin)
      1. #LoadModule rewrite_module modules/mod_rewrite.so' to ' LoadModule rewrite_module modules/mod_rewrite.so' (take out the #)
      1. AllowOverride None to AllowOverride All
    3. start apache and mysql from the xampp interface (you may need to change mysql configuration)
  3. copy over the following folders to a new 'drupal_remote_site' folder on your local machine
    1. Themes
    2. Modules
    3. Files
  4. if you don't already have the Backup and Migrate module on your remote machine, install it
  5. backup your database on the remote machine, copy this into the local folder 'drupal_remote_site'
  6. install the same version of drupal on your local machine which you had on your remote -- note: this downloads as a tarball which must be expanded and copied into within c:\xampp\htdocs\drupal (rename the copied folder as drupal from drupal-6.5 for instance)
  7. copy in your themes, modules, and files folder into this new drupal folder
  8. go to http://localhost:88/drupal/install.php, this will install necessary tables,etc. into the db
  9. now enable the Backup and Migrate module on the local machine
  10. use the 'Restore/Import DB' tab in drupal to import your db
  11. voila, all should be back to normal

Wednesday, December 3, 2008

The $fields array in Drupal (CCK)

the $fields array is very important for accessing field content when doing custom theming. Unfortunately field names are not well documented, nor are they intuitive. For example, the field name for a node:link field is view_node. In order to track down names of my fields I usually use print_r ... the trick here is that you must look for 'stdClass Object', almost always the index giving these objects as values are the names of the fields used within the $fields array.

For example:
[field_image_fid] => stdClass Object ( [content] =>

can be accessed in your tpl.php by:
$fields['field_image_fid']->content

Tuesday, November 25, 2008

having trouble with no "active" class being generated for menu's or primary/secondary links (
  • ) in Drupal 6.x? It has been documented that 6.x has issues with generating an active class ... at 6.5 the active
  • is classed as "active-trail", so if you are bringing in a theme that worked at 5.x this might be the issue.

    For me it was a naming issue within my primary links configuration (the same would be true for a menu). You must use a Drupal recognizable path such as "" for your homepage or "data" for a page at "http://www.yoursite.com/data". To avoid this, make sure to select this menu when creating new content.