Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespaces reorg #114

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ else
Static Maps API support allows you to get a valid url or a streamed bitmap which you can use:

```c#
using Google.Maps;
using Google.Maps.Common;

//always need to use YOUR_API_KEY for requests. Do this in App_Start.
GoogleSigned.AssignAllServices(new GoogleSigned("YOUR_API_KEY"));
var map = new StaticMapRequest();
map.Center = new Location("1600 Pennsylvania Ave NW, Washington, DC 20500");
map.Size = new System.Drawing.Size(400, 400);
map.Size = new GSize(400, 400);
map.Zoom = 14;
```

Expand Down Expand Up @@ -150,6 +153,7 @@ Questions, comments and/or suggestions are welcome! Please raise an [issue](http
## Contributors
A big thank you to all of our [contributors](https://github.com/ericnewton76/gmaps-api-net/graphs/contributors) including:

- [Luis Farzati](https://github.com/luisfarzati)
- [Eric Newton](https://github.com/ericnewton76)
- [Sheepzez](https://github.com/Sheepzez)
- [Mieliespoor](https://github.com/mieliespoor)
Expand Down
1 change: 1 addition & 0 deletions src/ConsoleApp1/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

using Google.Maps;
using Google.Maps.Geocoding;
using Google.Maps.Common;

namespace ConsoleApp1
{
Expand Down
1 change: 1 addition & 0 deletions src/Google.Maps.Test/Direction/DirectionRequestTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Specialized;

using NUnit.Framework;
using Google.Maps.Common;

namespace Google.Maps.Direction
{
Expand Down
3 changes: 2 additions & 1 deletion src/Google.Maps.Test/Direction/DirectionServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

using NUnit.Framework;

using Google.Maps.Shared;
using Google.Maps.Common;
using Google.Maps.Internal;

namespace Google.Maps.Direction
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;

using NUnit.Framework;
using Google.Maps.Common;

namespace Google.Maps.DistanceMatrix
{
Expand Down
1 change: 1 addition & 0 deletions src/Google.Maps.Test/Elevation/ElevationServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System;

using NUnit.Framework;
using Google.Maps.Common;

namespace Google.Maps.Elevation
{
Expand Down
3 changes: 2 additions & 1 deletion src/Google.Maps.Test/Geocoding/GeocodingServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

using NUnit.Framework;

using Google.Maps.Shared;
using Google.Maps.Common;
using Google.Maps.Internal;

namespace Google.Maps.Geocoding
{
Expand Down
1 change: 1 addition & 0 deletions src/Google.Maps.Test/GoogleMapsForBusinessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using NUnit.Framework;

using Google.Maps.Geocoding;
using Google.Maps.Common;

namespace Google.Maps
{
Expand Down
1 change: 1 addition & 0 deletions src/Google.Maps.Test/LatLngComparerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;

using NUnit.Framework;
using Google.Maps.Internal;

namespace Google.Maps
{
Expand Down
19 changes: 10 additions & 9 deletions src/Google.Maps.Test/MapColorTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
using Google.Maps.Common;

namespace Google.Maps
{
Expand All @@ -8,9 +9,9 @@ public class MapColorTests
[Test]
public void IsUndefined_Works()
{
var undefined = new MapColor();
var definedName = MapColor.FromName("red");
var definedRGB = MapColor.FromArgb(255,255,255);
var undefined = new GColor();
var definedName = GColor.FromName("red");
var definedRGB = GColor.FromArgb(255,255,255);

Assert.AreEqual(true, undefined.IsUndefined);
Assert.AreEqual(false, definedName.IsUndefined);
Expand All @@ -20,9 +21,9 @@ public void IsUndefined_Works()
[Test]
public void To24BitColor_Works()
{
var namedColor = MapColor.FromName("red");
var rgbColor = MapColor.FromArgb(255, 0, 0);
var rgbaColor = MapColor.FromArgb(255, 255, 0, 0);
var namedColor = GColor.FromName("red");
var rgbColor = GColor.FromArgb(255, 0, 0);
var rgbaColor = GColor.FromArgb(255, 255, 0, 0);

Assert.AreEqual("red", namedColor.To24BitColorString());
Assert.AreEqual("0xFF0000", rgbColor.To24BitColorString());
Expand All @@ -32,9 +33,9 @@ public void To24BitColor_Works()
[Test]
public void To32BitColor_Works()
{
var namedColor = MapColor.FromName("red");
var rgbColor = MapColor.FromArgb(255, 0, 0);
var rgbaColor = MapColor.FromArgb(255, 255, 0, 0);
var namedColor = GColor.FromName("red");
var rgbColor = GColor.FromArgb(255, 0, 0);
var rgbaColor = GColor.FromArgb(255, 255, 0, 0);

Assert.AreEqual("red", namedColor.To32BitColorString());
Assert.AreEqual("0xFF0000FF", rgbColor.To32BitColorString());
Expand Down
1 change: 1 addition & 0 deletions src/Google.Maps.Test/Places/PlaceDetailsServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;

using NUnit.Framework;
using Google.Maps.Common;

namespace Google.Maps.Places.Details
{
Expand Down
1 change: 1 addition & 0 deletions src/Google.Maps.Test/Places/PlacesServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Threading;

using NUnit.Framework;
using Google.Maps.Common;

namespace Google.Maps.Places
{
Expand Down
1 change: 1 addition & 0 deletions src/Google.Maps.Test/PolylineEncodingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;

using NUnit.Framework;
using Google.Maps.Internal;

namespace Google.Maps
{
Expand Down
3 changes: 2 additions & 1 deletion src/Google.Maps.Test/QuickExamplesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Google.Maps.Direction;
using Google.Maps.Geocoding;
using Google.Maps.StaticMaps;
using Google.Maps.Common;

namespace Google.Maps
{
Expand Down Expand Up @@ -43,7 +44,7 @@ public void StaticMapRequest_Example()
{
var map = new StaticMapRequest();
map.Center = new Location("1600 Amphitheatre Parkway Mountain View, CA 94043");
map.Size = new MapSize(400, 400);
map.Size = new GSize(400, 400);
map.Zoom = 14;

var imgTagSrc = map.ToUri();
Expand Down
5 changes: 3 additions & 2 deletions src/Google.Maps.Test/StaticMaps/StaticMapRequestTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;

using NUnit.Framework;
using Google.Maps.Common;

namespace Google.Maps.StaticMaps
{
Expand All @@ -14,7 +15,7 @@ public void Invalid_size_propert_set()
{
StaticMapRequest sm = new StaticMapRequest()
{
Size = new MapSize(-1, -1)
Size = new GSize(-1, -1)
};
});
}
Expand All @@ -26,7 +27,7 @@ public void Invalid_size_max()
{
StaticMapRequest sm = new StaticMapRequest()
{
Size = new MapSize(4097, 4097)
Size = new GSize(4097, 4097)
};
});
}
Expand Down
7 changes: 4 additions & 3 deletions src/Google.Maps.Test/StaticMaps/StaticMap_Path_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Text.RegularExpressions;

using NUnit.Framework;
using Google.Maps.Common;

namespace Google.Maps.StaticMaps
{
Expand Down Expand Up @@ -46,7 +47,7 @@ public void Path_NonstandardColor_EncodedProperly()
var map = new StaticMapRequest();
map.Paths.Add(new Path(new LatLng(30.0, -60.0))
{
Color = MapColor.FromArgb(0x80, 0xA0, 0xC0)
Color = GColor.FromArgb(0x80, 0xA0, 0xC0)
});
string color = ExtractColorFromUri(map.ToUri());
Assert.AreEqual("0X80A0C0FF", color.ToUpper());
Expand Down Expand Up @@ -89,7 +90,7 @@ private static Path GreenTriangleInAdaMN()
new LatLng(47.3017, -96.5299)
)
{
Color = MapColor.FromName("green")
Color = GColor.FromName("green")
};
}

Expand All @@ -102,7 +103,7 @@ private static Path RedTriangleNearAdaMN()
new LatLng(47.3105, -96.5326)
)
{
Color = MapColor.FromName("red")
Color = GColor.FromName("red")
};
}

Expand Down
5 changes: 3 additions & 2 deletions src/Google.Maps.Test/StreetView/StreetViewRequestTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using NUnit.Framework;
using Google.Maps.StreetView;
using Google.Maps.Common;

namespace Google.Maps.StreetView
{
Expand All @@ -15,7 +16,7 @@ public void Invalid_size_propert_set()
{
StreetViewRequest sm = new StreetViewRequest()
{
Size = new MapSize(-1, -1)
Size = new GSize(-1, -1)
};
});
}
Expand All @@ -27,7 +28,7 @@ public void Invalid_size_max()
{
StreetViewRequest sm = new StreetViewRequest()
{
Size = new MapSize(4097, 4097)
Size = new GSize(4097, 4097)
};
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using FluentAssertions.Collections;
using FluentAssertions;
using Google.Maps.Test;
using Google.Maps.Common;

namespace Google.Maps.StreetView
{
Expand All @@ -24,7 +25,7 @@ public void BasicUri()
StreetViewRequest sm = new StreetViewRequest()
{
Location = new LatLng(30.1, -60.2)
,Size = new MapSize(512, 512)
,Size = new GSize(512, 512)
};

//act
Expand All @@ -44,7 +45,7 @@ public void BasicUri_heading()
StreetViewRequest sm = new StreetViewRequest()
{
Location = new LatLng(30.1, -60.2)
,Size = new MapSize(512, 512)
,Size = new GSize(512, 512)
,Heading = 15
};

Expand All @@ -65,7 +66,7 @@ public void BasicUri_pitch()
StreetViewRequest sm = new StreetViewRequest()
{
Location = new LatLng(30.1, -60.2)
,Size = new MapSize(512, 512)
,Size = new GSize(512, 512)
,Pitch = 15
};

Expand Down
1 change: 1 addition & 0 deletions src/Google.Maps.Test/TimeZone/TimeZoneServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Collections.Generic;

using NUnit.Framework;
using Google.Maps.Common;

namespace Google.Maps.TimeZone
{
Expand Down
3 changes: 3 additions & 0 deletions src/Google.Maps.Test/ValueTextComparer_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
using System.Text;
using System.Threading.Tasks;

using Google.Maps.Internal;
using Google.Maps.Common;

namespace Google.Maps.Test
{
[TestFixture]
Expand Down
15 changes: 0 additions & 15 deletions src/Google.Maps/BaseRequest.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using Newtonsoft.Json;
using System;

namespace Google.Maps.Shared
namespace Google.Maps.Common
{
public class AddressComponent : IEquatable<AddressComponent>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google.Maps.Shared
namespace Google.Maps.Common
{
public enum AddressType
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Google.Maps
namespace Google.Maps.Common
{
/// <summary>
/// Directions may be calculated that adhere to certain restrictions.
Expand Down
12 changes: 12 additions & 0 deletions src/Google.Maps/Common/BaseRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Google.Maps.Common
{
public abstract class BaseRequest
{
public abstract Uri ToUri();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Text;

namespace Google.Maps
namespace Google.Maps.Common
{
/// <summary>
/// In a geocoding response, the Google Maps Geocoding API can return address results restricted to a specific area.
Expand Down
Loading