A lot of my clients(companies) want to print google maps (with directions) on b/w printers. But when we tried to do this - maps became agly because google maps has litle contrast and small resolution. As a result - everething on map isn't clear visible. We tried all possible settings of the printer and nothing couldnt help.
How to solve this programly? How make google maps (with routs on it) contrast ang good resolution?
Try reading the Styled Map section of the Google Maps API. They even have a wizard that could help you create a grayscale map.
Not a direct answer but something that indirectly solved the problem for me.
Overview - use freeware image editor 'IrfanView' to 'flatten' the image to b/w, using a custom threshold (not supported in standard IrfanView).
copy the map image from Google maps to the clipboard
paste into IrfanView
install the free 'threshold' plugin into IrfanView
3.1) Download FineThreshold from http://www.mehdiplugins.com/english/finethreshold.htm
3.2) Unzip it and save it in a known location.
3.3) In IrfanView, go to Image / Adobe 8BF Plugins / Filter Dialogs.
Use 'Add 8BF filters' (file) to locate and load the filter.
Use 'start selected filter' to invoke the actual filter.
Note the 'ok/cancel' buttons remain grayed out but work.
I found ~228 was a good threshold value for Google Maps. Just slide around that mark, and see when the background switches from black to white. You have to hit 'ok' for each value to see the impact. Then you have to exit the plugin to return to the main IrfanView window.
Try http://www.openstreetmap.org , select cycle map (on stack top right). Labels are slightly bigger than on Google, contrast is better (still not great)
this looks better fit for your need
https://snazzymaps.com/style/79/black-and-white
you can print with markers and labels also.
Related
Why doesn't google map z (zoom) parameter work inside the url?
I' ve searched over so I got few solutions for sending zoom parameter in google map url but based on the old posts (stackoverflow) which deal with the zoom level within the url it seems that this functionalities do not work anymore.
I've used the following z parameter but it's not working:
http://maps.google.com/?q=38.6531004,-90.243462&z=12
Below is the link where they have mentioned z parameter for zoom level
link
For those who do not want to read,
this works (z range:[1-20]):
https://maps.google.com/?q=38.6531004,-90.243462&ll=38.6531004,-90.243462&z=3
There is no documentation that covers this problem. However, there are few hacks.
The link that you have provided,
URL (stackoverflow):What parameters should I use in a Google Maps URL to go to a lat-lon?
Will not help you with getting the desired google maps zoom level inside a url
The following examples which have been working for quite a while DO NOT WORK anymore (they work but without getting the desired zoom level)
Examples:
http://maps.google.com/?q=38.6531004,-90.243462&z=3
http://maps.google.com/?q=38.6531004,-90.243462&zoom=3
http://maps.google.com/maps?q=Scottish+Rite+Hamilton+ON&loc:43.25911+-79.879494&z=15
Instead, you can get the zoom level easily by trying the following examples:
https://www.google.com/maps/#38.6531004,-90.243462,9z
https://maps.google.com/?ll=40.7060471,-74.0088901&z=3
(Note: after clicking on google maps you will get a gray marker which appears and quickly disappears)
However the above URL's will not give you a static pinpoint for the specified lat&long.
There is a "hack" on how to get a fixed pinpoint (red marker pin) and that is by giving the q attribute (represents the search query) and the II attribute(latitude and longitude of the map centre point) along with the z (zoom attribute)
Example (with the OP coordinates):
https://maps.google.com/?q=38.6531004,-90.243462&ll=38.6531004,-90.243462&z=3
If you want to change the zoom level just change the value of 'z'.
After searching the web I found that only this website:
https://moz.com/blog/new-google-maps-url-parameters
deals with google maps parameters/attributes/arguments, where things actually still work. If anyone want's more functionalities within the url, then this is the site to check.
Zoom intervals explained (https://developers.google.com/maps/documentation/static-maps/intro#Zoomlevels):
The following list shows the approximate level of detail you can
expect to see at each zoom level:
1: World
5: Landmass/continent
10: City
15: Streets
20: Buildings
This works as of 5 Aug 2018
http://www.google.com/maps/place/<lat>,<lng>/#<lat>,<lng>,<zoom>z
For example
http://www.google.com/maps/place/49.46800006494457,17.11514008755796/#49.46800006494457,17.11514008755796,7z
As of 04/2020 ...."because google is always changing and evolving"
In complement to Eugen Sunic comments above, and an alternative update to the Solution.
When Logged in to google and getting map data from the google generator, it is not the same as copying the URL from the browser window (which my may be manipulated to load different zooms trough the various alterations, html, Css and script tricks).
But in the below, keep in mind that Your address info may need to be part of the google array of database, eg you have some address map info linked to your account, images, business name, etc. or not... maybe just typed in for a quick map search with a pin-point... the later I don't know.
Also the below is not some Google API pay per 1k clicks thing, which is more geared to the commercial development end of google tracking heat maps, etc. So if you just need a simple solution and certain zoom and marker to work..then you might try the below.
When logged in too your Google account (maybe not) and showing your location marker on the map screen...
Choose the zoom detail of the map you want to appear in your web page. eg Whole US, State views, City, Street (by clicking the + or - zoom feature).
Then go to the hamburger menu to the left, and look down the list for "Share or Embed Map" and the popup window should load the same zoom level of the map! Do not try to change the zoom in the popup window feature, it wont work to change the link code but will change the pop up windows zoom of the map. In short, the embedded link code is preset and will not change in the popup.
Above this popup window of the map there will be two options at the top (Share and Embed) button/link selections.
Click on the Embed link/button and it should generate the code for the zoom you previously chose.
Lastly, copy the code, paste it into your web page and TEST!
As far as I can tell, There is no altering this code as the others suggested above, changing(z=3, 9z, etc) as the code is entirely different. But it will allow you to get the zoom you need "if the google code generator or procedure does not change".
But the zoom level was altered and good enough for me when I figured the process out. Changing it to other zooms is another can of code.
I have a KML file from an architect who says he colorized the lines (white, blue, red) and I see the codes in the file itself so I know they are there. The proper colors do display in Google Earth, but NOT in google maps http://lonesomevalley.com/site-map-mapbox/ that I added as a KML layer into MapBox. They also don't display when I bring into the Geojson.io tool so something must be wrong. I see that color is supported by google maps so wondering why it isn't working. Please help! Thanks in advance! My code can be downloaded here: http://evolv.com/lonesome.kml
If I understand the question right, it was the same problem like I had for quit a while. Then someone gave me this quit simple solution.
The colorcodes in kml are in BGR format, while most other formats are the usual RGB format.
The conversion is quit simple: RGB 'ff12dd' will be in BGR 'dd12ff' (R and B just change) but in kml there must always be 'FF' in front, so it will be 'FFdd12ff'
I can't tell you if it's the same issue on your mapbox-implementation(mapbox isn't google maps)
The colors also will not be applied in a google.maps.KmlLayer
The issue seems to be that you've placed the <Style/>'s in <Folder/>'s
When you validate the KML ( http://www.kmlvalidator.com/home ) you'll see that the styles may not be found(and more errors) .
Possible solution( at least related to google-maps): Place the Styles outside of the Folders, as direct childs of <Document/>
Okay after much trial and error working within the KML file, I finally consulted an expert who gave me a simple answer that worked! He said the easiest way to go about changing line colors and weight is through MapBox Editor itself. All you have to do is click on the Data tab, then the 3 horizontal lines button ("hamburger menu drawer icon") to bring up the features. Then you can delete any feature you want from there or click on the feature to change its stroke color and weight. So EASY!!! Just be sure to hit save when done. And there is no Undo if you trash something by mistake so make sure to Save every once in a while and just back out of the project without saving in order to get back something you deleted by mistake.
So all in all I believe that KML files don't bring in the colors of lines correctly to MapBox and therefore need to be corrected through the editor itself.
I have a building floor plan and I need to specify its position on top of google map.
I like the way this is done in Google Floor Plans app - screenshot(the right part with map) - but I cannot figure out how they made it! :)
What part in Google Maps API I should look at?
In short - I have an image (plan of floor), and need to show it on top of Google Map and be able to manipulate with it (changing dimensions on events).
I'm thinking you'll want to implement a custom overlay. That link provides the relevant instructions for doing so. Also, Google provides a simple example so you can see the result here. Is that sort of what you're going for?
#Cianan Sims: Well, sure, I want custom overlay, but how is the question :-)
Fortunately, Google published tool called Overlay Tiler, which does exactly what I wanted - georeferencing of the image.
I know it is possible with Google Map API v3 (MapTypeStyler option) but do you think it is with Leaflet API ?
Thing is that I have text that cover a map I need to make more visible by adjusting brightness or - even better - by applying blur effect like in this example : http://www.hongkiat.com/blog/css-filter/
CSS shader looks very promising but supported only with latest Chrome browser.
The text over the map is modal (user must interact with button) and I could add overlay with a PNG image file. I don't like to much this solution that need unnecessary file to be transfered to the client.
Thank you,
Leaflet is very lightweight and simply puts references to tile images on your html page. So I see two options to change the look of the tiles:
CSS
Which indeed depends on the browser.
Custom tiles
Leaflet will display tiles from any server. You can for example pick one of the many styles served by cloudmade or make one of your own there.
Or use a tool like TileMill to create (and perhaps even host) them yourself.
So this might be a bit tricky to demonstrate, since the problem only appears occasionally and unpredictably--hopefully the problem shows up when you view this question (or, alternatively, has stopped appearing altogether!).
We have a Google Maps implementation on our site that displays paginated search results on a map. The current page's results appear as regular Google Maps markers (with custom icons--these work fine), but the other search results appear as smaller markers in a KML layer. An example:
http://www.redflagdeals.com/in/verdun/map/
The large markers are squarish pin images; the small markers are coloured dots. Blue and purple markers/dots simply refer to different types of content. In the KML file, we've specified two Styles, one for each content type. Other than the Icon reference, which points to the different pin images, the two elements are exactly the same. Here's an example generated KML file for reference:
http://www.redflagdeals.com/in/verdun/map/?do=map_kml&longitude=-73.56895400000002&latitude=45.457064&order=deal_price&dir=asc&category_filter=0&content_filter=0&tag_filter=0&keyword=&page=1&show=deal%20coupon
Most of the time, our map shows the large and small markers perfectly. Occasionally, though, some or all of the small pins show up without the custom icons, instead reverting to the generic blue Google marker image. Today, the custom minipins that show up in blue are broken, while the purple ones are all fine. Other times, both the blue and purple ones are broken.
The problem usually fixes itself, leaving us clueless as to the cause or the solution. The only theory I have is that we use a CDN to host our marker images, and occasionally we push a new version to the CDN while updating all the filenames simultaneously (as we have CDN version numbers in the URLs for our images). Maybe it's possible Google is requesting one or both of the small pin images right when we're pushing a new CDN version, getting a 404, and giving up immediately. But that would mean Google caches the KML images (or lack thereof) for quite a long time. Other than that, I have no ideas.
Is there anything we can do to prevent this problem from cropping up in the future?
see this post (Comment #4 specifically) explains caching of custom markers
http://code.google.com/p/gmaps-api-issues/issues/detail?id=3864
I've just tested this, the result is the following:
I'm sure Google caches both, the KML-file and the marker-images.
(Of course they do, otherwise they must load the files and create new tiles on every single request )
So when you change any marker-image, you must change the URLs of the marker-images inside the KML-file.
You also must change the URL of the KML-file inside your application(otherwise google will not recognize the modified image-URL's)
It's sufficient to append a random parameter to the URLs