X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.maps%2Fsrc%2Forg%2Fsimantics%2Fmaps%2Ftile%2FITileProvider.java;fp=org.simantics.district.maps%2Fsrc%2Forg%2Fsimantics%2Fmaps%2Ftile%2FITileProvider.java;h=f88b8ab5266f3660f4d8a340f4822422f15a89cd;hb=e9f74f09e0cedb603c0b4de9e542de8dd64a5ce3;hp=0000000000000000000000000000000000000000;hpb=16ee01dc5a40981c58fd5b478b89552e5814e8bb;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.maps/src/org/simantics/maps/tile/ITileProvider.java b/org.simantics.district.maps/src/org/simantics/maps/tile/ITileProvider.java new file mode 100644 index 00000000..f88b8ab5 --- /dev/null +++ b/org.simantics.district.maps/src/org/simantics/maps/tile/ITileProvider.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2012 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.maps.tile; + +import java.awt.Image; +import java.awt.geom.Rectangle2D; +import java.net.URI; + +import org.simantics.maps.ProvisionException; + +/** + * @author Tuukka Lehtonen + */ +public interface ITileProvider { + + /** + * @return an identifier for the tile provider connection. May represent any + * protocol, not necessarily a web service at all. + */ + URI getSource(); + + /** + * @return the bounding box of tiles served by this tile provider in degrees + * [(-180,-90) x (180,90)] + */ + Rectangle2D getExtent(); + + /** + * A synchronous method for requesting the specified map tile as a raster + * image. + * + * @param key the requested tile + * @return the tile as an image + * @throws ProvisionException if any failure occurs while procuring the + * image + */ + Image get(TileKey key) throws ProvisionException; + +}