Enable my node.js web app to save google map pictures - google-maps

I have a node.js web application which makes use of google maps. I want to enable a user to save the map they are viewing in a pdf document. I'll use pdfKit to generate the pdf document as it has support for images but for this, I'll first need to save the image of the map. I don't know how I'll go about this. Can anyone give me some ideas on how to do this - how do I save an image of the map a user is looking at on the server?

I believe you would have to get the image file through Google Static Maps API, generate PDF and return the document to the user.
I would also take #Dr.Molle's comment into consideration if you plan to actually store the images in a database.

Related

Create a link in web page that permit to open google earth and/or google maps with loading a specified kml file

I'm trying to create a link in a web page that permit to open google maps and/or google earth loading the kml file specified.
I see here geouri method but don't seems working anymore with kml file
I also saw for example this:
https://earth.google.com/web/?kml=https://tourbuilder.withgoogle.com/tours/ahJzfmd3ZWItdG91cmJ1aWxkZXJyEQsSBFRvdXIYgICg6vjqywkM/earth
but this method seems working only with specific sites like tourbuilder, and for what I need, kml generated dynamically from the web pages, possibly updated over time and numerous kml (almost 200) would take a long time to create a "tour" for each (if that is possible) and would restrict the possible changes to the web page and to kml.
Can someone tell me if there is another way to create a link in a web page that permit to open google maps and/or google earth loading the kml file specified please?
Maps.google.com used to support loading public KMLs via the search bar or via a URL parameter, but not anymore. To load a KML in Google Maps, you need a web site (can be very simple) that uses the Maps API and loads a KML Layer. Sounds like not your use-case, but if it was a simple KML that wouldn't be changing often, you could consider uploading it to a MyMap and sharing that.
Google Earth for web & mobile (as opposed to the Earth Pro desktop application) does not currently support loading arbitrary KMLs via URL either, except for certain KML sources (as you saw with tourbuilder).

How to generate GIS Maps without any browser specific library?

I need to generate a GIS map showing some points and polygons. This map generation process has to run in the background so that every day at a certain time of the day a map is made and stored at a certain location in the file system.
I don't think leaflet can be used for this as it runs on the browser.
Not sure how will this happen in QGIS also....any light in this direction will be helpful.
My requirement is to generate a HTML report which contains a map. I cannot do it on the browser because the user will not use the browser and want the report to be inn his mailbox every day automatically.
I will be using node js to generate HTML.
How can this be achieved? Please save my life.
Thanks
I suggest you use something like phantom.js to perform what is essentially a screen capture of the map you generate in a web page that is 'displayed' on a headless, off-screen web page. What sort of map server you use to generate the maps is up to you; but that would let you capture a browser view of the map and re-package it in a PDF or an image that is embedded in an email.
Make that PDF or image a GeoPDF or a GeoTIFF or example and the result would retain some geospatial aspects instead of being a dumb screen capture.
I would use something capable of delivering a map tiling service (like wms) which you can then query server-side and piece together the tiles. I've had good luck with geoserver (http://geoserver.org/) but there are other solutions as well. I'm not sure if you can can query Google maps api or Open Street Map like this. The nice thing about your own map server is that you can completely define the map you want on it in one place. Aside from this, I would browse the npm repository to see if anyone has tackled this problem before.

How to integrate a map made in Photoshop with ASP.NET web application?

We have gone through the MapTiler website (http://www.maptiler.com/) and I downloaded the application and tried a sample. It is fantastic. But we have some questions:
1) How can we make integration with Map Tiler with our ASP.NET web application?
2) Once we render our photoshop customized map in google map, how can we put this map in our website because as there are many files created?
Our purpose is, we have a web application for real-estate. We want to put a planning map in google map. So that if any user open it, he can know how the building will look like.
Integration of ASP.NET with the maps generated by MapTiler is equal to any other web technology.
MapTiler prepares for you a directory structure with hundreds of small JPEG/PNG tiles and a sample ready-to-use HTML/JavaScript viewer which allows zooming on these tiles. If you upload all the files with directories to your web server, same as you do with normal images, then the viewer will display the map online in your websites.
The next step is then enhancement of the generated sample Google Maps API viewer with ASP.NET - to add binding to your database or other dynamic functionality.
This is the easiest way.
If you have large number of maps or if you want to avoid to transfer thousands of small files to the server, then you can choose to render the MBTiles format on this MapTiler screen:
In such case the whole map is saved in a single file which is easier to upload to the server, but you need to use a simple tileserver to serve the tiles. We have developed one in PHP (https://github.com/klokantech/tileserver-php/) and in C/C++ (http://www.tileserver.com/).
I saw online an alternative made in ASP.NET as well: https://github.com/sainsb/tilecannon

google maps: How to create static images containing lots of GPS path points

I need to create images of GPS paths on top of google maps satellite information. The ultimate goal is to import those images in a report that is being created in an Excel program that is run through userforms & VBA.
I'm having trouble coming up with a way to automate the generation of these images. Preferably the user would not have to install additional software and there would be a way of automating this process using VBA. I would like to use the Static Google Maps API, but that is limited by the number of characters in an HTML request (2048 as I understand) and my path data is easily going to exceed that length.
Let's assume for now that I have a single KML file with my GPS path data.
Any thoughts on a way to convert large KML path files into static maps image files using VBA? I'm imagining VBA opening a local HTML file with a dynamic google map, uploading the KML file, and somehow capturing and saving a screenshot of the KML data loaded onto the dynamic google map.
FYI I'm locked into using the existing Excel/VBA forms-based program to generate these reports.
(new to this board and relatively new at programming so please let me know if my description is lacking. thanks)

Google map location displayed in historic real time

I'm interested in adding a Google Maps feature to a program I'm writing. I would start with a historic GPS log file containing a record of my changing GPS location and date/time - for example as I drive along the road. Later on I would like to feed this log file into a windows program which would display the GPS position as a marker in the center of a Google Map that is displayed in a window on screen. The Google Map would be automatically scrolled horizontally or vertically in historic "real time" as the GPS position changed so that the marker always stays in the center of the map.
Below is a YouTube video of an existing program which already does exactly what I want, so it must be possible (it's the pane in the bottom right of the video frame)
http://www.youtube.com/watch?feature=player_embedded&v=r4rwMV7hhaY#at=840
Effectively the user would be playing-back their recorded movements in real-time from days or months ago. It would not be for tracking current movements.
I don't know much about the Google API yet, but I think that the Google maps would have to be running in a desktop program, and not on a web site.
Are there any pre-built modules which already do this (perhaps just feeding it a list of coordinates and times)?
If not, what API would I need to use to reproduce the map behavior shown in the video?
Also are there any licensing issues with doing this in a desktop program which would only be seen by 1 user rather than on a publicly available web site?
I have used the Google Maps API for creating an embedded GPS window like the one you referenced in your link, but basically it was embedding a browser window and linking it up to Google Maps. You can manage the data yourself and pump it over to the browser. This can be done locally.
You'll need to do a few things.
Define the map scripts (with an html/Javascript file). These scripts will allow you to update the location you are displaying on the map which you will hook into code side to control.
In your GUI define a browser object and set it to navigate to the html file you've made and then use the document portion of that object to invoke scripts.
You should be able to control the GPS location once you've done that. The Google Maps API is referenced in your html file. That html file is key, it will need to have all the functions you want to use to update the GPS location and display it on the map.
As per pre-built modules an/or licensing I do not know.