'); // Add ArcGIS js API drupal_set_html_head($script .'src="http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.4">'); // Setup Map Id drupal_add_js(array('gmap_arcgis' => array('id' => $map['id'])), 'setting'); /** * Setup polygons and labels. Labels have the following format: * * $map['arcgis']['labels'] = array($layer1 [, $layer2 [,... $layerN]]); * * Where $layer is * * $layer = array($layer_uri, $fields, $content, $icon); * * Where $layer_uri is a MapService layer, $fields is an array with * a pair of layer fields to pass to the query, $content is a string * with the content to display for each marker and $icon is an array * with parameteres from a GIcon class * * $icon = array($shadow, $image, $info_size, $shadow_size, * $info_anchor, $info_window_anchor); * * For more info on the GIcon class, see * http://code.google.com/intl/pt-BR/apis/maps/documentation/reference.html#GIcon * * Example: * * $labels = array( * array("http://mapservice/layer1", array('id', 'name'), array( * NULL, 'http://path/to/icon.png', * array(20, 34), array(37, 34), array(9, 34), array(9, 2) * ) * ), * array("http://mapservice/layer2"), * ); */ if (isset($map['arcgis']['polygons'])) { drupal_add_js(array('gmap_arcgis' => array('polygons' => $map['arcgis']['polygons'])), 'setting'); } if (isset($map['arcgis']['labels'])) { drupal_add_js(array('gmap_arcgis' => array('labels' => $map['arcgis']['labels'])), 'setting'); } // Add custom js $gmap_arcgis_path = drupal_get_path('module', 'gmap_arcgis') .'/'; drupal_add_js($gmap_arcgis_path .'gmap_arcgis.js'); } } }