コード例 #1
0
ファイル: SM_GoogleMaps.php プロジェクト: schwarer2006/wikia
function smfInitGoogleMaps()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['SMGoogleMapsQP'] = dirname(__FILE__) . '/SM_GoogleMapsQP.php';
    MapsMappingServices::registerServiceFeature('googlemaps2', 'qp', 'SMMapPrinter');
    return true;
}
コード例 #2
0
ファイル: SM_FormInputs.php プロジェクト: Tjorriemorrie/app
 public static function initialize()
 {
     global $wgAutoloadClasses;
     // This code should not get called when SF is not loaded, but let's have this
     // check to not run into problems when people mess up the settings.
     if (!defined('SF_VERSION')) {
         return true;
     }
     $wgAutoloadClasses['SMFormInput'] = __DIR__ . '/SM_FormInput.php';
     $hasFormInputs = false;
     foreach (MapsMappingServices::getServiceIdentifiers() as $serviceIdentifier) {
         $service = MapsMappingServices::getServiceInstance($serviceIdentifier);
         // Check if the service has a form input.
         $FIClass = $service->getFeature('fi');
         // If the service has no FI, skipt it and continue with the next one.
         if ($FIClass === false) {
             continue;
         }
         // At least one form input will be enabled when this point is reached.
         $hasFormInputs = true;
         // Add the result form input type for the service name.
         self::initFormHook($service->getName(), $service->getName());
         // Loop through the service alliases, and add them as form input types.
         foreach ($service->getAliases() as $alias) {
             self::initFormHook($alias, $service->getName());
         }
     }
     // Add the 'map' form input type if there are mapping services that have FI's loaded.
     if ($hasFormInputs) {
         self::initFormHook('map');
     }
     self::initFormHook('googlemapsEditor');
     return true;
 }
コード例 #3
0
ファイル: Maps_Geocode.php プロジェクト: yusufchang/app
 /**
  * Returns an array containing the parameter info.
  * @see ParserHook::getParameterInfo
  * 
  * @since 0.7
  * 
  * @return array
  */
 protected function getParameterInfo($type)
 {
     global $egMapsAvailableGeoServices, $egMapsAvailableCoordNotations;
     global $egMapsDefaultGeoService, $egMapsCoordinateNotation;
     global $egMapsAllowCoordsGeocoding, $egMapsCoordinateDirectional;
     $params = array();
     $params['location'] = new Parameter('location');
     $params['location']->addDependencies('mappingservice', 'geoservice');
     $params['location']->addCriteria(new CriterionIsLocation());
     $params['location']->setMessage('maps-geocode-par-location');
     $params['mappingservice'] = new Parameter('mappingservice', Parameter::TYPE_STRING, '', array(), array(new CriterionInArray(MapsMappingServices::getAllServiceValues())));
     $params['mappingservice']->addManipulations(new ParamManipulationFunctions('strtolower'));
     $params['mappingservice']->setMessage('maps-geocode-par-mappingservice');
     $params['geoservice'] = new Parameter('geoservice', Parameter::TYPE_STRING, $egMapsDefaultGeoService, array('service'), array(new CriterionInArray($egMapsAvailableGeoServices)));
     $params['geoservice']->addManipulations(new ParamManipulationFunctions('strtolower'));
     $params['geoservice']->setMessage('maps-geocode-par-geoservice');
     $params['allowcoordinates'] = new Parameter('allowcoordinates', Parameter::TYPE_BOOLEAN, $egMapsAllowCoordsGeocoding);
     $params['allowcoordinates']->setMessage('maps-geocode-par-allowcoordinates');
     $params['format'] = new Parameter('format', Parameter::TYPE_STRING, $egMapsCoordinateNotation, array('notation'), array(new CriterionInArray($egMapsAvailableCoordNotations)));
     $params['format']->addManipulations(new ParamManipulationFunctions('strtolower'));
     $params['format']->setMessage('maps-geocode-par-format');
     $params['directional'] = new Parameter('directional', Parameter::TYPE_BOOLEAN, $egMapsCoordinateDirectional);
     $params['directional']->setMessage('maps-geocode-par-directional');
     return $params;
 }
コード例 #4
0
 /**
  * Initialization function for Maps query printer functionality.
  */
 public static function initialize()
 {
     global $wgAutoloadClasses;
     $wgAutoloadClasses['SMQueryHandler'] = dirname(__FILE__) . '/SM_QueryHandler.php';
     $wgAutoloadClasses['SMMapper'] = dirname(__FILE__) . '/SM_Mapper.php';
     $wgAutoloadClasses['SMMapPrinter'] = dirname(__FILE__) . '/SM_MapPrinter.php';
     $wgAutoloadClasses['SMKMLPrinter'] = dirname(__FILE__) . '/SM_KMLPrinter.php';
     self::initFormat('kml', 'SMKMLPrinter');
     $hasQueryPrinters = false;
     foreach (MapsMappingServices::getServiceIdentifiers() as $serviceIdentifier) {
         $service = MapsMappingServices::getServiceInstance($serviceIdentifier);
         // Check if the service has a query printer.
         $QPClass = $service->getFeature('qp');
         // If the service has no QP, skipt it and continue with the next one.
         if ($QPClass === false) {
             continue;
         }
         // At least one query printer will be enabled when this point is reached.
         $hasQueryPrinters = true;
         // Initiate the format.
         $aliases = $service->getAliases();
         self::initFormat($service->getName(), 'SMMapper', $aliases);
     }
     // Add the 'map' result format if there are mapping services that have QP's loaded.
     if ($hasQueryPrinters) {
         self::initFormat('map', 'SMMapper');
     }
     return true;
 }
コード例 #5
0
 /**
  * Initialization function for Maps query printer functionality.
  */
 public static function initialize()
 {
     global $wgAutoloadClasses, $egMapsDefaultServices;
     $wgAutoloadClasses['SMQueryHandler'] = __DIR__ . '/SM_QueryHandler.php';
     $wgAutoloadClasses['SMMapPrinter'] = __DIR__ . '/SM_MapPrinter.php';
     $wgAutoloadClasses['SMKMLPrinter'] = __DIR__ . '/SM_KMLPrinter.php';
     self::initFormat('kml', 'SMKMLPrinter');
     foreach (MapsMappingServices::getServiceIdentifiers() as $serviceIdentifier) {
         $service = MapsMappingServices::getServiceInstance($serviceIdentifier);
         // Check if the service has a query printer.
         $QPClass = $service->getFeature('qp');
         // If the service has no QP, skipt it and continue with the next one.
         if ($QPClass === false) {
             continue;
         }
         // Initiate the format.
         $aliases = $service->getAliases();
         // Add the 'map' result format if there are mapping services that have QP's loaded.
         if ($egMapsDefaultServices['qp'] == $serviceIdentifier) {
             $aliases[] = 'map';
         }
         self::initFormat($service->getName(), 'SMMapPrinter', $aliases);
     }
     return true;
 }
コード例 #6
0
ファイル: YahooMaps.php プロジェクト: schwarer2006/wikia
function efMapsInitYahooMaps()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['MapsParamYMapType'] = dirname(__FILE__) . '/Maps_ParamYMapType.php';
    $wgAutoloadClasses['MapsYahooMaps'] = dirname(__FILE__) . '/Maps_YahooMaps.php';
    MapsMappingServices::registerService('yahoomaps', 'MapsYahooMaps', array('display_point' => 'MapsBasePointMap', 'display_map' => 'MapsBaseMap'));
    return true;
}
コード例 #7
0
function smfInitGoogleMaps3()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['SMGoogleMaps3FormInput'] = __DIR__ . '/SM_GoogleMaps3FormInput.php';
    MapsMappingServices::registerServiceFeature('googlemaps3', 'qp', 'SMMapPrinter');
    MapsMappingServices::registerServiceFeature('googlemaps3', 'fi', 'SMGoogleMaps3FormInput');
    return true;
}
コード例 #8
0
ファイル: OSM.php プロジェクト: schwarer2006/wikia
/**
 * Initialization function for the OSM service. 
 * 
 * @since 0.6.4
 * @ingroup OSM
 * 
 * @return true
 */
function efMapsInitOSM()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['MapsOSM'] = dirname(__FILE__) . '/Maps_OSM.php';
    $wgAutoloadClasses['MapsOSMDispMap'] = dirname(__FILE__) . '/Maps_OSMDispMap.php';
    MapsMappingServices::registerService('osm', 'MapsOSM', array('display_map' => 'MapsOSMDispMap'));
    return true;
}
コード例 #9
0
ファイル: Leaflet.php プロジェクト: gwdgithubnom/Maps
/**
 * Initialization function for the Leaflet service.
 *
 * @ingroup Leaflet
 *
 * @return boolean true
 */
function efMapsInitLeaflet()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['MapsLeaflet'] = __DIR__ . '/Maps_Leaflet.php';
    MapsMappingServices::registerService('leaflet', 'MapsLeaflet');
    $leafletMaps = MapsMappingServices::getServiceInstance('leaflet');
    $leafletMaps->addFeature('display_map', 'MapsDisplayMapRenderer');
    return true;
}
コード例 #10
0
 /**
  * @see ItemParameterManipulation::doManipulation
  * 
  * @since 0.7
  */
 public function doManipulation(&$value, Parameter $parameter, array &$parameters)
 {
     // Make sure the service is valid.
     $value = MapsMappingServices::getValidServiceName($value, $this->feature);
     // Get the service object so the service specific parameters can be retrieved.
     $serviceObject = MapsMappingServices::getServiceInstance($value);
     // Add the service specific service parameters.
     $serviceObject->addParameterInfo($parameters);
 }
コード例 #11
0
 /**
  * @see ParamDefinition::formatValue()
  *
  * @since 2.0
  *
  * @param $value mixed
  * @param $param IParam
  * @param $definitions array of IParamDefinition
  * @param $params array of IParam
  *
  * @return mixed
  */
 protected function formatValue($value, IParam $param, array &$definitions, array $params)
 {
     // Make sure the service is valid.
     $value = MapsMappingServices::getValidServiceName($value, $this->feature);
     // Get the service object so the service specific parameters can be retrieved.
     $serviceObject = MapsMappingServices::getServiceInstance($value);
     // Add the service specific service parameters.
     $serviceObject->addParameterInfo($definitions);
     return $value;
 }
コード例 #12
0
ファイル: SM_GoogleMaps3.php プロジェクト: Tjorriemorrie/app
function smfInitGoogleMaps3()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['SMGoogleMaps3FormInput'] = __DIR__ . '/SM_GoogleMaps3FormInput.php';
    //$wgAutoloadClasses['SMGoogleMaps3MultiInput'] = __DIR__ . '/SM_GoogleMaps3MultiInput.php';
    MapsMappingServices::registerServiceFeature('googlemaps3', 'qp', 'SMMapPrinter');
    MapsMappingServices::registerServiceFeature('googlemaps3', 'fi', 'SMGoogleMaps3FormInput');
    //$sfgFormPrinter->setInputTypeHook( 'googlemapsmulti', array( 'SMGoogleMaps3MultiInput', 'onInputRequest' ), array() );
    return true;
}
コード例 #13
0
ファイル: GoogleMaps3.php プロジェクト: gwdgithubnom/Maps
/**
 * Initialization function for the Google Maps v3 service. 
 * 
 * @since 0.6.3
 * @ingroup MapsGoogleMaps3
 * 
 * @return boolean true
 */
function efMapsInitGoogleMaps3()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['MapsGoogleMaps3'] = __DIR__ . '/Maps_GoogleMaps3.php';
    MapsMappingServices::registerService('googlemaps3', 'MapsGoogleMaps3');
    // TODO: kill below code
    $googleMaps = MapsMappingServices::getServiceInstance('googlemaps3');
    $googleMaps->addFeature('display_map', 'MapsDisplayMapRenderer');
    return true;
}
コード例 #14
0
ファイル: SM_OpenLayers.php プロジェクト: Tjorriemorrie/app
function smfInitOpenLayers()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['SMOpenLayersQP'] = __DIR__ . '/SM_OpenLayersQP.php';
    // TODO: the if should not be needed, but when omitted, a fatal error occurs cause the class that's extended by this one is not found.
    if (defined('SF_VERSION')) {
        $wgAutoloadClasses['SMOpenLayersFormInput'] = __DIR__ . '/SM_OpenLayersFormInput.php';
    }
    MapsMappingServices::registerServiceFeature('openlayers', 'qp', 'SMMapPrinter');
    MapsMappingServices::registerServiceFeature('openlayers', 'fi', 'SMOpenLayersFormInput');
    return true;
}
コード例 #15
0
ファイル: SM_Leaflet.php プロジェクト: krabina/SemanticMaps
function smfInitLeaflet()
{
    global $wgAutoloadClasses;
    /* forms input with leaflet not implemented yet
    	$wgAutoloadClasses['SMLeafletFormInput'] = __DIR__ . '/SM_LeafletFormInput.php';
    	*/
    MapsMappingServices::registerServiceFeature('leaflet', 'qp', 'SMMapPrinter');
    /* forms input with leaflet not implemented yet
    	MapsMappingServices::registerServiceFeature( 'leaflet', 'fi', 'SMLeafletFormInput' );
    	*/
    return true;
}
コード例 #16
0
ファイル: GoogleMaps.php プロジェクト: schwarer2006/wikia
/**
 * Initialization function for the Google Maps v2 service. 
 * 
 * @since 0.6.3
 * @ingroup MapsGoogleMaps
 * 
 * @return true
 */
function efMapsInitGoogleMaps()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['MapsGoogleMaps'] = dirname(__FILE__) . '/Maps_GoogleMaps.php';
    $wgAutoloadClasses['CriterionGoogleOverlay'] = dirname(__FILE__) . '/CriterionGoogleOverlay.php';
    $wgAutoloadClasses['MapsParamGMapType'] = dirname(__FILE__) . '/Maps_ParamGMapType.php';
    MapsMappingServices::registerService('googlemaps2', 'MapsGoogleMaps');
    $googleMaps = MapsMappingServices::getServiceInstance('googlemaps2');
    $googleMaps->addFeature('display_point', 'MapsBasePointMap');
    $googleMaps->addFeature('display_map', 'MapsBaseMap');
    return true;
}
コード例 #17
0
ファイル: SM_YahooMaps.php プロジェクト: schwarer2006/wikia
function smfInitYahooMaps()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['SMYahooMapsQP'] = dirname(__FILE__) . '/SM_YahooMapsQP.php';
    // TODO: the if should not be needed, but when omitted, a fatal error occurs cause the class that's extended by this one is not found.
    if (defined('SF_VERSION')) {
        $wgAutoloadClasses['SMYahooMapsFormInput'] = dirname(__FILE__) . '/SM_YahooMapsFormInput.php';
    }
    MapsMappingServices::registerServiceFeature('yahoomaps', 'qp', 'SMMapPrinter');
    MapsMappingServices::registerServiceFeature('yahoomaps', 'fi', 'SMYahooMapsFormInput');
    return true;
}
コード例 #18
0
ファイル: GoogleMaps3.php プロジェクト: Tjorriemorrie/app
/**
 * Initialization function for the Google Maps v3 service. 
 * 
 * @since 0.6.3
 * @ingroup MapsGoogleMaps3
 * 
 * @return true
 */
function efMapsInitGoogleMaps3()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['MapsGoogleMaps3'] = __DIR__ . '/Maps_GoogleMaps3.php';
    $wgAutoloadClasses['MapsParamGMap3Type'] = __DIR__ . '/Maps_ParamGMap3Type.php';
    $wgAutoloadClasses['MapsParamGMap3Types'] = __DIR__ . '/Maps_ParamGMap3Types.php';
    $wgAutoloadClasses['MapsParamGMap3Typestyle'] = __DIR__ . '/Maps_ParamGMap3Typestyle.php';
    $wgAutoloadClasses['MapsParamGMap3Zoomstyle'] = __DIR__ . '/Maps_ParamGMap3Zoomstyle.php';
    MapsMappingServices::registerService('googlemaps3', 'MapsGoogleMaps3');
    $googleMaps = MapsMappingServices::getServiceInstance('googlemaps3');
    $googleMaps->addFeature('display_map', 'MapsDisplayMapRenderer');
    return true;
}
コード例 #19
0
/**
 * Initialization function for the Google Maps v3 service. 
 * 
 * @since 0.6.3
 * @ingroup MapsGoogleMaps3
 * 
 * @return true
 */
function efMapsInitGoogleMaps3()
{
    global $wgAutoloadClasses;
    $wgAutoloadClasses['MapsGoogleMaps3'] = dirname(__FILE__) . '/Maps_GoogleMaps3.php';
    $wgAutoloadClasses['MapsParamGMap3Type'] = dirname(__FILE__) . '/Maps_ParamGMap3Type.php';
    $wgAutoloadClasses['MapsParamGMap3Types'] = dirname(__FILE__) . '/Maps_ParamGMap3Types.php';
    $wgAutoloadClasses['MapsParamGMap3Typestyle'] = dirname(__FILE__) . '/Maps_ParamGMap3Typestyle.php';
    $wgAutoloadClasses['MapsParamGMap3Zoomstyle'] = dirname(__FILE__) . '/Maps_ParamGMap3Zoomstyle.php';
    MapsMappingServices::registerService('googlemaps3', 'MapsGoogleMaps3');
    $googleMaps = MapsMappingServices::getServiceInstance('googlemaps3');
    $googleMaps->addFeature('display_map', 'MapsBaseMap');
    $googleMaps->addFeature('display_point', 'MapsBasePointMap');
    return true;
}
コード例 #20
0
 /**
  * @see ParameterManipulation::manipulate
  * 
  * @since 0.7
  */
 public function manipulate(Parameter &$parameter, array &$parameters)
 {
     global $egMapsOLLayerGroups, $egMapsOLAvailableLayers;
     $layerDefs = array();
     $layerNames = array();
     foreach ($parameter->getValue() as $layerOrGroup) {
         $lcLayerOrGroup = strtolower($layerOrGroup);
         // Layer groups. Loop over all items and add them when not present yet.
         if (array_key_exists($lcLayerOrGroup, $egMapsOLLayerGroups)) {
             foreach ($egMapsOLLayerGroups[$lcLayerOrGroup] as $layerName) {
                 if (!in_array($layerName, $layerNames)) {
                     if (is_array($egMapsOLAvailableLayers[$layerName])) {
                         $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$layerName][0];
                     } else {
                         $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$layerName];
                     }
                     $layerNames[] = $layerName;
                 }
             }
         } elseif (array_key_exists($lcLayerOrGroup, $egMapsOLAvailableLayers)) {
             if (!in_array($lcLayerOrGroup, $layerNames)) {
                 if (is_array($egMapsOLAvailableLayers[$lcLayerOrGroup])) {
                     $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$lcLayerOrGroup][0];
                 } else {
                     $layerDefs[] = 'new ' . $egMapsOLAvailableLayers[$lcLayerOrGroup];
                 }
                 $layerNames[] = $lcLayerOrGroup;
             }
         } else {
             $title = Title::newFromText($layerOrGroup, Maps_NS_LAYER);
             if ($title->getNamespace() == Maps_NS_LAYER && $title->exists()) {
                 $layerPage = new MapsLayerPage($title);
                 if ($layerPage->hasValidDefinition('openlayers')) {
                     $layer = $layerPage->getLayer();
                     if (!in_array($layerOrGroup, $layerNames)) {
                         $layerDefs[] = $layer->getJavaScriptDefinition();
                         $layerNames[] = $layerOrGroup;
                     }
                 } else {
                     wfWarn("Invalid layer ({$layerOrGroup}) encountered after validation.");
                 }
             } else {
                 wfWarn("Invalid layer ({$layerOrGroup}) encountered after validation.");
             }
         }
     }
     $parameter->setValue($layerDefs);
     MapsMappingServices::getServiceInstance('openlayers')->addLayerDependencies($this->getDependencies($layerNames));
 }
コード例 #21
0
	/**
	 * Constructor.
	 * 
	 * @param $format String
	 * @param $inline
	 */
	public function __construct( $format, $inline ) {
		global $egMapsDefaultServices;

		$this->isMapFormat = $format == 'map';
		
		// TODO: allow service parameter to override the default
		// Note: if this is allowed, then the getParameters should only return the base parameters.
		if ( $this->isMapFormat ) $format = $egMapsDefaultServices['qp'];
		
		// Get the instance of the service class.
		$service = MapsMappingServices::getValidServiceInstance( $format, 'qp' );
		
		// Get an instance of the class handling the current query printer and service.
		$QPClass = $service->getFeature( 'qp' );	
		$this->queryPrinter = new $QPClass( $format, $inline, $service );
	}
コード例 #22
0
 /**
  * Returns an array containing the parameter info.
  * @see ParserHook::getParameterInfo
  * 
  * @since 0.7
  * 
  * @return array
  */
 protected function getParameterInfo($type)
 {
     global $egMapsDistanceUnit, $egMapsDistanceDecimals, $egMapsAvailableGeoServices, $egMapsDefaultGeoService;
     $params = array();
     $params['mappingservice'] = array('default' => '', 'values' => MapsMappingServices::getAllServiceValues(), 'tolower' => true);
     $params['geoservice'] = array('default' => $egMapsDefaultGeoService, 'aliases' => 'service', 'values' => $egMapsAvailableGeoServices, 'tolower' => true);
     $params['unit'] = array('default' => $egMapsDistanceUnit, 'values' => MapsDistanceParser::getUnits());
     $params['decimals'] = array('type' => 'integer', 'default' => $egMapsDistanceDecimals);
     $params['location1'] = array('type' => 'mapslocation', 'aliases' => 'from', 'dependencies' => array('mappingservice', 'geoservice'));
     $params['location2'] = array('type' => 'mapslocation', 'aliases' => 'to', 'dependencies' => array('mappingservice', 'geoservice'));
     // Give grep a chance to find the usages:
     // maps-geodistance-par-mappingservice, maps-geodistance-par-geoservice,
     // maps-geodistance-par-unit, maps-geodistance-par-decimals,
     // maps-geodistance-par-location1, maps-geodistance-par-location2
     foreach ($params as $name => &$param) {
         $param['message'] = 'maps-geodistance-par-' . $name;
     }
     return $params;
 }
コード例 #23
0
ファイル: Maps_Geocode.php プロジェクト: gwdgithubnom/Maps
 /**
  * Returns an array containing the parameter info.
  * @see ParserHook::getParameterInfo
  * 
  * @since 0.7
  * 
  * @return array
  */
 protected function getParameterInfo($type)
 {
     global $egMapsAvailableGeoServices, $egMapsAvailableCoordNotations;
     global $egMapsDefaultGeoService, $egMapsCoordinateNotation;
     global $egMapsAllowCoordsGeocoding, $egMapsCoordinateDirectional;
     $params = array();
     $params['location'] = array('type' => 'mapslocation', 'dependencies' => array('mappingservice', 'geoservice'));
     $params['mappingservice'] = array('default' => '', 'values' => MapsMappingServices::getAllServiceValues(), 'tolower' => true);
     $params['geoservice'] = array('default' => $egMapsDefaultGeoService, 'aliases' => 'service', 'values' => $egMapsAvailableGeoServices, 'tolower' => true);
     $params['allowcoordinates'] = array('type' => 'boolean', 'default' => $egMapsAllowCoordsGeocoding);
     $params['format'] = array('default' => $egMapsCoordinateNotation, 'values' => $egMapsAvailableCoordNotations, 'aliases' => 'notation', 'tolower' => true);
     $params['directional'] = array('type' => 'boolean', 'default' => $egMapsCoordinateDirectional);
     // Give grep a chance to find the usages:
     // maps-geocode-par-location, maps-geocode-par-mappingservice, maps-geocode-par-geoservice,
     // maps-geocode-par-allowcoordinates, maps-geocode-par-format, maps-geocode-par-directional
     foreach ($params as $name => &$param) {
         $param['message'] = 'maps-geocode-par-' . $name;
     }
     return $params;
 }
コード例 #24
0
 /**
  * Returns an array containing the parameter info.
  * @see ParserHook::getParameterInfo
  * 
  * @since 0.7
  * 
  * @return array
  */
 protected function getParameterInfo($type)
 {
     global $egMapsDistanceUnit, $egMapsDistanceDecimals, $egMapsAvailableGeoServices, $egMapsDefaultGeoService;
     $params = array();
     $params['location1'] = new Parameter('location1', Parameter::TYPE_STRING, null, array('from'), array(new CriterionIsLocation()));
     $params['location1']->addDependencies('mappingservice', 'geoservice');
     $params['location1']->setMessage('maps-geodistance-par-location1');
     $params['location2'] = new Parameter('location2', Parameter::TYPE_STRING, null, array('to'), array(new CriterionIsLocation()));
     $params['location2']->addDependencies('mappingservice', 'geoservice');
     $params['location2']->setMessage('maps-geodistance-par-location2');
     $params['unit'] = new Parameter('unit', Parameter::TYPE_STRING, $egMapsDistanceUnit, array(), array(new CriterionInArray(MapsDistanceParser::getUnits())));
     $params['unit']->addManipulations(new ParamManipulationFunctions('strtolower'));
     $params['unit']->setMessage('maps-geodistance-par-unit');
     $params['decimals'] = new Parameter('decimals', Parameter::TYPE_INTEGER, $egMapsDistanceDecimals);
     $params['decimals']->setMessage('maps-geodistance-par-decimals');
     $params['mappingservice'] = new Parameter('mappingservice', Parameter::TYPE_STRING, '', array(), array(new CriterionInArray(MapsMappingServices::getAllServiceValues())));
     $params['mappingservice']->addManipulations(new ParamManipulationFunctions('strtolower'));
     $params['mappingservice']->setMessage('maps-geodistance-par-mappingservice');
     $params['geoservice'] = new Parameter('geoservice', Parameter::TYPE_STRING, $egMapsDefaultGeoService, array('service'), array(new CriterionInArray($egMapsAvailableGeoServices)));
     $params['geoservice']->addManipulations(new ParamManipulationFunctions('strtolower'));
     $params['geoservice']->setMessage('maps-geodistance-par-geoservice');
     return $params;
 }
コード例 #25
0
ファイル: Maps_Mapper.php プロジェクト: schwarer2006/wikia
 /**
  * This function returns the definitions for the parameters used by every map feature.
  *
  * @return array
  */
 public static function getCommonParameters()
 {
     global $egMapsAvailableServices, $egMapsAvailableGeoServices, $egMapsDefaultGeoService, $egMapsMapWidth, $egMapsMapHeight, $egMapsDefaultService;
     $params = array();
     $params['mappingservice'] = new Parameter('mappingservice');
     $params['mappingservice']->addAliases('service');
     $params['mappingservice']->setDefault($egMapsDefaultService);
     $params['mappingservice']->addCriteria(new CriterionInArray(MapsMappingServices::getAllServiceValues()));
     $params['geoservice'] = new Parameter('geoservice');
     $params['geoservice']->setDefault($egMapsDefaultGeoService);
     $params['geoservice']->addCriteria(new CriterionInArray($egMapsAvailableGeoServices));
     $params['geoservice']->addDependencies('mappingservice');
     $params['geoservice']->addManipulations(new MapsParamGeoService('mappingservice'));
     $params['geoservice']->setDescription(wfMsg('maps-par-geoservice'));
     $params['zoom'] = new Parameter('zoom', Parameter::TYPE_INTEGER);
     $params['zoom']->setDescription(wfMsg('maps-par-zoom'));
     $params['width'] = new Parameter('width', Parameter::TYPE_STRING, $egMapsMapWidth, array(), array(new CriterionMapDimension('width')));
     $params['width']->addManipulations(new MapsParamDimension('width'));
     $params['width']->setDescription(wfMsg('maps-par-width'));
     $params['height'] = new Parameter('height', Parameter::TYPE_STRING, $egMapsMapHeight, array(), array(new CriterionMapDimension('height')));
     $params['height']->addManipulations(new MapsParamDimension('height'));
     $params['height']->setDescription(wfMsg('maps-par-height'));
     return $params;
 }
コード例 #26
0
 /**
  * Renders and returns the output.
  * @see ParserHook::render
  * 
  * @since 0.7
  * 
  * @param array $parameters
  * 
  * @return string
  */
 public function render(array $parameters)
 {
     // Get the instance of the service class.
     $service = MapsMappingServices::getServiceInstance($parameters['mappingservice'], $this->getName());
     // Get an instance of the class handling the current parser hook and service.
     $mapClass = $service->getFeatureInstance('display_point');
     return $mapClass->renderMap($parameters, $this->parser);
 }
コード例 #27
0
ファイル: OpenLayers.php プロジェクト: schwarer2006/wikia
function efMapsInitOpenLayers()
{
    MapsMappingServices::registerService('openlayers', 'MapsOpenLayers', array('display_point' => 'MapsBasePointMap', 'display_map' => 'MapsBaseMap'));
    return true;
}
コード例 #28
0
 public static function onInputRequest($coordinates, $input_name, $is_mandatory, $is_disabled, array $field_args)
 {
     $formInput = new self(MapsMappingServices::getServiceInstance('googlemaps3'));
     return $formInput->getInputOutput($coordinates, $input_name, $is_mandatory, $is_disabled, $field_args);
 }
コード例 #29
0
ファイル: SM_Leaflet.php プロジェクト: hangya/SemanticMaps
function smfInitLeaflet()
{
    MapsMappingServices::registerServiceFeature('leaflet', 'qp', 'SMMapPrinter');
    return true;
}
コード例 #30
0
 protected function getServiceParameters($service)
 {
     $service = MapsMappingServices::getServiceInstance($service);
     $params = array();
     $params['zoom'] = new Parameter('zoom', Parameter::TYPE_INTEGER);
     $params['zoom']->setMessage('maps-par-zoom');
     $service->addParameterInfo($params);
     return $params;
 }