|
在本例中,我们将创建两个位置,然后对其进行地理编码,将它们显示在地图上,并查找这两个位置之间的最佳路线。首先定义起始位置和终点位置。在 body 标记之间插入以下行。
<%
// Create the source location object
Location fromLoc = SpatialManager.createLocation(
null, //point
"OracleHQ", //companyName
"http://www.oracle.com/technology/obe/obe_as_1012/wireless/location/index.html", //houseNumber
new String[] { "500 Oracle Parkway" }, //intersectingStreetNames
null, //secondLine
"Redwood City", //cityName
"CA", //stateName
"94065", //postalCode
null, //postalCodeExt
"US"); //countryName
// Create the destination location object
Location toLoc = SpatialManager.createLocation(
null, //point
"Hotel", //companyName
"http://www.oracle.com/technology/obe/obe_as_1012/wireless/location/index.html", //houseNumber
new String[] { "3000 Los Prados St" }, //intersectingStreetNames
null, //secondLine
"San Mateo", //cityName
"CA", //stateName
"9440", //postalCode
null, //postalCodeExt
"US"); //countryName
%>

|