Doe is exists a way to remove all the places from the OSM map? Also like shops, bars, restorations, hotels etc.
I wish to use a maps with a less info. Is it possible to do this from the original OSM server? Maybe like a option in URL or something else? I use Leaflet library for my project, maybe some option in it?
I wished to have it like in GMAPS API:
new google.maps.Map(map_div,{
styles:[{
elementType:'all',
featureType:'poi',
stylers:[{
visibility:'off'
}]
}]});
Over JS or over extra URL, so or so, but without places.
The main OSM service provides only one rendering, and you can't change that rendering. Instead, you could:
Render your own tiles - you could design them in Tilemill and host them using Tilestache.
Use maps provided by a third party, such as these Mapbox maps, or opencyclemap, or...
Related
I am creating an app where I use a leaflet map. I was wondering if there is any extern library that I can use to translate coordinates into street addresses? Im using Angular 6.
Here is a really simple possibility by using Nominatim. It's a tool used by OpenStreetmap. Here is a link for all the details:
https://wiki.openstreetmap.org/wiki/Nominatim
And here is an example on how you could use it:
$.get('https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=47.217954&lon=-1.552918', function(data){
console.log(data.address.road);
});
You will only need to replace coordinates with variable like this:
lat='+ latitude +'
And if you want a plugin: https://esri.github.io/esri-leaflet/examples/reverse-geocoding.html
What you are asking for is called Geocoding. For Leaflet there is a plethora of plugins to accomplish this, all of them listed at https://leafletjs.com/plugins#geocoding. Note that some plugins, such as https://github.com/perliedman/leaflet-control-geocoder, are not limited to one geocoding provider.
I'm ingesting a large geoJSON file in leaflet with somewhere near 19,000 features (points). This results in a massive amount of clutter on the map and is unmanageable.
The goal is to use geolocation to mark my location, draw a 5nm circle around it, and only display geoJSON features that reside within that geometry.
A condensed version of my project is:
https://jsfiddle.net/blintster/d2ucock2/3/
I've worked out finding my location and drawing the circle, but I'm not able to parse the geoJSON features on location. Ideally the output would function like this: https://esri.github.io/esri-leaflet/examples/spatial-queries.html However, that method only seems to apply to L.esri.FeatureLayer and this is a locally imported geoJSON.
The geoJSON layer in question is below where [airports] is the 19,000 entries:
var allairportsLayer = L.geoJson([airports], {
filter: airportFilter,
onEachFeature: function(feature, layer) {
layer.bindPopup(feature.properties.Type + " - " + feature.properties.FacilityName + "<br>Contact Info: " + feature.properties.Manager + "<br> Phone: " + feature.properties.ManagerPhone);
}
}).addTo(map);
function airportFilter(feature) {
if (feature.properties.State === "MD") return true
};
I was able to pair down the results slightly by using the filter method by state but that only allowed me to determine if an attribute meets a specified criteria.
I'v also tried the following method: https://www.mapbox.com/mapbox.js/example/v1.0.0/marker-radius-search/
with no luck.
Does anyone know of any additional methods I could try to parse the data so it only shows points that reside within a geometry?
However, that method only seems to apply to L.esri.FeatureLayer and this is a locally imported geoJSON.
esri-leaflet piggybacks off ArcGIS Server and ArcGIS Online services which provide a backend hosted database that supports spatial queries.
obviously Esri isn't the only option, but your use-case is a perfect example of a situation when it is beneficial not to fetch an entire dataset that you don't plan on displaying.
you could create a arcgis developer account and then sign into arcgis.com to upload your .geojson file as a new hosted service for free.
you could find another hosted service that provides comparable functionality
you could run your own server, install your own PostGIS database and hook up spatial web queries yourself.
you could continue to download all 19,000 features on page load and either:
a) simplify your search and test whether the relevant L.latLngBounds.contains() each point.
b) use something like turf to test the relationship with an actual circle. (one caveat worth mentioning here is that leaflet doesn't include any built in methods for generating actual L.circle geometry so you'd need more custom logic for that too. i wrote something similar here that you are welcome to ripoff).
What I want to do is to load a map with predefined markers on it. I could write code in map initialization to do this. I wonder if google offer REST api that I call it instead of coding to load the map and its predefined markers?
Of course there is! heres a link to their JS api: https://developers.google.com/maps/documentation/javascript/
Read till the bottom, there's a small example.
I have set my Google Map object to view as a ROADMAP, but there is no traffic options like there is on the regular Google Maps. Below is the control I am trying to get. Is this possible via the map options in the API? I tried looking in the docs but there is nothing there for that (unless I am missing something).
You can create a custom control as shown on this example from the documentation.
Here is an example that shows embedding a traffic control onto the map.
http://pietervogelaar.nl/google-maps-api-v3-traffic-toggle-button/
I have just started with bing maps and wish to accompilish two things for my project .
a) define layers/shapes by loading data via xml
B) Have a tooltip/infobox like this site:-
check the source file here
For custom infoboxes in Bing Maps there are two options. The first is to use the built in infobox control and set the html content property. I have a blog post on how to do this here: http://rbrundritt.wordpress.com/2011/11/08/simple-custom-infoboxes-in-bing-maps-v7/
The second method is to use the custom infobox module I created for Bing Maps V7 here: http://bingmapsv7modules.codeplex.com/wikipage?title=Custom%20Infobox%20Control
As for XML data, if it is in GeoRSS or GML format then you can use this module:
http://bingmapsv7modules.codeplex.com/wikipage?title=GeoRSS%20Plugin
If it is in GPX format you can use this module:
http://bingmapsv7modules.codeplex.com/wikipage?title=GPX%20Parser
For tooltips you can take a look at this blog post: http://rbrundritt.wordpress.com/2011/11/21/pushpin-tooltips-in-bing-maps-v7/