I want to create a static google maps image which displays buildings (and buildings only). I looked through the Styled Maps page on static maps stylings, but I couldn't find an option for buildings in particular.
Please note that this should also work in less populated areas, so simply turning the landscape one colour and showing the roads in another does not suffice (like done in this image).
Is there a way to create such a map?
The closest feature for buildings would be the landscape.man_made feature which selects structures built by humans. You can also experiment on other features that may suite your needs such as points of interest.
For features that you want to hide from the map, you can set the style to visibility:off for that specific feature.
Here's an example that changes the stroke color for all man made landscapes and hides all roads:
https://maps.googleapis.com/maps/api/staticmap?size=512x512&zoom=17¢er=Brooklyn&style=feature:landscape.man_made|element:geometry.stroke|color:0xff0000&style=feature:road|visibility:off&key=YOUR_API_KEY
Note that the sample uses the element geometry.stroke which selects only the stroke of the feature's geometry.
Hope this helps!
Related
I'd like for my road-path-smooth elements to show at a lower zoom level than they currently are because my application is for the outdoors and these are more important elements. Is that possible? I can't seem to find out how to adjust this in studio.
If you're talking about displaying layers from the Mapbox Streets tileset, then no, it's probably not possible. The vector tiles are optimised for Mapbox's style (also, confusingly, called Mapbox Streets), and don't contain data that isn't already displayed.
Your need is a common one, but unfortunately the only way to solve it is to find a different set of vector tiles that meets your needs, or create one yourself.
Let's say you want to build an app where people can find out whether the location the users are on has a risk of being flooded. You want to be able to create flood zone areas on the map and compare the user geolocation relative to the area. How do I do that with google_maps_flutter? or is there any other way to do it with plugins in flutter?
What I have in mind right now is to create polygons on the map and perform some geometric operations with it (if that is even possible). I have Esri SHP files which I will export to json and parse it in flutter and then use the results to draw polygons of the areas.
no code just yet..
You can make use of 'overlay widgets' in Flutter. You can draw, say a circle, indicating a flood zone with colour and radius in accordance with the probability (or other parameters).
Depending on how you want to display, you can create a separate UI control to display the comparision with reference to the user's geo-location.
I'm using Mapbox GL JS. Is there any way I can style my base layer to look like the Mapbox Light example, but showing only the UK?
I assume I would use Mapbox Studio to build my own base layer, but I can't see any way in Studio to filter by country.
If that's not possible, is there any way I could show labels on the UK only, and show other countries as filled polygons? (As per this unanswered question.)
Unfortunately it is not possible to filter by a certain geography when selecting the data source for a layer. If you're working with Mapbox's tiles, they'll always cover the entire planet.
There is the possibility to restrict the map to a certain (rectangular) bounds, with the map.setMaxBounds method (https://www.mapbox.com/mapbox-gl-js/api/#Map#setMaxBounds). This might work reasonably well since you want to restrict the view to the UK, but might not be suitable depending on the geometry you want to restrict the view to.
As a workaround you could create a dataset and add a polygon that covers the entire planet except for the extent you want to show in your map. Then add this dataset in your style as the top most layer and style it with whatever you'd like the empty space in your map to look like.
The workaround has been also suggested in this SO answer, if you can get maptiles for the UK only (the SO answer gives a link, but for Germany) you can
upload them to Mapbox as a dataset, export it to tilesets, and then
to a map as a layer. Delete all other layers
You have also the possibility to Style a single country in Mapbox
studio ref this tutorial. The other countries are still shown, but you can style your map in a way to highlight UK
There is a option that allows you to show only one country highlighted. But drawback is, you lose all the layers and tile-level details. Here is the link https://www.mapbox.com/videos/how-to/map-a-single-country-in-mapbox-studio/.
But if you want to include the tile details as well as whole world map but in that map only one or two or custom amount of countries highlighted, then, from above link of Natural Earth download the zipped file of ne_10m_admin_0_countries and upload.
Go back to your map style, and instead of making a blank one. Add another layer of ne_10m_admin_0_countries in your current map. Select the country in the filter option (in same way as shown in video). And change its opacity. That's it.
Hope it helps. Have a great day.
I am new to OpenstreetMap and Leafletjs. I am trying to implement a map displaying journey time information on motorways (also called highways in some part of the world) by using different colors to show road congestion and the problem I'm facing is, once the map tiles are rendered, it comes with all information, like town/city names, road names etc.
On the basis of road information that I receive, I create road colorings in an overlay that sits on top of the tile layer. The problem is, once that happens, the road colorings cover the road names that appear on the tile layer. The problem can be seen in the image displayed below.
Is there a way, I could extract the road names so that I could put it in a layer above the road coloring layer so that road names appear on top of road colorings.
Thanks for any sort of help, Looking forward to some replies.
Thanks
In theory, you could create two sets of tiles: one with the road lines, another with the shields (labels). Render the shields tiles with a transparent background. Then hack Leaflet around to have a second tile layer above the overlay layer.
However... that's a whole bunch of hassle for a fairly simple problem. So: why not render the road numbers alongside the roads, rather than on top of them? That way, your overlay line won't obscure the numbers. Here's an example of a style that does this (disclaimer: my site!).
Assuming you're using Mapnik to render your tiles, you'll want to use TextSymbolizer rather than ShieldSymbolizer. Customising the style is (of course) much easier if you're using TileMill rather than pure Mapnik XML.
As you say, the roadnames (here ref icon symbolizers) are part of the OSM raster map tiles and can't changed easily.
So the easiest solution would be to switch to a mapstyle without labels.
Another idea would be to add more alpha to your cusom GPS track, so it get's more 'hollow' and fits better in the mapstyle. But the default OSM style isn't good for adding informations on top, as this basemap is already to detailed. Maybe it makes sense to use another one:
http://wiki.openstreetmap.org/wiki/Featured_tiles
I've already looked into SurroundFrames and MapSurrounds, but this appears to be for cases in which you want to add these elements to a printed page. I, on the other hand, am using the MapControl within a live application, and I would like these element directly on the map, in the same way you see them on Google Maps.
Do I have to add these things from scratch using custom symbols and capturing events, or does ArcObjects automate this in any way?
The PageLayoutControl is designed to do this. Scale bars, legends, north arrow, map insets, titles, overview maps, etc. are all layout elements.