Package com.esri.gpt.catalog.search

Examples of com.esri.gpt.catalog.search.IMapViewer


  protected void buildAddToMapLink(IFeedRecord record) {
    String resourceUrl = Val.chkStr(record.getResourceUrl());
    String serviceType = Val.chkStr(record.getServiceType()).toLowerCase();
    String serviceName = Val.chkStr(record.getService());
    String viewerUrl = Val.chkStr(this.getMapViewerUrl());
    IMapViewer iMapViewer = null;

    if ((viewerUrl.length() != 0)) {
      // return if a map viewer link cannot be built
      if (resourceUrl.length() == 0 || (serviceType.length() == 0)) {
        return;
      } else {
        boolean canHandle = (serviceType.equalsIgnoreCase(ResourceLinkBuilder.ServiceType.AGS.name())
                || serviceType.equalsIgnoreCase(ResourceLinkBuilder.ServiceType.AIMS.name())
                || serviceType.equalsIgnoreCase(ResourceLinkBuilder.ServiceType.WMS.name())
                || serviceType.equalsIgnoreCase(ResourceLinkBuilder.ServiceType.WFS.name()) || serviceType
                .equalsIgnoreCase(ResourceLinkBuilder.ServiceType.WCS.name()));
        if (!canHandle) {
          return;
        }
      }

    } else {
      iMapViewer = MapViewerFactory.createMapViewer(resourceUrl, serviceType, record, context);
      if (iMapViewer == null) {
        return;
      }
      String addToMapUrl = iMapViewer.readAddToMapUrl();
      if (addToMapUrl == null || "".equals(addToMapUrl)) {
        return;
      }
      String resourceKey = "catalog.rest.addToMap";
      ResourceLink link = this.makeLink(addToMapUrl, ResourceLink.TAG_ADDTOMAP,
              resourceKey);
      link.setTarget(iMapViewer.readTarget());
      record.getResourceLinks().add(link);
      return;

    }
    // maybe url is already an add to map url?  if so no modigications are required
View Full Code Here

TOP

Related Classes of com.esri.gpt.catalog.search.IMapViewer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.