]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.district.maps/src/org/simantics/maps/tile/ITileProvider.java
Share some projects for Simantics District
[simantics/district.git] / org.simantics.district.maps / src / org / simantics / maps / tile / ITileProvider.java
1 /*******************************************************************************
2  * Copyright (c) 2012 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.maps.tile;
13
14 import java.awt.Image;
15 import java.awt.geom.Rectangle2D;
16 import java.net.URI;
17
18 import org.simantics.maps.ProvisionException;
19
20 /**
21  * @author Tuukka Lehtonen
22  */
23 public interface ITileProvider {
24
25     /**
26      * @return an identifier for the tile provider connection. May represent any
27      *         protocol, not necessarily a web service at all.
28      */
29     URI getSource();
30
31     /**
32      * @return the bounding box of tiles served by this tile provider in degrees
33      *         [(-180,-90) x (180,90)]
34      */
35     Rectangle2D getExtent();
36
37     /**
38      * A synchronous method for requesting the specified map tile as a raster
39      * image.
40      * 
41      * @param key the requested tile
42      * @return the tile as an image
43      * @throws ProvisionException if any failure occurs while procuring the
44      *         image
45      */
46     Image get(TileKey key) throws ProvisionException;
47
48 }