midpoint between two latitude and longitude

You need to convert to radians. Change it to the following: public static void midPoint(double lat1,double lon1,double lat2,double lon2){ double dLon = Math.toRadians(lon2 – lon1); //convert to radians lat1 = Math.toRadians(lat1); lat2 = Math.toRadians(lat2); lon1 = Math.toRadians(lon1); double Bx = Math.cos(lat2) * Math.cos(dLon); double By = Math.cos(lat2) * Math.sin(dLon); double lat3 = Math.atan2(Math.sin(lat1) + Math.sin(lat2), … Read more

Move google map center javascript api

Your problem is that in moveToLocation, you’re using document.getElementById to try to get the Map object, but that only gets you an HTMLDivElement, not the google.maps.Map object you’re expecting. So your variable map has no panTo function, which is why it doesn’t work. What you need to is squirrel the map variable away somewhere, and … Read more

error:InvalidValueError: setCenter: not a LatLng or LatLngLiteral: in property lat: not a number

The .value attribute of a HTMLInputElement returns the value as a string. You have to parse the content of lat and lng with parseFloat() before passing it to the maps API function initAutocomplete() { var lat = parseFloat(document.getElementById(‘lat’).value); var lng = parseFloat(document.getElementById(‘lng’).value); var map = new google.maps.Map(document.getElementById(‘map’), { center: { lat: lat, lng: lng }, … Read more

Pulling values from a Java Properties file in order?

Extend java.util.Properties, override both put() and keys(): import java.util.Collections; import java.util.Enumeration; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Properties; import java.util.HashMap; public class LinkedProperties extends Properties { private final HashSet<Object> keys = new LinkedHashSet<Object>(); public LinkedProperties() { } public Iterable<Object> orderedKeys() { return Collections.list(keys()); } public Enumeration<Object> keys() { return Collections.<Object>enumeration(keys); } public Object put(Object key, Object … Read more

custom marker icon with react-leaflet

I finally found the correct code for the Icon.js file : import L from ‘leaflet’; const iconPerson = new L.Icon({ iconUrl: require(‘../img/marker-pin-person.svg’), iconRetinaUrl: require(‘../img/marker-pin-person.svg’), iconAnchor: null, popupAnchor: null, shadowUrl: null, shadowSize: null, shadowAnchor: null, iconSize: new L.Point(60, 75), className: ‘leaflet-div-icon’ }); export { iconPerson };

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)