geoportal idea

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
qtrimble's picture

I have a bunch of georeferenced data (published as web services) that I would like to display in a Flex web mapping application which is embedded onto a Drupal page.

If I create a custom content type (geospatial data) which captures some metadata about each georeferenced dataset, including the map service url can I then pass the URL (CCK field) into an embedded Flex web mapping application?

I've already written the generic mapping tools using the ArcGIS Server Flex API which support all Flex 3.x SDK versions. On the Drupal end, I'm thinking that CCK is necessary to define the fields which will contain the information that will be used by the Flex web app. The part that I'm stumped with is how to write the Flex app to consume the data stored in the CCFK fields.

Quaye

Comments

You have at least two

waldmanm's picture

You have at least two options:

  1. If you only need to pass a URL or a few values, you can set flashvars that are passed to the SWF file when it is invoked (e.g., with SWFObject). You can access them inside your app as Application.application.parameter.

  2. Alternatively, you can use Services and AMFPHP and call the node.get method to get a node and read its fields. A good primer on that is here:
    http://electricpineapple.net/2009/03/10/api-keys-to-the-city-setting-up-...

There are some modules such as SWFObject and SWFAddress to help in the integration. I ended up with a customized page template, using info from the SWFAddress web site: http://www.asual.com/swfaddress/

HTH

Thanks for the recommendations

qtrimble's picture

Thanks for the recommendations. I was able to retrieve some node data following a simple walk through here: http://groups.drupal.org/node/2768.

I found this link easier to follow than the recommended item 2 link. However, I do plan on reading more into the use of api keys and session ids since they seem very important for security reasons.

As mentioned, the example I followed was great but the example explicitly calls the node id using the node.get call. I plan on modifying my custom content type template file to include the swf file so the node content and the flex app will coexist on the same page. With that said, is it possible to auto-detect the node information that the Flex app needs to perform its mapping duties?

Update

qtrimble's picture

So I'm well on my way to fulfilling my original objective. I am now using the Flash Node and the SWF Tools modules and with some extra php, pulling CCK field content from the node and passing flashvars into my Flex application using a Flash node filter. The Flex application uses the flashvars to define the web service to use for displaying my geographic data.

I'm using views to list my data by type and by associated project but now I would like display each geographic dataset by it's location. I think the GMap would be best for this since it integrates so nicely with views. So I'll start by creating Latitude and Longitude CCK fields to store the centroid coordinates of each data set. The tricky part is automating the extraction of this information from the web service. I can do it in the Flex app but then I have to pass this back to the node somehow. I'm exploring different approaches to this but if anyone has any ideas, please feel free to share.

Adobe Technologies

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: