Skip to main content

Posts

Showing posts from May, 2020

How to create a screenshot of your website with JavaScript using html2canvas

The errors on a Web App are part of our daily lives unless you are a superior being from another world. Sometimes, although exceptions should be reported automatically by your code, there are cases where the user would want to report an error by himself and in most of the cases, words are not enough to explain what an error on your awesome app looks like. This is just one of many uses that you could give to the utility of taking screenshots directly in the browser with Javascript. In order to create a screenshot of your website without using a third party service, we recommend you to use the awesome html2canvas library. The script allows you to take "screenshots" of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page. The library should work fine on the followin

How to highlight an area (City, State or Country) in Google Maps with JavaScript

Although this is not always necessary on applications that use Google Maps to display addresses or something related, some clients do want to highlight some area, city or country. In this article, we'll explain 2 ways to highlight some City, State or Country with JavaScript. Short description about what you are going to do To achieve this, you will basically need to look for the coordinates of the state or country on GADM. Once you have them, draw a shape on the Google Maps with the Polygon object providing an array with all the coordinates that play basically as borders of the place that you want to highlight. Important: Retrieve geographic coordinates of the City, State or Country The most important point of this tutorial is of knowing the geographic coordinates of the borders-limits of the area that you want to highlight. With Google Maps, you will be unable to get such information from this tool, instead we recommend you an easier way to get them through the  GADM utility . In