截至2016-07-11,MapQuest已停止直接访问其瓷砖.他们似乎只支持Leaflet,iOS和Android SDK.知道如何让Openlayers再次使用MapQuest,或者我们应该考虑另一种选择吗?谢谢.
背景:我有一个桌面浏览器应用程序,它使用mapquest和传单js插件.我使用divIcon类作为标记,这允许我使用自定义HTML和样式标记.每个divIcon标记还包含一个隐藏的div,当标记悬停在其上时显示(使用:悬停类).我没有使用内置到传单中的默认标记或默认弹出窗口,因为自定义html可以更好地控制样式.
问题:当弹出窗口显示时,地图上的任何其他标记都显示在弹出窗口的顶部,而不是在下面.我已经尝试将弹出div的z-index设置为一个非常高的数字,但它没有帮助.
什么是预期:当您将鼠标悬停在图标上时,标记应位于弹出窗口后面,而不是在前面.
这不是一个重复的问题:这个问题是不一样的这一个.这个问题是关于让默认的传单弹出窗口保持在地图z-index上下文之外的自定义div的顶部.这个问题是关于自定义鼠标悬停弹出窗口(不是默认弹出窗口)保持在其他标记之上.另外,我的解决方案完全不同于公认的javascript"hack"作为解决方法.
问题的工作示例:https://jsfiddle.net/mrrost/py2bqw7j/
以下是带有自定义标记/弹出窗口的divIcon代码:
var pin = L.divIcon({
html: `
<div class='marker'>
Pin
<div class='popup'>
Marker info. Other markers WILL BE on top of this div.
This is BAD and a PROBLEM.
</div>
</div>
`,
});
Run Code Online (Sandbox Code Playgroud)
这个最重要的css定义:
#map {
position: fixed;
}
/* hide default leaflet pin; div.popup is put inside here */
.leaflet-marker-icon {
border: 0; margin: 0; padding: 0;
}
div.popup {
display: none;
position: absolute;
}
div.marker:hover div.popup {
display: …Run Code Online (Sandbox Code Playgroud) 我正在使用http Dart 包向 MapQuest Static Maps API发送GET请求以获取图像。但是,对此请求的响应直接返回图像,而不是Uri,或者也许我做错了什么。
你能帮我显示收到的图像吗?
这是请求代码:
final http.Response response = await http.get(
'https://www.mapquestapi.com/geocoding/v1/address?key=[MYAPIKEY]&inFormat=kvp&outFormat=json&location=${address}&thumbMaps=false&maxResults=1');
final decodedResponse = json.decode(response.body);
setState(() {
_coords = decodedResponse['results'][0]['locations'][0]['latLng'];
});
final http.Response staticMapResponse = await http.get(
'https://www.mapquestapi.com/staticmap/v5/map?key=[MYAPIKEY]¢er=${coords['lat']},${coords['lng']}&zoom=13&type=hyb&locations=${coords['lat']},${coords['lng']}&size=500,300@2x');
Run Code Online (Sandbox Code Playgroud)
坐标是从 MapQuest 的地理编码 API 接收的,这是一个async请求。
我有以下代码
conn = Faraday.new(:url => 'http://www.mapquestapi.com') do |faraday|
faraday.response :logger # log requests to STDOUT
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
faraday.options.params_encoder = Faraday::FlatParamsEncoder
end
response = conn.get do |req|
req.url '/geocoding/v1/batch'
req.params['key'] = 'xxxxx%7xxxxxxxxx%2xxxx%3xxxx-xxxx'
req.params['location'] = addresses[0]
end
Run Code Online (Sandbox Code Playgroud)
不幸的是,关键 PARAM编码为显示在日志中这样的关键= XXXXX%257xxxxxxxxx%252xxxx%253xxxx-XXXX,造成了Mapquest服务API响应与无效键(由于编码,因为我与邮差试图和它的工作原理)
I, [2014-01-22T19:16:17.949640 #93669] INFO -- : get http://www.mapquestapi.com/geocoding/v1/batch?key=xxxxx%257xxxxxxxxx%252xxxx%253xxxx-xxxx&location=1047+East+40th+Avenue%2C+Vancouver%2C+BC+V5W+1M5%2C+Canada
D, [2014-01-22T19:16:17.949778 #93669] DEBUG -- request: User-Agent: "Faraday v0.9.0"
accept-encoding: ""
I, [2014-01-22T19:16:19.038914 #93669] INFO -- Status: 200
D, [2014-01-22T19:16:19.039043 #93669] DEBUG -- response: server: "Apache-Coyote/1.1" …Run Code Online (Sandbox Code Playgroud) 在使用osmdroid时.我得到"截至2016年7月11日,直接瓷砖访问已停止." 我认为我们必须使用APIKEY来使用这个或新的sdk,但我找不到任何地方如何做到这一点.请帮忙.
我在OSMBonusPack_v5.0上使用OSMDROID 4.2.请看下面的屏幕截图:
我是OSM和OSMdroid的新手.
我正在按照这个非常好的教程来显示离线地图.基本上我所做的是:
/mnt/sdcard/osmdroid/问题是瓷砖没有渲染.我有一个空白页面.
我找到了这个解决方案来解决我的问题.
但现在,我不得不使用PNG文件,这需要更多的空间.它对我的应用程序来说效率不高,因为用户必须下载更大的包.
我的问题是:如何在OSMDroid和MapQuest中使用JPEG图块?
提前致谢.
我想创建一个导航应用程序,使用mapquest sdk for android,在创建路径后使用GPS提供实时的转向指示,就像在按下按钮时在谷歌地图上开始导航一样.是否可以仅使用mapquest sdk实现该功能,或者我是否需要任何其他api.
如果有可能,那么,有没有办法提取该指导('左/右')提示并在程序中使用它?
我的网址是:
http://www.mapquestapi.com/geocoding/v1/batch?key=dNBvDLtTx85L3akdg8vBoHQXrWpDJSEI&location=HEBRON,KY,US&location=CINCINNATI,KY,US&location=CINCINNATI,KY,US&location=BEDFORD PARK,IL,US&location=BEDFORD PARK,IL,US&location=HODGKINS,IL,US&location=HODGKINS,IL,US&location=HODGKINS,IL,US&location=BALDWIN PARK,CA,US&location=BALDWIN PARK,CA,US&location=BALDWIN PARK,CA,US&location=,,US
Run Code Online (Sandbox Code Playgroud)
很长,但是应该符合https://www.mapquestapi.com/geocoding/
当我运行以下php代码时,谜团就揭开了帷幕:
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_URL, $urlForGeocode);
curl_setopt($ch, CURLOPT_HTTPGET, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
$return = curl_exec ($ch);
curl_close ($ch);
echo( $return);
$output = shell_exec('curl ' . $urlForGeocode);
echo( $output);
Run Code Online (Sandbox Code Playgroud)
该变量$urlEncode保存上面url的值。第一个输出是:
<html><body><b>Http/1.1 Bad Request</b></body> </html>
Run Code Online (Sandbox Code Playgroud)
第二个请求的输出是:
{
"info": {
"statuscode": 400,
"copyright": {
"text": "\u00A9 2016 MapQuest, Inc.",
"imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "\u00A9 2016 MapQuest, Inc."
},
"messages": ["no 'json' parameter found"]
},
"options": { …Run Code Online (Sandbox Code Playgroud) 我知道之前已经在这里提出了类似的问题,但他们都没有真正回答我的问题,而且我有压力要在截止日期前完成我的项目.
基本上我正在编写一个显示在线和离线地图的应用程序.
我目前正在使用MapBox SDK查看离线和在线地图,但MapBox目前不提供路由解决方案.所以我正在寻找一种方法来做到这一点.
主要的问题似乎是,不仅有一个SDK会提供在线OSM地图,离线OSM地图和路由,所以我想知道我是否能够使用MapBox处理地图然后使用MapQuest来获取路线?这可能吗?推荐吗?
我正在开展一个项目,我们需要知道街道的方向(指南针).实际上,我们只有一个GeoPoint(lat; long和heading),我们计划使用reverseGeocoding来告诉它在哪里(哪条街道?); 然后我们想知道他是否走错了路.
谷歌地图,OSM,Mapquest他们都在街道上显示一个箭头指示其方向.我猜他们会用它们画它们,所以他们必须知道它们的角度.这就是我想知道的(如果可能的话)
提前致谢!
#编辑:
我想也许他们把街道切成小块,然后他们说"街道的这条轨道从(lat1; lng1)到(lat2; lng2)"会给那条轨道一个方向,所以他们可以画出来箭头.也不是每条街道都是一条直线,所以它的方向不仅仅是一条,而是取决于你所在街道的哪一部分.