Hi @chabito79
Could you pls give some more insight on how you achieved this? How were you able to access the map’s HTML? Did you have to use a separate field other than the geolocation field itself?
Thanks
Hi @chabito79
Could you pls give some more insight on how you achieved this? How were you able to access the map’s HTML? Did you have to use a separate field other than the geolocation field itself?
Thanks
I dont have the project’s code anymore…but I remember I ended up integrating google maps instead of leaflet.
I used an HTML field and injected the map on it (following the standard way)… here’s a nice tutorial about it.
Regards
This is the code for showing popup on the marker. The below code can be included on refresh(frm) trigger.
var map = frm.get_field("geolocation_field").map;
var latlng = L.latLng({'lat':<value>, 'lng': <value>});
var marker = L.marker(latlng);
map.flyTo(latlng, map.getZoom());
marker.addTo(map);
marker.bindPopup(<content>).openPopup();
that great
I want to use restapi to send geojson to erpnext. but I have a trouble, could you check this?
Thank you.
Check the json
Nested “features” is array of objects
Thank for your reply, I tried fixed follow your suggestion but it still not work, the map is default, dont’ have a point here
dd = {
“name1”: “Hcm096”,
“odo”: 200,
“geolocation”: json.dumps(
{“type”: “FeatureCollection”,
“features”: [{
“type”: “Feature”,
“geometry”: {
“type”: “Point”,
“coordinates”: [
106.6964048,
10.7511488]
}
}
]
}
)
}
data = json.dumps(dd)
r = requests.post(url, data, auth=(‘59aa898bdfdf713’, ‘1365c7955faa000’))
print(r)
Example command:
curl -Ssl -X POST https://erp.example.com/api/resource/ToDo \
-H "Content-Type: application/json" \
-H "Authorization: token $api_key:$api_secret" \
-H "Accept: application/json" \
-d '{
"description": "ToDo Mumbai",
"todo_location": "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[72.867851,19.088689]}}]}"
}'
todo_location
is a custom Geolocation
field added on ToDo
Hi all
Anyone got this error/warning on mobile app-android?
Geolocation error: application does not have sufficient geolocation permissions
If so, how did you resolve it?
Mind explaining how to go about this please?
The ERPNext Android app is built with Cordova. You’ll need to research on how to build a Cordova app and follow the steps in the ERPNext Mobile Github repo at GitHub - frappe/mobile: Mobile App for Frappe built on Flutter
Cheers
This is in order. Was just wondering whether this means, I will end up with a different app from the mainstream?
Yes
Ok. Thank you. Will do so.
Hello, I tried the first code on this post and the results are not 2 circles on the map as shown in the diagram. There’s nothing happening.
I want to make a system where I enter coordinates (longitude and latitude) then points are created and joined on the map. How can I go about it?
Can someone explain how can I make a Geolocation based Attendance Employee check-in system?
I tried to make some changes in geolocation.js file frappe.
I was able to hide all the control options, but it was not storing the current location.
Thanks in advance!
Hope It helps someone!