Package net.rim.device.api.lbs.maps.server.exchange

Examples of net.rim.device.api.lbs.maps.server.exchange.GeocodeExchange


                        final Thread t = new Thread(new Runnable() {
                            /**
                             * @see java.lang.Runnable#run()
                             */
                            public void run() {
                                final GeocodeExchange ex =
                                        Geocoder.getInstance().geocode(null,
                                                _freeFormEditField.getText(),
                                                dim, 0);

                                // Check if the request was successful
                                if (ex.getExceptionList().size() == 0) {
                                    requestSuccess(ex);
                                } else {
                                    requestFailure(ex);
                                }
                            }
                        });
                        t.start();
                    } else {
                        Geocoder.getInstance().geocode(this,
                                _freeFormEditField.getText(), dim, 0);
                    }
                } else // Use the structured data
                {
                    if (blocking) {
                        // We are making a blocking request, should not be
                        // called on event thread.
                        final Thread t = new Thread(new Runnable() {
                            /**
                             * @see java.lang.Runnable#run()
                             */
                            public void run() {
                                try {
                                    final GeocodeExchange ex =
                                            Geocoder.getInstance().geocode(
                                                    null, createMapLocation(),
                                                    dim, 0);

                                    // Check if the request was successful
                                    if (ex.getExceptionList().size() == 0) {
                                        requestSuccess(ex);
                                    } else {
                                        requestFailure(ex);
                                    }
                                } catch (final GeocodeException ge) {
View Full Code Here


     */
    public void requestSuccess(final ServerExchange exchange) {
        // Display results in the event of a successful request.

        if (exchange instanceof GeocodeExchange) {
            final GeocodeExchange geocodecExchange = (GeocodeExchange) exchange;
            final Vector results = geocodecExchange.getResults();

            final StringBuffer text = new StringBuffer();

            for (int i = 0; i < results.size(); i++) {
                text.append(GeocodeDemo.composeLocation((MapLocation) results
View Full Code Here

        final Thread travelTimeThread = new Thread() {
            public void run() {
                try {
                    // Attempt to geocode the destination address
                    showStatus("Geocoding destination address...");
                    final GeocodeExchange ex =
                            Geocoder.getInstance().geocode(null, address, null,
                                    0);
                    final Vector results = ex.getResults();

                    if (results.size() == 0) {
                        throw new Exception("Could not geocode address");
                    }
View Full Code Here

TOP

Related Classes of net.rim.device.api.lbs.maps.server.exchange.GeocodeExchange

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.