Posts

Showing posts with the label openstreetmap

Read openstreetmap PBF file with PHP?

Read openstreetmap PBF file with PHP? I downloaded a mbtiles file from this location: https://openmaptiles.com/downloads/europe/netherlands/ mbtiles I can serve this file in PHP with this library : https://github.com/klokantech/tileserver-php PHP This returns a compressed PBF , which Mapbox GL JS can use, but I'm not able in PHP to decode this data to get information out of it. PBF Mapbox GL JS Has anybody ever extracted data from PBF using PHP ? PBF PHP By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Remove old marker add new one after call ajax method every x second with OpenLayers

Remove old marker add new one after call ajax method every x second with OpenLayers I want to change marker position for every x seconds using ajax method but i am facing 1 issue for that is the new marker is adding on OpenLayers but old marker is not removing from OpenLayers. I want to remove old marker first and then add new marker in updated place. function ShowCurrentTime() { var obj = {}; obj.device_id = $.trim($("[id*=txtdevice_id]").val()); var marker; var mapOptions; $.ajax({ url: "TRACKING.aspx/GetData", data: JSON.stringify(obj), type: "POST", dataType: "json", contentType: "application/json; charset=utf-8", success: function(data) { if (data.d != '') { var lat = data.d[1]; var lng = data.d[2]; } $.each(data, function(index, value) { ...