Skip to content
General Revolution Evolution Add-ons International
Login | Register | MODX.com
MODX Open Source Content Management System, Framework, Platform and More.
Find a Partner | Hosts + SaaS | Jobs | Donate
  • RegisterSign Up with the MODX Community
  • LoginUse Your MODX.com Account
  • MODX Community Forums
  • Add-ons
  • Images, Videos & Podcasts
  •  
  • Creating Dynamic Maps from Info from Database#

  • 11927
    105
    You may or may not want to use the code I write. It's probably all against the syntax rules of php and MODx. :)

    Carpet Cleaning

    heavensbest Reply #1, 10 months, 1 week ago

    Reply
    • Link to this post#1
    Does any one know of a good program or way to create a map that updates dynamically from information from a database?

    The information is the territories that are not for sale, so I would want to show the territories that are for sale in blue and the ones not for sale in gray. The territory boundaries are zip codes, roughly.

    I tried creating an image for each zip code and overlapping them, but that takes too long to load. Even if the files are gif I only load the images that not available which are gray over one image that is blue.


  • 28042
    15,112
    How MODx Evo Works

    Log in to an Evo Manager username guest, password guestuser.

    sottwell Reply #2, 10 months, 1 week ago

    Reply
    • Link to this post#2
    This might be of interest to you. http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html

    Google Maps uses AJAX, and also has an API for letting you create your own maps http://code.google.com/apis/maps/index.html


  • 4172
    1,615
    xdbedit - create your own CMP to edit custom-tables with TV-input-types
    MIGX (multiItemsGridTV, sortable multirecord-TV)
    formit2db with autocreate schema&classes
    formit2resource
    custom-tv-input-type for revo:imagelistTV
    quickCMP - CMP for creating simple backend-'modules' per snippets
    bloX/Xedit - Ressource-Listing and frontend-sorting/editing....

    Bruno17 Reply #3, 10 months, 1 week ago

    Reply
    • Link to this post#3
    this script can merge transparent gifs of same size together and saves it to a new gif.
    You can run that script onSaveSomething.

    <?php
    
    $regions='calabria,abruzzo,toscana';
    $regions=explode(',',$regions);
    
    // Create image instances
    $src_path = $modx->getOption('assets_path').'images/map/';
    $src_url =  $modx->getOption('assets_url').'images/map/';
    
    $dest = imagecreatefromgif($src_path.'italia.gif');
    
    //Get the sizes of image   
        $srcx=imageSX($dest);
        $srcy=imageSY($dest);
    
    // Copy and merge images together
    foreach ($regions as $region){
        $src = imagecreatefromgif($src_path.$region.'.gif');
        imagecopymerge($dest, $src, 0, 0, 0, 0, $srcx, $srcy, 100);
    }
    
    
    // Save the image as a GIF
    $img = imagegif($dest,$src_path.'map.gif');
    
    // Output and free from memory
    $out = '<img src="'.$src_url.'map.gif"/>';
    // Free from memory
    
    imagedestroy($dest);
    imagedestroy($src);
    
    
    return $out;


  • 11927
    105
    You may or may not want to use the code I write. It's probably all against the syntax rules of php and MODx. :)

    Carpet Cleaning

    heavensbest Reply #4, 10 months, 1 week ago

    Reply
    • Link to this post#4
    sottwell ~ Thanks for the information. I looked into google maps api from the link you gave me and the only way I could tell to color code zip codes is by having the exact boundaries of each zip code. Getting up to date information like that is pretty pricey. Thank you though.

    Bruno 17 ~ I'm still amazed by all the things that can be done with php. Thank you. I think this may be the way to go.





Actions

Login to Post

Other Support Options

To file a bug or make a feature request visit our issue tracker, or you can also purchase commercial support.

Love MODX?

If you build sites for a living with MODX or just love using it, why not give back?

Information

Posted in this thread:
Bruno17, heavensbest, sottwell

 
Back to Top

MODX Global HQ

1333 N Stemmons Fwy, Ste 110
Dallas, TX 75207
United States

+1 (469) 777-MODX (6639)

The MODX Company

  • Contact
  • Media Center
  • Careers at MODX
  • Wall of Fame
  • The MODX Blog

Sponsors

SoftLayer Firehost: Secure Cloud Hosting

Stay Connected

Read our previous email newsletters.

Twitter Facebook Google+ LinkedIn github Feeds

Privacy Policy | Terms of Service | Pixels by AKTA Web Studio© 2005-2012 MODX. All rights reserved. Trademark Policy