LWUIT引路蜂地图开发示例:本地查询

本地查询:快速查找指定区域内的宾馆信息
部署运行你感兴趣的模型镜像

本地查询可以查询指定区域内诸如宾馆,邮局等用户感兴趣的地方。其使用方法和地址查询非常类似。
下面示例查询32.0616667, 118.7777778为中心点一定区域内宾馆的信息。

package com.pstreets.gisengine.demo.lwuit; 
  
//--------------------------------- IMPORTS ------------------------------------ 
  
import com.mapdigit.gis.MapPoint; 
  
import com.mapdigit.gis.geometry.GeoLatLng; 
import com.mapdigit.gis.raster.MapType; 
  
import com.mapdigit.gis.service.IGeocodingListener; 
import com.pstreets.gisengine.demo.MapDemoLWUIT; 
import com.sun.lwuit.Command; 
import com.sun.lwuit.events.ActionEvent; 
  
public class MapLocalSearchLWUIT extends MapDemoLWUIT 
        implements IGeocodingListener{ 
  
    private Command mapFindAddressCommand; 
  
    public void startApp() { 
        init(); 
        canvas.setTitle("Local Search"); 
  
        mapFindAddressCommand=new Command("Find Address"){ 
            public void actionPerformed(ActionEvent evt) { 
                String name = "宾馆"; 
                GeoLatLng screenCenter = map.getScreenCenter(); 
                map.getLocations(name, 0, screenCenter, 
                  map.getScreenBounds(screenCenter)); 
  
            } 
        }; 
        canvas.addCommand(mapFindAddressCommand); 
        GeoLatLng center =  new GeoLatLng(32.0616667, 118.7777778); 
        map.setCenter(center, 13, MapType.MICROSOFTCHINA); 
        map.setGeocodingListener(this); 
  
        canvas.show(); 
    } 
  
    public void done(String query, MapPoint[] result) { 
        if (result != null) { 
            map.panTo(result[0].getPoint()); 
            for (int i = 0; i < result.length; i++) { 
                System.out.println(result[i].objectNote); 
            } 
        } 
    } 
}


本地查询方法
public void getLocations(String address,int start,GeoLatLng center,GeoBounds bound, IGeocodingListener listener);
指定中心点和查询区域。本地查询可以多次返回结果,start为查询结果起始顺序,每次返回结果在SearchOptions 中定义,缺省每次返回4个。
上述结果返回内容为,具体结果可能不同。
“晶丽酒店025-83310818 025-83310818212223 025-86636636 ”
“城市名人酒店025-83123333 025-83123888 ”
“南京玄武饭店 025-83358888 ”
“Sofitel Galaxy Nanjing – 南京索菲特银河大酒店025-83718888 “

LWUIT 引路蜂地图开发包Ver2.1下载

您可能感兴趣的与本文相关的镜像

Stable-Diffusion-3.5

Stable-Diffusion-3.5

图片生成
Stable-Diffusion

Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值