Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsMapMapCreating a basic mapCreating a basic map
Previous
 
Next
New Post
11/21/2006 3:32 PM
 

Ok I almost have a working basic google map... There is one problem... When I pass the map.setCenter it causes the app to fail.. Here is my code for you guys to look at and or use.. I used the Bi4ce.GoMap as a reference to get me started.. I checked the GoMap source and could not find where the Map.setCenter was passed.

.ascx file

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="maps.ascx.vb" Inherits="maps" %>

<asp:Literal ID="GoogleMapScript" Runat="server"></asp:Literal>

<asp:Literal ID="GoogleMap" Runat="server"></asp:Literal>

<asp:Literal ID="GoogleJavaScript" Runat="server"></asp:Literal>

 

.ascv.vb file

Imports DotNetNuke.Entities.Modules

Imports DotNetNuke.UI.Utilities

Imports Microsoft.VisualBasic.ControlChars

Public Class maps

Inherits PortalModuleBase

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

GoogleMapScript.Text = "<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA1K8Zoeblm8NGUhtVKx9XWBTTIzPU9tdsxWq6A66V5E_Uwk7exBR9yo5xeFaVgit0d1j77-k5M3VwGQ' type=""text/javascript""></script>"

GoogleMap.Text = "<div id=""map"" style=""width:640; height:480;""></div>"

SetGoogleJavaScript()

End Sub

Private Sub SetGoogleJavaScript()

Dim js As New System.Text.StringBuilder

js.Append("<script language=""javascript"">" & vbCrLf)

js.Append("//<![CDATA[" & vbCrLf)

js.Append("var map = new GMap2(document.getElementById(""map""));" & vbCrLf)

js.Append("map.addControl(new GSmallMapControl());" & vbCrLf)

js.Append("map.addControl(new GMapTypeControl());" & vbCrLf)

js.Append("map.setCenter(new GLatLng(37.4419, -122.1419));" & vbCrLf) <-- this is where it causes an error.. Am I missing some quotes or something?

js.Append("//]]>" & vbCrLf)

js.Append("</script>" & vbCrLf)

GoogleJavaScript.Text = js.ToString

js = Nothing

End Sub

End Class

 
New Post
11/22/2006 6:29 AM
 
Sorry, I don't know enough to help you, but I have noticed all maps (on different sites and localhost) are causing my browser (IE and FF) to fail - I am not sure what the problem is but are you sure it's your code (maybe the Google API has changed recently?)

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
11/23/2006 11:02 AM
 

It is the code.. I was able to create a map that would display everything correctly when you clicked a button.

I also noticed in the above code if I do not have the SetCenter line in the code and ran the page when you click on one of the controls it would give an error of something not defined...I am not sure if it has something to do with SetCenter not being there...But it was my understanding that SetCenter was optional and was not needed to get the map running.

When I get back from Thanksgiving break I will test this with the button method that I know works.

 
New Post
11/28/2006 5:05 PM
 

I got it working!

It is mostly the fault of IE.

If you want a basic google map v2 api here are the source files.

 
New Post
5/29/2007 1:24 PM
 

Mobious, have you made any updates to this code since you created it? I am trying to do the same think and just want to see what the latest is. Thanks for your work.

 

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsMapMapCreating a basic mapCreating a basic map


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out