Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple PHP proxy
<?php
$ch = curl_init($_GET['url']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
?>
@bmcbride

This comment has been minimized.

Copy link
Owner Author

commented Sep 24, 2013

Usage example:

$.getJSON("proxy.php?url=http://www.someserver.com/data.geojson", function (data) {
    myGeoJSONlayer.addData(data);
}).complete(function () {
    map.fitBounds(myGeoJSONlayer.getBounds());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.