google maps - Check if point is in polygon or not -
there region on map, , have check user placed marker on region. problem how declare "rectangular", how declare bounds lat , lng..
maybe wants know details: developing web application taxi company. so, user declare original , destinatoin putting 2 markers. , center of city, square 12x12 km. has constant tarif 10$. , tarif other destinations (outside square) calculated tarif km. db.
there may many ways, 1 possible:
create google.maps.circle
center set center of city , radius of 12000.
all have check if destination placed within bounds of circle.
definedcircle.getbounds().contains(destinationlatlng)
Comments
Post a Comment